Skip to content

Commit

Permalink
Merge pull request #1016 from grantfirl/ufs-dev-PR26
Browse files Browse the repository at this point in the history
UFS-dev PR#26
  • Loading branch information
grantfirl committed Jun 29, 2023
2 parents d8a5b1f + 4d69108 commit 92c8a9e
Show file tree
Hide file tree
Showing 37 changed files with 7,550 additions and 403 deletions.
13 changes: 10 additions & 3 deletions physics/GFS_MP_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ subroutine GFS_MP_generic_post_run(
graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, &
dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, &
fh_dfi_radar,index_of_process_dfi_radar, ix_dfi_radar, dfi_radar_tten, radar_tten_limits, fhour, prevsq, &
errmsg, errflg)
iopt_lake, iopt_lake_clm, lkm, use_lake_model, errmsg, errflg)
!
use machine, only: kind_phys
use calpreciptype_mod, only: calpreciptype
implicit none

integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires
integer, intent(in) :: imp_physics_nssl
integer, intent(in) :: imp_physics_nssl, iopt_lake_clm, iopt_lake, lkm
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma, exticeden
integer, intent(in) :: index_of_temperature,index_of_process_mp
integer, intent(in) :: index_of_temperature,index_of_process_mp,use_lake_model(:)

integer :: dfi_radar_max_intervals
real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour
Expand Down Expand Up @@ -228,6 +228,13 @@ subroutine GFS_MP_generic_post_run(
dgraupelprv(:) = tem * graupelprv(:)
diceprv(:) = tem * iceprv(:)
end if
else if(lkm>0 .and. iopt_lake==iopt_lake_clm) then
do i=1,im
if(use_lake_model(i)>0) then
raincprv(i) = rainc(i)
rainncprv(i) = frain * rain1(i)
end if
end do
end if

if (cal_pre) then ! hchuang: add dominant precipitation type algorithm
Expand Down
28 changes: 28 additions & 0 deletions physics/GFS_MP_generic_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,34 @@
dimensions = ()
type = logical
intent = in
[lkm]
standard_name = control_for_lake_model_execution_method
long_name = control for lake model execution: 0=no lake, 1=lake, 2=lake+nsst
units = flag
dimensions = ()
type = integer
intent = in
[iopt_lake]
standard_name = control_for_lake_model_selection
long_name = control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[iopt_lake_clm]
standard_name = clm_lake_model_control_selection_value
long_name = value that indicates clm lake model in the control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[use_lake_model]
standard_name = flag_for_using_lake_model
long_name = flag indicating lake points using a lake model
units = flag
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
32 changes: 29 additions & 3 deletions physics/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,22 @@ subroutine GFS_phys_time_vary_init (
zwtxy, xlaixy, xsaixy, lfmassxy, stmassxy, rtmassxy, woodxy, stblcpxy, fastcpxy, &
smcwtdxy, deeprechxy, rechxy, snowxy, snicexy, snliqxy, tsnoxy , smoiseq, zsnsoxy, &
slc, smc, stc, tsfcl, snowd, canopy, tg3, stype, con_t0c, lsm_cold_start, nthrds, &
errmsg, errflg)
lkm, use_lake_model, lakefrac, lakedepth, iopt_lake, iopt_lake_clm, iopt_lake_flake, &
lakefrac_threshold, lakedepth_threshold, errmsg, errflg)

implicit none

! Interface variables
integer, intent(in) :: me, master, ntoz, iccn, iflip, im, nx, ny, levs, iaermdl
logical, intent(in) :: h2o_phys, iaerclm, lsm_cold_start
integer, intent(in) :: idate(:)
real(kind_phys), intent(in) :: fhour
integer, intent(in) :: idate(:), iopt_lake, iopt_lake_clm, iopt_lake_flake
real(kind_phys), intent(in) :: fhour, lakefrac_threshold, lakedepth_threshold
real(kind_phys), intent(in) :: xlat_d(:), xlon_d(:)

integer, intent(in) :: lkm
integer, intent(inout) :: use_lake_model(:)
real(kind=kind_phys), intent(in ) :: lakefrac(:), lakedepth(:)

integer, intent(inout) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:)
real(kind_phys), intent(inout) :: ddy_o3(:), ddy_h(:)
real(kind_phys), intent(in) :: ozpl(:,:,:), h2opl(:,:,:)
Expand Down Expand Up @@ -670,6 +675,27 @@ subroutine GFS_phys_time_vary_init (
endif noahmp_init
endif lsm_init

!Lake model
if(lkm>0 .and. iopt_lake>0) then
! A lake model is enabled.
do i = 1, im
!if (lakefrac(i) > 0.0 .and. lakedepth(i) > 1.0 ) then

! The lake data must say there's a lake here (lakefrac) with a depth (lakedepth)
if (lakefrac(i) > lakefrac_threshold .and. lakedepth(i) > lakedepth_threshold ) then
! This is a lake point. Inform the other schemes to use a lake model, and possibly nsst (lkm)
use_lake_model(i) = lkm
cycle
else
! Not a valid lake point.
use_lake_model(i) = 0
endif
enddo
else
! Lake model is disabled or settings are invalid.
use_lake_model = 0
endif

is_initialized = .true.

contains
Expand Down
67 changes: 67 additions & 0 deletions physics/GFS_phys_time_vary.fv3.meta
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,73 @@
dimensions = ()
type = integer
intent = in
[lkm]
standard_name = control_for_lake_model_execution_method
long_name = control for lake model execution: 0=no lake, 1=lake, 2=lake+nsst
units = flag
dimensions = ()
type = integer
intent = in
[use_lake_model]
standard_name = flag_for_using_lake_model
long_name = flag indicating lake points using a lake model
units = flag
dimensions = (horizontal_dimension)
type = integer
intent = inout
[lakefrac]
standard_name = lake_area_fraction
long_name = fraction of horizontal grid area occupied by lake
units = frac
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
[lakedepth]
standard_name = lake_depth
long_name = lake depth
units = m
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = in
[iopt_lake]
standard_name = control_for_lake_model_selection
long_name = control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[iopt_lake_clm]
standard_name = clm_lake_model_control_selection_value
long_name = value that indicates clm lake model in the control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[iopt_lake_flake]
standard_name = flake_model_control_selection_value
long_name = value that indicates flake model in the control for lake model selection
units = 1
dimensions = ()
type = integer
intent = in
[lakefrac_threshold]
standard_name = lakefrac_threshold_for_enabling_lake_model
long_name = fraction of horizontal grid area occupied by lake must be greater than this value to enable a lake model
units = frac
dimensions = ()
type = real
kind = kind_phys
intent = in
[lakedepth_threshold]
standard_name = lake_depth_threshold_for_enabling_lake_model
long_name = lake depth must be greater than this value to enable a lake model
units = m
dimensions = ()
type = real
kind = kind_phys
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
6 changes: 3 additions & 3 deletions physics/GFS_radiation_surface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ subroutine GFS_radiation_surface_run ( &
lsm_ruc, xlat, xlon, slmsk, lndp_type, n_var_lndp, sfc_alb_pert,&
lndp_var_list, lndp_prt_list, landfrac, snodl, snodi, sncovr, &
sncovr_ice, fice, zorl, hprime, tsfg, tsfa, tisfc, coszen, &
cplice, min_seaice, min_lakeice, lakefrac, use_flake, &
cplice, min_seaice, min_lakeice, lakefrac, use_lake_model, &
alvsf, alnsf, alvwf, alnwf, facsf, facwf, &
semis_lnd, semis_ice, semis_wat, snoalb, use_cice_alb, con_ttp, &
albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, &
Expand All @@ -69,7 +69,7 @@ subroutine GFS_radiation_surface_run ( &
logical, intent(in) :: frac_grid, lslwr, lsswr, use_cice_alb, cplice
integer, intent(in) :: lsm, lsm_noahmp, lsm_ruc, lndp_type, n_var_lndp
real(kind=kind_phys), intent(in) :: min_seaice, min_lakeice, con_ttp
logical, dimension(:), intent(in) :: use_flake
integer, dimension(:), intent(in) :: use_lake_model

real(kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, slmsk, &
sfc_alb_pert, lndp_prt_list, &
Expand Down Expand Up @@ -154,7 +154,7 @@ subroutine GFS_radiation_surface_run ( &
!> - Call module_radiation_surface::setemis(),to set up surface
!! emissivity for LW radiation.
call setemis (lsm, lsm_noahmp, lsm_ruc, frac_grid, cplice, &
use_flake, lakefrac, xlon, xlat, slmsk, &
use_lake_model, lakefrac, xlon, xlat, slmsk, &
! frac_grid, min_seaice, xlon, xlat, slmsk, &
snodl, snodi, sncovr, sncovr_ice, zorl, tsfg, &
tsfa, hprime, semis_lnd, semis_ice, semis_wat,&
Expand Down
8 changes: 4 additions & 4 deletions physics/GFS_radiation_surface.meta
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@
type = real
kind = kind_phys
intent = in
[use_flake]
standard_name = flag_for_using_flake
long_name = flag indicating lake points using flake model
[use_lake_model]
standard_name = flag_for_using_lake_model
long_name = flag indicating lake points using a lake model
units = flag
dimensions = (horizontal_loop_extent)
type = logical
type = integer
intent = inout
[alvsf]
standard_name = vis_albedo_strong_cosz
Expand Down
8 changes: 5 additions & 3 deletions physics/GFS_surface_composites_inter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ module GFS_surface_composites_inter
!!
subroutine GFS_surface_composites_inter_run (im, dry, icy, wet, semis_wat, semis_lnd, semis_ice, &
adjsfcdlw, gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat,&
adjsfcusw, adjsfcdsw, adjsfcnsw, errmsg, errflg)
adjsfcusw, adjsfcdsw, adjsfcnsw, use_lake_model, errmsg, errflg)

implicit none

! Interface variables
integer, intent(in ) :: im
logical, dimension(:), intent(in ) :: dry, icy, wet
logical, dimension(:), intent(in ) :: dry, icy
logical, dimension(:), intent(inout) :: wet
real(kind=kind_phys), dimension(:), intent(in ) :: semis_wat, semis_lnd, semis_ice, &
adjsfcdlw, adjsfcdsw, adjsfcnsw
real(kind=kind_phys), dimension(:), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat
real(kind=kind_phys), dimension(:), intent(out) :: adjsfcusw
integer, dimension(:), intent(in) :: use_lake_model

! CCPP error handling
character(len=*), intent(out) :: errmsg
Expand Down Expand Up @@ -68,4 +70,4 @@ subroutine GFS_surface_composites_inter_run (im, dry, icy, wet, semis_wat, semis

end subroutine GFS_surface_composites_inter_run

end module GFS_surface_composites_inter
end module GFS_surface_composites_inter
11 changes: 9 additions & 2 deletions physics/GFS_surface_composites_inter.meta
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
units = flag
dimensions = (horizontal_loop_extent)
type = logical
intent = in
intent = inout
[semis_wat]
standard_name = surface_longwave_emissivity_over_water
long_name = surface lw emissivity in fraction over water
Expand Down Expand Up @@ -116,6 +116,13 @@
type = real
kind = kind_phys
intent = in
[use_lake_model]
standard_name = flag_for_using_lake_model
long_name = flag indicating lake points using a lake model
units = flag
dimensions = (horizontal_loop_extent)
type = integer
intent = in
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand All @@ -130,4 +137,4 @@
units = 1
dimensions = ()
type = integer
intent = out
intent = out
Loading

0 comments on commit 92c8a9e

Please sign in to comment.