<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://micro.stanford.edu/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Create_Straight_Dislocations_for_ParaDiS_Input</id>
	<title>Create Straight Dislocations for ParaDiS Input - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://micro.stanford.edu/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Create_Straight_Dislocations_for_ParaDiS_Input"/>
	<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Create_Straight_Dislocations_for_ParaDiS_Input&amp;action=history"/>
	<updated>2026-07-05T21:51:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>http://micro.stanford.edu/mediawiki/index.php?title=Create_Straight_Dislocations_for_ParaDiS_Input&amp;diff=649&amp;oldid=prev</id>
		<title>Caiwei: Create dislocations.f moved to Create Straight Dislocations for ParaDiS Input</title>
		<link rel="alternate" type="text/html" href="http://micro.stanford.edu/mediawiki/index.php?title=Create_Straight_Dislocations_for_ParaDiS_Input&amp;diff=649&amp;oldid=prev"/>
		<updated>2008-10-25T06:20:52Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/wiki/Create_dislocations.f&quot; class=&quot;mw-redirect&quot; title=&quot;Create dislocations.f&quot;&gt;Create dislocations.f&lt;/a&gt; moved to &lt;a href=&quot;/wiki/Create_Straight_Dislocations_for_ParaDiS_Input&quot; title=&quot;Create Straight Dislocations for ParaDiS Input&quot;&gt;Create Straight Dislocations for ParaDiS Input&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Create dislocations for ParaDiS input file==&lt;br /&gt;
==Sylvie Aubry (10/29/07)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      implicit none&lt;br /&gt;
      integer nmax&lt;br /&gt;
      parameter (nmax = 20)&lt;br /&gt;
      integer ndis,n&lt;br /&gt;
      integer i,j,t,k,m,inc,m0,m1,method&lt;br /&gt;
      integer tmin(nmax),tmax(nmax),tstep(nmax)&lt;br /&gt;
      integer length,fp,maxstep&lt;br /&gt;
      integer ncount,ncount_int(nmax+1),ncount_tmp(nmax+1)&lt;br /&gt;
      integer seed(nmax)&lt;br /&gt;
      double precision bx(nmax),by(nmax),bz(nmax)&lt;br /&gt;
      double precision nx(nmax),ny(nmax),nz(nmax)&lt;br /&gt;
      double precision a(nmax),b(nmax),c(nmax)&lt;br /&gt;
      double precision x0(nmax),y0(nmax),z0(nmax)&lt;br /&gt;
      double precision x,y,z,tmp&lt;br /&gt;
      double precision rc,rTol&lt;br /&gt;
      double precision xmin,ymin,zmin,xmax,ymax,zmax&lt;br /&gt;
      double precision bnorm,nnorm&lt;br /&gt;
      double precision burgMag,L,Lmin,Lmax,minSeg,maxSeg&lt;br /&gt;
      character*50 name,name2,type&lt;br /&gt;
&lt;br /&gt;
Read in some parameters&lt;br /&gt;
&lt;br /&gt;
L : Length in micrometer&lt;br /&gt;
      read(*,*) L&lt;br /&gt;
maxstep for the simulation&lt;br /&gt;
      read(*,*) maxstep&lt;br /&gt;
&lt;br /&gt;
L = (read-in L) micrometer = 10^-6 m.&lt;br /&gt;
      burgMag = 2.725d-10&lt;br /&gt;
      L = L*1d-6/burgMag &lt;br /&gt;
      Lmin = -L/2.d0 + 300.d0&lt;br /&gt;
      Lmax =  L/2.d0&lt;br /&gt;
      write(*,*)&lt;br /&gt;
      write(*,*) &amp;#039;L=&amp;#039;,L&lt;br /&gt;
      write(*,*) &amp;#039;Lmin=&amp;#039;,Lmin&lt;br /&gt;
      write(*,*) &amp;#039;Lmax=&amp;#039;,Lmax&lt;br /&gt;
      write(*,*) &amp;#039;Total number of steps=&amp;#039;,maxstep&lt;br /&gt;
number of points on each dislocation line&lt;br /&gt;
      inc = 50&lt;br /&gt;
      write(*,5) &amp;#039;Number of points on the curve=&amp;#039;,inc&lt;br /&gt;
      write(*,*)&lt;br /&gt;
&lt;br /&gt;
File name&lt;br /&gt;
      read(*,*) name&lt;br /&gt;
ndis = how many dislocations&lt;br /&gt;
      read(*,*) ndis&lt;br /&gt;
      if (ndis.le.0.and.ndis.gt.nmax) then&lt;br /&gt;
         write(*,*) &amp;#039;Wrong number of dislocations.&amp;#039;&lt;br /&gt;
         stop&lt;br /&gt;
      else&lt;br /&gt;
         write(*,*) &amp;#039;Reading &amp;#039;,ndis,&amp;#039; dislocations.&amp;#039;&lt;br /&gt;
      endif&lt;br /&gt;
&lt;br /&gt;
Read Burgers vectors and glide planes&lt;br /&gt;
&lt;br /&gt;
      do i=1,ndis&lt;br /&gt;
         write(*,*)&lt;br /&gt;
         write(*,30) &amp;#039;For dislocation &amp;#039;,i,&amp;#039;/&amp;#039;,ndis&lt;br /&gt;
Burgers vector&lt;br /&gt;
         read(*,*) bx(i),by(i),bz(i) &lt;br /&gt;
Glide planes&lt;br /&gt;
         read(*,*) nx(i),ny(i),nz(i)&lt;br /&gt;
&lt;br /&gt;
Normalize Burgers vector/Glide plane in units of burgMag = a sqrt(3)/2.&lt;br /&gt;
&lt;br /&gt;
         do j=1,3&lt;br /&gt;
            bnorm = sqrt(bx(i)**2 + by(i)**2 + bz(i)**2)&lt;br /&gt;
            bx(i)= bx(i)/bnorm&lt;br /&gt;
            by(i)= by(i)/bnorm&lt;br /&gt;
            bz(i)= bz(i)/bnorm&lt;br /&gt;
&lt;br /&gt;
            nnorm = sqrt(nx(i)**2 + ny(i)**2 + nz(i)**2)&lt;br /&gt;
            nx(i)= nx(i)/nnorm&lt;br /&gt;
            ny(i)= ny(i)/nnorm&lt;br /&gt;
            nz(i)= nz(i)/nnorm&lt;br /&gt;
         enddo&lt;br /&gt;
&lt;br /&gt;
Choose how to get dislocation line&lt;br /&gt;
&lt;br /&gt;
         read(*,*) method&lt;br /&gt;
         if (method.eq.0) then&lt;br /&gt;
    &lt;br /&gt;
Define dislocation line automatically according to type and seed&lt;br /&gt;
    &lt;br /&gt;
Type of the dislocation : screw, edge, mixed&lt;br /&gt;
            read(*,*) type&lt;br /&gt;
            write(*,*) &amp;#039;Type of dislocation: &amp;#039;,type(1:length(type))&lt;br /&gt;
            read(*,*) seed(i)&lt;br /&gt;
    &lt;br /&gt;
            call get_abc(a(i),b(i),c(i),x0(i),y0(i),z0(i),&lt;br /&gt;
     &amp;amp;        bx(i),by(i),bz(i),nx(i),ny(i),nz(i),&lt;br /&gt;
     &amp;amp;           type,Lmin,Lmax,seed(i))&lt;br /&gt;
            &lt;br /&gt;
         else&lt;br /&gt;
            read(*,*) a(i),b(i),c(i),x0(i),y0(i),z0(i)&lt;br /&gt;
         endif&lt;br /&gt;
&lt;br /&gt;
         write(*,20) &amp;#039;bx=&amp;#039;,bx(i),&amp;#039; by=&amp;#039;,by(i),&amp;#039; bz=&amp;#039;,bz(i)&lt;br /&gt;
         write(*,20) &amp;#039;nx=&amp;#039;,nx(i),&amp;#039; ny=&amp;#039;,ny(i),&amp;#039; c=&amp;#039;,nz(i)&lt;br /&gt;
&lt;br /&gt;
         write(*,20) &amp;#039;a=&amp;#039;,a(i),&amp;#039; b=&amp;#039;,b(i),&amp;#039; c=&amp;#039;,c(i)&lt;br /&gt;
         write(*,20) &amp;#039;x0=&amp;#039;,x0(i),&amp;#039; y0=&amp;#039;,y0(i),&amp;#039; z0=&amp;#039;,z0(i)&lt;br /&gt;
&lt;br /&gt;
         call get_bounds(xmin,xmax,Lmin,Lmax,a(i),x0(i))&lt;br /&gt;
         call get_bounds(ymin,ymax,Lmin,Lmax,b(i),y0(i))&lt;br /&gt;
         call get_bounds(zmin,zmax,Lmin,Lmax,c(i),z0(i))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
         tmin(i) = max(xmin,ymin,zmin)&lt;br /&gt;
         tmax(i) = min(xmax,ymax,zmax)&lt;br /&gt;
&lt;br /&gt;
         if (tmin(i).gt.tmax(i)) then&lt;br /&gt;
            tmp = tmin(i)&lt;br /&gt;
            tmin(i) = tmax(i)&lt;br /&gt;
            tmax(i) = tmp&lt;br /&gt;
         endif&lt;br /&gt;
         &lt;br /&gt;
inc in the final number of points on the dislocation line.&lt;br /&gt;
&lt;br /&gt;
         tstep(i) = (tmax(i)-tmin(i))/inc&lt;br /&gt;
         if (tstep(i).eq.0) then&lt;br /&gt;
            write(*,*) &amp;#039;Found a number of point on the &amp;#039;,&lt;br /&gt;
     &amp;amp;                  &amp;#039;curve equals to zero - ABORT&amp;#039;&lt;br /&gt;
            stop&lt;br /&gt;
         endif&lt;br /&gt;
         write(*,*) &amp;#039;bounds=&amp;#039;,tmin(i),tmax(i)&lt;br /&gt;
      enddo&lt;br /&gt;
&lt;br /&gt;
Write outputs files&lt;br /&gt;
    &lt;br /&gt;
write .cn file&lt;br /&gt;
&lt;br /&gt;
      name2 = &amp;#039;Outputs/&amp;#039;//name(1:length(name))//&amp;#039;_results&amp;#039;&lt;br /&gt;
      open(unit=20,file=&amp;#039;../../Runs/&amp;#039;//name(1:length(name))//&amp;#039;.cn&amp;#039;)&lt;br /&gt;
      write(20,400) &amp;#039;### ParaDis input file (create_dislocation.f) ###&amp;#039;&lt;br /&gt;
      write(20,400) &amp;#039;### S.A. (10/29/07)&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
      write(20,400) &amp;#039;#Directory to write output files&amp;#039;&lt;br /&gt;
      write(20,*) &amp;#039;dirname =&amp;#039;,name2(1:length(name2))&lt;br /&gt;
      write(20,*) &lt;br /&gt;
      write(20,400)  &amp;#039;#Input files for PBC image stresses&amp;#039;&lt;br /&gt;
      write(20,400)  &amp;#039;Rijmfile = &amp;quot;Inputs/Rijm.cube.out&amp;quot;&amp;#039;&lt;br /&gt;
      write(20,400)  &amp;#039;RijmPBCfile = &amp;quot;Inputs/RijmPBC.cube.out&amp;quot;&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
      write(20,400)  &amp;#039;#Total simulation step&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;maxstep=&amp;#039;,maxstep&lt;br /&gt;
      write(20,*)&lt;br /&gt;
      write(20,400)  &amp;#039;#The total number of CPUs&amp;#039;&lt;br /&gt;
      write(20,400)  &amp;#039;numXdoms = 1&amp;#039;&lt;br /&gt;
      write(20,400)  &amp;#039;numYdoms = 1&amp;#039;&lt;br /&gt;
      write(20,400)  &amp;#039;numZdoms = 1&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
      write(20,400)  &amp;#039;#Cells for dislocation grouping (&amp;gt;=3)&amp;#039;&lt;br /&gt;
      write(20,400)  &amp;#039;numXcells = 3&amp;#039;&lt;br /&gt;
      write(20,400)  &amp;#039;numYcells = 3&amp;#039;&lt;br /&gt;
      write(20,400)  &amp;#039;numZcells = 3&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;#Fast multipole method specs.&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;fmEnabled = 0  #disable fast multipole&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;fmMPOrder = 2&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;fmTaylorOrder = 4&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;fmCorrectionTbl = &amp;quot;Inputs/fm-ctab.m2.t4.dat&amp;quot;&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;timestepIntegrator = &amp;quot;backward-euler&amp;quot;&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
      write(20,400)  &amp;#039;#Simulation box size&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;xBoundMin =&amp;#039;,Lmin&lt;br /&gt;
      write(20,*)  &amp;#039;xBoundMax =&amp;#039;,Lmax&lt;br /&gt;
      write(20,*)  &amp;#039;yBoundMin =&amp;#039;,Lmin&lt;br /&gt;
      write(20,*)  &amp;#039;yBoundMax =&amp;#039;,Lmax&lt;br /&gt;
      write(20,*)  &amp;#039;zBoundMin =&amp;#039;,Lmin&lt;br /&gt;
      write(20,*)  &amp;#039;zBoundMax =&amp;#039;,Lmax&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;#Boundary conditions&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;xBoundType = 0&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;yBoundType = 0&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;zBoundType = 0&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;#Mobility law function&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;mobilityLaw = &amp;quot;BCC_0&amp;quot;&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;MobScrew =&amp;#039;, 10.&lt;br /&gt;
      write(20,*)  &amp;#039;MobEdge  =&amp;#039;, 10.&lt;br /&gt;
      write(20,*)  &amp;#039;MobClimb =&amp;#039;, 1.e-4&lt;br /&gt;
&lt;br /&gt;
max/min Seg = max/min length of dislocation segment. &lt;br /&gt;
current dislocation segment length is inc&lt;br /&gt;
&lt;br /&gt;
      write(20,*)&lt;br /&gt;
      minSeg = 4*inc&lt;br /&gt;
      maxSeg = 2*minSeg&lt;br /&gt;
      write(20,400)  &amp;#039;#Discretization&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;maxSeg =&amp;#039;,maxSeg&lt;br /&gt;
      write(20,*)  &amp;#039;minSeg =&amp;#039;,minSeg&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;#Maximum nodal displacement at each time step&amp;#039;&lt;br /&gt;
      write(20,400)  &amp;#039;rmax = 100&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
      write(20,400)  &amp;#039;#Error tolerance in determining time step&amp;#039;&lt;br /&gt;
It should be  such that rntol &amp;lt; 0.5 rc = 0.5 a. &lt;br /&gt;
      rc = minSeg/sqrt(3.d0)*0.5&lt;br /&gt;
      rTol = 0.45*0.5*rc&lt;br /&gt;
      write(20,*)  &amp;#039;rTol =&amp;#039;,rTol    &lt;br /&gt;
      write(20,*)&lt;br /&gt;
      write(20,400)  &amp;#039;#Maximum time step&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;maxDT = 1e+07&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
      write(20,*)  &amp;#039;#Core cut-off radius&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;rc =&amp;#039;,rc&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;#Turn on elastic interaction&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;elasticinteraction = 1&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;#Applied stress in Pa (xx,yy,zz,yz,zx,xy)&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;appliedStress = [ 0 0 0 0 0 0 ]&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;#Loading&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;loadType = 1&amp;#039; &lt;br /&gt;
      write(20,*)  &amp;#039;eRate = 1&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;edotdir = [1 0 0]&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;#Save files&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;savecn = 1&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;savecnfreq = 100&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400)  &amp;#039;#Povray output&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;povray = 1&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;povrayfreq = 100&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;povraydt = -1.000000e+00&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;povraytime = 0.000000e+00&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;povraycounter = 0&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;saveprop = 1&amp;#039;&lt;br /&gt;
      write(20,*)  &amp;#039;savepropfreq = 1&amp;#039;&lt;br /&gt;
      write(20,*)&lt;br /&gt;
      write(20,*)  &amp;#039;preserveOldTags = 1&amp;#039;&lt;br /&gt;
      close(20)&lt;br /&gt;
&lt;br /&gt;
Write .data file&lt;br /&gt;
&lt;br /&gt;
      open(unit=20,file=&amp;#039;../../Runs/&amp;#039;//name(1:length(name))//&amp;#039;.data&amp;#039;)&lt;br /&gt;
      write(20,400) &amp;#039;### ParaDis nodal file (create_dislocation.f)&amp;#039;&lt;br /&gt;
      write(20,400) &amp;#039;### S.A. (10/29/07)###&amp;#039;&lt;br /&gt;
      write(20,400)&lt;br /&gt;
&lt;br /&gt;
      write(20,400) &amp;#039;#File version number&amp;#039;&lt;br /&gt;
      write(20,400) &amp;#039;2&amp;#039;&lt;br /&gt;
      write(20,400)&lt;br /&gt;
&lt;br /&gt;
      write(20,400) &amp;#039;#Number of data file segments&amp;#039;&lt;br /&gt;
      write(20,400) &amp;#039;1&amp;#039;&lt;br /&gt;
      write(20,400) &amp;#039;#Minimum coordinate values (x, y, z)&amp;#039;&lt;br /&gt;
      write(20,*) -L/2,-L/2,-L/2&lt;br /&gt;
      write(20,400) &amp;#039;#Maximum coordinate values (x, y, z)&amp;#039;&lt;br /&gt;
      write(20,*) L/2,L/2,L/2&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400) &amp;#039;#Node count&amp;#039;&lt;br /&gt;
      ncount = 0&lt;br /&gt;
      do i=1,ndis+1&lt;br /&gt;
         ncount_int(i) = 0&lt;br /&gt;
      enddo&lt;br /&gt;
&lt;br /&gt;
      do i=1,ndis&lt;br /&gt;
         do t=tmin(i),tmax(i),tstep(i)&lt;br /&gt;
            ncount = ncount + 1&lt;br /&gt;
            ncount_int(i+1) = ncount_int(i+1) + 1 &lt;br /&gt;
         enddo&lt;br /&gt;
      enddo&lt;br /&gt;
&lt;br /&gt;
      write(20,*) ncount&lt;br /&gt;
      write(20,400) &amp;#039;#Domain geometry (x, y, z)&amp;#039;&lt;br /&gt;
      write(20,400) &amp;#039;1 1 1&amp;#039;&lt;br /&gt;
      write(20,*) &lt;br /&gt;
      write(20,400) &amp;#039;#Domain boundaries (x, y, z)&amp;#039;&lt;br /&gt;
      write(20,*) -L/2&lt;br /&gt;
      write(20,*) -L/2&lt;br /&gt;
      write(20,*) -L/2&lt;br /&gt;
      write(20,*)  L/2&lt;br /&gt;
      write(20,*)  L/2&lt;br /&gt;
      write(20,*)  L/2&lt;br /&gt;
      write(20,*)&lt;br /&gt;
&lt;br /&gt;
      write(20,400) &amp;#039;#node_tag, x, y, z, num_arms, constraint&amp;#039;&lt;br /&gt;
      write(20,400) &amp;#039;#arm_tag, burgx, burgy, burgz, nx, ny, nz&amp;#039;&lt;br /&gt;
      write(20,400) &amp;#039;#length in unit of burgMag&amp;#039;&lt;br /&gt;
      m = 0&lt;br /&gt;
      m0 = 0&lt;br /&gt;
      m1 = 0&lt;br /&gt;
      do i=1,ndis&lt;br /&gt;
    &lt;br /&gt;
first&lt;br /&gt;
   &lt;br /&gt;
         m0 = m&lt;br /&gt;
         m1 = m1 + ncount_int(i)&lt;br /&gt;
         t=tmin(i)&lt;br /&gt;
         x = x0(i) + a(i)*t&lt;br /&gt;
         y = y0(i) + b(i)*t&lt;br /&gt;
         z = z0(i) + c(i)*t        &lt;br /&gt;
         write(20,250) &amp;#039;0,&amp;#039;,m,&amp;#039; &amp;#039;,x,y,z,2,0&lt;br /&gt;
         write(20,300) &amp;#039;     0,&amp;#039;,m0+ncount_int(i+1)-1,&lt;br /&gt;
     &amp;amp;        bx(i),by(i),bz(i)&lt;br /&gt;
         write(20,350) &amp;#039;       &amp;#039;,nx(i),ny(i),nz(i)&lt;br /&gt;
         write(20,300) &amp;#039;     0,&amp;#039;,m+1,-bx(i),-by(i),-bz(i)&lt;br /&gt;
         write(20,350) &amp;#039;       &amp;#039;,nx(i),ny(i),nz(i)&lt;br /&gt;
         m = m + 1&lt;br /&gt;
    &lt;br /&gt;
all &lt;br /&gt;
    &lt;br /&gt;
         do t=tmin(i)+tstep(i),tmax(i)-tstep(i),tstep(i)&lt;br /&gt;
            x = x0(i) + a(i)*t&lt;br /&gt;
            y = y0(i) + b(i)*t&lt;br /&gt;
            z = z0(i) + c(i)*t        &lt;br /&gt;
            write(20,250) &amp;#039;0,&amp;#039;,m,&amp;#039; &amp;#039;,x,y,z,2,0&lt;br /&gt;
            write(20,300) &amp;#039;    0,&amp;#039;,m-1,bx(i),by(i),bz(i)&lt;br /&gt;
            write(20,350) &amp;#039;      &amp;#039;,nx(i),ny(i),nz(i)&lt;br /&gt;
            write(20,300) &amp;#039;    0,&amp;#039;,m+1,-bx(i),-by(i),-bz(i)&lt;br /&gt;
            write(20,350) &amp;#039;      &amp;#039;,nx(i),ny(i),nz(i)&lt;br /&gt;
            m = m + 1&lt;br /&gt;
         enddo&lt;br /&gt;
&lt;br /&gt;
last node         &lt;br /&gt;
&lt;br /&gt;
         t = tmax(i)&lt;br /&gt;
         x = x0(i) + a(i)*t&lt;br /&gt;
         y = y0(i) + b(i)*t&lt;br /&gt;
         z = z0(i) + c(i)*t        &lt;br /&gt;
         write(20,250) &amp;#039;0,&amp;#039;,m,&amp;#039; &amp;#039;,x,y,z,2,0&lt;br /&gt;
         write(20,300) &amp;#039;    0,&amp;#039;,m-1,bx(i),by(i),bz(i)&lt;br /&gt;
         write(20,350) &amp;#039;      &amp;#039;,nx(i),ny(i),nz(i)&lt;br /&gt;
         write(20,300) &amp;#039;    0,&amp;#039;,m1,-bx(i),-by(i),-bz(i)&lt;br /&gt;
         write(20,350) &amp;#039;      &amp;#039;,nx(i),ny(i),nz(i)&lt;br /&gt;
         m = m + 1&lt;br /&gt;
      enddo&lt;br /&gt;
&lt;br /&gt;
      close(20)&lt;br /&gt;
&lt;br /&gt;
 5    format(a,i3)&lt;br /&gt;
 10   format(a,f9.2,a)&lt;br /&gt;
 20   format(a,f9.2,a,f9.2,a,f9.2)&lt;br /&gt;
 30   format(a,i2,a,i3)&lt;br /&gt;
 100  format(3f15.3,i2,a)&lt;br /&gt;
 200  format(2i5,6f10.3,a)&lt;br /&gt;
&lt;br /&gt;
 250  format(a,i4,a,3f12.2,2i2)&lt;br /&gt;
 300  format(a,i4,3f12.2)&lt;br /&gt;
 350  format(a,3f12.2)&lt;br /&gt;
 400  format(a)&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      double precision function min(a,b,c)&lt;br /&gt;
      implicit none&lt;br /&gt;
      double precision a,b,c,min0     &lt;br /&gt;
      if (a.lt.b) then&lt;br /&gt;
         min0 = a&lt;br /&gt;
      else&lt;br /&gt;
         min0 = b&lt;br /&gt;
      endif&lt;br /&gt;
      if (min0.lt.c) then&lt;br /&gt;
         min = min0&lt;br /&gt;
      else&lt;br /&gt;
         min = c&lt;br /&gt;
      endif&lt;br /&gt;
      return min&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      double precision function max(a,b,c)&lt;br /&gt;
      implicit none&lt;br /&gt;
      double precision a,b,c,max0    &lt;br /&gt;
      if (a.gt.b) then&lt;br /&gt;
         max0 = a&lt;br /&gt;
      else&lt;br /&gt;
         max0 = b&lt;br /&gt;
      endif&lt;br /&gt;
      if (max0.gt.c) then&lt;br /&gt;
         max = max0&lt;br /&gt;
      else&lt;br /&gt;
         max = c&lt;br /&gt;
      endif       &lt;br /&gt;
      end   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      integer function length(str)&lt;br /&gt;
      character*(*) str&lt;br /&gt;
      n = len(str)&lt;br /&gt;
 10   if (n.gt.0) then&lt;br /&gt;
        if (str(n:n).eq.&amp;#039; &amp;#039;) then&lt;br /&gt;
          n = n - 1&lt;br /&gt;
          goto 10&lt;br /&gt;
        endif&lt;br /&gt;
      endif&lt;br /&gt;
      length = n&lt;br /&gt;
      return&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      subroutine random_gen(ranval,min,max,seed)&lt;br /&gt;
      integer seed&lt;br /&gt;
      real*4 ranval_tmp&lt;br /&gt;
      double precision min,max,ranval      &lt;br /&gt;
      ranval_tmp = rand(seed)&lt;br /&gt;
      ranval = ranval_tmp*(max-min) + min&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
     subroutine get_abc(a,b,c,x0,y0,z0,bx,by,bz,nx,ny,nz,&lt;br /&gt;
     &amp;amp;     type,Lmin,Lmax,seed)&lt;br /&gt;
      implicit none&lt;br /&gt;
      integer length&lt;br /&gt;
      integer seed,seedX0,seedY0,seedZ0,seedalpha&lt;br /&gt;
      double precision a,b,c&lt;br /&gt;
      double precision x0,y0,z0,bx,by,bz,nx,ny,nz,Lmin,Lmax&lt;br /&gt;
      double precision alpha&lt;br /&gt;
      character*20 type&lt;br /&gt;
&lt;br /&gt;
      seedX0 = seed + 19&lt;br /&gt;
      seedY0 = seed + 395&lt;br /&gt;
      seedZ0 = seed + 34&lt;br /&gt;
      seedalpha = seed&lt;br /&gt;
&lt;br /&gt;
      call random_gen(x0,Lmin/5d0,Lmax/5d0,seedX0)&lt;br /&gt;
      call random_gen(y0,Lmin/5d0,Lmax/5d0,seedY0)&lt;br /&gt;
      call random_gen(z0,Lmin/5d0,Lmax/5d0,seedZ0)&lt;br /&gt;
      call random_gen(alpha,-100.d0,100.d0,seedalpha)&lt;br /&gt;
&lt;br /&gt;
screw : dislocation line is parallel to the Burgers vector.&lt;br /&gt;
&lt;br /&gt;
      if (type(1:length(type)).eq.&amp;#039;screw&amp;#039;) then&lt;br /&gt;
         a = alpha * bx&lt;br /&gt;
         b = alpha * by&lt;br /&gt;
         c = alpha * bz&lt;br /&gt;
      endif&lt;br /&gt;
&lt;br /&gt;
edge : dislocation line is normal to the Burgers vector &lt;br /&gt;
and the glide plane&lt;br /&gt;
&lt;br /&gt;
      if (type(1:length(type)).eq.&amp;#039;edge&amp;#039;) then&lt;br /&gt;
         a =  alpha * (by*nz - bz*ny)&lt;br /&gt;
         b = -alpha * (bx*nz - bz*nx)&lt;br /&gt;
         c =  alpha * (bx*ny - by*nx)&lt;br /&gt;
      endif&lt;br /&gt;
&lt;br /&gt;
mixed : edge and screw component&lt;br /&gt;
&lt;br /&gt;
      if (type(1:length(type)).eq.&amp;#039;mixed&amp;#039;) then&lt;br /&gt;
         a = alpha * bx + alpha * (by*nz - bz*ny)&lt;br /&gt;
         b = alpha * by - alpha * (bx*nz - bz*nx)&lt;br /&gt;
         c = alpha * bz + alpha * (bx*ny - by*nx)&lt;br /&gt;
      endif&lt;br /&gt;
&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      subroutine get_bounds(xmin,xmax,Lmin,Lmax,a,x)&lt;br /&gt;
      implicit none&lt;br /&gt;
      integer i&lt;br /&gt;
      double precision xmin,xmax,Lmin,Lmax,a,x&lt;br /&gt;
         if (a.ne.0) then&lt;br /&gt;
            if (a.gt.0) then&lt;br /&gt;
               xmin = (Lmin-x)/a&lt;br /&gt;
               xmax = (Lmax-x)/a&lt;br /&gt;
            else&lt;br /&gt;
               xmin = (Lmax-x)/a&lt;br /&gt;
               xmax = (Lmin-x)/a &lt;br /&gt;
            endif&lt;br /&gt;
         else&lt;br /&gt;
            xmin = -10d10&lt;br /&gt;
            xmax =  10d10&lt;br /&gt;
         endif&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
      subroutine get_rand(seed,yy)&lt;br /&gt;
      implicit none&lt;br /&gt;
      integer i, number, old, seed, x, y&lt;br /&gt;
      double precision yy     &lt;br /&gt;
       number = 1000&lt;br /&gt;
       old = seed&lt;br /&gt;
       do i = 1, number&lt;br /&gt;
          x = MOD((57*old+1), 256)&lt;br /&gt;
          y = MOD((57*x+1), 256)&lt;br /&gt;
         old=y &lt;br /&gt;
      enddo&lt;br /&gt;
      yy = dabs(y*1.d0/255.d0)&lt;br /&gt;
      end&lt;/div&gt;</summary>
		<author><name>Caiwei</name></author>
	</entry>
</feed>