ESCOMP / CTSM

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

Plan to phase out LND_SETS_DUST_EMIS_DRV_FLDS #2713

Open ekluzek opened 1 month ago

ekluzek commented 1 month ago

LND_SETS_DUST_EMIS_DRV_FLDS was added to ctsm5.2.019 as a way to bridge between how dust emissions are currently handled between CAM and CTSM to a future way we want to handle it. Right now we want CAM to be able to act in a backwards compatible way and have control, until we can move the control all the way over to CTSM. Longer term CTSM should have control and CAM listens to it (with the ability for CAM users to change it if they need to).

The way it's working now in #2699 is that for CTSM standalone LND_SETS_DUST_EMIS_DRV_FLDS is set to TRUE and controlled by CTSM. When coupled to CAM (as in https://github.com/ESCOMP/CAM/pull/1104). It's set to FALSE and CAM controls it. However, when CAM is controlling it the CTSM namelist still needs to know what it's set to so that the Prigent streams can be appropriately set (#2687). Which means CTSM needs to read in the drv_flds_in settings (at least for dust_emis_method and zender_soil_erod_source) from the CAM namelist. This CAN be done -- but it relies on the fact that the CAM namelist is set first, and it relies on assuming the CAM namelist is going to be accessible from $CASEDIR/Buildconf/camconf/drv_flds_in. If any of this changes because of an update to CAM -- it'll break. Since, this has been stable over the last decade or so -- this might be acceptable though. But, in order to remove this dependence I think it would be good to phase this feature out.

There's a couple different paths that could be done to achieve this, but here I'll list what I plan to do for now. We should have a few people discuss this to decide on the best path forward especially for the longer term solution.

@fvitt

Definition of done:

ekluzek commented 1 month ago

The short term fix I plan to make is for CTSM to read in the $CASEDIR/Buildconf/camconf/drv_flds_in file when LND_SETS_DUST_EMIS_DRV_FLDS==FALSE (and fail if that file is not found) for all the drv_flds_in field settings similar to the user_nl_clm file.

Since it's reading in the whole file -- I need to handle #2712 as well. An alternative would be to JUST read in the two dust emissions namelist settings -- but this would require special handling for just those rather than the use of the general method to read in namelist files.

Note, that having CTSM ALWAYS read in CAM's drv_flds_in namelist file -- also might be a good thing to do as discussed here: https://github.com/ESCOMP/CTSM/issues/2712#issuecomment-2297388021. So the transition plan could be that LND_SETS_DUST_EMIS_DRV_FLDS is removed -- but the CAM drv_flds_in file is still read in. Or that it's removed AND the CAM drv_flds_in file is no longer read in as well.

ekluzek commented 1 month ago

In talking with @adrifoster I realized this all makes the most sense if CTSM sets dust emissions type and CAM only listens to what CTSM decide to do. So I am now planning on going that direction.

This means that the read for CAM's drv_flds_in namelist will be removed as part of this.

wwieder commented 1 month ago

+1 CAM should listen to CTSM more often :)

ekluzek commented 1 month ago

@fvitt and I went over the plan together. We did realize that because of complexity with CAM chemistry, CAM should be the expert in deciding megan, drydep, and fire-emission. It's also likely that CAM should be the expert in setting dust tuning scaling factors that will be implemented as part of tuning dust in CAM/CTSM for the Leung scheme. So this aspect needs to be thought about more.