-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'match_file_type_on_read_v2'
Fix reading netcdf variable into a different data type Main change is to fix the reading of a variable that is one type on a NetCDF file but a different data type in memory. Previously, this could lead to memory corruption (not just of the variable in question, but other variables as well). This was not causing any problems in out-of-the-box configurations, but it sometimes tripped up some developers when they added new fields on datasets. In addition, this adds new self-test code to test ncdio_pio. This module is hard to get under unit test, but we want to have some tests of it, to pick up problems like the one fixed in this tag. So as a compromise solution for now, I have introduced unit test-like tests that are built into a standard build of CTSM and run in a standard run if a given namelist flag is set. A better long-term solution would be to integrate these tests into the pFUnit-based unit testing framework, but that would take some work. I have added tests of the new code, and a bit of testing of other code in ncdio_pio, but there's still a lot in ncdio_pio that is not tested. I figure we can gradually add tests as we make changes to ncdio_pio. Finally, an unrelated change to the unit test build: files generated by genf90 now appear in the unit test build directory rather than the source tree. Resolves #1091 (Memory corruption when reading a netcdf variable into a variable of a different type, at least with PIO1) Resolves #1188 (In unit test build: files generated by genf90 should go in build dir rather than source dir)
- Loading branch information
Showing
36 changed files
with
1,481 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
The purpose of this testmod directory is to trigger the runtime | ||
self-tests. This runs a suite of unit/integration tests. | ||
|
||
We use cold start so that we can get through initialization faster, | ||
since how we initialize the model is unimportant for these self-tests. |
3 changes: 3 additions & 0 deletions
3
cime_config/testdefs/testmods_dirs/clm/run_self_tests/shell_commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
./xmlchange CLM_FORCE_COLDSTART="on" | ||
|
1 change: 1 addition & 0 deletions
1
cime_config/testdefs/testmods_dirs/clm/run_self_tests/user_nl_clm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
for_testing_run_ncdiopio_tests = .true. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.