PROGRAM GEN_FLOW_ARROWS C This program takes the tmpout# files from the aml of the same name and C does more calculations before generating the arrow coverages character*50 infile,outfile do 1 lay=1,6 write (infile,fmt=’(a6,i1)’) ‘tmpout’,lay write (outfile,fmt=’(a5,i1)’) ‘genin’,lay open (unit=30,file=’check’) open (unit=10,file=infile) open (unit=20,file=outfile) write (outfile,’(a5,i1)’) ‘noout’,lay open (unit=25,file=outfile) 10 read (10,*,end=98) ir,ic,iseq,x0,y0,xx,yy,slope c see if this is a large enough flux to worry about sum = abs(xx)+abs(yy) r=0 angle=0 if (sum .lt. 0.00001) then c if this cell got here it’s active, so we need to note it write (25,fmt=’(i10,2f15.4)’) iseq,x0,y0 go to 10 end if c Calculate the angle, then the x & y to get an arrow 420 cover units long c If xx is zero it’s just y, but we need it in the right direction if (xx .lt. 0.00001 .and. xx .gt.-0.00001) then y=420 x=0 if (yy .lt. 0.0) y=-420 c Or if yy is zero it’s just x, but we need it in the right direction else if (yy .lt. 0.00001 .and. yy .gt.-0.00001) then y=0 x=420 if (xx .lt. 0.0) x=-420 c Or if they are not zero then lets convert to polar coords. then use c our arrow length for r. Remember angle is in radians. else c get the angle and put it in the proper quadrant angle=atan(abs(slope)) if (xx .lt. 0.0 .and. yy .gt. 0.0) + angle=3.141592654-angle if (xx .lt. 0.0 .and. yy .lt. 0.0) + angle=angle-3.141592654 if (xx .gt. 0.0 .and. yy .lt. 0.0) + angle=0.0-angle c make the radius in the proper quandrant also r=420 x=r*cos(angle) y=r*sin(angle) end if c Calc the arrow orig relative to x0 & y0, so the arrow goes through node xb=x0-(x/2) yb=y0-(y/2) c Calc the arrow point xe=x0+(x/2) ye=y0+(y/2) c Print out a file write (20,fmt=’(i10)’) iseq write (20,fmt=’(2f15.4)’) xb,yb write (20,fmt=’(2f15.4)’) xe,ye write (20,*) ‘END’ if (lay .eq. 1) + write (30,fmt=’(2i4,10f10.3)’),ir,ic,angle,r,x,y go to 10 98 write (20,*) ‘END’ write (25,*) ‘END’ close (10) close (20) close (25) 1 continue stop end