-
Notifications
You must be signed in to change notification settings - Fork 169
Add the subroutines of GF cps for CCPP-FV3 #139
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| !> \file cu_gf_driver_post.F90 | ||
| !! Contains code related to GF convective schemes to be used within the GFS physics suite. | ||
|
|
||
| module cu_gf_driver_post | ||
|
|
||
| contains | ||
|
|
||
| subroutine cu_gf_driver_post_init () | ||
| end subroutine cu_gf_driver_post_init | ||
|
|
||
| subroutine cu_gf_driver_post_finalize() | ||
| end subroutine cu_gf_driver_post_finalize | ||
|
|
||
| !> \section arg_table_cu_gf_driver_post_run Argument Table | ||
|
Collaborator
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. instead of having Model, Stateout, Grid, Tbd in the argument list (of which only Tbd and Stateout are used anyway), it would be better to pass in the components phy_f3d(:,:,5), phy_f3d(:,:,6), gt0(:,:) and gq0(:,:,1) using their respective standard names (see GFS_typedefs.F90) and giving them meaningful local names. |
||
| !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | | ||
| !! |----------------|--------------------------------------------------------|--------------------------------------------------------------------------|---------------|------|-------------------|-----------|--------|----------| | ||
| !! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | | ||
| !! | Stateout | FV3-GFS_Stateout_type |Fortran DDT containing FV3-GFS prognostic state to return to dycore | DDT | 0 | GFS_stateout_type | | inout | F | | ||
| !! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | | ||
| !! | Tbd | FV3-GFS_Tbd_type | Fortran DDT containing FV3-GFS miscellaneous data | DDT | 0 | GFS_tbd_type | | inout | F | | ||
| !! | errmsg | error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | | ||
| !! | errflg | error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | | ||
| !! | ||
| subroutine cu_gf_driver_post_run (Model, Stateout, Grid, Tbd, errmsg, errflg) | ||
|
|
||
| use machine, only: kind_phys | ||
| use GFS_typedefs, only: GFS_control_type, GFS_stateout_type, GFS_grid_type, GFS_tbd_type | ||
|
|
||
| implicit none | ||
|
|
||
| type(GFS_control_type), intent(in) :: Model | ||
| type(GFS_stateout_type), intent(inout) :: Stateout | ||
| type(GFS_grid_type), intent(in) :: Grid | ||
| type(GFS_tbd_type), intent(inout) :: Tbd | ||
|
|
||
| character(len=*), intent(out) :: errmsg | ||
| integer, intent(out) :: errflg | ||
|
|
||
| ! Initialize CCPP error handling variables | ||
| errmsg = '' | ||
| errflg = 0 | ||
|
|
||
| Tbd%phy_f3d(:,:,5) = Stateout%gt0(:,:) | ||
| Tbd%phy_f3d(:,:,6) = Stateout%gq0(:,:,1) | ||
|
|
||
| end subroutine cu_gf_driver_post_run | ||
|
|
||
| end module cu_gf_driver_post | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| !> \file cu_gf_driver_pre.F90 | ||
| !! Contains code related to GF convective schemes to be used within the GFS physics suite. | ||
|
|
||
| module cu_gf_driver_pre | ||
|
|
||
| contains | ||
|
|
||
| subroutine cu_gf_driver_pre_init () | ||
| end subroutine cu_gf_driver_pre_init | ||
|
|
||
| subroutine cu_gf_driver_pre_finalize() | ||
| end subroutine cu_gf_driver_pre_finalize | ||
|
|
||
| !> \section arg_table_cu_gf_driver_pre_run Argument Table | ||
| !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | | ||
| !! |----------------|--------------------------------------------------------|--------------------------------------------------------------------------|---------------|------|-------------------|-----------|--------|----------| | ||
| !! | Model | FV3-GFS_Control_type | Fortran DDT containing FV3-GFS model control parameters | DDT | 0 | GFS_control_type | | in | F | | ||
|
Collaborator
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. see above comment for cu_gf_driver_post_run (replace GFS derived data types with individual components) |
||
| !! | Statein | FV3-GFS_Statein_type | Fortran DDT containing FV3-GFS prognostic state in from dycore | DDT | 0 | GFS_statein_type | | in | F | | ||
| !! | Grid | FV3-GFS_Grid_type | Fortran DDT containing FV3-GFS grid and interpolation related data | DDT | 0 | GFS_grid_type | | in | F | | ||
| !! | Tbd | FV3-GFS_Tbd_type | Fortran DDT containing FV3-GFS miscellaneous data | DDT | 0 | GFS_tbd_type | | inout | F | | ||
| !! | errmsg | error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | | ||
| !! | errflg | error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | | ||
| !! | ||
| subroutine cu_gf_driver_pre_run (Model, Statein, Grid, Tbd, errmsg, errflg) | ||
|
|
||
| use machine, only: kind_phys | ||
| use GFS_typedefs, only: GFS_control_type, GFS_statein_type, GFS_grid_type, GFS_tbd_type | ||
|
|
||
| implicit none | ||
|
|
||
| type(GFS_control_type), intent(in) :: Model | ||
| type(GFS_statein_type), intent(in) :: Statein | ||
| type(GFS_grid_type), intent(in) :: Grid | ||
| type(GFS_tbd_type), intent(inout) :: Tbd | ||
|
|
||
| !--- hli for GF convective scheme | ||
| real(kind=kind_phys) :: dtdyn | ||
| !-- | ||
| character(len=*), intent(out) :: errmsg | ||
| integer, intent(out) :: errflg | ||
|
|
||
| ! Initialize CCPP error handling variables | ||
| errmsg = '' | ||
| errflg = 0 | ||
|
|
||
| if(Model%kdt.gt.1) then | ||
| dtdyn=3600.0*(Model%fhour)/Model%kdt ! G. Firl's suggestion | ||
| !print*,'hli Model%dtp,dtdyn',Model%dtp,dtdyn | ||
| !print*,'hli Statein%tgrs(:,:)',Statein%tgrs(:,:) | ||
| !print*,'hli Tbd%phy_f3d(:,:,5)',Tbd%phy_f3d(:,:,5) | ||
| if(Model%dtp > dtdyn) then | ||
| Tbd%forcet(:,:)=(Statein%tgrs(:,:) - Tbd%phy_f3d(:,:,5))/Model%dtp | ||
| Tbd%forceq(:,:)=(Statein%qgrs(:,:,1)- Tbd%phy_f3d(:,:,6))/Model%dtp | ||
| else | ||
| Tbd%forcet(:,:)=(Statein%tgrs(:,:) - Tbd%phy_f3d(:,:,5))/dtdyn | ||
| Tbd%forceq(:,:)=(Statein%qgrs(:,:,1)- Tbd%phy_f3d(:,:,6))/dtdyn | ||
| endif | ||
| else | ||
| Tbd%forcet(:,:)=0.0 | ||
| Tbd%forceq(:,:)=0.0 | ||
| endif | ||
| print*,'hli pre Tbd%forcet(1,1)',Tbd%forcet(1,1) | ||
|
|
||
| end subroutine cu_gf_driver_pre_run | ||
|
|
||
| end module cu_gf_driver_pre | ||
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 am not sure if you are supposed to change the default model config. Maybe @grantfirl has a better idea on how to create a different input.nml that uses GF instead of SAS (and a corresponding suite definition file for both FV3 and SCM).
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.
Which brings up the question why a copy of input.nml resides in ccpp-physics - it shouldn't be there. @grantfirl is it actually used? Not by FV3 at least, but maybe by SCM?
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.
To follow up on this, @haiqinli, Dom has (rightly) moved the input.nml used in the SCM from the ccpp-physics repository to the gmtb-scm repository. It is now located in gmtb-scm/scm/etc/case_config in the master branch. Also as Dom suggested, for testing the GF scheme, it is best to create a copy of input.nml for your testing, perhaps input_GF.nml. The original represents the operational namelist values and should stay that way. Then, when you go to run the SCM, you'll also want to modify the case configuration namelists to point to your modified input_GF.nml. For example, if you run the TWP-ICE case, make a copy of gmtb-scm/scm/etc/case_config/twpice.nml, rename it twpice_GF.nml (or similar) and edit the physics_nml variable within to point to your new input_GF.nml file.
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.
As far as I can see, this has not been addressed yet.