356LOGICAL FUNCTION distmtx(NAN, LAN, LOOKNGB, UPNGB)
370INTEGER,
INTENT(IN) :: nan
371INTEGER,
DIMENSION(NAN),
INTENT(IN) :: lan
372LOGICAL,
INTENT(IN) :: lookngb, upngb
374INTEGER :: ra, rb, rc, rd, rf, rg, rh, ri, rj, rk, rl, rm
375INTEGER :: rn, ro, rp, rq, rs, rt, ru, rv, rw, rx, ry, rz
376INTEGER :: a_start, a_end
378DOUBLE PRECISION :: dik
379DOUBLE PRECISION :: maxbd, minbd
380INTEGER,
DIMENSION(:),
ALLOCATABLE :: ba, bb
381INTEGER,
DIMENSION(:),
ALLOCATABLE :: ca, cb
382DOUBLE PRECISION,
DIMENSION(:),
ALLOCATABLE :: xc, yc, zc
383LOGICAL :: calcmat=.false.
385LOGICAL :: toom=.false.
387LOGICAL :: pixr=.false.
390LOGICAL :: is_clone, boundary, keep_it
391INTEGER,
DIMENSION(3) :: pixpos
392DOUBLE PRECISION,
DIMENSION(3) :: xyz, uvw
393INTEGER :: pid, cid, did, eid, fid, ai, bi, ci
394INTEGER :: init_a, end_a
395INTEGER :: init_b, end_b
396INTEGER :: init_c, end_c
397INTEGER,
DIMENSION(3) :: dim = (/-1, 0, 1/)
398INTEGER,
DIMENSION(3,3,3) :: shift
402INTEGER :: atom_start, atom_end
403INTEGER,
DIMENSION(:),
ALLOCATABLE :: atpix
408 INTEGER FUNCTION getnbx (NP, NPS)
409 INTEGER,
INTENT(IN) :: np, nps
411 LOGICAL FUNCTION dvtbox (ST, NAS, NAT, NPOS)
412 INTEGER,
INTENT(IN) :: st, nas, nat
413 DOUBLE PRECISION,
DIMENSION(NAT,3),
INTENT(INOUT) :: npos
417 INTEGER,
INTENT(IN) :: nobj, nthreads, thread_id
420 INTEGER,
INTENT(IN) :: nobj, nthreads, thread_id
423 DOUBLE PRECISION FUNCTION calcdij (R12, AT1, AT2, STEP_1, STEP_2, SID)
425 DOUBLE PRECISION,
DIMENSION(3),
INTENT(INOUT) :: r12
426 INTEGER,
INTENT(IN) :: at1, at2, step_1, step_2, sid
428 DOUBLE PRECISION FUNCTION spheres_caps_volumes (DAB, RAP, RBP)
429 DOUBLE PRECISION,
INTENT(IN) :: dab, rap, rbp
434 write (6,
'("In DMTX:: LOOKNGB= ",L1, ", NOHOM= ",L1," PBC= ",L1,", CUBIC= ",L1)') lookngb, nohp, pbc, overall_cubic
437if (
allocated(gr_tmp))
deallocate(gr_tmp)
438allocate(gr_tmp(nsp,nsp), stat=err)
448 if (gr_cut(i,j) .gt. gr_cutoff)
then
449 gr_tmp(i,j)=gr_cutoff
451 gr_tmp(i,j)=gr_cut(i,j)
453 if (.not.lookngb) gr_tmp(i,j) = gr_tmp(i,j) + 50.0
466 if (
allocated(voisj))
deallocate(voisj)
467 allocate(voisj(maxn,nna,ns), stat=err)
474 if (
allocated(contj))
deallocate(contj)
475 allocate(contj(nna,ns), stat=err)
495 a_start = nan *(nbx**3 - 1)/2 + 1
496 a_end = a_start + nan - 1
499ab = isize(1)*isize(2)
503numth = omp_get_max_threads()
506 if (numth .ge. 2*(ns-1))
then
513if (all_atoms) doatoms=.true.
518 call print_pixel_grid ()
523 if (nan.lt.numth) numth=nan
526 allocate(poa(nna,3), stat=err)
538 if (.not.
dvtbox(sat, na, nna, poa))
then
544 if (
allocated(thepix))
deallocate(thepix)
545 allocate(thepix(abc), stat=err)
553 if (
allocated(atpix))
deallocate(atpix)
554 allocate(atpix(nna), stat=err)
568 if (.not.lookngb) ra = maxn*10
569 if (.not.lookngb .or. abc .le. 5) ra =
min(ra*5, nna)
572 thepix(rb)%TOCHECK=.false.
573 thepix(rb)%CHECKED=.false.
574 allocate(thepix(rb)%ATOM_ID(ra), stat=err)
576 alc_tab=
"THEPIX%ATOM_ID"
581 thepix(rb)%IDNEIGH(:) = 0
582 thepix(rb)%ATOM_ID(:) = 0
588 if (isize(rb) .eq. 1)
then
591 pixpos(rb) = int((fullpos(ra,rb,sat) - pmin(rb))*cutf)
592 if (pixpos(rb) .eq. isize(rb)) pixpos(rb) = pixpos(rb)-1
597 if (ncells.gt.1)
then
598 xyz = matmul(poa(ra,:), the_box(sat)%carttofrac/nbx)
600 xyz = matmul(poa(ra,:), the_box(1)%carttofrac/nbx)
603 if (ncells.gt.1)
then
604 xyz = matmul(fullpos(ra,:,sat), the_box(sat)%carttofrac)
606 xyz = matmul(fullpos(ra,:,sat), the_box(1)%carttofrac)
610 uvw(rb) = xyz(rb) - floor(xyz(rb))
611 pixpos(rb) = int(uvw(rb)*isize(rb))
615 pix = pixpos(1) + pixpos(2)*isize(1) + pixpos(3)*ab + 1
616 if (pix.gt.abc .or. pix.le.0)
then
617 write (6,
'("Thread(id)= ",i4,", MD step= ",i8)') thread_num, sat
619 write (6,
'("at= ",i7,", pos(x)= ",f15.10,", pos(y)= ",f15.10,", pos(z)= ",f15.10)') ra, poa(ra,:)
621 write (6,
'("at= ",i7,", pos(x)= ",f15.10,", pos(y)= ",f15.10,", pos(z)= ",f15.10)') ra, fullpos(ra,:,sat)
624 write (6,
'("at= ",i7,", fra(x)= ",f15.10,", fra(y)= ",f15.10,", fra(z)= ",f15.10)') ra, xyz
625 write (6,
'("at= ",i7,", cor(x)= ",f15.10,", cor(y)= ",f15.10,", cor(z)= ",f15.10)') ra, uvw
627 write (6,
'("at= ",i7,", pixpos(x)= ",i4,", pixpos(y)= ",i4,", pixpos(z)= ",i4)') ra, pixpos
628 write (6,
'("at= ",i7,", pixpos= ",i10)') ra, pix
634 if ((pbc .and. ra.ge.a_start .and. ra.le.a_end) .or. .not.pbc)
then
635 if (.not.thepix(pix)%TOCHECK)
then
642 if (pbc .and. .not.calc_prings)
then
643 call set_shift (shift, ai, bi, ci, isize(1), isize(2), isize(3), ab, abc)
645 if (ai.eq.1 .or. ai.eq.isize(1)) boundary=.true.
646 if (bi.eq.1 .or. bi.eq.isize(2)) boundary=.true.
647 if (ci.eq.1 .or. ci.eq.isize(3)) boundary=.true.
651 if (isize(1) .eq. 1)
then
658 if (isize(2) .eq. 1)
then
665 if (isize(3) .eq. 1)
then
675 if (ai.eq.1 .and. cid.eq.1)
then
677 else if (ai.eq.isize(1) .and. cid.eq.3)
then
679 else if (bi.eq.1 .and. did.eq.1)
then
681 else if (bi.eq.isize(2) .and. did.eq.3)
then
683 else if (ci.eq.1 .and. eid.eq.1)
then
685 else if (ci.eq.isize(3) .and. eid.eq.3)
then
691 thepix(pix)%IDNEIGH(pid) = pix + dim(cid) + dim(did) * isize(1) + dim(eid) * ab + shift(cid,did,eid)
696 thepix(pix)%NEIGHBOR = pid
698 thepix(pix)%TOCHECK=.true.
700 thepix(pix)%ATOMS = thepix(pix)%ATOMS + 1
701 thepix(pix)%ATOM_ID(thepix(pix)%ATOMS) = ra
718 thread_num = omp_get_thread_num()
722 do rc=atom_start, atom_end
724 rf = rc - (rc/nan)*nan
725 if (rf .eq. 0) rf=nan
727 do rh=1, thepix(rd)%NEIGHBOR
728 ri = thepix(rd)%IDNEIGH(rh)
729 rj = thepix(ri)%ATOMS
731 rl = thepix(ri)%ATOM_ID(rk)
733 if ((rc.ge.a_start .and. rc.le.a_end) .or. (rl.ge.a_start .and. rl.le.a_end))
then
734 rm = rl - (rl/nan)*nan
735 if (rm .eq. 0) rm=nan
738 if (.not.pbc .or. nbx.gt.1)
then
739 if (((rc.ge.a_start .and. rc.le.a_end) .and. (rl.ge.a_start .and. rl.le.a_end)) .or. .not.pbc)
then
747 if (rg.ne.rn .or. .not.nohp)
then
756 rij(rp) = poa(rc,rp) - poa(rl,rp)
762 rij(rp) = fullpos(rf,rp,sat) - fullpos(rm,rp,sat)
765 if (ncells .gt. 1)
then
766 dij =
calcdij(rij,rf,rm,sat,sat,sat)
768 dij =
calcdij(rij,rf,rm,sat,sat,1)
770 if (dik-dij .gt.0.01d0)
then
774 if (dij .le. gr_tmp(rg,rn))
then
779 if (calc_prings)
then
786 contj(rp,sat)=contj(rp,sat)+1
787 if (contj(rp,sat) .gt. maxn)
then
793 voisj(contj(rp,sat),rp,sat)=rq
794 if (.not.calc_prings .and. upngb)
then
796 voisj(contj(rp,sat),rp,sat)=-rq
809 if (la_count(rf,ro,sat).eq.4 .and. contj(rf,sat).eq.4)
then
810 if (la_count(rm,ro,sat).eq.4 .and. contj(rm,sat).eq.4)
then
813 rs = voisj(rq,rf,sat)
814 do rt=1, contj(rs,sat)
815 if (voisj(rt,rs,sat) .eq. rm) rp=rp+1
820 corta(rg,ro)=corta(rg,ro)+1
823 cornera(rg,ro,sat)=cornera(rg,ro,sat)+1
825 elseif (rp.eq.2)
then
827 edgeta(rg,ro)=edgeta(rg,ro)+1
830 edgea(rg,ro,sat)=edgea(rg,ro,sat)+1
832 elseif (rp.ge.3)
then
834 corta(rg,ro)=corta(rg,ro)+1
836 edgeta(rg,ro)=edgeta(rg,ro)+1
838 defta(rg,ro)=defta(rg,ro)+1
841 cornera(rg,ro,sat)=cornera(rg,ro,sat)+1
843 edgea(rg,ro,sat)=edgea(rg,ro,sat)+1
845 defa(rg,ro,sat)=defa(rg,ro,sat)+1
862 if (
allocated(thepix))
then
864 if (
allocated(thepix(rc)%ATOM_ID))
deallocate(thepix(rc)%ATOM_ID)
868 if (
allocated(atpix))
deallocate(atpix)
872 if (.not.lookngb)
then
875 corta(rc,rd)=corta(rc,rd)/2
876 edgeta(rc,rd)=edgeta(rc,rd)/2
877 defta(rc,rd)=defta(rc,rd)/2
879 cornera(rc,rd,sat)=cornera(rc,rd,sat)/2
880 edgea(rc,rd,sat)=edgea(rc,rd,sat)/2
881 defa(rc,rd,sat)=defa(rc,rd,sat)/2
886 if (.not.calc_prings .and.upngb)
then
888 if (
allocated(ba))
deallocate(ba)
889 allocate(ba(ra), stat=err)
896 if (
allocated(bb))
deallocate(bb)
897 allocate(bb(ra), stat=err)
906 if (
allocated(ca))
deallocate(ca)
907 allocate(ca(rb), stat=err)
914 if (
allocated(cb))
deallocate(cb)
915 allocate(cb(rb), stat=err)
922 if (
allocated(xc))
deallocate(xc)
923 allocate(xc(rb), stat=err)
930 if (
allocated(yc))
deallocate(yc)
931 allocate(yc(rb), stat=err)
938 if (
allocated(zc))
deallocate(zc)
939 allocate(zc(rb), stat=err)
947 if (ra.gt.0 .or. rb.gt.0)
then
951 do rd=1, contj(rc,sat)
952 rf = voisj(rd,rc,sat)
960 voisj(rd,rc,sat) = -rf
966 if (ncells .gt. 1)
then
967 call calcrij (rc,rf,sat,sat,sat)
979 call update_bonds (0, sat-1, ra, ba, bb, xc, yc, zc)
980 call update_bonds (1, sat-1, rb, ca, cb, xc, yc, zc)
982 call update_atom_neighbors (sat-1, rc-1, contj(rc,sat))
983 do rd=1, contj(rc,sat)
984 call update_this_neighbor (sat-1, rc-1, rd-1, voisj(rd,rc,sat))
1008 if (
allocated(thepix))
deallocate(thepix)
1009 allocate(thepix(abc), stat=err)
1010 if (err .ne. 0)
then
1027 if (.not.lookngb) ra = maxn*10
1028 if (.not.lookngb .or. abc .le. 5) ra =
min(ra*5, nna)
1031 thepix(rb)%TOCHECK=.false.
1032 thepix(rb)%CHECKED=.false.
1033 allocate(thepix(rb)%ATOM_ID(ra), stat=err)
1034 if (err .ne. 0)
then
1035 alc_tab=
"THEPIX%ATOM_ID"
1044 thepix(rb)%IDNEIGH(:) = 0
1045 thepix(rb)%ATOM_ID(:) = 0
1053 if (
allocated(poa))
deallocate (poa)
1054 allocate(poa(nna,3), stat=err)
1055 if (err .ne. 0)
then
1065 if (
allocated(poa))
deallocate (poa)
1066 allocate(poa(nna,3), stat=err)
1067 if (err .ne. 0)
then
1074 if (.not.
dvtbox(sat, na, nna, poa))
then
1087 thepix(ra)%TOCHECK=.false.
1088 thepix(ra)%CHECKED=.false.
1089 thepix(ra)%IDNEIGH(:) = 0
1090 thepix(ra)%ATOM_ID(:) = 0
1095 if (isize(rb) .eq. 1)
then
1098 pixpos(rb) = int((fullpos(ra,rb,sat) - pmin(rb))*cutf)
1099 if (pixpos(rb) .eq. isize(rb)) pixpos(rb) = pixpos(rb)-1
1103 if (nbx .gt. 1)
then
1104 if (ncells.gt.1)
then
1105 xyz = matmul(poa(ra,:), the_box(sat)%carttofrac/nbx)
1107 xyz = matmul(poa(ra,:), the_box(1)%carttofrac/nbx)
1110 if (ncells.gt.1)
then
1111 xyz = matmul(fullpos(ra,:,sat), the_box(sat)%carttofrac)
1113 xyz = matmul(fullpos(ra,:,sat), the_box(1)%carttofrac)
1117 uvw(rb) = xyz(rb) - floor(xyz(rb))
1118 pixpos(rb) = int(uvw(rb)*isize(rb))
1122 pix = pixpos(1) + pixpos(2)*isize(1) + pixpos(3)*ab + 1
1123 if (pix.gt.abc .or. pix.le.0)
then
1125 write (6,
'("Thread(id)= ",i4,", MD step= ",i8)') omp_get_thread_num(), sat
1127 write (6,
'("MD step= ",i8)') sat
1130 write (6,
'("at= ",i7,", pos(x)= ",f15.10,", pos(y)= ",f15.10,", pos(z)= ",f15.10)') ra, poa(ra,:)
1132 write (6,
'("at= ",i7,", pos(x)= ",f15.10,", pos(y)= ",f15.10,", pos(z)= ",f15.10)') ra, fullpos(ra,:,sat)
1135 write (6,
'("at= ",i7,", fra(x)= ",f15.10,", fra(y)= ",f15.10,", fra(z)= ",f15.10)') ra, xyz
1136 write (6,
'("at= ",i7,", cor(x)= ",f15.10,", cor(y)= ",f15.10,", cor(z)= ",f15.10)') ra, uvw
1138 write (6,
'("at= ",i7,", pixpos(x)= ",i4,", pixpos(y)= ",i4,", pixpos(z)= ",i4)') ra, pixpos
1139 write (6,
'("at= ",i7,", pixpos= ",i10)') ra, pix
1149 if ((pbc .and. ra.ge.a_start .and. ra.le.a_end) .or. .not.pbc)
then
1150 if (.not.thepix(pix)%TOCHECK)
then
1160 if (pbc .and. .not.calc_prings)
then
1161 call set_shift (shift, ai, bi, ci, isize(1), isize(2), isize(3), ab, abc)
1163 if (ai.eq.1 .or. ai.eq.isize(1)) boundary=.true.
1164 if (bi.eq.1 .or. bi.eq.isize(2)) boundary=.true.
1165 if (ci.eq.1 .or. ci.eq.isize(3)) boundary=.true.
1169 if (isize(1) .eq. 1)
then
1176 if (isize(2) .eq. 1)
then
1183 if (isize(3) .eq. 1)
then
1188 do cid=init_a, end_a
1189 do did=init_b, end_b
1190 do eid=init_c, end_c
1193 if (ai.eq.1 .and. cid.eq.1)
then
1195 else if (ai.eq.isize(1) .and. cid.eq.3)
then
1197 else if (bi.eq.1 .and. did.eq.1)
then
1199 else if (bi.eq.isize(2) .and. did.eq.3)
then
1201 else if (ci.eq.1 .and. eid.eq.1)
then
1203 else if (ci.eq.isize(3) .and. eid.eq.3)
then
1209 thepix(pix)%IDNEIGH(pid) = pix + dim(cid) + dim(did) * isize(1) + dim(eid) * ab + shift(cid,did,eid)
1214 thepix(pix)%NEIGHBOR = pid
1216 thepix(pix)%TOCHECK=.true.
1218 thepix(pix)%ATOMS = thepix(pix)%ATOMS + 1
1219 thepix(pix)%ATOM_ID(thepix(pix)%ATOMS) = ra
1226 if (thepix(rc)%TOCHECK)
then
1227 rd = thepix(rc)%ATOMS
1229 do rf=1, thepix(rc)%NEIGHBOR
1230 rg = thepix(rc)%IDNEIGH(rf)
1231 if (.not.thepix(rg)%CHECKED)
then
1232 rh = thepix(rg)%ATOMS
1234 if (rc .eq. rg)
then
1240 rk = thepix(rc)%ATOM_ID(rj)
1242 rn = thepix(rg)%ATOM_ID(rm)
1243 if ((rk.ge.a_start .and. rk.le.a_end) .or. (rn.ge.a_start .and. rn.le.a_end))
then
1244 rp=rk - (rk/nan)*nan
1245 rq=rn - (rn/nan)*nan
1246 if (rp .eq. 0) rp=nan
1247 if (rq .eq. 0) rq=nan
1248 if (rp .ne. rq)
then
1252 if (.not.pbc .or. nbx.gt.1)
then
1253 if (((rk.ge.a_start .and. rk.le.a_end) .and. (rn.ge.a_start .and. rn.le.a_end)) .or. .not.pbc)
then
1261 if (rl.ne.ro .or. .not.nohp)
then
1270 rij(rs) = poa(rk,rs) - poa(rn,rs)
1276 rij(rs) = fullpos(rp,rs,sat) - fullpos(rq,rs,sat)
1279 if (ncells .gt. 1)
then
1280 dij =
calcdij(rij,rp,rq,sat,sat,sat)
1282 dij =
calcdij(rij,rp,rq,sat,sat,1)
1284 if (dik-dij .gt.0.01d0)
then
1288 if (dij .le. gr_tmp(rl,ro))
then
1292 maxbd=
max(dij,maxbd)
1296 minbd=
min(dij,minbd)
1297 if (calc_prings)
then
1305 contj(rt,sat)=contj(rt,sat)+1
1306 if (contj(rt,sat) .gt. maxn)
then
1316 voisj(contj(rt,sat),rt,sat)=ru
1317 contj(ru,sat)=contj(ru,sat)+1
1318 if (contj(ru,sat) .gt. maxn)
then
1328 voisj(contj(ru,sat),ru,sat)=rt
1329 if (.not.calc_prings .and. upngb)
then
1332 voisj(contj(rt,sat),rt,sat)=-ru
1333 voisj(contj(ru,sat),ru,sat)=-rt
1341 if (rl .eq. ro)
then
1343 if (la_count(rp,rv,sat).eq.4 .and. contj(rp,sat).eq.4)
then
1344 if (la_count(rq,rv,sat).eq.4 .and. contj(rq,sat).eq.4)
then
1347 ry = voisj(rx,rp,sat)
1348 do rz=1, contj(ry,sat)
1349 if (voisj(rz,ry,sat) .eq. rq) rw=rw+1
1356 corta(rl,rv)=corta(rl,rv)+1
1357 if (ns .gt. 1) cornera(rl,rv,sat)=cornera(rl,rv,sat)+1
1358 elseif (rw.eq.2)
then
1362 edgeta(rl,rv)=edgeta(rl,rv)+1
1363 if (ns .gt. 1) edgea(rl,rv,sat)=edgea(rl,rv,sat)+1
1364 elseif (rw.ge.3)
then
1368 corta(rl,rv)=corta(rl,rv)+1
1372 edgeta(rl,rv)=edgeta(rl,rv)+1
1376 defta(rl,rv)=defta(rl,rv)+1
1378 cornera(rl,rv,sat)=cornera(rl,rv,sat)+1
1379 edgea(rl,rv,sat)=edgea(rl,rv,sat)+1
1380 defa(rl,rv,sat)=defa(rl,rv,sat)+1
1395 thepix(rc)%CHECKED=.true.
1399 if (.not.calc_prings .and.upngb)
then
1401 if (
allocated(ba))
deallocate(ba)
1402 allocate(ba(ra), stat=err)
1403 if (err .ne. 0)
then
1413 if (
allocated(bb))
deallocate(bb)
1414 allocate(bb(ra), stat=err)
1415 if (err .ne. 0)
then
1427 if (
allocated(ca))
deallocate(ca)
1428 allocate(ca(rb), stat=err)
1429 if (err .ne. 0)
then
1439 if (
allocated(cb))
deallocate(cb)
1440 allocate(cb(rb), stat=err)
1441 if (err .ne. 0)
then
1451 if (
allocated(xc))
deallocate(xc)
1452 allocate(xc(rb), stat=err)
1453 if (err .ne. 0)
then
1463 if (
allocated(yc))
deallocate(yc)
1464 allocate(yc(rb), stat=err)
1465 if (err .ne. 0)
then
1475 if (
allocated(zc))
deallocate(zc)
1476 allocate(zc(rb), stat=err)
1477 if (err .ne. 0)
then
1488 if (ra.gt.0 .or. rb.gt.0)
then
1492 do rd=1, contj(rc,sat)
1493 rf = voisj(rd,rc,sat)
1501 voisj(rd,rc,sat) = -rf
1507 if (ncells .gt. 1)
then
1508 dij =
calcdij(rij,rc,rf,sat,sat,sat)
1510 dij =
calcdij(rij,rc,rf,sat,sat,1)
1520 call update_bonds (0, sat-1, ra, ba, bb, xc, yc, zc)
1521 call update_bonds (1, sat-1, rb, ca, cb, xc, yc, zc)
1523 call update_atom_neighbors (sat-1, rc-1, contj(rc,sat))
1524 do rd=1, contj(rc,sat)
1525 call update_this_neighbor (sat-1, rc-1, rd-1, voisj(rd,rc,sat))
1540 if (
allocated(thepix))
then
1542 if (
allocated(thepix(rc)%ATOM_ID))
deallocate(thepix(rc)%ATOM_ID)
1557 if (maxbd-minbd .lt. 0.1)
then
1558 minbd = minbd - 0.5;
1559 maxbd = maxbd + 0.5;
1561 call recup_dmin_dmax (minbd, maxbd)
1569 call show_error (
"Impossible to allocate memory !"//char(0), &
1570 "Function: DMTX"//char(0), char(9)//
"Table: "//alc_tab(1:len_trim(alc_tab))//char(0))
1572if (pixr)
call pixout (pout)
1574if (
allocated(thepix))
then
1576 if (
allocated(thepix(rc)%ATOM_ID))
deallocate(thepix(rc)%ATOM_ID)
1580if (
allocated(poa))
deallocate(poa)
1581if (
allocated(ba))
deallocate(ba)
1582if (
allocated(bb))
deallocate(bb)
1583if (
allocated(ca))
deallocate(ca)
1584if (
allocated(cb))
deallocate(cb)
1585if (
allocated(xc))
deallocate(xc)
1586if (
allocated(yc))
deallocate(yc)
1587if (
allocated(zc))
deallocate(zc)