Conversation
Partially addresses ESCOMP#601
This will integrate better with existing infrastructure for processing colon-delimited lists.
Before this change, an empty WATER_TRACERS xml variable was treated as a length-1 list containing an empty string, rather than as a length-0 list.
It looks like these fields were removed from esmFldsExchange_cesm_mod at some point, but weren't removed from fd_cesm.yaml.
We can enable these checks once we add water tracers to ensure that water tracers are being handled consistently with bulk fluxes.
This reverts commit a39d47d. This capability is enabled on this branch so we can back out this temporary commit.
This means we are potentially getting n_tracers multiple times instead of just once, but it allows the code to work in the situation where we don't have any tracer fields and shr_wtracers_mod hasn't been initialized. (I'm not sure if this will arise in practice, but it might.)
This breaks the dependency on this share code for UFS.
This will make it more clear to readers that tracers are handled identically to bulk, and will also make it less likely for the two to get out of sync.
Per suggestion from Mariana Vertenstein
Since this field doesn't have a corresponding bulk field, we need to add some flexibility to the checker method.
Faxa_rain, Faxa_rainc, Faxa_rainl, Faxa_snow, Faxa_snowc, Faxa_snowl
This is a preparatory change for an upcoming change where I plan to extract the shared code in state_setexport into a shared routine, and then (more importantly) for a change in the logic I'll use for water tracer fields: I want logic in place that will keep non-tracer fields having the same values regardless of the presence of water tracers, and this new logic will be more amenable to that plan.
This will let us adjust the implementation in a common way for all components. This is bit-for-bit with the last commit for the test SMS_Ld3_D_P8x1.f10_f10_mg37.X.green_gnu
This isn't yet leveraged because we don't have water tracer fields defined yet, but this will be leveraged in an upcoming change. Note that I have also changed various settings of gridTofieldMap=2 to be more local: this only applies for fields with a single ungridded dimension, so does not apply to fields with both a water tracer ungridded dimension and an additional ungridded dimension for another purpose. It's safe to assume this in various components' field_setexport subroutines, because those aren't used for water tracer fields.
Since this field doesn't have a corresponding bulk field, we need to add some flexibility in the routine that sets water tracer fields.
Faxa_rainc, Faxa_rainl, Faxa_rain, Faxa_snowc, Faxa_snowl, Faxa_snow.
This adds both the non-tracer and tracer versions of these fields: the non-tracer versions hadn't been added yet.
This was missing before; I am adding it both for non-tracers and tracers
And add non-tracer field for Flrr_flood to land, which previously hadn't been added.
Also add non-tracer fields for Forr_rofl_glc and Forr_rofi_glc, which hadn't previously been added.
Make ice_covered 0 some places. Make topo range from 0 to 3000. Code written by Claude Code (with substantial guidance and iteration from me), reviewed by myself.
This is needed for the smb renormalization
Since the naming convention is to have "_wtracers" last, we're also changing the dimension ordering convention to be consistent with that.
The lnd->glc mapping relies on particular values of coupling fields if we want to fully test the logic, so set some more reasonable values for the necessary fields.
|
I still want to do a more extensive review and testing of this myself, so for now marking this as draft. |
| <entry id="water_tracer_names" modify_via_xml="WATER_TRACERS" skip_default_entry="true"> | ||
| <type>char</type> | ||
| <category>water_tracers</category> | ||
| <group>ALLCOMP_attributes</group> |
There was a problem hiding this comment.
I'm putting the new variables in ALLCOMP_attributes. I'm not sure if this is right, or if these should go in DRIVER_attributes. I chose ALLCOMP_attributes just because there was more stuff (and more relevant stuff) there, but I'm not sure why I'd choose one over the other.
But actually, maybe ALLCOMP_attributes is needed given that MOM may need to access these rather than going through the share code??
@mvertens do you have guidance here?
There was a problem hiding this comment.
@billsacks - if any component needs this variable - then it should belong in ALLCOMP_attributes. I think I envisioned the DRIVER_attributes as having variables that are available on all processors but are specific to the driver itself (e.g. pio, etc).
I am not sure why the following variables
reprosum_diffmax
reprosum_recompute,
reprosum_use_ddpdd
wv_sat_scheme
wv_sat_table_spacing
wv_sat_transition_start
wv_sat_use_tables
are in the DRIVER_attributes and not in the ALLCOMP_attributes.
@jedwards4b - what are your thoughts on this?
Description of changes
Core changes needed to add water tracers in CESM, for the sake of water isotopes and other purposes.
Major pieces of this include:
Some pieces are not yet implemented:
Depends on ESCOMP/CESM_share#82
Specific notes
Contributors other than yourself, if any:
CMEPS Issues Fixed (include github issue #):
Are changes expected to change answers? (specify if bfb, different at roundoff, more substantial) Changes answers for X compsets (due to some changed counter logic and maybe other things); should be bit-for-bit for all other compsets
Any User Interface Changes (namelist or namelist defaults changes)? Adds xml and config variables controlling water tracers
Testing performed
Only minimal testing so far. I will test this more extensively and update this when I do.