-
Notifications
You must be signed in to change notification settings - Fork 6
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
Initialise ssnow
variables in mpiworker
#471
Open
SeanBryan51
wants to merge
2
commits into
main
Choose a base branch
from
397-uninitialised-ssnowrtevap_sat-and-ssnowrtevap_unsat-in-worker-processes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Initialise ssnow
variables in mpiworker
#471
SeanBryan51
wants to merge
2
commits into
main
from
397-uninitialised-ssnowrtevap_sat-and-ssnowrtevap_unsat-in-worker-processes
Conversation
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
Note to reproduce the error, the following temporary patch was used to "fix" #396: diff --git a/src/offline/cable_parameters.F90 b/src/offline/cable_parameters.F90
index 8117f3f..f9c242e 100644
--- a/src/offline/cable_parameters.F90
+++ b/src/offline/cable_parameters.F90
@@ -2294,22 +2294,22 @@ CONTAINS
endwhere
! ____________________ MMY comment out as we don't use hys ___________________________
- do k=1,ms
- do i=1,mp
- if (ssnow%wb_hys(i,k) .lt. 0._r_2) then
- ssnow%wb_hys(i,k) = ssnow%wb(i,k)
- end if
- ssnow%wb_hys(i,k) = max(soil%watr(i,k) ,min(soil%ssat_vec(i,k), ssnow%wb_hys(i,k)))
-
- if (ssnow%smp_hys(i,k) .lt. -1.0e+30_r_2) then !set to missing, calc
- ssnow%smp_hys(i,k) = -soil%sucs_vec(i,k)* &
- ( (ssnow%wb_hys(i,k)-ssnow%watr_hys(i,k))/&
- (ssnow%ssat_hys(i,k)-ssnow%watr_hys(i,k)) )**&
- (-1._r_2/soil%bch_vec(i,k) )
- end if
- ssnow%smp_hys(i,k) = max(-1.0e10,min(-soil%sucs_vec(i,k),ssnow%smp_hys(i,k) ))
- end do
- end do
+! do k=1,ms
+! do i=1,mp
+! if (ssnow%wb_hys(i,k) .lt. 0._r_2) then
+! ssnow%wb_hys(i,k) = ssnow%wb(i,k)
+! end if
+! ssnow%wb_hys(i,k) = max(soil%watr(i,k) ,min(soil%ssat_vec(i,k), ssnow%wb_hys(i,k)))
+
+! if (ssnow%smp_hys(i,k) .lt. -1.0e+30_r_2) then !set to missing, calc
+! ssnow%smp_hys(i,k) = -soil%sucs_vec(i,k)* &
+! ( (ssnow%wb_hys(i,k)-ssnow%watr_hys(i,k))/&
+! (ssnow%ssat_hys(i,k)-ssnow%watr_hys(i,k)) )**&
+! (-1._r_2/soil%bch_vec(i,k) )
+! end if
+! ssnow%smp_hys(i,k) = max(-1.0e10,min(-soil%sucs_vec(i,k),ssnow%smp_hys(i,k) ))
+! end do
+! end do
! MMY note that after commenting out, wb_hys and smp_hys are not defined any more
|
87aa062
to
db04538
Compare
ssnow
variables in mpiworker
Benchcab regression tests pass for both site and spatial runs:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Variables
ssnow%rtevap_sat
,ssnow%rtevap_unsat
andssnow%qrecharge
are uninitialised in all MPI worker processes and crashes the model when runtime memory checks are enabled (see #397 for more details). These variables are specifically initialised (to zero) in cable_parameters.F90 for the serial case (and for the MPI master process). Rather than communicating the initialised variables from master to worker, this change initialises the variables in the worker directly.Although we plan to deprecate the MPI drivers in the future, this change will still be useful when comparing the behaviour of MPI vs serial during development.
Fixes #397
Type of change
Please delete options that are not relevant.
Checklist
📚 Documentation preview 📚: https://cable--471.org.readthedocs.build/en/471/