Project

General

Profile

increasing grids in netcdf file

Added by saurabh singh almost 8 years ago

Hi

I have a reanalysis data subset file with a variable uwnd. I need to find its correlation with TRMM precipitation. Hower Trmm is spaced 0.25 degree lat/long rectilinearly while reananlysis 2 data is 2.5 lat/long( i guess gaussian grid). I need to bring increase the grids of the sU10 data to match with the trmm grids in order to do spatial correlation. I don't want to change the grid values, but just want to add more grids. I tried various methods in ncl BUT FAILED. iS THERE ANY WAY TO ACHIEVE THIS IN CDO?

sU10.nc (1.56 MB) sU10.nc reannalysis -2 subset file
t1.nc (30.5 MB) t1.nc trmm subset file

Replies (7)

RE: increasing grids in netcdf file - Added by Uwe Schulzweida almost 8 years ago

Try the CDO operator remapnn for this talk:

cdo remapnn,t1.nc sU10.nc sU10_on_t1_grid.nc

RE: increasing grids in netcdf file - Added by saurabh singh almost 8 years ago

this doea the conversion . But there is something very strange i observed :

when i use cdo to read information regarding the transformed variable i get good results that is mean meadin,max,min

cdo info sfix.nc
-1 : Date Time Level Gridsize Miss : Minimum Mean Maximum : Parameter ID
1 : 2000-01-01 00:00:00 10 7200 0 : -8.2600 -0.10724 5.9000 : -1

however when i use ncl to extract grid information i get value in 2000. i dont have clue what went wrong, apparently it seems like that values are not correctly represented at grids

(0,0,0,0) -21035
(0,0,0,1) -21035
(0,0,0,2) -21035
(0,0,0,3) -21035
(0,0,0,4) -21035
(0,0,0,5) -21035
(0,0,0,6) -20992

RE: increasing grids in netcdf file - Added by saurabh singh almost 8 years ago

is there any way to solve the problem, i am still struggling with it.

RE: increasing grids in netcdf file - Added by Ralf Mueller almost 8 years ago

without the file, it's hard to guess

RE: increasing grids in netcdf file - Added by saurabh singh almost 8 years ago

hi @Ralf Thehos Mueller please fingf the files in attachment

sU10.nc (1.56 MB) sU10.nc reananlyis un-gridded file
t1.nc (30.5 MB) t1.nc trmm filee used to regrid reananlysis file
sU10_on_t1_grid.nc (39.6 MB) sU10_on_t1_grid.nc regridded file

RE: increasing grids in netcdf file - Added by Ralf Mueller almost 8 years ago

your input is a short variable, i.e. 16bit integer. CDO used double internally, thats why the info operator shows reasonable results.

with ncl, you get the plain integer values. Use the copy operator together with the -b option, e.g.

 cdo -b F32 copy <in> <out>
I uploaded my result file.

btw: ncview can handle it

RE: increasing grids in netcdf file - Added by saurabh singh almost 8 years ago

Thanks a lot, this explains it all , also i came across this solution, when i type printVarSummary i got the following in NCL

scale_factor : 0.01
add_offset : 207.65
units : m/s
actual_range : ( -32.79, 37.59 )
unpacked_valid_range : ( -120, 120 )
valid_range : ( -32765, -8765 )

which explains :

here are “scale_factor", and "add_offset”. Once you apply those to your numbers, you are fine. Some software packages apply these automatically once you open the variable, and sometimes (particularly when looking into the file) you still need to apply them.

However i liked your solution more, thanks a lot Ralf. :) :)

    (1-7/7)