[Thread Prev][Thread Next][Index]

Re: [ferret_users] Appending output data to a netCDF file in i-dimension



Dear Peng,

the problem to combine segments of a larger dataset is common for the output of parallel models.

MOM comes with a tool mppncombine. To use this tool, the partial files must be equipped with some information on the full size of the domain. Unfortunately, these attribute lines could not be written directly from ferret.

There is also a tool ncmerge

https://sourceforge.net/p/getm-utils/wiki/ncmerge/

May be, you produce slices, apply the operations on the time axis and "merge" the results?

All the best,
Martin

Am 05.02.2020 um 21:46 schrieb Ge Peng - NOAA Affiliate:

I need to compute daily climate normals (30-yrs averages) from a daily dataset  (variable: var_dta), with dimensions of I:1385; J:596; L:10957.

 

As the machine memory is not large enough for me to compute the normals for the entire field, I had to do so at each data point along the i-dimension (1:1385) and output the results to an intermediate nc file, using the code below. (Potentially, I may have to do so at each of xy data points. Printing out values at each of all xy data points to an ascii file takes too long!)

 

Unfortunately, I am getting an error message (see below) and would appreciate any help you may provide. 


If you have a better way for computing daily climate normals with a large dataset, I'd appreciate it if you could share your method with me.

 

Thanks,

 

--- Peng

 

------

! - Define a daily modulo time axis

def axis/t=0:365.2425/edges/npoints=365/t0=1-JAN-0001/units=days/modulo tdaily

 

! – Compute daily normals along i-dimension

     sp rm -f v_ij.nc

     repeat/range=1:`idm`/name=ii (;\

     let v_ij=var_dta[i=`ii`] ;\

     let v_norm=v_ij[GT=tdaily@mod] ;\

     let v_std=(v_ij[GT=tdaily@modvar])^0.5 ;\

     let v_min=v_ij[GT=tdaily@modmin] ;\

     let v_max=v_ij[GT=tdaily@modmax] ;\

     let v_npts=v_ij[GT=tdaily@modngd] ;\

     save/file=v_ij.nc/app v_norm,v_std,v_min,v_max,v_npts ;\

     can var v_* ;\

     )

 

**TMAP ERR: Requested data range is outside of data set limits

                        Expected: V_NORM[I=           2 :           2 ] Found: V_NORM[I=           1 :           1 ]

LIST/FORMAT=CDF/file=v_ij.nc/app v_norm,v_std,v_min,v_max,v_npts

 

The same error message if I use either one of the following two:

save/file=v_ij.nc/app/I=1 v_norm,v_std,v_min,v_max,v_npts ;\

save/file=v_ij.nc/app/I=`ii` v_norm,v_std,v_min,v_max,v_npts ;\

 

--

Ge Peng, PhD
Research Scholar
NOAA's Cooperative Institute for Satellite Earth System Studies (CISESS) at 

NOAA’s National Centers for Environmental Information (NCEI)

Center for Weather and Climate (CWC)

151 Patton Ave, Asheville, NC 28801 USA
+1 828 257 3009; ge.peng@xxxxxxxx

ORCID: http://orcid.org/0000-0002-1986-9115

Following CICS-NC on Facebook






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

Privacy Policy | Disclaimer | Accessibility Statement