c program mksut c c Make single-ut netcdf file(s) at selected model time(s): c include 'mkncdf.h' pointer(pfields,fields(1)) character*80 flnmcdf,msspath,flnm,rcpcomm,tmpdir c c Get user input for this run: c call getinp call clearstr(tmpdir) write(tmpdir,"('/usr/tmp/TIGCM')") c c Ut loop: c istart = 1 iprhdr = 1 do 100 it=1,ntms call rdtgcm(histvol,nhvols,tmpdir,istart,mtimes(1,it),pfields, + ifget,nfhist,imx,kmx,jmx,nflds,zp1,dzp,iden,ionvel,luhist, + iprhdr,ivol,isdyn,istimes,issech,ier) if (ier.ne.0) then write(6,"('mkncdf (sut): error ',i3,' from rdtgcm: it=',i3, + ' mtimes=',i2,':',i2,':',i2)") ier,it,(mtimes(i,it),i=1,3) goto 100 else write(6,"('mtime=',i2,':',i2,':',i2,' isdyn=',l1, + ' istimes=',l1,' kmx=',i2,' nflds=',i2)") + (mtimes(i,it),i=1,3),isdyn,istimes,kmx,nflds endif istart = 0 call alloc(pgcmzp,kmx) call setgrid(gcmlat,glat1,dlat,jmx, gcmlon, + glon1,dlon,imx,gcmzp,zp1,dzp,kmx) ut(it) = float(mtimes(2,it))+float(mtimes(3,it))/60. c c ifget may have been changed in gettgcm (certain fields may not c be available...set ifields accordingly: c do i=1,nfhist if (ifget(i).le.0.and.ifields(i).gt.0) ifields(i) = 0 enddo call incind(ifields,nftot,nfplt) call incind(ifget,nfhist,nfget) c c Construct netcdf file name: c call tail(histvol(ivol),flnm) if (ut(it).lt.10) then write(flnmcdf,"(a,'.ut0',i1,'.cdf')") flnm(1:lenstr(flnm)), + ifix(ut(it)) else write(flnmcdf,"(a,'.ut',i2,'.cdf')") flnm(1:lenstr(flnm)), + ifix(ut(it)) endif lenflnm = lenstr(flnmcdf) c c Make netcdf file from current history: c call mksut(fields,flnmcdf(1:lenflnm),it) c c Copy netcdf file to unix directory: lenunix = lenstr(unixdir) if (lenunix.gt.0) then write(rcpcomm,"('rcp ',a,' ',a)") flnmcdf(1:lenflnm), + unixdir(1:lenunix) istat = ishell(rcpcomm) if (istat.eq.0) then write(6,"('Remote copied ',a,' to ',a)") + flnmcdf(1:lenflnm),unixdir(1:lenunix) else write(6,"('>>> Error remote copying ',a,' to ',a, + ' istat=',i3)") flnmcdf(1:lenflnm),unixdir(1:lenunix), + istat endif endif c c Copy netcdf file to mass store: lenmss = lenstr(mssdir) if (lenmss.gt.0) then msspath = mssdir(1:lenstr(mssdir))//"/"//flnmcdf(1:lenflnm) call mswrite(ier,flnmcdf(1:lenflnm), + msspath(1:lenstr(msspath)),' ',367,' ') if (ier.ne.0) then write(6,"('>>> error from mswrite=',i3)") ier else write(6,"('Wrote mss file ',a)") msspath(1:lenstr(msspath)) endif endif c c End ut loop: call hpdeallc(pfields,ier,1) 100 continue stop 'done' end