c c------------------------------------------------------------------ c Begin file /home/sting/foster/timescdf/timescdf.f c------------------------------------------------------------------ c program timescdf c include "timescdf.h" dimension pnttime(imx,kmx,jmx,nfhist) character*80 flnmcdf,rcpcomm character*32 ftail data luhist/10/, iprhdr/1/ c c Make netcdf file from single timescdf history: c call setgrid(gcmlat,glat1,dlat,jmx, gcmlon,glon1,dlon,imx, + gcmzp,zp1,dzp,kmx) call getinp c c Read an existing timesgcm history: c istart = 1 do it=1,ntms write(6,"(' ')") write(6,"('Read timesgcm hist: it=',i2,' ntms=',i2, + ' md:mh:mm=',i2,':',i2,':',i2)") + it,ntms,(mtimes(i,it),i=1,3) call gettimes(histvol,nhvols,istart,mtimes(1,it),pnttime, + imx,kmx,jmx,nfhist,iden,luhist,iprhdr,ivol,ier) if (ier.eq.1) then write(6,"('>>> Stopping because proc could not find ', + 'model time ',i2,':',i2,':',i2)") (mtimes(i,it),i=1,3) write(6,"(' History volume(s) searched = ')") do j=1,nhvols write(6,"(a)") histvol(j) enddo stop 'histtime' elseif (ier.ne.0) then write(6,"('>>> Error ',i3,' from gettimes')") ier stop 'gettimes' endif istart = 0 iprhdr = 0 ut(it) = float(mtimes(2,it)) + float(mtimes(3,it))/60. call tail(histvol(ivol),ftail) if (ut(it).lt.10.) then write(flnmcdf,"(a,'.ut0',i1,'.cdf')") ftail(1:lenstr(ftail)), + ifix(ut(it)) else write(flnmcdf,"(a,'.ut',i2,'.cdf')") ftail(1:lenstr(ftail)), + ifix(ut(it)) endif lenflnm = lenstr(flnmcdf) write(6,"('netcdf file name=',a)") flnmcdf(1:lenflnm) call mkcdf(flnmcdf(1:lenflnm),pnttime) c c Copy netcdf file to unix directory: if (nunixdir.gt.0) then write(rcpcomm,"('rcp ',a,' ',a)") flnmcdf(1:lenflnm),unixdir istat = ishell(rcpcomm) write(6,"('istat from ishell(rcpcomm)=',i3,' rcpcomm=',a)") + istat,rcpcomm endif c c End time (history) loop: enddo c stop 'success!' end