Project

General

Profile

cmip5 ocean bottom temperature

Added by Brendan DeTracey over 9 years ago

Is there a "smart" way to extract ocean bottom temperatures from cmip5 climate models? The only way I can think of is using intlevelx3d and a very large ocean depth(but this would only work if intlevelx3d extrapolates using nearest neighbour, which I do not know). Any other suggestions? Thanks.


Replies (6)

RE: cmip5 ocean bottom temperature - Added by Brendan DeTracey over 9 years ago

Okay, I generated a 3d depth field for the source data and a 3d depth field for the target i.e. bottom depth. The following gives me a segfault:
cdo intlevel3d,CanESM2_depth3D.nc thetao_Omon_CanESM2_historical_r1i1p1_198101.nc CanESM2_depth3D_target.nc test.nc

Any ideas why it is not working?

RE: cmip5 ocean bottom temperature - Added by Brendan DeTracey over 9 years ago

Tried again with a more recent version (1.6.2 on Ubuntu, previously was 1.5.6 on Cygwin at work) and got:
cdo intlevel3d (Abort): Output vertical coordinate variables are not allowd to contian missing values.

So I filled them in for a test:
cdo fillmiss CanESM2_depth3D_target.nc CanESM2_depth3D_target_filled.nc

And then:
do intlevel3d,CanESM2_depth3D.nc thetao_Omon_CanESM2_historical_r1i1p1_198101.nc CanESM2_depth3D_target_filled.nc test.nc

Error (vlistDefVarLongname) : varID 31 undefined!

Could really use some guidance with that last cryptic message. Have attached filled depth file.

RE: cmip5 ocean bottom temperature - Added by Brendan DeTracey over 9 years ago

Last attempt. I realized my target depths were missing a vertical dimension, so I created a new target depth file:
@$ cdo -v intlevel3d,CanESM2_depth3D.nc thetao_Omon_CanESM2_historical_r1i1p1_198101.nc CanESM2_depth3D_target_filled_new.nc test.nc
OpenMP: num_procs = 4 max_threads = 1
Warning (cdfScanVarAttributes) : NetCDF: Variable not found - lev_bnds
Warning (cdfScanVarAttributes) : NetCDF: Variable not found - lat_bnds
Warning (cdfScanVarAttributes) : NetCDF: Variable not found - lon_bnds
Warning (cdfScanVarAttributes) : NetCDF: Variable not found - areacello
Warning (cdfScanVarAttributes) : NetCDF: Variable not found - lat_bnds
Warning (cdfScanVarAttributes) : NetCDF: Variable not found - lon_bnds
cdo intlevel3d: 40 records input 3d vertical height

cdo intlevel3d: 1 records target 3d vertical height and gridsize 49152

cdo intlevel3d: Input vertical coordinate has no missing values.
cdo intlevel3d: Output vertical coordinate has no missing values.
ERROR, reshGetElem, resource_handle.c, line 421, called from gridInqSize
errorString: "Error while trying to resolve the ID "gridID" in `gridInqSize()`: list element not found. The failed ID is 0"@

This is my dead end.

RE: cmip5 ocean bottom temperature - Added by Uwe Schulzweida over 9 years ago

This is definitely a bug in the CDO operator intlevel3d. I have fixed this problem in the CDO release 1.6.7.
Thanks for this report!
Cheers,
Uwe

RE: cmip5 ocean bottom temperature - Added by Ralf Mueller over 9 years ago

You could try numpy's MaskedArrays: http://docs.scipy.org/doc/numpy/reference/routines.ma.html

from cdo import *
cdo = Cdo()
th = cdo.readArray('thetao_Omon_CanESM2_historical_r1i1p1_198101.nc','thetao')

RE: cmip5 ocean bottom temperature - Added by Brendan DeTracey over 9 years ago

I could, if I knew python... my python knowledge is a very slow WIP.
Originally I thought of using Matlab and pulling the maximum non-missing depth index from the data, but I wanted to use cdo as much as possible to reduce the data to manageable sizes.
I might have to do this as I keep finding bugs in intlevel3d.

    (1-6/6)