337LOGICAL FUNCTION distmtx(NAN, LAN, LOOKNGB, UPNGB)
351INTEGER,
INTENT(IN) :: nan
352INTEGER,
DIMENSION(NAN),
INTENT(IN) :: lan
353LOGICAL,
INTENT(IN) :: lookngb, upngb
355INTEGER :: ra, rb, rc, rd, rf, rg, rh, ri, rj, rk, rl, rm
356INTEGER :: rn, ro, rp, rq, rs, rt, ru, rv, rw, rx, ry, rz
357INTEGER :: a_start, a_end
359DOUBLE PRECISION :: dik
360DOUBLE PRECISION :: maxbd, minbd
361INTEGER,
DIMENSION(:),
ALLOCATABLE :: ba, bb
362INTEGER,
DIMENSION(:),
ALLOCATABLE :: ca, cb
363DOUBLE PRECISION,
DIMENSION(:),
ALLOCATABLE :: xc, yc, zc
364LOGICAL :: calcmat=.false.
366LOGICAL :: toom=.false.
368LOGICAL :: pixr=.false.
371LOGICAL :: is_clone, dclo
372INTEGER,
DIMENSION(3) :: pixpos
373DOUBLE PRECISION,
DIMENSION(3) :: xyz
374INTEGER :: pid, cid, did, eid, fid, ai, bi, ci
375INTEGER :: init_a, end_a
376INTEGER :: init_b, end_b
377INTEGER :: init_c, end_c
378INTEGER,
DIMENSION(3) :: dim = (/-1, 0, 1/)
379INTEGER,
DIMENSION(3,3,3) :: shift
383INTEGER :: atom_start, atom_end
384INTEGER,
DIMENSION(:),
ALLOCATABLE :: atpix
389 INTEGER FUNCTION getnbx (NP, NPS)
390 INTEGER,
INTENT(IN) :: np, nps
392 LOGICAL FUNCTION dvtbox (ST, NAS, NAT, NPOS)
393 INTEGER,
INTENT(IN) :: st, nas, nat
394 DOUBLE PRECISION,
DIMENSION(NAT,3),
INTENT(INOUT) :: npos
398 INTEGER,
INTENT(IN) :: nobj, nthreads, thread_id
401 INTEGER,
INTENT(IN) :: nobj, nthreads, thread_id
404 DOUBLE PRECISION FUNCTION calcdij (R12, AT1, AT2, STEP_1, STEP_2, SID)
406 DOUBLE PRECISION,
DIMENSION(3),
INTENT(INOUT) :: r12
407 INTEGER,
INTENT(IN) :: at1, at2, step_1, step_2, sid
409 DOUBLE PRECISION FUNCTION spheres_caps_volumes (DAB, RAP, RBP)
410 DOUBLE PRECISION,
INTENT(IN) :: dab, rap, rbp
415 write (6,
'("In DMTX:: LOOKNGB= ",L1, ", NOHOM= ",L1," PBC= ",L1,", CUBIC= ",L1)') lookngb, nohp, pbc, overall_cubic
418if (
allocated(gr_tmp))
deallocate(gr_tmp)
419allocate(gr_tmp(nsp,nsp), stat=err)
429 if (gr_cut(i,j) .gt. gr_cutoff)
then
430 gr_tmp(i,j)=gr_cutoff
432 gr_tmp(i,j)=gr_cut(i,j)
434 if (.not.lookngb) gr_tmp(i,j) = gr_tmp(i,j) + 50.0
447 if (
allocated(voisj))
deallocate(voisj)
448 allocate(voisj(maxn,nna,ns), stat=err)
455 if (
allocated(contj))
deallocate(contj)
456 allocate(contj(nna,ns), stat=err)
476 a_start = nan *(nbx**3 - 1)/2 + 1
477 a_end = a_start + nan - 1
480ab = isize(1)*isize(2)
484numth = omp_get_max_threads()
487 if (numth .ge. 2*(ns-1))
then
494if (all_atoms) doatoms=.true.
499 call print_pixel_grid ()
504 if (nan.lt.numth) numth=nan
507 allocate(poa(nna,3), stat=err)
519 if (.not.
dvtbox(sat, na, nna, poa))
then
539 thread_num = omp_get_thread_num()
543 if (
allocated(thepix))
deallocate(thepix)
544 allocate(thepix(abc), stat=err)
551 if (
allocated(atpix))
deallocate(atpix)
552 allocate(atpix(atom_end-atom_start+1), stat=err)
565 if (.not.lookngb) rc = maxn*10
566 if (.not.lookngb .or. abc .le. 5) rc =
min(rc*5, nna)
569 thepix(rd)%TOCHECK=.false.
570 thepix(rd)%CHECKED=.false.
571 allocate(thepix(rd)%ATOM_ID(rc), stat=err)
573 alc_tab=
"THEPIX%ATOM_ID"
578 thepix(rd)%IDNEIGH(:) = 0
579 thepix(rd)%ATOM_ID(:) = 0
585 pixpos(rd) = int((fullpos(rc,rd,sat) - pmin(rd))*cutf)
586 if (pixpos(rd) .eq. isize(rd)) pixpos(rd) = pixpos(rd)-1
590 if (ncells.gt.1)
then
591 xyz = matmul(poa(rc,:), the_box(sat)%carttofrac/nbx)
593 xyz = matmul(poa(rc,:), the_box(1)%carttofrac/nbx)
596 if (ncells.gt.1)
then
597 xyz = matmul(fullpos(rc,:,sat), the_box(sat)%carttofrac)
599 xyz = matmul(fullpos(rc,:,sat), the_box(1)%carttofrac)
603 pixpos(rd) = int((xyz(rd) - anint(xyz(rd)) + 0.5d0)*isize(rd))
604 xyz(rd) = xyz(rd) - anint(xyz(rd)) + 0.5d0
605 if (pixpos(rd) .eq. isize(rd)) pixpos(rd) = pixpos(rd)-1
608 pix = pixpos(1) + pixpos(2)*isize(1) + pixpos(3)*ab + 1
609 if (pix.gt.abc .or. pix.le.0)
then
610 write (6,
'("Thread(id)= ",i4,", MD step= ",i8)') thread_num, sat
612 write (6,
'("at= ",i7,", pos(x)= ",f15.10,", pos(y)= ",f15.10,", pos(z)= ",f15.10)') rc, poa(rc,:)
614 write (6,
'("at= ",i7,", pos(x)= ",f15.10,", pos(y)= ",f15.10,", pos(z)= ",f15.10)') rc, fullpos(rc,:,sat)
617 write (6,
'("at= ",i7,", cor(x)= ",f15.10,", cor(y)= ",f15.10,", cor(z)= ",f15.10)') rc, xyz
619 write (6,
'("at= ",i7,", pixpos(x)= ",i4,", pixpos(y)= ",i4,", pixpos(z)= ",i4)') rc, pixpos
620 write (6,
'("at= ",i7,", pixpos= ",i10)') rc, pix
626 if ((pbc .and. rc.ge.a_start .and. rc.le.a_end) .or. .not.pbc)
then
627 if (.not.thepix(pix)%TOCHECK)
then
633 if (pbc .and. .not.calc_prings)
then
634 call set_shift (shift, ai, bi, ci, isize(1), isize(2), isize(3))
637 if (ai.eq.1 .or. ai.eq.isize(1)) dclo=.true.
638 if (bi.eq.1 .or. bi.eq.isize(2)) dclo=.true.
639 if (ci.eq.1 .or. ci.eq.isize(3)) dclo=.true.
643 if (isize(1) .eq. 1)
then
650 if (isize(2) .eq. 1)
then
657 if (isize(3) .eq. 1)
then
666 thepix(pix)%IDNEIGH(pid) = pix + dim(cid) + dim(did) * isize(1) + dim(eid) * isize(1) * isize(2)
667 thepix(pix)%IDNEIGH(pid) = thepix(pix)%IDNEIGH(pid) + shift(cid,did,eid)
669 if (ai.eq.1 .and. cid.eq.1)
then
671 else if (ai.eq.isize(1) .and. cid.eq.3)
then
673 else if (bi.eq.1 .and. did.eq.1)
then
675 else if (bi.eq.isize(2) .and. did.eq.3)
then
677 else if (ci.eq.1 .and. eid.eq.1)
then
679 else if (ci.eq.isize(3) .and. eid.eq.3)
then
686 thepix(pix)%NEIGHBOR = pid
688 thepix(pix)%TOCHECK=.true.
690 thepix(pix)%ATOMS = thepix(pix)%ATOMS + 1
691 thepix(pix)%ATOM_ID(thepix(pix)%ATOMS) = rc
693 if (rc.ge.atom_start .and. rc.le.atom_end) atpix(rc-atom_start+1) = pix
696 do rc=atom_start, atom_end
697 rd = atpix(rc-atom_start+1)
698 rf = rc - (rc/nan)*nan
699 if (rf .eq. 0) rf=nan
701 do rh=1, thepix(rd)%NEIGHBOR
702 ri = thepix(rd)%IDNEIGH(rh)
703 rj = thepix(ri)%ATOMS
705 rl = thepix(ri)%ATOM_ID(rk)
707 if ((rc.ge.a_start .and. rc.le.a_end) .or. (rl.ge.a_start .and. rl.le.a_end))
then
708 rm = rl - (rl/nan)*nan
709 if (rm .eq. 0) rm=nan
712 if (.not.pbc .or. nbx.gt.1)
then
713 if (((rc.ge.a_start .and. rc.le.a_end) .and. (rl.ge.a_start .and. rl.le.a_end)) .or. .not.pbc)
then
721 if (rg.ne.rn .or. .not.nohp)
then
730 rij(rp) = poa(rc,rp) - poa(rl,rp)
736 rij(rp) = fullpos(rf,rp,sat) - fullpos(rm,rp,sat)
739 if (ncells .gt. 1)
then
740 dij =
calcdij(rij,rf,rm,sat,sat,sat)
742 dij =
calcdij(rij,rf,rm,sat,sat,1)
744 if (dik-dij .gt.0.01d0)
then
748 if (dij .le. gr_tmp(rg,rn))
then
753 if (calc_prings)
then
760 contj(rp,sat)=contj(rp,sat)+1
761 if (contj(rp,sat) .gt. maxn)
then
767 voisj(contj(rp,sat),rp,sat)=rq
768 if (.not.calc_prings .and. upngb)
then
770 voisj(contj(rp,sat),rp,sat)=-rq
783 if (la_count(rf,ro,sat).eq.4 .and. contj(rf,sat).eq.4)
then
784 if (la_count(rm,ro,sat).eq.4 .and. contj(rm,sat).eq.4)
then
787 rs = voisj(rq,rf,sat)
788 do rt=1, contj(rs,sat)
789 if (voisj(rt,rs,sat) .eq. rm) rp=rp+1
794 corta(rg,ro)=corta(rg,ro)+1
797 cornera(rg,ro,sat)=cornera(rg,ro,sat)+1
799 elseif (rp.eq.2)
then
801 edgeta(rg,ro)=edgeta(rg,ro)+1
804 edgea(rg,ro,sat)=edgea(rg,ro,sat)+1
806 elseif (rp.ge.3)
then
808 corta(rg,ro)=corta(rg,ro)+1
810 edgeta(rg,ro)=edgeta(rg,ro)+1
812 defta(rg,ro)=defta(rg,ro)+1
814 cornera(rg,ro,sat)=cornera(rg,ro,sat)+1
816 edgea(rg,ro,sat)=edgea(rg,ro,sat)+1
818 defa(rg,ro,sat)=defa(rg,ro,sat)+1
833 if (
allocated(thepix))
deallocate(thepix)
834 if (
allocated(atpix))
deallocate(atpix)
839 if (.not.lookngb)
then
842 corta(rc,rd)=corta(rc,rd)/2
843 edgeta(rc,rd)=edgeta(rc,rd)/2
844 defta(rc,rd)=defta(rc,rd)/2
846 cornera(rc,rd,sat)=cornera(rc,rd,sat)/2
847 edgea(rc,rd,sat)=edgea(rc,rd,sat)/2
848 defa(rc,rd,sat)=defa(rc,rd,sat)/2
853 if (.not.calc_prings .and.upngb)
then
855 if (
allocated(ba))
deallocate(ba)
856 allocate(ba(ra), stat=err)
863 if (
allocated(bb))
deallocate(bb)
864 allocate(bb(ra), stat=err)
873 if (
allocated(ca))
deallocate(ca)
874 allocate(ca(rb), stat=err)
881 if (
allocated(cb))
deallocate(cb)
882 allocate(cb(rb), stat=err)
889 if (
allocated(xc))
deallocate(xc)
890 allocate(xc(rb), stat=err)
897 if (
allocated(yc))
deallocate(yc)
898 allocate(yc(rb), stat=err)
905 if (
allocated(zc))
deallocate(zc)
906 allocate(zc(rb), stat=err)
914 if (ra.gt.0 .or. rb.gt.0)
then
918 do rd=1, contj(rc,sat)
919 rf = voisj(rd,rc,sat)
927 voisj(rd,rc,sat) = -rf
933 if (ncells .gt. 1)
then
934 call calcrij (rc,rf,sat,sat,sat)
946 call update_bonds (0, sat-1, ra, ba, bb, xc, yc, zc)
947 call update_bonds (1, sat-1, rb, ca, cb, xc, yc, zc)
949 call update_atom_neighbors (sat-1, rc-1, contj(rc,sat))
950 do rd=1, contj(rc,sat)
951 call update_this_neighbor (sat-1, rc-1, rd-1, voisj(rd,rc,sat))
975 if (
allocated(thepix))
deallocate(thepix)
976 allocate(thepix(abc), stat=err)
994 if (.not.lookngb) ra = maxn*10
995 if (.not.lookngb .or. abc .le. 5) ra =
min(ra*5, nna)
998 thepix(rb)%TOCHECK=.false.
999 thepix(rb)%CHECKED=.false.
1000 allocate(thepix(rb)%ATOM_ID(ra), stat=err)
1001 if (err .ne. 0)
then
1002 alc_tab=
"THEPIX%ATOM_ID"
1011 thepix(rb)%IDNEIGH(:) = 0
1012 thepix(rb)%ATOM_ID(:) = 0
1020 if (
allocated(poa))
deallocate (poa)
1021 allocate(poa(nna,3), stat=err)
1022 if (err .ne. 0)
then
1032 if (
allocated(poa))
deallocate (poa)
1033 allocate(poa(nna,3), stat=err)
1034 if (err .ne. 0)
then
1041 if (.not.
dvtbox(sat, na, nna, poa))
then
1053 thepix(ra)%TOCHECK=.false.
1054 thepix(ra)%CHECKED=.false.
1055 thepix(ra)%IDNEIGH(:) = 0
1056 thepix(ra)%ATOM_ID(:) = 0
1061 pixpos(rb) = int((fullpos(ra,rb,sat) - pmin(rb))*cutf)
1062 if (pixpos(rb) .eq. isize(rb)) pixpos(rb) = pixpos(rb)-1
1065 if (nbx .gt. 1)
then
1066 if (ncells.gt.1)
then
1067 xyz = matmul(poa(ra,:), the_box(sat)%carttofrac/nbx)
1069 xyz = matmul(poa(ra,:), the_box(1)%carttofrac/nbx)
1072 if (ncells.gt.1)
then
1073 xyz = matmul(fullpos(ra,:,sat), the_box(sat)%carttofrac)
1075 xyz = matmul(fullpos(ra,:,sat), the_box(1)%carttofrac)
1079 pixpos(rb) = int((xyz(rb) - anint(xyz(rb)) + 0.5d0)*isize(rb))
1080 xyz(rb) = xyz(rb) - anint(xyz(rb)) + 0.5d0
1081 if (pixpos(rb) .eq. isize(rb)) pixpos(rb) = pixpos(rb)-1
1084 pix = pixpos(1) + pixpos(2)*isize(1) + pixpos(3)*ab + 1
1085 if (pix.gt.abc .or. pix.le.0)
then
1087 write (6,
'("Thread(id)= ",i4,", MD step= ",i8)') omp_get_thread_num(), sat
1089 write (6,
'("MD step= ",i8)') sat
1092 write (6,
'("at= ",i7,", pos(x)= ",f15.10,", pos(y)= ",f15.10,", pos(z)= ",f15.10)') ra, poa(ra,:)
1094 write (6,
'("at= ",i7,", pos(x)= ",f15.10,", pos(y)= ",f15.10,", pos(z)= ",f15.10)') ra, fullpos(ra,:,sat)
1097 write (6,
'("at= ",i7,", cor(x)= ",f15.10,", cor(y)= ",f15.10,", cor(z)= ",f15.10)') ra, xyz
1099 write (6,
'("at= ",i7,", pixpos(x)= ",i4,", pixpos(y)= ",i4,", pixpos(z)= ",i4)') ra, pixpos
1100 write (6,
'("at= ",i7,", pixpos= ",i10)') ra, pix
1110 if ((pbc .and. ra.ge.a_start .and. ra.le.a_end) .or. .not.pbc)
then
1111 if (.not.thepix(pix)%TOCHECK)
then
1120 if (pbc .and. .not.calc_prings)
then
1121 call set_shift (shift, ai, bi, ci, isize(1), isize(2), isize(3))
1124 if (ai.eq.1 .or. ai.eq.isize(1)) dclo=.true.
1125 if (bi.eq.1 .or. bi.eq.isize(2)) dclo=.true.
1126 if (ci.eq.1 .or. ci.eq.isize(3)) dclo=.true.
1130 if (isize(1) .eq. 1)
then
1137 if (isize(2) .eq. 1)
then
1144 if (isize(3) .eq. 1)
then
1149 do cid=init_a, end_a
1150 do did=init_b, end_b
1151 do eid=init_c, end_c
1153 fid = dim(eid) * isize(1) * isize(2)
1154 thepix(pix)%IDNEIGH(pid) = pix + dim(cid) + dim(did) * isize(1) + fid + shift(cid,did,eid)
1156 if (ai.eq.1 .and. cid.eq.1)
then
1158 else if (ai.eq.isize(1) .and. cid.eq.3)
then
1160 else if (bi.eq.1 .and. did.eq.1)
then
1162 else if (bi.eq.isize(2) .and. did.eq.3)
then
1164 else if (ci.eq.1 .and. eid.eq.1)
then
1166 else if (ci.eq.isize(3) .and. eid.eq.3)
then
1173 thepix(pix)%NEIGHBOR = pid
1175 thepix(pix)%TOCHECK=.true.
1177 thepix(pix)%ATOMS = thepix(pix)%ATOMS + 1
1178 thepix(pix)%ATOM_ID(thepix(pix)%ATOMS) = ra
1185 if (thepix(rc)%TOCHECK)
then
1186 rd = thepix(rc)%ATOMS
1188 do rf=1, thepix(rc)%NEIGHBOR
1189 rg = thepix(rc)%IDNEIGH(rf)
1190 if (.not.thepix(rg)%CHECKED)
then
1191 rh = thepix(rg)%ATOMS
1193 if (rc .eq. rg)
then
1199 rk = thepix(rc)%ATOM_ID(rj)
1201 rn = thepix(rg)%ATOM_ID(rm)
1202 if ((rk.ge.a_start .and. rk.le.a_end) .or. (rn.ge.a_start .and. rn.le.a_end))
then
1203 rp=rk - (rk/nan)*nan
1204 rq=rn - (rn/nan)*nan
1205 if (rp .eq. 0) rp=nan
1206 if (rq .eq. 0) rq=nan
1207 if (rp .ne. rq)
then
1211 if (.not.pbc .or. nbx.gt.1)
then
1212 if (((rk.ge.a_start .and. rk.le.a_end) .and. (rn.ge.a_start .and. rn.le.a_end)) .or. .not.pbc)
then
1220 if (rl.ne.ro .or. .not.nohp)
then
1229 rij(rs) = poa(rk,rs) - poa(rn,rs)
1235 rij(rs) = fullpos(rp,rs,sat) - fullpos(rq,rs,sat)
1238 if (ncells .gt. 1)
then
1239 dij =
calcdij(rij,rp,rq,sat,sat,sat)
1241 dij =
calcdij(rij,rp,rq,sat,sat,1)
1243 if (dik-dij .gt.0.01d0)
then
1247 if (dij .le. gr_tmp(rl,ro))
then
1251 maxbd=
max(dij,maxbd)
1255 minbd=
min(dij,minbd)
1256 if (calc_prings)
then
1264 contj(rt,sat)=contj(rt,sat)+1
1265 if (contj(rt,sat) .gt. maxn)
then
1275 voisj(contj(rt,sat),rt,sat)=ru
1276 contj(ru,sat)=contj(ru,sat)+1
1277 if (contj(ru,sat) .gt. maxn)
then
1287 voisj(contj(ru,sat),ru,sat)=rt
1288 if (.not.calc_prings .and. upngb)
then
1291 voisj(contj(rt,sat),rt,sat)=-ru
1292 voisj(contj(ru,sat),ru,sat)=-rt
1300 if (rl .eq. ro)
then
1302 if (la_count(rp,rv,sat).eq.4 .and. contj(rp,sat).eq.4)
then
1303 if (la_count(rq,rv,sat).eq.4 .and. contj(rq,sat).eq.4)
then
1306 ry = voisj(rx,rp,sat)
1307 do rz=1, contj(ry,sat)
1308 if (voisj(rz,ry,sat) .eq. rq) rw=rw+1
1315 corta(rl,rv)=corta(rl,rv)+1
1316 if (ns .gt. 1) cornera(rl,rv,sat)=cornera(rl,rv,sat)+1
1317 elseif (rw.eq.2)
then
1321 edgeta(rl,rv)=edgeta(rl,rv)+1
1322 if (ns .gt. 1) edgea(rl,rv,sat)=edgea(rl,rv,sat)+1
1323 elseif (rw.ge.3)
then
1327 corta(rl,rv)=corta(rl,rv)+1
1331 edgeta(rl,rv)=edgeta(rl,rv)+1
1335 defta(rl,rv)=defta(rl,rv)+1
1337 cornera(rl,rv,sat)=cornera(rl,rv,sat)+1
1338 edgea(rl,rv,sat)=edgea(rl,rv,sat)+1
1339 defa(rl,rv,sat)=defa(rl,rv,sat)+1
1354 thepix(rc)%CHECKED=.true.
1358 if (.not.calc_prings .and.upngb)
then
1360 if (
allocated(ba))
deallocate(ba)
1361 allocate(ba(ra), stat=err)
1362 if (err .ne. 0)
then
1372 if (
allocated(bb))
deallocate(bb)
1373 allocate(bb(ra), stat=err)
1374 if (err .ne. 0)
then
1386 if (
allocated(ca))
deallocate(ca)
1387 allocate(ca(rb), stat=err)
1388 if (err .ne. 0)
then
1398 if (
allocated(cb))
deallocate(cb)
1399 allocate(cb(rb), stat=err)
1400 if (err .ne. 0)
then
1410 if (
allocated(xc))
deallocate(xc)
1411 allocate(xc(rb), stat=err)
1412 if (err .ne. 0)
then
1422 if (
allocated(yc))
deallocate(yc)
1423 allocate(yc(rb), stat=err)
1424 if (err .ne. 0)
then
1434 if (
allocated(zc))
deallocate(zc)
1435 allocate(zc(rb), stat=err)
1436 if (err .ne. 0)
then
1447 if (ra.gt.0 .or. rb.gt.0)
then
1451 do rd=1, contj(rc,sat)
1452 rf = voisj(rd,rc,sat)
1460 voisj(rd,rc,sat) = -rf
1466 if (ncells .gt. 1)
then
1467 dij =
calcdij(rij,rc,rf,sat,sat,sat)
1469 dij =
calcdij(rij,rc,rf,sat,sat,1)
1479 call update_bonds (0, sat-1, ra, ba, bb, xc, yc, zc)
1480 call update_bonds (1, sat-1, rb, ca, cb, xc, yc, zc)
1482 call update_atom_neighbors (sat-1, rc-1, contj(rc,sat))
1483 do rd=1, contj(rc,sat)
1484 call update_this_neighbor (sat-1, rc-1, rd-1, voisj(rd,rc,sat))
1498 if (
allocated(thepix))
deallocate(thepix)
1511 if (maxbd-minbd .lt. 0.1)
then
1512 minbd = minbd - 0.5;
1513 maxbd = maxbd + 0.5;
1515 call recup_dmin_dmax (minbd, maxbd)
1523 call show_error (
"Impossible to allocate memory !"//char(0), &
1524 "Function: DMTX"//char(0), char(9)//
"Table: "//alc_tab(1:len_trim(alc_tab))//char(0))
1526if (pixr)
call pixout (pout)
1528if (
allocated(thepix))
deallocate(thepix)
1529if (
allocated(poa))
deallocate(poa)
1530if (
allocated(ba))
deallocate(ba)
1531if (
allocated(bb))
deallocate(bb)
1532if (
allocated(ca))
deallocate(ca)
1533if (
allocated(cb))
deallocate(cb)
1534if (
allocated(xc))
deallocate(xc)
1535if (
allocated(yc))
deallocate(yc)
1536if (
allocated(zc))
deallocate(zc)