ESCOMP / CTSM

Community Terrestrial Systems Model (includes the Community Land Model of CESM)
http://www.cesm.ucar.edu/models/cesm2.0/land/
Other
305 stars 307 forks source link

oldfflag can NOT be used with subgridflag==1, and rename subgridflag #502

Closed ekluzek closed 5 years ago

ekluzek commented 6 years ago

Brief summary of bug

In looking at the code in a ctsm meeting we noticed that oldflag can NOT be used with subgridflag==1.

General bug information

CTSM version you are using: ctsm1.0.dev010

Does this bug cause significantly incorrect results in the model's science? Yes

Used together results wouldn't make sense.

Configurations affected: Clm45 case turning subgridflag=1 and oldfflag=1

Details of bug

This configuration will probably run, but give screwy results, because snow_depth will be set by frac_snow of the other method, and then frac_snow will be overwritten by the oldffflag method. We just decided this based on code inspection, without doing a simulation.

We also decided that oldfflag is a flag that should be used for the NWP case.

billsacks commented 6 years ago

@ekluzek I'm relabeling this as an enhancement because this is really just about adding an error-check on user inputs. My feeling is that "bug - impacts science" should really be restricted to areas where the model is giving scientifically incorrect answers for some relatively common configuration. That, in my mind, labels a serious scientific issue that needs to be addressed, and I feel we should try not to dilute that label too much.

billsacks commented 6 years ago

While doing this, we should rename subgridflag to use_subgrid_fluxes, as @swensosc suggested.

billsacks commented 6 years ago

@ekluzek you self-assigned this, but I'd be happy to take this on in the course of doing my CanopyHydrology cleanup. So I'll reassign it to myself.

billsacks commented 5 years ago

I noticed that none of the error checks in CLMBuildNamelist involving subgridflag were working as intended: subgridflag wasn't being added to the default namelist, so the error checks only kicked in if the user explicitly specified subgridflag in user_nl_clm. I have fixed that in d8d2a2d8 by calling add_default for use_subgrid_fluxes. However, it looks like the same problem (impotent error checks) might exist for other variables checked in setup_logic_hydrology_switches (I'm not fixing those for now).