noresm3_0_038_cam6_4_121: Do not create two CO2 tracers#284
Conversation
- Only create one total CO2 tracer when a CO2 chemistry is running and co2_cycle is on - When sharing total CO2 between co2_cycle and chemistry, do not create duplicate CO2 diagnostic fields - Create NFxxxxesmGhg esm compsets (so that co2_cycle is turned on) - Add test for an esm compset running ghg_mam_oslo chemistry
| <!-- This should move to a CAM use case file | ||
| <!-- These values are set here since it is part of the compset | ||
| definition --> | ||
| <value compset="_BGC%BDRP"> co2_cycle_rad_passive=.false. </value> |
There was a problem hiding this comment.
CMEPS has no setting for BGC%BDRP. It only has BGC%BPRP and BGC%BDRD - you want to have this be BGC%BPRP instead.
There was a problem hiding this comment.
Oops, fixed.
Thanks for catching the typo.
| ! | ||
| ! Quadratic height fiels Z3*Z3 | ||
| ! | ||
| ftem(ncol+1:,:) = 0.0_r8 |
There was a problem hiding this comment.
Could you please add a comment as to why you need ncol+1:
There was a problem hiding this comment.
It's because of all the outfld calls that pass pcols. I wanted to make sure no bad numbers (or NaNs) could cause problems. Alternatively, I could change those outfld calls.
| call cnst_add(c_names(icnst), c_mw(icnst), c_cp(icnst), c_qmin(icnst), c_i(icnst), & | ||
| longname=c_names(icnst), mixtype='dry') | ||
|
|
||
| call cnst_get_ind(c_names(icnst), c_i(icnst), abort=.false.) |
There was a problem hiding this comment.
Would be good to add a comment like the following:
This logic prevents duplicate CO2 tracers from being created. The fix checks whether the CO2 tracer already exists before attempting to register it. If it exists (found in the constituent database), the code skips the cnst_add() call and sets local_co2 = .false., avoiding duplication.
There was a problem hiding this comment.
Why are you setting local_co2 to be true or false in a loop over constituents? Would you not want to check if the name is co2 before you set the local value? It seems like this will be reset for every constituent that is added. Maybe I am missing a critical piece.
There was a problem hiding this comment.
I agree, this is a logic flaw that happened to not cause any problems because CO2 is the last constituent in the array. Logic has been made more robust and a duplicate of any of the other constituents is an error.
Fix typo in config_component.xml
| call cnst_add(c_names(icnst), c_mw(icnst), c_cp(icnst), c_qmin(icnst), c_i(icnst), & | ||
| longname=c_names(icnst), mixtype='dry') | ||
|
|
||
| call cnst_get_ind(c_names(icnst), c_i(icnst), abort=.false.) |
Summary: Introduce change from NorESM2.3 to defer to chemistry when it has an active CO2 specie
Contributors: @gold2718
Reviewers: @mvertens
Purpose of changes: co2_cycle (for emission runs) creates a second CO2 tracer when chemistry when it has an active CO2 specie
Github PR URL: #284
Changes made to build system: Adjust
pcnstwhen both co2_cycle and a GHG chemistry are activeChanges made to the namelist: None
Changes to the defaults for the boundary datasets: None
Substantial timing or memory changes: None
Details:
Testing: