[Thread Prev][Thread Next][Index]

Re: Muti-cdf files



Hi Xin,
	There is a related question in the Mail Archives under the Ferret
documentation page
http://ferret.wrc.noaa.gov/Ferret/Mail_Archives/ferret_mail_archives.html

Look at
http://ferret.wrc.noaa.gov/Ferret/Mail_Archives/fu_2001/msg00672.html
and the responses to it.  In particular note that the more complete
flexibility of the MC descriptor only comes with the more recent
versions, and the warning that the user must take care that what (s)he
builds into the MC descriptor file makes sense.
----------------------------------------------------------------------
Here is a demo that may be close to the situation you face.  I've run
it on 5.33 and all goes well with the exception of one warning message
that I can't seem to eliminate but seems to have no effect.

Step 1 : Create a descriptor file dec_cent.nc that will combines two
         netCDF files decade.nc (10 years of annual "sst" data 1765-1774)
         and century.nc (the following 100 years of annual data) into a
         single series of 110 points.
Things to note: 1) I've used D_TIME_UNIT = 31557600.0 to indicate years
of length 365.25 days, 2) the S_START/S_END values are in years and are
at my discretion - although it would match the contents of the files
to use 1765,1774 and 1775,1874 I CAN CHOOSE TO OVERRIDE these times and
make the data appear to span the period 1900-2009 as follows

**********************************************************************
* test of mc descriptor to combine decade & century of annual data   *
**********************************************************************
 $FORMAT_RECORD
      D_TYPE               = '  MC',
      D_FORMAT             = '  1A',
      D_SOURCE_CLASS       = 'MODEL OUTPUT',
 $END
 $BACKGROUND_RECORD
      D_EXPNUM             = '0001',
      D_MODNUM             = '  AA',
      D_TITLE              = 'test data written by ferret',
      D_TIME_UNIT          = 31557600.0,
      D_TIME_MODULO        = .FALSE.,
      D_ADD_PARM           = 15*' ',
 $END
 $MESSAGE_RECORD
      D_MESSAGE            = ' ',
      D_ALERT_ON_OPEN      = F,
      D_ALERT_ON_OUTPUT    = F,
 $END
*************************************************
 $EXTRA_RECORD
 $END
 $STEPFILE_RECORD
      s_filename           = 'decade.nc',
      S_AUX_SET_NUM        = 0,
      S_START              = 1900,
      S_END                = 1909,
      S_DELTA              = 1.0,
      S_NUM_OF_FILES       = 1,
      S_REGVARFLAG         = ' ',
 $END
**************************************************
 $EXTRA_RECORD
 $END
 $STEPFILE_RECORD
   S_FILENAME           = 'century.nc',
   S_AUX_SET_NUM        = 0,
   S_START              = 1910,
   S_END                = 2009,
   S_DELTA              = 1.0,
   S_NUM_OF_FILES       = 1,
   S_REGVARFLAG         = ' ',
 $END
**************************************************
 $STEPFILE_RECORD
      s_filename           = '**END OF STEPFILES**'
 $END
**************************************************

Step 2 : Create the two data files decade.nc and century.nc
         and test their content. Then access them using the

! the following axis definitions should each be on a single line
def axis/t="1-jul-1765:12:00":"1-jul-1774:12:00"/units=days
        /t0="1-jan-1750:00:00"/npoints=10 tax1
def axis/t="1-jul-1775:12:00":"1-jul-1874:12:00"/units=days
        /t0="1-jan-1750:00:00"/npoints=100 tax2
let v1=mod(l[gt=tax1],5)/5 ; let v2=mod(l[gt=tax2],20)/20
! see what the "data" look like
set view upper ; plot v1,v2
message
!
! then write them to netcdf files
!
def var/title="SST" sst=v1 ; save/file=decade.nc/clobber sst
def var/title="SST" sst=v2 ; save/file=century.nc/clobber sst
!
! now reread the data files and overplot as a check
!
can var sst ! to get rid of the algebraically defined function
use decade.nc ; use century.nc
plot/over sst[d=1],sst[d=2]
message
!
! delete the netCDF files then access them via dec_cent.des
!
can data/all
set data dec_cent.des
sho grid/all sst ; set view lower ; plot sst


|--****--****-*---*---***--***--|____spillane@pmel.noaa.gov____|
|-*__---*-----*--*-*--*--*-*--*-|_SCIENCE APPLICATIONS SUPPORT_|
|--***--*-----*-*---*-***--***--|____EPIC/Ferret/PlotPlus______|
|-----*-*-----*-*****-*----*----|__Room 2070 Bldg#3 NOAA/PMEL__|
|-****---****-*-*---*-*----*----|____Phone_:_(206)526-6780_____|




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement