Skip to content
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

Bring external land model support #10

Merged
8 changes: 4 additions & 4 deletions physics/GFS_MP_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module GFS_MP_generic_post
!> @{
subroutine GFS_MP_generic_post_run( &
im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, &
imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, progsigma, con_g, rainmin, dtf, frain, rainc, &
imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rainmin, dtf, frain, rainc, &
rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0,&
graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, &
totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat, &
Expand All @@ -37,7 +37,7 @@ subroutine GFS_MP_generic_post_run(
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
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, progsigma
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma
integer, intent(in) :: index_of_temperature,index_of_process_mp

integer :: dfi_radar_max_intervals
Expand Down Expand Up @@ -363,7 +363,7 @@ subroutine GFS_MP_generic_post_run(
enddo
endif

if (cplflx .or. cplchm) then
if (cplflx .or. cplchm .or. cpllnd) then
do i = 1, im
dsnow_cpl(i)= max(zero, rain(i) * srflag(i))
drain_cpl(i)= max(zero, rain(i) - dsnow_cpl(i))
Expand All @@ -372,7 +372,7 @@ subroutine GFS_MP_generic_post_run(
enddo
endif

if (cplchm) then
if (cplchm .or. cpllnd) then
do i = 1, im
rainc_cpl(i) = rainc_cpl(i) + rainc(i)
enddo
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_MP_generic_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@
dimensions = ()
type = logical
intent = in
[cpllnd]
standard_name = flag_for_land_coupling
long_name = flag controlling cpllnd collection (default off)
units = flag
dimensions = ()
type = logical
intent = in
[progsigma]
standard_name = do_prognostic_updraft_area_fraction
long_name = flag for prognostic sigma in cumulus scheme
Expand Down
14 changes: 10 additions & 4 deletions physics/GFS_stochastics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc
gu0, gv0, gt0, gq0_wv, dtdtnp, &
gq0_cw, gq0_rw, gq0_sw, gq0_iw, gq0_gl, &
rain, rainc, tprcp, totprcp, cnvprcp, &
totprcpb, cnvprcpb, cplflx, &
totprcpb, cnvprcpb, cplflx, cpllnd, &
rain_cpl, snow_cpl, drain_cpl, dsnow_cpl, &
ntcw,ntrw,ntsw,ntiw,ntgl, &
errmsg, errflg)
Expand Down Expand Up @@ -128,8 +128,10 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc
real(kind_phys), dimension(:), intent(inout) :: totprcpb
real(kind_phys), dimension(:), intent(inout) :: cnvprcpb
logical, intent(in) :: cplflx
! rain_cpl, snow_cpl only allocated if cplflx == .true. or cplchm == .true.
logical, intent(in) :: cpllnd
! rain_cpl only allocated if cplflx == .true. or cplchm == .true. or cpllnd == .true.
real(kind_phys), dimension(:), intent(inout) :: rain_cpl
! snow_cpl only allocated if cplflx == .true. or cplchm == .true.
real(kind_phys), dimension(:), intent(inout) :: snow_cpl
! drain_cpl, dsnow_cpl only allocated if cplflx == .true. or cplchm == .true.
real(kind_phys), dimension(:), intent(in) :: drain_cpl
Expand Down Expand Up @@ -240,8 +242,10 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc
totprcpb(:) = totprcpb(:) + (sppt_wts(:,15) - 1 )*rain(:)
cnvprcpb(:) = cnvprcpb(:) + (sppt_wts(:,15) - 1 )*rainc(:)

if (cplflx) then
if (cplflx .or. cpllnd) then
rain_cpl(:) = rain_cpl(:) + (sppt_wts(:,15) - 1.0)*drain_cpl(:)
endif
if (cplflx) then
snow_cpl(:) = snow_cpl(:) + (sppt_wts(:,15) - 1.0)*dsnow_cpl(:)
endif
!zero out radiative heating tendency for next physics step
Expand Down Expand Up @@ -342,8 +346,10 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc
totprcpb(:) = totprcpb(:) + (ca(:,15) - 1 )*rain(:)
cnvprcpb(:) = cnvprcpb(:) + (ca(:,15) - 1 )*rainc(:)

if (cplflx) then
if (cplflx .or. cpllnd) then
rain_cpl(:) = rain_cpl(:) + (ca(:,15) - 1.0)*drain_cpl(:)
endif
if (cplflx) then
snow_cpl(:) = snow_cpl(:) + (ca(:,15) - 1.0)*dsnow_cpl(:)
endif
!zero out radiative heating tendency for next physics step
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_stochastics.meta
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@
dimensions = ()
type = logical
intent = in
[cpllnd]
standard_name = flag_for_land_coupling
long_name = flag controlling cpllnd collection (default off)
units = flag
dimensions = ()
type = logical
intent = in
[rain_cpl]
standard_name = cumulative_lwe_thickness_of_precipitation_amount_for_coupling
long_name = total rain precipitation
Expand Down
19 changes: 13 additions & 6 deletions physics/GFS_surface_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ end subroutine GFS_surface_generic_post_init
!> \section arg_table_GFS_surface_generic_post_run Argument Table
!! \htmlinclude GFS_surface_generic_post_run.html
!!
subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, lssav, dry, icy, wet, &
subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpllnd, lssav, dry, icy, wet, &
lsm, lsm_noahmp, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, &
adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, &
adjvisbmu, adjvisdfu, t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, pah, pahi, &
Expand All @@ -58,7 +58,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, lss
implicit none

integer, intent(in) :: im
logical, intent(in) :: cplflx, cplaqm, cplchm, cplwav, lssav
logical, intent(in) :: cplflx, cplaqm, cplchm, cplwav, cpllnd, lssav
logical, dimension(:), intent(in) :: dry, icy, wet
integer, intent(in) :: lsm, lsm_noahmp
real(kind=kind_phys), intent(in) :: dtf
Expand Down Expand Up @@ -121,18 +121,24 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, lss
enddo
endif

if (cplflx .or. cplchm) then
if (cplflx .or. cplchm .or. cpllnd) then
do i=1,im
tsfci_cpl(i) = tsfc(i)
enddo
endif

if (cplflx .or. cpllnd) then
do i=1,im
dlwsfc_cpl (i) = dlwsfc_cpl(i) + adjsfcdlw(i)*dtf
dswsfc_cpl (i) = dswsfc_cpl(i) + adjsfcdsw(i)*dtf
psurfi_cpl (i) = pgr(i)
enddo
endif

if (cplflx) then
do i=1,im
dlwsfci_cpl (i) = adjsfcdlw(i)
dswsfci_cpl (i) = adjsfcdsw(i)
dlwsfc_cpl (i) = dlwsfc_cpl(i) + adjsfcdlw(i)*dtf
dswsfc_cpl (i) = dswsfc_cpl(i) + adjsfcdsw(i)*dtf
dnirbmi_cpl (i) = adjnirbmd(i)
dnirdfi_cpl (i) = adjnirdfd(i)
dvisbmi_cpl (i) = adjvisbmd(i)
Expand All @@ -148,12 +154,13 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, lss
nlwsfc_cpl (i) = nlwsfc_cpl(i) + nlwsfci_cpl(i)*dtf
t2mi_cpl (i) = t2m(i)
q2mi_cpl (i) = q2m(i)
psurfi_cpl (i) = pgr(i)
enddo
endif

! --- estimate mean albedo for ocean point without ice cover and apply
! them to net SW heat fluxes

if (cplflx .or. cpllnd) then
do i=1,im
! if (Sfcprop%landfrac(i) < one) then ! Not 100% land
if (wet(i)) then ! some open water
Expand Down
7 changes: 7 additions & 0 deletions physics/GFS_surface_generic_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@
dimensions = ()
type = logical
intent = in
[cpllnd]
standard_name = flag_for_land_coupling
long_name = flag controlling cpllnd collection (default off)
units = flag
dimensions = ()
type = logical
intent = in
[lssav]
standard_name = flag_for_diagnostics
long_name = logical flag for storing diagnostics
Expand Down