CFMIP / COSPv2.0

COSP - The CFMIP (Cloud Feedbacks Model Intercomparison Project) Observation Simulator Package
41 stars 38 forks source link

Calculation of cloudsat_preclvl_index fails when use_vgrid=.false. #68

Open alejandrobodas opened 2 years ago

alejandrobodas commented 2 years ago

The error is caused by the calculation of cospIN%fracPrecipIce at the end of the the CloudSat radar optics section in subsample_and_optics, between L870 and L887. If this diagnostic can only be calculated for the CloudSat grid, then this needs to be protected by an IF test. The error can be seen in this CI test.

alejandrobodas commented 2 years ago

This bug has uncovered a lack of robustness in the calculation of some CALIPSO diagnostics. Some diagnostics produce wrong results when requested on model levels. This could be because they shouldn't be calculated on model levels or because the calculations are have bugs. If the former we need some quality control that checks for consistency between the requested configuration and outputs. I haven't fixed this in this change, I've created a new test (Global UM with diagnostics on model levels) that doesn't request the problematic diagnostics: Lclzopaquecalipso=.false., Lclopaquemeanz=.false., Lclthinmeanz=.false., Lclopaquemeanzse=.false., Lclthinmeanzse=.false., Lclzopaquecalipsose=.false.,

alejandrobodas commented 2 years ago

As part of this change, I've made some minor changes to plot_test_outputs.py so that it doesn't fail when variables are not present in the output file.

dustinswales commented 2 years ago

@alejandrobodas Thanks for finding this bug and cleaning it up! We can leave this issue open, I will take a look at the calipso diagnostics on model/stat levels soon.

alejandrobodas commented 2 years ago

PR #69 only partially addresses the issues raised here, so I'm reopening this issue.