Skip to content

Commit

Permalink
Merge pull request #238 from grantfirl/rrfsv1-to-ufs/dev9
Browse files Browse the repository at this point in the history
Ninth reconciliation PR from production/RRFS.v1
  • Loading branch information
grantfirl authored Jan 16, 2025
2 parents 24643b0 + 0b42661 commit 449343f
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 52 deletions.
6 changes: 3 additions & 3 deletions physics/CONV/Grell_Freitas/cu_gf_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ end subroutine cu_gf_driver_init
!! \htmlinclude cu_gf_driver_run.html
!!
!>\section gen_gf_driver Grell-Freitas Cumulus Scheme Driver General Algorithm
subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart, gf_coldstart, &
cactiv,cactiv_m,g,cp,xlv,r_v,forcet,forceqv_spechum,phil,raincv, &
qv_spechum,t,cld1d,us,vs,t2di,w,qv2di_spechum,p2di,psuri, &
hbot,htop,kcnv,xland,hfx2,qfx2,aod_gf,cliw,clcw, &
Expand Down Expand Up @@ -97,7 +97,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
integer :: its,ite, jts,jte, kts,kte
integer, intent(in ) :: im,km,ntracer,nchem,kdt
integer, intent(in ) :: ichoice_in,ichoicem_in,ichoice_s_in
logical, intent(in ) :: flag_init, flag_restart, do_mynnedmf
logical, intent(in ) :: flag_init, flag_restart, do_mynnedmf, gf_coldstart
logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend
real (kind=kind_phys), intent(in) :: g,cp,xlv,r_v
logical, intent(in ) :: ldiag3d
Expand Down Expand Up @@ -431,7 +431,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
ccn_m(i) = 0.

! set aod and ccn
if (flag_init .and. .not.flag_restart) then
if ((flag_init .and. .not.flag_restart) .or. gf_coldstart) then
aod_gf(i)=aodc0
else
if((cactiv(i).eq.0) .and. (cactiv_m(i).eq.0))then
Expand Down
7 changes: 7 additions & 0 deletions physics/CONV/Grell_Freitas/cu_gf_driver.meta
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,13 @@
dimensions = ()
type = logical
intent = in
[gf_coldstart]
standard_name = flag_for_cold_start_gf
long_name = flag to cold start G-F
units = flag
dimensions = ()
type = logical
intent = in
[ichoice_in]
standard_name = identifier_for_c3_or_gf_deep_convection_closure
long_name = flag for C3 or GF deep convection closure
Expand Down
5 changes: 3 additions & 2 deletions physics/CONV/Grell_Freitas/cu_gf_driver_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module cu_gf_driver_pre
!> \section arg_table_cu_gf_driver_pre_run Argument Table
!! \htmlinclude cu_gf_driver_pre_run.html
!!
subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, prevst, prevsq, &
subroutine cu_gf_driver_pre_run (flag_init, flag_restart, gf_coldstart, kdt, fhour, dtp, t, q, prevst, prevsq, &
forcet, forceq, cactiv, cactiv_m, conv_act, conv_act_m, &
rrfs_sd, ntsmoke, ntdust, ntcoarsepm, chem3d, gq0, &
errmsg, errflg)
Expand All @@ -26,6 +26,7 @@ subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q,

logical, intent(in) :: flag_init
logical, intent(in) :: flag_restart
logical, intent(in) :: gf_coldstart
logical, intent(in) :: rrfs_sd
integer, intent(in) :: kdt
real(kind_phys), intent(in) :: fhour
Expand Down Expand Up @@ -59,7 +60,7 @@ subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q,
! For restart runs, can assume that prevst and prevsq
! are read from the restart files beforehand, same
! for conv_act.
if(flag_init .and. .not.flag_restart) then
if((flag_init .and. .not.flag_restart) .or. gf_coldstart) then
!$acc kernels
forcet(:,:)=0.0
forceq(:,:)=0.0
Expand Down
7 changes: 7 additions & 0 deletions physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@
kind = kind_phys
intent = in
optional = True
[gf_coldstart]
standard_name = flag_for_cold_start_gf
long_name = flag to cold start G-F
units = flag
dimensions = ()
type = logical
intent = in
[rrfs_sd]
standard_name = do_smoke_coupling
long_name = flag controlling rrfs_sd collection
Expand Down
39 changes: 11 additions & 28 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ module GFS_phys_time_vary

private

public GFS_phys_time_vary_init, GFS_phys_time_vary_timestep_init, GFS_phys_time_vary_timestep_finalize, GFS_phys_time_vary_finalize

logical :: is_initialized = .false.
public GFS_phys_time_vary_init, GFS_phys_time_vary_timestep_init, GFS_phys_time_vary_finalize

real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys
real(kind=kind_phys), parameter :: con_99 = 99.0_kind_phys
Expand Down Expand Up @@ -95,7 +93,8 @@ subroutine GFS_phys_time_vary_init (
smcwtdxy, deeprechxy, rechxy, snowxy, snicexy, snliqxy, tsnoxy , smoiseq, zsnsoxy, &
slc, smc, stc, tsfcl, snowd, canopy, tg3, stype, con_t0c, lsm_cold_start, nthrds, &
lkm, use_lake_model, lakefrac, lakedepth, iopt_lake, iopt_lake_clm, iopt_lake_flake, &
lakefrac_threshold, lakedepth_threshold, ozphys, h2ophys, errmsg, errflg)
lakefrac_threshold, lakedepth_threshold, ozphys, h2ophys, is_initialized, errmsg, &
errflg)

implicit none

Expand Down Expand Up @@ -193,6 +192,7 @@ subroutine GFS_phys_time_vary_init (
real(kind_phys), intent(in) :: con_t0c

integer, intent(in) :: nthrds
logical, intent(inout) :: is_initialized
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

Expand Down Expand Up @@ -713,7 +713,8 @@ subroutine GFS_phys_time_vary_timestep_init (
tsfc, tsfco, tisfc, hice, fice, facsf, facwf, alvsf, alvwf, alnsf, alnwf, zorli, zorll, &
zorlo, weasd, slope, snoalb, canopy, vfrac, vtype, stype,scolor, shdmin, shdmax, snowd, &
cv, cvb, cvt, oro, oro_uf, xlat_d, xlon_d, slmsk, landfrac, ozphys, h2ophys, &
do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, tau_amf, errmsg, errflg)
do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau, tau_amf, is_initialized, &
errmsg, errflg)

implicit none

Expand Down Expand Up @@ -762,6 +763,7 @@ subroutine GFS_phys_time_vary_timestep_init (
real(kind_phys), intent(inout), optional :: smois(:,:), sh2o(:,:), tslb(:,:), tref(:)
integer, intent(inout) :: vtype(:), stype(:),scolor(:), slope(:)

logical, intent(in) :: is_initialized
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

Expand Down Expand Up @@ -931,36 +933,17 @@ subroutine GFS_phys_time_vary_timestep_init (
end subroutine GFS_phys_time_vary_timestep_init
!> @}

!> \section arg_table_GFS_phys_time_vary_timestep_finalize Argument Table
!! \htmlinclude GFS_phys_time_vary_timestep_finalize.html
!!
!>\section gen_GFS_phys_time_vary_timestep_finalize GFS_phys_time_vary_timestep_finalize General Algorithm
!> @{
subroutine GFS_phys_time_vary_timestep_finalize (errmsg, errflg)

implicit none

! Interface variables
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

! Initialize CCPP error handling variables
errmsg = ''
errflg = 0

end subroutine GFS_phys_time_vary_timestep_finalize
!> @}

!> \section arg_table_GFS_phys_time_vary_finalize Argument Table
!! \htmlinclude GFS_phys_time_vary_finalize.html
!!
subroutine GFS_phys_time_vary_finalize(errmsg, errflg)
subroutine GFS_phys_time_vary_finalize(is_initialized, errmsg, errflg)

implicit none

! Interface variables
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
logical, intent(inout) :: is_initialized
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg

! Initialize CCPP error handling variables
errmsg = ''
Expand Down
39 changes: 20 additions & 19 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,13 @@
dimensions = ()
type = ty_h2ophys
intent = in
[is_initialized]
standard_name = flag_for_gfs_phys_time_vary_interstitial_initialization
long_name = flag carrying interstitial initialization status
units = flag
dimensions = ()
type = logical
intent = inout
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand All @@ -1062,6 +1069,13 @@
[ccpp-arg-table]
name = GFS_phys_time_vary_finalize
type = scheme
[is_initialized]
standard_name = flag_for_gfs_phys_time_vary_interstitial_initialization
long_name = flag carrying interstitial initialization status
units = flag
dimensions = ()
type = logical
intent = inout
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down Expand Up @@ -2055,26 +2069,13 @@
dimensions = ()
type = ty_h2ophys
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
units = none
dimensions = ()
type = character
kind = len=*
intent = out
[errflg]
standard_name = ccpp_error_code
long_name = error code for error handling in CCPP
units = 1
[is_initialized]
standard_name = flag_for_gfs_phys_time_vary_interstitial_initialization
long_name = flag carrying interstitial initialization status
units = flag
dimensions = ()
type = integer
intent = out

########################################################################
[ccpp-arg-table]
name = GFS_phys_time_vary_timestep_finalize
type = scheme
type = logical
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down

0 comments on commit 449343f

Please sign in to comment.