*=*=*=*= instat.html =*=*=*=*
subroutine instat IMPLICIT NONE c c Initialize a statistics header file and data file. SRL c #include "dimensions.h" #include "dimphys.h" #include "comvert.h" #include "comcstfi.h" c._.#include "param2" c._.#include "bats" c._.#include "outcon" c._.#include "phycmn" c._.#include "drscoords" #include "statto.h" c integer n,nsteppd C c IF (istats.lt.1) RETURN c number of physical timestep corresponding to each storge print*,'daysec',daysec print*,'dtphys',dtphys nsteppd=nint(daysec/dtphys) print*,'nsteppd=',nsteppd if (abs(float(nsteppd)-daysec/dtphys).gt.1.e-8*daysec) , stop'Dans Instat: 1jour .ne. n pas physiques' if(mod(nsteppd,istime).ne.0) , stop'Dans Instat: 1jour .ne. n*istime pas physiques' istats=nsteppd/istime print*,'istats=',istats print*,'On sauvegarder ',istime,'fois par jours' print*,'soit tous les ',istats,' pas de temps' C Write some numbers which might be useful later into a header file. C open(ushead, file='cumul.hdr', form='unformatted', status='new') c._. write(ushead) rntape, kstart, ktotal, itspd, kphysic, refday write(ushead) 0.E+0,0,0,istats*istime,1,0 c._. write(ushead) cols, rows, npgrid, nl write(ushead) iim,npgrid/iim,npgrid,nlayermx write(ushead) sig_s write(ushead) istats, istime, n2dvar, n3dvar, nltime C do n = 1, istime nstore(n) = 0 enddo write(ushead) nstore C C Write a lot of nothing into the data file. C open(usdata, file='cumul.dat', form='unformatted', status='new' #ifdef sgi & ,access='direct', recl=npgrid) #else & ,access='direct', recl=4*npgrid) #endif C do n = 1, npgrid dummy(n) = 0.0 enddo C do n = 1, nltime*istime write(usdata, rec = n) dummy enddo C C PRINT*,'End of : instat' C RETURN END