Project

General

Profile

Undefined grid handling

Added by Anne Moree over 4 years ago

Hi,
I have a file (sss.nc) with the following info:

dimensions:
x = 180 ;
y = 193 ;
time = 12 ;
variables:
double sss(time, y, x) ;
sss:missing_value = -99. ;
sss:units = "psu" ;
sss:long_name = "Sea surface salinity" ;

I want to add a field from another file (the sos variable from attached sos.nc) to this sss field. This file has the following info:
dimensions:

time = UNLIMITED ; // (12 currently)
lon = 360 ;
lat = 180 ;
variables:
double time(time) ;
time:standard_name = "time" ;
time:long_name = "time" ;
time:units = "months since 1-1-16 12:00:00" ;
time:calendar = "365_day" ;
time:axis = "T" ;
float lon(lon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:axis = "X" ;
float lat(lat) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:axis = "Y" ;
float sos(time, lat, lon) ;
sos:standard_name = "sea_water_salinity" ;
sos:units = "psu" ;
sos:_FillValue = 1.e+20f ;
sos:missing_value = 1.e+20f ;
sos:original_name = "so" ;

I see that some regridding is needed in order to add sos to sss. However, I do not have the target grid of the sss file. Therefore I do the following:
cdo setgrid,r180x193 sss_file_in.nc sss_file_out.nc # because this seems to be the grid, but I could be wrong
cdo remapbil,r180x193 sos_file_in.nc sos_file_out.nc

Now they should have the same grid characteristics, and I add the sos variable to the file with the sss variable (ncks -A -v sos sos_file_out.nc sss_file_out.nc). This is where I see the sss variable grid is shifted. I tried playing around with cdo shiftx and cdo sellonlatbox but to no good result.

Any ideas on how to handle this sss.nc file?

Thank you in advance,
Anne

sos.nc (2.97 MB) sos.nc the file with sos variable
sss.nc (3.18 MB) sss.nc the file with sss variable

Replies (1)

RE: Undefined grid handling - Added by Anne Moree over 4 years ago

Hi again,

I spend some more time on this and figured out that the sss file is not on a regular r180x193 grid. It is on a specific model grid, which I could use to remap the sos
field. One question remains, would there be a way to figure out the grid of the sss file if I did not know it belonged to a certain model?

Cheers,
Anne

    (1-1/1)