Project

General

Profile

cdo remapbil - operation not allowed in define mode

Added by Fernanda Matos 5 months ago

Hi all!

I am trying to remap the PRISM4 land-sea mask for the mid-Pliocene to the same grid as the ecmwf land-sea mask following the steps of a colleague that has done this operation for the TL159 IFS grid (linear). In my case, I am working with Tco95 (cubic-octahedral).

He has done this operation with:

1. select the modern land-sea mask from the initial file of IFS

cdo selcode,172 ICMGGECE3INIT pdtmp.grb 

2. interpolate the modern land-sea mask into the unstructured n80 grid with 35718 cells.
cdo -f nc -t ecmwf setgrid,g35718x1 pdtmp.grb lsm_gg.nc 

3. remap the PRISM4D mid-pliocene land-sea mask to t106 grid

cdo remapbil,t106grid Plio_enh_LSM_v1.0.nc LSM.nc 

4.remap the mid-pliocene land-sea mask into the unstructured n80 grid with 35718 cells.
cdo remapbil,./gdes_n80_reduced LSM.nc lsmlgm_gg.nc 

I need to remap the mid-pliocene land-sea mask to the n96 grid with 40320 cells.

Doing steps 1 and 2 exactly like before but changing 35718x1 to 40320x1 worked:

cdo selcode,172 ICMGGECE3INIT pdtmp.grb 
cdo -f nc -t ecmwf setgrid,g40320x1 pdtmp.grb lsm_gg.nc 

However, when doing steps 3 and 4:

cdo remapbil,t106grid Plio_enh_LSM_v1.0.nc LSM.nc
cdo remapbil,./midpli2_griddes.txt LSM.nc lsmlgm_gg.nc

I get the following error:

cdi  cdf_put_var_int   : 131072 0 20

cdi  error (cdf_put_var_int): NetCDF: Operation not allowed in define mode

I tried to find ways to take Plio_enh_LSM_v1.0.nc out of this define mode, but I do not know exactly where to start. Could you please help me?

The files I am using are attached here. Thank you very much in advance!

midpli2_griddes.txt (4.98 KB) midpli2_griddes.txt grid description for n96
Plio_enh_LSM_v1.0.nc (256 KB) Plio_enh_LSM_v1.0.nc mid-pliocene land-sea mask
LSM.nc (208 KB) LSM.nc land-sea mask file created with step 3

Replies (2)

RE: cdo remapbil - operation not allowed in define mode - Added by Uwe Schulzweida 5 months ago

Hi Fernanda,

This is an error when writing the Gaussian reduced grid to NetCDF. We will fix this problem in the next CDO version 2.4.0. The last working version is 2.1.1.

Cheers,
Uwe

RE: cdo remapbil - operation not allowed in define mode - Added by Fernanda Matos 5 months ago

Hi Uwe,

thank you!! I will try to create an unstructured grid that contains 40320 cells. Do you know a good way to do it?

All the best,
Fernanda

    (1-2/2)