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

Add negative soil moisture check and adjustment to SSTEP #644

Merged
merged 1 commit into from
Aug 11, 2022

Conversation

aubreyd
Copy link
Collaborator

@aubreyd aubreyd commented Aug 9, 2022

TYPE: enhancement?

KEYWORDS: NoahMP, soil moisture

SOURCE: Aubrey D, NCAR

DESCRIPTION OF CHANGES:
The new Xinanjiang infiltration scheme triggers NaNs when the top 2 soil layers show a negative net soil moisture. There is a catch for this negative soil moisture condition at the end of the SOILWATER routine, but this happens after the Xinanjiang module is called within the infiltration iterative loop. To avoid NaNs, we added a duplicate check and adjustment (move water from lower layer to fill deficit in upper layer) into the SSTEP solver right after the oversaturation check. For consistency with current solution, we maintain the 0.01mm minimum soil water threshold implemented in the SOILWATER adjustment, however for future development we may want to consider SMCDRY or another fractional soil moisture based threshold.

There will be answer changes.

ISSUE: Fixes #645

TESTS CONDUCTED:

  1. Tested on two sample NWM cutout basins that were generating NaNs with the Xinanjiang infiltration scheme. On 1-year tests, the new code does not produce NaNs and is very close to original solution.
  2. Tested CONUS NWM domain over 3 months when original code was generating at least 1 NaN cell. The new code does not generate NaNs and is very close to original solution.
  3. Code passed ncores and perfect restart tests with CONUS domain.

Checklist

Merging the PR depends on following checklist being completed. Add X between each of the square
brackets if they are completed in the PR itself. If a bullet is not relevant to you, please comment
on why below the bullet.

  • Closes issue #xxxx (An issue must exist or be created to be closed. The issue describes and documents the problem and general solution, the PR describes the technical details of the solution.)
  • [NA] Tests added (unit tests and/or regression/integration tests)
  • Backwards compatible
  • [NA] Requires new files? If so, how to generate them.
  • [NA] Documentation included
  • [NA] Short description in the Development section of NEWS.md

…inanjiang module. For consistency using 0.01mm minimum threshold to match current SOILWATER routine check - worth rethinking this value in the future.
@aubreyd aubreyd marked this pull request as ready for review August 10, 2022 19:08
@aubreyd aubreyd added noahmp NoahMP-related issues or code v3.0-calibration labels Aug 10, 2022
Copy link
Contributor

@arezoorn arezoorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have read through the code changes, and all seems logical to me. I do not see any issue with the current implementation.

Copy link
Member

@scrasmussen scrasmussen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Still putting together unit test to try to simulate negative soil moisture to test this use case but I trust the testing Aubrey did 👍

@scrasmussen
Copy link
Member

LGTM! Still putting together unit test to try to simulate negative soil moisture to test this use case but I trust the testing Aubrey did 👍

3: . PRE-SH2O  =  -9.99999978E-03  -9.99999978E-03  -9.99999978E-03  0.340354979
3:  WARNING: Negative smc adjustment
3:  POST-SH2O =   9.99999975E-05   3.33333301E-05   1.66666650E-05  0.330289006
3:  WMINUS =    0.00000000


3: . PRE-SH2O  =  -9.99999978E-03  -9.99999978E-03  -9.99999978E-03  -9.99999978E-03
3:  WARNING: Negative smc adjustment
3:  WARNING: SMC deficit - this water will be removed from subsurface runoff (meters).   2.00759638E-02
3:  POST-SH2O =   9.99999975E-05   3.33333301E-05   1.66666650E-05   9.99999975E-06
3:  WMINUS =    2.00759638E-02

PR passes new unit tests and functions as expected 😄

@aubreyd
Copy link
Collaborator Author

aubreyd commented Aug 11, 2022

Just adding that while I have not specifically tested this, it does look like there is an existing check for negative subsurface runoff in Land_models/NoahMP/phys/module_sf_noahmpdrv.F:
soldrain(i,j) = max(RUNSB*dt, 0.) !mm , underground runoff
So if we hit a case where the new soil moisture deficit correction needs to take water from subsurface runoff and subsurface runoff is 0, it will not crash the model with negative subsurface runoff (though it also will not conserve mass...).

@aubreyd
Copy link
Collaborator Author

aubreyd commented Aug 11, 2022

See remaining outstanding issues logged here:
#646
#647

@rcabell rcabell self-requested a review August 11, 2022 17:15
@rcabell rcabell merged commit ad6a2de into NCAR:master Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noahmp NoahMP-related issues or code v3.0-calibration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Xinanjiang runoff scheme generating NaNs
4 participants