37 implicit real*8(a-h,o-z)
38 character*200 fnamei,fnameo
40 real*4 zrec(100000),nw,ne,sw,se,zmin,zmax
41 integer*2 srec(100000)
42 equivalence(hrec(1),zrec(1),srec(1))
48 1
format(
'Program gsqr - converts grid points ',
49 *
'to their squared values')
52 2
format(
'Enter the input grid file name: ',$)
54 open(lin,file=fnamei,status=
'old',form=
'unformatted')
57 3
format(
'Enter the output grid file name: ',$)
59 open(lout,file=fnameo,status=
'new',form=
'unformatted')
64 read(lin) glamn,glomn,dgla,dglo,nla,nlo,ikind
65 write(lout) glamn,glomn,dgla,dglo,nla,nlo,ikind
71 read(lin)(hrec(i),i=1,nlo)
73 hrec(i) = nint(sqrt(1.0*hrec(i)))
75 write(lout)(hrec(i),i=1,nlo)
78 elseif(ikind.eq.1)
then 80 read(lin) (zrec(i),i=1,nlo)
82 zrec(i) = sqrt(zrec(i))
84 write(lout)(zrec(i),i=1,nlo)
87 elseif(ikind.eq.-1)
then 89 read(lin) (srec(i),i=1,nlo)
91 srec(i) = nint(sqrt(1.0*srec(i)))
93 write(lout)(srec(i),i=1,nlo)
96 elseif(ikind.eq.2)
then 98 read(lin) (srec(i),i=1,nlo)
100 srec(i) = nint(sqrt(1.0*srec(i)))
102 write(lout)(srec(i),i=1,nlo)
program gsqrt
Part of the NADCON5 NADCON5 Core Library , Square Root of values in a *.b grid.