-
Notifications
You must be signed in to change notification settings - Fork 343
[WIP] For testing add a framework to bypass parts of the code #3425
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
base: b4b-dev
Are you sure you want to change the base?
Changes from all commits
d3178e1
d65ecfb
96e0c94
f6272ef
7006740
93628b2
28834c9
256e692
0137dc2
69792af
de1ca06
c1c7ca3
db4551c
cb8e7ec
09aa5ac
bf498ab
3c54060
ce2d68b
2fc723f
d8d656b
4ce6b5f
7dc7dcd
2a46724
c95b886
86382c6
dac0ae0
e867afe
d19b894
a5d5b5c
b3185c0
1acf630
2636975
def2c97
bf947fb
80192dc
df19381
417922d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #!/bin/bash | ||
| ./xmlchange CLM_FORCE_COLDSTART="on" | ||
|
|
||
| # We use this testmod in a _Ln1 test; this requires forcing the ROF coupling frequency to every time step | ||
| ./xmlchange ROF_NCPL=48 | ||
|
|
||
| # Restarts aren't allowed for these tests, and turn off CPL history | ||
| ./xmlchange REST_OPTION="never" | ||
| ./xmlchange HIST_OPTION="never" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,14 @@ | ||
| ! Bypass as much of the init phase as can be done | ||
| ! Bypassing the run phase already was inherited from the for_testing_fastsetup_bypassrun testmod | ||
| for_testing_bypass_init = .true. | ||
|
|
||
| ! Turn on some of the self tests | ||
| for_testing_run_ncdiopio_tests = .true. | ||
|
|
||
| ! Turn off history, restarts, and output | ||
| hist_empty_htapes = .true. | ||
| use_noio = .true. | ||
| for_testing_run_decomp_init_tests = .true. | ||
|
|
||
| ! Exit initialization phase after the self tests | ||
| for_testing_bypass_init = .true. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,7 @@ module clm_driver | |
| use clm_instMod | ||
| use SoilMoistureStreamMod , only : PrescribedSoilMoistureInterp, PrescribedSoilMoistureAdvance | ||
| use SoilBiogeochemDecompCascadeConType , only : no_soil_decomp, decomp_method | ||
| use SelfTestDriver , only : for_testing_bypass_run_except_clock_advance | ||
| ! | ||
| ! !PUBLIC TYPES: | ||
| implicit none | ||
|
|
@@ -165,6 +166,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro | |
| ! CalcIrrigationNeeded. Simply declaring this variable makes the ICE go away. | ||
| real(r8), allocatable :: dummy1_to_make_pgi_happy(:) | ||
| !----------------------------------------------------------------------- | ||
| if ( for_testing_bypass_run_except_clock_advance() ) return | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because this short circuits the code -- it's worth thinking if this should be a simple return statement or a more explicit if structure.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @samsrabin this is one thing I'd like to hear feedback on. Let me know what you think about this.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well this one isn't just an early return; it actually short-circuits the entire subroutine. So why not just wrap its call in an
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm seeing now that the other
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really like your idea @samsrabin. For performance it's of course better to do at the higher level. For readability it might depend on where you want these things to be seen. But, in this case it would remove this strange testing option from code that's a mix of science/software infrastructure to the higher level in the NUOPC cap that is pretty much just for SE's. So it helps with readability as well as separation of concerns. |
||
|
|
||
| ! Determine processor bounds and clumps for this processor | ||
|
|
||
|
|
@@ -1576,6 +1578,8 @@ subroutine clm_drv_init(bounds, & | |
| integer :: fp, fc ! filter indices | ||
| !----------------------------------------------------------------------- | ||
|
|
||
| if ( for_testing_bypass_run_except_clock_advance() ) return | ||
|
|
||
| associate( & | ||
| snl => col%snl , & ! Input: [integer (:) ] number of snow layers | ||
|
|
||
|
|
@@ -1657,6 +1661,7 @@ subroutine clm_drv_patch2col (bounds, & | |
| ! !LOCAL VARIABLES: | ||
| integer :: c,fc ! indices | ||
| ! ----------------------------------------------------------------- | ||
| if ( for_testing_bypass_run_except_clock_advance() ) return | ||
|
|
||
| ! Note: lake points are excluded from many of the following | ||
| ! averages. For some fields, this is because the field doesn't | ||
|
|
@@ -1752,6 +1757,8 @@ subroutine write_diagnostic (bounds, nstep, lnd2atm_inst) | |
| integer :: status(MPI_STATUS_SIZE) ! mpi status | ||
| !------------------------------------------------------------------------ | ||
|
|
||
| if ( for_testing_bypass_run_except_clock_advance() ) return | ||
|
|
||
| call get_proc_global(ng=numg) | ||
|
|
||
| if (masterproc) then | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I should add more error checking to the build-namelist for these bypass options. I also think that these testing options should maybe do things like ensure that history and restart files are off the like. There also might be some error checking that some of the advanced options are NOT turned on with the bypass options, and that sort of thing. And it will be important to make sure it's clear that these bypass and testing options are turned on -- and they don't get turned on accidentally. It will take some thinking to figure that out.