[Thread Prev][Thread Next][Index]
Re: multi-netcdf files for ensemble simulations
Hi Ansley,
Yes, this was the easiest solution, thanks a lot for your help!
Cheers,
Sonia
PS: Thanks as well to Rob Scott for his suggestion (I was not able to make it
work but this would probably have beeen a solution as well).
> Hi Sonia,
> I am going to quote your script here -- your attachment doesn't show
> up in the email archives.
> --------------------------
> def axis/x=1:360:1 xaxis
> def axis/y=-90:90:1 yaxis
> def axis/z=1:2:1/DEPTH zaxis
> def grid/x=xaxis/y=yaxis/z=zaxis glace_grid
>
> use "DL_HAD3_ok/HadAM3_ENSR_SIM01_SoilWet.nc"
> def axis/z=1:1:1 zaxis1
> def grid/like=glace_grid/z=zaxis1 glace_grid1
> let/title="soilwetHAD3" sw=soilwet[G=glace_grid1]
> save/file=testglace.nc/klimits=1:2/k=1 sw
> can data/all
>
> use "DL_HAD3_ok/HadAM3_ENSR_SIM02_SoilWet.nc"
> def axis/z=2:2:1 zaxis1
> def grid/like=glace_grid/z=zaxis1 glace_grid1
> let/title="soilwetHAD3" sw=soilwet[G=glace_grid1]
> save/append/file=testglace.nc/k=2 sw
> can data/all
> --------------------------
>
> In Example 4 of Chap. 10 Sec. 2, you'll notice that the first SAVE
> command, which writes the NetCDF file header, writes variables that are
> defined using the "zaxis" Z axis, which has all the desired output levels.
> This way the file is set with the right number of levels. So you want to
> put
> your variable sw on the first level of axis "zaxis" when you first
> write it out.
>
> The example in the Users Guide is also a bit different from what
> you'redoing,
> in that it's reading ascii files with the FILE command. That is why the axes
> zaxis1, zaxis2, are used. You do not need those. Do your input files
> have Z axes? If not, then you will need to force them onto a Z axis, by
> adding
> to it a variable whose values are zero, at the correct depth, i.e.
> let sw=soilwet + 0*z[gz=zgrid1,k=1].
>
> Your script would then be something like this:
>
> def axis/z=1:2:1/DEPTH zaxis
>
> use "DL_HAD3_ok/HadAM3_ENSR_SIM01_SoilWet.nc"
> let/title="soilwetHAD3" sw=soilwet + 0*z[gz=zaxis,z=1]
> save/file=testglace.nc/klimits=1:2/k=1 sw
> can data/all
>
> use "DL_HAD3_ok/HadAM3_ENSR_SIM02_SoilWet.nc"
> let/title="soilwetHAD3" sw=soilwet + 0*z[gz=zaxis,z=2]
> save/append/file=testglace.nc/k=2 sw
> can data/all
>
>
> Sonia Seneviratne wrote:
>
> >Dear Ferreters,
> >
> >Hopefully someone already found a solution to the following problem:
> >
> >I have a series of NetCDF files entailing output from GCM ensemble
simulations.
> >In order to analyse the data, it would help me to be able to concatenate the
> >NetCDF files on one axis, with each axis "level" corresponding to one member
of
> >the ensemble (I thought of using the Z axis for this as I only have surface
> >fields).
> >
> >I did a few tests following the instructions from Chap. 10 Sec. 2, however,
the
> >output file does never entail more than one z-level (see attachment). Did
anyone
> >have this problem before and manage to find a solution?
> >
> >Thank you very much!
> >Sonia
> >
> >---------------------------------------------------------------------
> >Sonia Seneviratne (Dr. Sc.)
> >NASA Goddard Space Flight Center, Code 900.3, Bldg. 33, Rm A105
> >Greenbelt Road, Greenbelt, MD 20771, USA
> >Phone: +1 301 614 5930; Fax: +1 301 614 6297
> >senevira@janus.gsfc.nasa.gov
> >---------------------------------------------------------------------
> >
> >
> >
>
>
> --
> This message has been scanned for viruses and dangerous
> content by MailScanner, and is believed to be clean.
>
>
--
This message has been scanned for viruses and dangerous
content by MailScanner, and is believed to be clean.
[Thread Prev][Thread Next][Index]
Dept of Commerce /
NOAA /
OAR /
PMEL /
TMAP
Contact Us | Privacy Policy | Disclaimer | Accessibility Statement