[Thread Prev][Thread Next][Index]

Re: [ferret_users] appending ensemble slabs

Hi Ryo,

 Why don't you load the files in as an ensemble directly rather than individually? There's no real need to merge the files but the following should work.

let tmp=i[i=1:2]
save/file=tmp1.nc/clob tmp
save/file=tmp2.nc/clob tmp

can var/all

! load all ensemble members at once

let myfiles = spawn("ls -1 tmp?.nc")
ensemble tmp_all = myfiles

save/mlimits=1:2/clob/file=tmp_ensemble.nc/m=1 tmp
! This works for me. All members are defined.
save/app/file=tmp_ensemble.nc/m=2 tmp

can data/all

use tmp_ensemble.nc
list tmp

             VARIABLE : I[I=1:2]
             FILENAME : tmp_ensemble.nc
             SUBSET   : 2 by 2 points (X-E (realization))
             1      2   
             1      2
 1   / 1:  1.000  2.000
 2   / 2:  1.000  2.000


On 29/04/18 00:01, Ryo Furue wrote:
Ferret users,

I'm trying to append "ensemble slabs" to a netCDF, using the ideas from

So far, I've failed to append data in the ensemble-axis direction.  See an example below.  The first ensemble member is written to the file but the second member remains undefined.

I have a set of vertical profiles of temperature in separate files and I'd like to treat them as an ensemble so that it's easy to take an average temp[m=1:20@AVE], for example.

FERRET v7.3 (optimized)
Linux 2.6.32-696.13.2.el6.x86_64 64-bit - 12/04/17
set data levitus_climatology
save/clobber/file=tmp0.nc temp[x=180:180@MAX,y=0:0@MAX]
save/clobber/file=tmp1.nc temp[x=180:180@MAX,y=1:1@MAX]
save/clobber/file=tmp2.nc temp[x=180:180@MAX,y=2:2@MAX]
save/clobber/file=tmp3.nc temp[x=180:180@MAX,y=3:3@MAX]
save/clobber/file=tmp4.nc temp[x=180:180@MAX,y=4:4@MAX]
cancel data/all

define symbol outfile tmp.nc
define symbol emax 5

let evals = esequence({1,2,3,4,5})

set data tmp0.nc
let etemp = temp + 0*evals
save/clobber/file=($outfile)/mlimits=1:($emax)/m=1 etemp
cancel data tmp0.nc

set data tmp1.nc
let etemp = temp + 0*evals
save/append/file=($outfile)/m=2 etemp
cancel data tmp1.nc

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement