how to make fortran code to remove coordinate of particles from input file to avoid overlapping -
i had configuration 1804 particles particles overlap. try make fortran code remove co-ordinates of particles. got error. please me.
program check_overlap implicit double precision (a-h,o-z) parameter (maxatom = 20000000) dimension rx(maxatom), ry(maxatom), rz(maxatom) real drmax character resname*(5),atomname*(5) character box_par drmax = 0.15 open (10, file = 'conf.gro') read (10,*) box_par read (10,*) nn 100 ipart = 1, nn read(10,99) numres,resname,atomname,numatom, & rx(ipart), ry(ipart), rz(ipart) 99 format (i5,2a5,i5,3f8.3) 100 continue close(10) 200 = 1, nn-1 rxi = rx(i) ryi = ry(i) rzi = rz(i) 300 j = i+1 , nn rxij = rxi - rx (j) ryij = ryi - ry (j) rzij = rzi - rz (j) rijsq = rxij*rxij + ryij*ryij + rzij*rzij if ( rijsq.lt.25) rxiold = rxi ryiold = ryi rziold = rzi rxinew = rxiold + (2.0 * ranf (dumy) - 1.0) * drmax ryinew = ryiold + (2.0 * ranf (dumy) - 1.0) * drmax rzinew = rziold + (2.0 * ranf (dumy) - 1.0) * drmax rxinew = rxinew - anint (rxinew) ryinew = ryinew - anint (ryinew) rzinew = rzinew - anint (rzinew) rxij_new = rxi - rxinew ryij_new = ryi - ryinew rzij_new = rzi - rzinew rijsq_new = rxij_new*rxij_new + ryij_new*ryij_new+ & rzij_new*rzij_new if (rijsq_new.gt.25) rx(i) = rxinew ry(i) = ryinew rz(i) = rzinew end if end if 300 continue 200 continue call writeout (cn)
Comments
Post a Comment