code: craytest fortran from cogs disk =ncsa ctss users guide eg#1 program tempt calculation: c(i)=exp(-0.5)*pi/i change: etime cpu timer replaces 'second'. caution: note the use of a 2 subscript timer array is a fortran trick. change: input from file 'tempt.data' and output to file 'tempt.output'. change: particular input is the vector length "nx". change: second cpu(user) time 'second' added. caution: In Convex SPP1200/XA-16 SPP-UX compile, load and execute with: command: fc -o tempt tempt.f command: run tempt parameter (ndim=5120) real a(ndim),b(ndim),c(ndim) real etime,tv(3,3) caution: fc "real" implies IEEE precision which means 23 or 24 bits fraction caution: cft "real" implies 48bits = 6bytes for the fraction, continued: unlike ibm "real" which implies 24bits = 3bytes. continued: Otherwise all variables not starting with (i-n) are continued: implicitly real, unless otherwise declared. The fraction continued: for "double precision" is 96bits=12bytes, hence no "real*8" open(6,file='tempt.output') open(5,file='tempt.data',status='old') read(5,*) nx tv(3,1)=etime(tv(1,1)) tv(3,2)=etime(tv(1,2)) call init(ndim,nx,a,b) call calc(ndim,nx,a,b,c) tv(3,3)=etime(tv(1,3)) tuoh=tv(1,2)-tv(1,1) ! user cpu timer overhead tsoh=tv(2,2)-tv(2,1) ! system cpu timer overhead ttoh=tv(3,2)-tv(3,1) ! system cpu timer overhead tusr=tv(1,3)-tv(1,2)-tuoh tsys=tv(2,3)-tv(2,2)-tsoh ttot=tv(3,3)-tv(3,2)-ttoh write(6,66) nx,nx,c(nx),tuoh,tusr,tsoh,tsys,ttoh,ttot 66 format(1x,' nx=',i5,'; c(',i5,')=',f10.7 & /' ohead=',e12.4,' seconds; user time=',e12.4,' seconds', & /' ohead=',e12.4,' seconds; system time=',e12.4,' seconds', & /' ohead=',e12.4,' seconds; total time=',e12.4,' seconds') stop end subroutine init(ndim,nx,a,b) comment: removed cdir$ novector real a(ndim),b(ndim) pi=acos(-1.0) do 10 ix=1,nx a(ix)=pi b(ix)=float(ix) 10 continue return end subroutine calc(ndim,nx,a,b,c) comment: removed cdir$ novector real a(ndim),b(ndim),c(ndim) do 20 ix=1,nx c(ix)=exp(-0.5)*a(ix)/b(ix) 20 continue return end