Comments (4)
Bill Sacks < [email protected] > - 2014-07-31 14:47:52 -0600
We probably want to use this option for one test for each configuration... this could replace the addition of select fields, which we do for some tests.
from ctsm.
Blocks #1347
from ctsm.
I took a closer look at this. It looks like the logic is spread over two places: 'global' settings are applied from namelist variables here and then if the global settings have no opinion, the 'local' settings are applied. The local logic is in Bill's code snippet above; basically all history fields are written by default, but the caller can opt out of that by passing in 'inactive' to an optional parameter called 'default' (example).
There are already a few relevant namelist flags affecting the global logic (per the code link above), the logic is a bit complex, and the ordering matters:
- If hist_fincl says the specific field is on, return ON
- If hist_empty_htapes says every field is off, return OFF
- If hist_fexcl says the specific field is off, return OFF
- otherwise, return the local vote (as described above)
fwiw all local votes are recorded in a global masterlist.actflag variable, and later (at the end of the simulation I'm guessing), the logic above is executed.
I think it makes most sense to keep all the global flags together, so I propose to modify the logic above to check some new flag ('hist_all'?) after checking the other three global flags. With that ordering, the fexcl flag can still be used to remove specific history fields.
In addition I thought it'd make sense to leave some documentation breadcrumbs in the code: 1) if you find one global flag, find out about the others 2) if you find the local logic, find out about the global logic, and vice versa.
On a minor note, I could make it crash if both hist_empty_htapes and the new flag (hist_all?) are set, since that's contradictory, but I'm not sure if that's CESM's usual policy for handling inconsistent flag settings.
from ctsm.
@johnpaulalex thank you for your careful work on this, as usual! You have come to understand this better than I have at this point :-) And yes, histFileMod is some of our oldest infrastructure code in CTSM, so it has accumulated some complexity and cruft over time....
I like your suggestion of where to insert hist_all into the ordering so that hist_fexcl can still be used to remove specific history fields.
One thing I may not have said when we talked βΒ and I'm not sure if it's clear to you from your trace of the code logic β is that the default/inactive logic only applies to the first history "tape" (h0). My initial thought was that this new namelist option should just apply to the first history tape, and I think that's what my hacky code snippet would have accomplished, but I suppose it could be a vector namelist option like many of the other history-related namelist flags and so could theoretically apply to any history tape. Since, in practice, I only see this being used for software testing, I'd say do whichever one is cleanest to implement (unless @ekluzek or others have opinions).
As for the name, we now tend towards longer, more explicit flag names than have been used in the past, so maybe something like, "hist_all_fields"?
Yes, adding more documentation would be fantastic - thank you!
And yes, we do try to add error-checking to prevent incompatible flags. We try to put this in at least one of (1) CLMBuildNamelist.pm and/or (2) the Fortran code. We try for (1) when feasible (the advantage is that this catches incompatibilities at build-namelist time, which typically means at build time or model submission time rather than waiting for run time), and it's not uncommon to do both (on the off-chance that a user has force-created a lnd_in file without going through the build-namelist script, and also because this makes the code more self-documenting as to incompatibility of flags).
@ekluzek see above if you aren't currently following this issue.
Also @slevis-lmwg I want to bring you in the loop here because this might have a bit of interaction with #1059 .
from ctsm.
Related Issues (20)
- Turn on Leung_2024 dust emission scheme by default for clm6_0
- Are these checks needed anymore? HOT 2
- Historical configuration for CLM6 HOT 5
- Quick start wiki not accurate for git-fleximod HOT 4
- fsurdat_modifier weirdness with PCT_CFT HOT 2
- Cleanup: Reduce duplication of fire code HOT 2
- Deprecate support/testing for NWP with Bgc/BgcCrop HOT 1
- Add graceful error checking when you ask for vector output at a higher subgrid level than the variable HOT 1
- Stop using the "subname" pattern and use ErrMsg instead HOT 1
- Reset accumulators to initval instead of 0
- Resetting causes runaccum accumulators to miss an update
- Accumulators not reset for inactive points
- need to update mosart_in file HOT 4
- Update CMEPS/MOSART/CISM/RTM tags HOT 4
- Start using "submodule" rather than "external" in the code (with the git fleximod update)
- cnmatrix solver crashes depending on the finidat file, as well as in an IHist simulation HOT 1
- Oddities in single-point mapalgo defaults HOT 1
- Check of finidat_interp_dest.status isn't reached HOT 2
- Deprecate and remove the VIC-Hydro option
- Deprecate running with CRU and Qian forcing HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctsm.