add stream field specific unit conversions in stream_defintion_MODEL.xml - #438
add stream field specific unit conversions in stream_defintion_MODEL.xml#438mvertens wants to merge 3 commits into
Conversation
…ndep unit conversion and cplhist field mapping
|
@ekluzek @billsacks - the problem I ran into when I originally thought of doing this in the xml is that I was trying to put the unit conversion on a stream rather than on a field - and that of course will not work if the different stream fields have different units. With this PR now the unit conversion(s) are on stream field(s).
|
billsacks
left a comment
There was a problem hiding this comment.
This looks great - thanks a lot for implementing this! I just have a couple of requests about comments:
ekluzek
left a comment
There was a problem hiding this comment.
There's a couple things I ask for. The one that's important is to upgrade the constants in the stream definition file from single to double precision. I think that's important enough to do. But, it still not make answers identical because of the conversion from a divide to a multiply, but certainly a good thing to have in place.
|
@ekluzek @billsacks - thanks for your review. I think I've addressed all of your comments. |
|
@mvertens - is it quick for you to redo your baseline test with the latest code (where you have changed the |
Summary
Allow a unit conversion factor on stream variables
Description of changes
Adds an optional third token to a
<var>line in a stream definition, giving a factor applied to that field as it is read. Uses it to fix nitrogen deposition, where the conversion was previously inferred from field names and got cplhist forcing wrong by a factor of 1000.datm_pres_ndep_moddecided whether to convert nitrogen deposition from gN/m2/s to kgN/m2/s by looking at which stream fields were present: four fields meant no conversion, two fields meant divide by 1000.A
<var>line may now carry a conversion factor:dshr_strdata_modas the field is read, so the data enters the system already in the units the model expects and no component carries conversion logic of its own.datm_pres_ndep_modnow only sums the fields it is given.Specific notes
Contributors other than yourself, if any: claude
CDEPS Issues Fixed: #437
Are there dependencies on other component PRs:
Are changes expected to change answers: different to roundoff
COMPSET: 1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%GRIS-EVOLVE_SWAV_SESP
GRID: a%1.9x2.5_l%1.9x2.5_oi%null_r%r05_w%null_z%null_g%gris4_m%tnx1v4
And the following was obtained for the diffs:
Any User Interface Changes (namelist or namelist defaults changes):
Testing performed (e.g. aux_cdeps, CESM prealpha, etc):
Hashes used for testing: