-
Notifications
You must be signed in to change notification settings - Fork 64
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 support for scheme w/o run phase #548
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
934f1f5
Changes for CCPP SCM schemes w/o run phases
dustinswales d53546b
Merge branch 'feature/capgen' of https://github.com/NCAR/ccpp-framewo…
dustinswales 8c3850d
Add test for scheme w/o run phase.
dustinswales c75542f
Omission from previous commit
dustinswales fd2e60b
Change from no_run_phase to has_run_phase
dustinswales 236c0ed
Merge branch 'main' of https://github.com/NCAR/ccpp-framework into no…
dustinswales File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module setup_coeffs | ||
use ccpp_kinds, ONLY: kind_phys | ||
implicit none | ||
|
||
public :: setup_coeffs_timestep_init | ||
|
||
contains | ||
!> \section arg_table_setup_coeffs_timestep_init Argument Table | ||
!! \htmlinclude arg_table_setup_coeffs_timestep_init.html | ||
!! | ||
subroutine setup_coeffs_timestep_init(coeffs, errmsg, errflg) | ||
|
||
real(kind_phys), intent(inout) :: coeffs(:) | ||
character(len=512), intent(out) :: errmsg | ||
integer, intent(out) :: errflg | ||
|
||
errmsg = '' | ||
errflg = 0 | ||
|
||
coeffs(:) = 1._kind_phys | ||
|
||
end subroutine setup_coeffs_timestep_init | ||
|
||
end module setup_coeffs |
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,29 @@ | ||
[ccpp-table-properties] | ||
name = setup_coeffs | ||
type = scheme | ||
[ccpp-arg-table] | ||
name = setup_coeffs_timestep_init | ||
type = scheme | ||
[ coeffs ] | ||
standard_name = coefficients_for_interpolation | ||
long_name = coefficients for interpolation | ||
units = none | ||
dimensions = (horizontal_dimension) | ||
type = real | ||
kind = kind_phys | ||
intent = inout | ||
[ errmsg ] | ||
standard_name = ccpp_error_message | ||
long_name = Error message for error handling in CCPP | ||
units = none | ||
dimensions = () | ||
type = character | ||
kind = len=512 | ||
intent = out | ||
[ errflg ] | ||
standard_name = ccpp_error_code | ||
long_name = Error flag for error handling in CCPP | ||
units = 1 | ||
dimensions = () | ||
type = integer | ||
intent = out |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
setup_coeffs.meta | ||
temp_set.meta | ||
temp_adjust.meta | ||
temp_calc_adjust.meta |
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
Oops, something went wrong.
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.
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.
This just says
phase
, isphase
alwaysrun
?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.
This is to catch instances when "func" doesn't contain a run.
But yeah, phase can be init, run, or final, but we don't care if init and final are not present.
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 still don't understand the logic. Somewhere, the code calls
analyze
for a certain phase (which can be anything you said:init
,final
, ...). Then in line 1144, you check if that phase is in the func dictionary. If it is not, you sethas_run_phase
toFalse
. That makes sense ifphase
isrun
, but not if the argumentphase
isinit
?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.
The way I understand it is, this may be wrong:
Capgen creates group caps for each CCPP phase except for the run phase, and caps for each group's run phase. For example, in the SCM GFS_v16 SDF, we have the following caps created (4 ccpp phase caps, and 3 group caps):
public :: SCM_GFS_v16_initialize
public :: SCM_GFS_v16_timestep_initial
public :: SCM_GFS_v16_time_vary
public :: SCM_GFS_v16_radiation
public :: SCM_GFS_v16_physics
public :: SCM_GFS_v16_timestep_final
public :: SCM_GFS_v16_finalize
So when analyzing/writing the group caps you can only have phase=run.
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.
Oh, that is fundamentally different from prebuild. In prebuild, there is a cap for each phase and each group. I think right now that limitation in capgen isn't a problem, but I would prefer that check in the code just in case the capgen implementation changes in the future and
analyze
at the group level can get called for other phases, too.For example:
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.
There's another option though. We could try to treat the FV3 dycore with the fast physics as its own "host model" for CCPP framework purposes. I thought about this in the past, when I heard discussions about moving more physics into the FV3 dycore ("inline physics"). I think that should be possible with relatively little engineering on the build system side.
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.
We have discussed one way to handle this but I can't find the reference right now. The idea would be that we have two ways to combine sub-suites. Do you recall where that took place or should I add what I recall to #275 ?
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.
If you could, yes please. I don't remember. Thanks very much!
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 have added what I recall to the description section of #275 .
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.
Thanks! Yes, I think this would give us the desired capability.