Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ elseif (${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel")
./physics/wv_saturation.F
./physics/cldwat2m_micro.F
./physics/surface_perturbation.F90
./physics/cu_gf_deep.F90
./physics/cu_gf_sh.F90
PROPERTIES COMPILE_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -ftz")
# Replace -xHost or -xCORE-AVX2 with -xCORE-AVX-I for certain files (following FV3/gfsphysics/makefile)
set(CMAKE_Fortran_FLAGS_LOPT ${CMAKE_Fortran_FLAGS})
Expand Down
4 changes: 2 additions & 2 deletions input.nml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@
random_clds = .true.
trans_trac = .true.
cnvcld = .true.
imfshalcnv = 2

Copy link
Copy Markdown
Collaborator

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).

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown
Collaborator

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.

imfdeepcnv = 2
imfshalcnv = 3
imfdeepcnv = 3
cdmbgwd = 3.5,0.25
prslrd0 = 0.
ivegsrc = 1
Expand Down
4,754 changes: 4,754 additions & 0 deletions physics/cu_gf_deep.F90

Large diffs are not rendered by default.

786 changes: 786 additions & 0 deletions physics/cu_gf_driver.F90

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions physics/cu_gf_driver_post.F90
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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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
66 changes: 66 additions & 0 deletions physics/cu_gf_driver_pre.F90
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 |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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
Loading