Skip to content
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

code should error on missing mxsoil_color when SOIL_COLOR is used #272

Closed
lvankampenhout opened this issue Feb 13, 2018 · 1 comment
Closed
Labels
bfb bit-for-bit bug something is working incorrectly

Comments

@lvankampenhout
Copy link
Contributor

This bug only manifests under unique circumstances, namely when using a custom surface dataset and the variable mxsoil_color has accidentally been forgotten (this happened to me due to a bug or "feature" in CDO's merge).

When mxsoil_color is not present, the init code in SurfaceAlbedoMod.F90 simply assumes 8 color classes. However my input dataset assumes 20 classes, which are reflected in the values of variable SOIL_COLOR. This by itself is an erroneous model state, but it also led to the production of weird errors in Snicar en in the production of NaN's. Root cause: code in subroutine SoilAlbedo accesses memory that has not been allocated.

This mismatch state can be prevented simply by requiring mxsoil_color and erroring out when it does not exist, and SOIL_COLOR does. A more complicated solution would be to somehow guess the value of mxsoil_color from the input , but this requires more work.

@lvankampenhout
Copy link
Contributor Author

Just for cross-reference purposes: the error message first produced by SNICAR read:

1549: SNICAR ERROR: FOUND A WORMHOLE. STUCK IN INFINITE LOOP! Called from:

@billsacks billsacks added bug something is working incorrectly tag: simple bfb labels Feb 13, 2018
billsacks added a commit to billsacks/ctsm that referenced this issue Aug 3, 2018
Aborting is safer than assuming 8 classes, and avoids possibly cryptic
errors

Fixes ESCOMP#272
billsacks added a commit that referenced this issue Aug 4, 2018
Minor bug fixes, cleanup, documentation and enhancements

A collection of minor bug fixes, code cleanup, documentation and
enhancements, all bit-for-bit. See list of issues fixed below for
details.

Issues fixed (include CTSM Issue #):
- Fixes #24 (ncd_io_1d_log_glob is broken)
- Fixes #120 (Incorrect comments in Biogeophysics1Mod.F90
- Fixes #217 (Change some cheyenne_gnu tests to cheyenne_intel)
- Fixes #245 (Put all .gitignore entries in top-level file)
- Fixes #272 (Code should error on missing mxsoil_color when SOIL_COLOR
  is used)
- Fixes #283 (Add more helpful message about need to do init_interp with
  wrong number of vertical layers)
- Fixes #367 (For cmip6 runs: Turn on cpl hist output needed to drive a
  TG compset)
- Fixes #412 (Fix documentation of init_interp_method)
- Fixes #419 (Do not allow SOYFIXN diagnostic field with FUN)
- Fixes #464 (Some lines longer than 132 characters)
- Fixes #465 (Remove backwards compatibility check for snw_rds)
- Fixes #467 (Increase wallclock limit for test)
billsacks added a commit to billsacks/ctsm that referenced this issue Feb 22, 2019
Aborting is safer than assuming 8 classes, and avoids possibly cryptic
errors

Fixes ESCOMP#272
billsacks added a commit to billsacks/ctsm that referenced this issue Feb 22, 2019
Minor bug fixes, cleanup, documentation and enhancements

A collection of minor bug fixes, code cleanup, documentation and
enhancements, all bit-for-bit. See list of issues fixed below for
details.

Issues fixed (include CTSM Issue #):
- Fixes ESCOMP#24 (ncd_io_1d_log_glob is broken)
- Fixes ESCOMP#120 (Incorrect comments in Biogeophysics1Mod.F90
- Fixes ESCOMP#217 (Change some cheyenne_gnu tests to cheyenne_intel)
- Fixes ESCOMP#245 (Put all .gitignore entries in top-level file)
- Fixes ESCOMP#272 (Code should error on missing mxsoil_color when SOIL_COLOR
  is used)
- Fixes ESCOMP#283 (Add more helpful message about need to do init_interp with
  wrong number of vertical layers)
- Fixes ESCOMP#367 (For cmip6 runs: Turn on cpl hist output needed to drive a
  TG compset)
- Fixes ESCOMP#412 (Fix documentation of init_interp_method)
- Fixes ESCOMP#419 (Do not allow SOYFIXN diagnostic field with FUN)
- Fixes ESCOMP#464 (Some lines longer than 132 characters)
- Fixes ESCOMP#465 (Remove backwards compatibility check for snw_rds)
- Fixes ESCOMP#467 (Increase wallclock limit for test)
AGonzalezNicolas pushed a commit to HPSCTerrSys/clm5_0 that referenced this issue Jun 27, 2024
Aborting is safer than assuming 8 classes, and avoids possibly cryptic
errors

Fixes ESCOMP#272
AGonzalezNicolas pushed a commit to HPSCTerrSys/clm5_0 that referenced this issue Jul 5, 2024
Aborting is safer than assuming 8 classes, and avoids possibly cryptic
errors

Fixes ESCOMP#272
@samsrabin samsrabin added simple bfb bit-for-bit labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bfb bit-for-bit bug something is working incorrectly
Projects
None yet
Development

No branches or pull requests

3 participants