Project

General

Profile

Question on using input data with attributes add_offset and scale_factor

Added by Susanne Brienen about 3 years ago

Hi.
Is INT2LM able to handle netcdf attributes “add_offset” and “scale_factor”? If yes, how?
I have input data which are packed like this for several variables. Using this, INT2LM crashes because the vcoord has negative values (when not taking into account the offset and scale factor).

vcoord = 32767, 27282, 22374, 17899, 13857, 10249, 7073, 4143, 1516, -953,
-3306, -5514, -7622, -9628, -11533, -13352, -15070, -16701, -18231,
-19689, -21046, -22331, -23529, -24640, -25680, -26632, -27513, -28307,
-29028, -29678, -30255, -30761, -31202, -31578, -31892, -32149, -32354,
-32510, -32626, -32709, _ ;

short vcoord(level1) ;
vcoord:long_name = "Height-based hybrid Gal-Chen coordinate" ;
vcoord:units = "Pa" ;
vcoord:ivctype = 2 ;
vcoord:irefatm = 2 ;
vcoord:p0sl = 100000. ;
vcoord:t0sl = 288.149993896484 ;
vcoord:dt0lp = 42. ;
vcoord:vcflat = 11430. ;
vcoord:delta_t = 75. ;
vcoord:h_scal = 10000. ;
vcoord:add_offset = 11350.f ;
vcoord:scale_factor = 0.3463851f ;
vcoord:packed = "yes" ;

Surely, I could transform the data before using INT2LM, but if there is a possiblity for using INT2LM directly, it would be better (vcoord is not the only variable affected)

Thanks, Susanne


Replies (2)

RE: Question on using input data with attributes add_offset and scale_factor - Added by Burkhardt Rockel about 3 years ago

No, reading packed variables in INT2LM is not possible, only internally compressed variables.
You mention that you have other variables that are also affected. Hopefully no 3D variables, because in packing and unpacking these you may loose quite some accuracy.

RE: Question on using input data with attributes add_offset and scale_factor - Added by Susanne Brienen about 3 years ago

Unfortunately yes, also 3D variables

Does anybody have experience with this?

The input data I want to use are the 0.11° EURO-CORDEX COSMO-CLM simulations driven by HadGEM2 (performed at ETH).

    (1-2/2)