Project

General

Profile

Help subtracting two files, How to match grids

Added by Syed Ali almost 12 years ago

Dear All

I want to subtract two files in Grads, one is CRU 0.5deg and the other is a model's output at 0.5deg, simple subtraction gives error of Grid mismatching, I have also tried a Grads interpolation fuction lterp but it also didnt work. Please help me to regrid one or both at same grids.Below is the info of the two files.

[pmdtest@pmd CRU]$ cdo sinfov GLOBAL_CRU_CTL_CRU-TS31_MM_0.5deg_1971-2000_pr.nc
File format: netCDF
-1 : Institut Source Name Time Typ Grid Size Num Levels Num
1 : unknown unknown pr var F32 259200 1 1 1
Horizontal grids :
1 : lonlat > size : dim = 259200 nlon = 720 nlat = 360
lon : first = -179.75 last = 179.75 inc = 0.5 degrees_east circular
lat : first = -89.75 last = 89.75 inc = 0.5 degrees_north

[pmdtest@pmd analysis]$ cdo sinfov RAD_mon_pressure_1971-2000_ERA40_lonlat.nc
File format: netCDF
-1 : Institut Source Name Time Typ Grid Size Num Levels Num
1 : unknown unknown cld var F32 13013 1 11 1
2 : unknown unknown clrls var F32 13013 1 1 2
3 : unknown unknown clrlt var F32 13013 1 1 2
4 : unknown unknown clrss var F32 13013 1 1 2
5 : unknown unknown clrst var F32 13013 1 1 2
6 : unknown unknown clwp var F32 13013 1 11 1
7 : unknown unknown firtp var F32 13013 1 1 2
8 : unknown unknown frla var F32 13013 1 1 2
9 : unknown unknown frsa var F32 13013 1 1 2
10 : unknown unknown mask con F32 13013 1 1 2
11 : unknown unknown ps var F32 13013 1 1 2
12 : unknown unknown qrl var F32 13013 1 11 1
13 : unknown unknown qrs var F32 13013 1 11 1
14 : unknown unknown sabtp var F32 13013 1 1 2
15 : unknown unknown solin var F32 13013 1 1 2
16 : unknown unknown topo con F32 13013 1 1 2
Horizontal grids :
1 : lonlat > size : dim = 13013 nlon = 143 nlat = 91
lon : first = 42.6710281 last = 113.671028 inc = 0.5 degrees_east
lat : first = -0.591595769 last = 44.4084042 inc = 0.5 degrees_north


Replies (3)

RE: Help subtracting two files, How to match grids - Added by Augusto Sanabria almost 12 years ago

Hi Syed,

Looks like you need to change your files to a common resolution.
Have a look at entry "changing grid resolution" from 2012-06-01.
You will find there an explanation of the way to change resolution of a netCDF grid.

Cheers,

Augusto

RE: Help subtracting two files, How to match grids - Added by Jaison-Thomas Ambadan almost 12 years ago

Hi,

try,

cdo -remapbil,RAD_mon_pressure_1971-2000_ERA40_lonlat.nc GLOBAL_CRU_CTL_CRU-TS31_MM_0.5deg_1971-2000_pr.nc remaped_file.nc

This will change your global data to the same resolution as the "RAD_mon_pressure_1971-2000_ERA40_lonlat.nc"

More info regarding the interpolation routines can be found here: https://code.zmaw.de/embedded/cdo/1.5.5/cdo.html#x1-4930002.12

Cheers,
J.

RE: Help subtracting two files, How to match grids - Added by SANJUKTA RANI PADHI almost 6 years ago

Hi all,
I have two having different grid size. When i used cdo sub infile1.nc infile2.nc outfile.nc . It show cdo sub (Abort): Grid size of the input parameters do not match!.

dell@dell-Inspiron-15-3567:~/work/rf/composite/drought$ cdo sinfo drgt.djf.mean.nc
File format : netCDF
-1 : Institut Source Ttype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown instant 1 1 65160 1 F64 : -1
Grid coordinates :
1 : lonlat : points=65160 (362x180)
lon : -0.5 to 360.5 by 1 degrees_east
lat : -89.5 to 89.5 by 1 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 1 step
RefTime = 1979-12-01 00:00:00 Units = minutes Calendar = standard Bounds = true
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
1983-01-01 00:00:00
cdo sinfo: Processed 1 variable over 1 timestep ( 0.00s )
dell@dell-Inspiron-15-3567:~/work/rf/composite/drought$ cdo sinfo precip.djf.mean.nc
File format : netCDF4
-1 : Institut Source Ttype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown instant 1 1 64800 1 F32 : -1
Grid coordinates :
1 : lonlat : points=64800 (360x180)
lon : 0.5 to 359.5 by 1 degrees_east circular
lat : 89.5 to -89.5 by -1 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 1 step
RefTime = 1800-01-01 00:00:00 Units = days Calendar = standard Bounds = true
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
1957-07-02 12:00:00
cdo sinfo: Processed 1 variable over 1 timestep ( 0.00s )
dell@dell-Inspiron-15-3567:~/work/rf/composite/drought$ cdo sub drgt.djf.mean.nc precip.djf.mean.nc precip.djf.anom.nc

cdo sub (Abort): Grid size of the input parameters do not match!

Please help me in this topic. And also I am attaching the info of two files. Please find the attachment. Kindly help me. I am running out of time for submitting my reports.

Thank You

1.png (203 KB) 1.png
    (1-3/3)