-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure at least one test running FatesSp just uses the compset and not a test-mod directory #1817
Comments
@adrifoster the user-mod is in cime_config/usermods_dirs/fates_sp. There is a user_nl_clm that needs to be modified. And we'll need to change the test list so that some of the FatesSp tests don't use a test-mod. |
Okay in looking at this file I am actually not seeing any problems with the history variable names.. So now I'm not sure why the user was seeing that bug. I will go through the tutorial now and see what the deal may be. |
I believe the user was using an out-dated version of CTSM that was incompatible with their FATES version, so I believe this is actually not a bug. However, we may still want to make sure some FATES tests use this compset. |
It seems from investigation of the different testdefs that for some sort of FatesColdDefBase, in shell_commands we need:
In the Fates testdef we also have a user_nl_clm file, but I'm not sure we want to use all of these in a FATES SP test:
@ekluzek does this seem correct? If so, I was going to create a new testdefs folder with just a shell_commands file with the xmlchange commands above. Then in the FatesColdDefReducedComplexSatPhen test def we would just have that new test def in the include_user_mods file as well as the fates_sp user mod. Would we want to add a user_nl_clm file with the |
Yes, I think the user-mod should JUST have the shell_commands parts and not the user_nl_clm parts. The user_nl_clm parts do get appended on, rather than overwritten, but that means the order matters. For this test mod we should avoid doing anything to the user_nl_clm, just to make sure it doesn't conflict with the user-mod. So that means you probably need the test with this test mod to run a month so that you'll get output. The question then is if we should have more than one test mod for FatesSP,? One would be this basic one that only does shell_commands, and another one could mess with history settings. Look at the other basic test cases and see what they do about history settings, that could help inform here. |
@ekluzek @billsacks trying something new here by creating a Design Doc, please let me know what you think! Software Design DocumentationFATES Test Def Update IntroductionWe want to update the FATES test definitions to:
Potential Solutions
Quote from "Software Engineering at Google" - https://abseil.io/resources/swe-bookOne final aspect of writing clear tests and avoiding brittleness has to do with code sharing. Most software attempts to achieve a principle called DRY—"Don’t Repeat Yourself." DRY states that software is easier to maintain if every concept is canonically represented in one place and code duplication is kept to a minimum. This approach is especially valuable in making changes easier because an engineer needs to update only one piece of code rather than tracking down multiple references. The downside to such consolidation is that it can make code unclear, requiring readers to follow chains of references to understand what the code is doing. In normal production code, that downside is usually a small price to pay for making code easier to change and work with. But this cost/benefit analysis plays out a little differently in the context of test code. Good tests are designed to be stable, and in fact you usually want them to break when the system being tested changes. So DRY doesn’t have quite as much benefit when it comes to test code. At the same time, the costs of complexity are greater for tests: production code has the benefit of a test suite to ensure that it keeps working as it becomes complex, whereas tests must stand by themselves, risking bugs if they aren’t self-evidently correct. As mentioned earlier, something has gone wrong if tests start becoming complex enough that it feels like they need their own tests to ensure that they’re working properly. Instead of being completely DRY, test code should often strive to be DAMP—that is, to promote "Descriptive And Meaningful Phrases." A little bit of duplication is OK in tests so long as that duplication makes the test simpler and clearer. Design ConsiderationsGeneral Constraints:Because we are using the FATES and FATES SP compset for the FATES SP tests, some parameters (e.g., those related to spitfire, megan, etc.) as well as some history variable specifications are set up before the files in a Design and ArchitectureMy preference is to go with Potential Solution 2 above, at least for the test defs related to FATES SP. This removes the issue of order and makes the test more 'DAMP'. Code design
Rollout PlanI plan to test each modified test def individually to ensure the parameters are set accurately, as well as run the usual |
Brief summary of bug
As of the latest FATES API update I believe we now have a mis-match between some of the history exclude variable names set up in the FATES-SP compset (
I2000Clm51FatesSpRsGs
) and the FATES code.General bug information
CTSM version you are using:
ctsm5.1.dev105
Does this bug cause significantly incorrect results in the model's science? No
Configurations affected:
I2000Clm51FatesSpRsGs
Details of bug
We just need to update the variable names in the compset
user_nl_clm
.However, it is unfortunate that this bug was not caught in testing. We should probably also make sure that tests that use a compset with included/excluded variables do not get overwritten by those set up in the testing script itself.
Important details of your setup / configuration so we can reproduce the bug
This came up when a new user was following our recent CTSM Global FATES Case tutorial
./create_newcase --case ~/clm_tutorial_cases/I2000_CTSM_FATESsp --res f45_g37 --compset I2000Clm51FatesSpRsGs --run-unsupported
Important output or errors that show the problem
Error message in the lnd log:
`
htapes_fieldlist ERROR:
FATES_GPP_UNDERSTORY in fexcl(
74 ) for history tape 1 not found
ENDRUN:
ERROR: ERROR in histFileMod.F90 at line 852
`
@ekluzek I am happy to tackle at least part of this, if you could point me to where this compset is set up.
The text was updated successfully, but these errors were encountered: