Project

General

Profile

CESM hybrid sigma pressure coordinate levels broken in 1.9.x

Added by David Reusch almost 6 years ago

I am seeing the same problems with hybrid sigma pressure coordinate levels in CDO versions later than 1.7.2 that were reported in "Treatment of hybrid levels from CESM" https://code.mpimet.mpg.de/boards/1/topics/4731 in March 2017. Apologies for opening a new message thread but I wanted to focus just on the specific problem with variables not being included in the output file.

In short, any operation (e.g., cdo selyear) will produce a file that has metadata referring to ap, b, ap_bnds and b_bnds but without including these variables in the output file. Obviously this breaks subsequent file processing that needs them.

More specifically, variable lev has formula_terms = "a: hyam b: hybm p0: P0 ps: PS" in the input and formula_terms = "ap: ap b: b ps: ps" in the output. Unfortunately, ap and b are not in the output file. A similar situation exists for variable lev_bnds and ap_bnds, b_bnds.

(I'm also noticing that ilev and ilev-bnds are not present in the output but these would only be necessary if a variable using ilev was present and none are once hyai, hybi are dropped).

It's unfortunate that the names are changing (perhaps because the formula has changed? I'm no expert when it comes to how hybrid sigma pressure coordinates are implemented...) but I'd already adapted my code for that. Omitting key variables from the output file is a lot harder to handle.

Note that I haven't tried figuring out how to fix the broken output dataset because (a) it used to work and should work now and (b) I still have access to 1.7.2 so I can still do the processing I needed to do.

I have attached (single timestep) input and output files created with 1.7.2 (works), 1.9.3 and 1.9.4 (neither work).

Thanks for your attention to this issue and please let me know if I missed something/can provide more info.


Replies (2)

RE: CESM hybrid sigma pressure coordinate levels broken in 1.9.x - Added by Uwe Schulzweida over 5 years ago

You have to add the bounds attribute to the variable lev:

ncatted -a bounds,lev,c,c,"ilev" input_file.nc

RE: CESM hybrid sigma pressure coordinate levels broken in 1.9.x - Added by David Reusch over 5 years ago

Thanks for the workaround fix, it does indeed produce the desired results. I can't say I would have come up with this on my own (or definitely not very quickly!) so it is greatly appreciated. I will be sure to add it to my workflow for this dataset since I can't fix the original files myself.

However, I am still very curious why 1.7.2 worked without the "bounds" attribute and what has changed in a subsequent release to make this a required field? This wouldn't be the first time that GCM datasets were released to the public with errors (minor to major) but I find it unfortunate that this particular dataset broke with respect to CDO between CDO releases.

Thanks!

    (1-2/2)