Here is a real world example. The approach below creates a string
which is then passed to the system command. The extra step [explicit
creation of the command string as a separate variable]
is not needed. However, the user wanted to print out the
various commands she was using.
user is $USER
She also used unix wild cards
--- begin nyrstart=400 nyrend =799 mssi= "/CCSM/csm/b20.007/ocn/hist/" ;move to directory fili= "b20.007.pop.h.0" ; first part of file name diri= "/ptmp/user/" ;where to put data diro= "/ptmp/user/" ;where to put data filo= "b20.TEMP." ;rename output files do nyear=nyrstart,nyrend ; acquire files msscmd= "msrcp -n 'mss:" + mssi + fili + nyear + "-[0-1][0-9].nc' "+ diri+"." print (" msscmd= "+ msscmd) system (msscmd) ; use netCDF operator to strip desired ; variable(s) and concatenate ncocmd= "ncrcat -v TEMP " + diri + fili + "*.nc "+diro+filo+nyear+".nc" print ("ncocmd = "+ncocmd) system (ncocmd) ; remove the current years files rmcmd = "'rm' "+diri+fili+nyear+"*.nc" print ("rmcmd ="+ rmcmd) system (rmcmd) end doend ===================== The commands look like:
msscmd= msrcp -n 'mss:/CCSM/csm/b20.007/ocn/hist/b20.007.pop.h.0400-[0-1][0-9].nc' /ptmp/user/.
ncocmd = ncrcat -v TEMP /ptmp/user/b20.007.pop.h.0*.nc /ptmp/user/b20.TEMP.400.nc
rmcmd ='rm' /ptmp/sterling/b20.007.pop.h.0400*.nc
msscmd= msrcp -n 'mss:/CCSM/csm/b20.007/ocn/hist/b20.007.pop.h.0401-[0-1][0-9].nc' /ptmp/user/.
ncocmd = ncrcat -v TEMP /ptmp/sterling/b20.007.pop.h.0*.nc /ptmp/sterling/b20.TEMP.401.nc
rmcmd ='rm' /ptmp/sterling/b20.007.pop.h.0401*.nc
etc. ===================== Note: on the msrcp command above the -n option is present. This means to *not* acquire from the MSS if it already exists. ====================== system("msrcp -n 'mss:/LIXIN/FOAM/npforce0/atmos/mss_file_name.nc' /ptmp/LIXIN/.") ====================== You can also use "msread" system ("msread local_file_name /LIXIN/FOAM/npforce0/atmos/mss_file_name")
Dennis Shea
> >Feng, >you can not access the ncar mass store as if it were a directory. You must >first retreive the data to a local disk. > >you can excute the mass store read from the system prior to running ncl, >or you can use the system command in ncl to execute it within the >script: > >system("msread mscommands....") >etc > >sm > > > >On Wed, 21 Jan 2004, Feng He wrote: > >> I don't know how to input data from mss (mass store system) when I use ncl. >> >> I try to do it in this way: diri = "mss:/LIXIN/FOAM/npforce0/atmos/" >> , but I failed. >> > >-- > > >****************************************************** >Sylvia Murphy EML: murphys AT ucar.edu >NCAR CGD/CSEG PHN: 303-497-1720 >1850 Table Mesa Drive FAX: 303-497-1333 >Boulder CO 80305 > > >WEB: http://www.cgd.ucar.edu/csm/support/ > http://www.cgd.ucar.edu/csm/support/CSM_Graphics/ >****************************************************** > > > >_______________________________________________ >ncl-talk mailing list >ncl-talk AT ucar.edu >http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________ ncl-talk mailing list ncl-talk AT ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Wed Jan 21 2004 - 12:07:30 MST