Skip to content

Commit

Permalink
Ensuring the moisture budget is correct via PBL, microphysics coupling
Browse files Browse the repository at this point in the history
  • Loading branch information
lisa-bengtsson committed Apr 18, 2022
1 parent 235ec38 commit 842eae3
Show file tree
Hide file tree
Showing 7 changed files with 274 additions and 56 deletions.
26 changes: 21 additions & 5 deletions physics/GFS_MP_generic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,15 @@ end subroutine GFS_MP_generic_post_init
!> @{
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, con_g, rainmin, dtf, frain, rainc, &
imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, 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, &
drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, &
graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, &
dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d, lssav, num_dfi_radar, fh_dfi_radar, &
index_of_process_dfi_radar, ix_dfi_radar, dfi_radar_tten, radar_tten_limits, fhour, errmsg, errflg)
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, qgrs_dsave, &
errmsg, errflg)
!
use machine, only: kind_phys

Expand All @@ -104,7 +105,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
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, progsigma
integer, intent(in) :: index_of_temperature,index_of_process_mp

integer :: dfi_radar_max_intervals
Expand Down Expand Up @@ -148,7 +149,8 @@ subroutine GFS_MP_generic_post_run(
real(kind=kind_phys), dimension(:), intent(inout) :: diceprv
real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv
real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv

real(kind=kind_phys), dimension(:,:), intent(out) :: dqdt_qmicro
real(kind=kind_phys), dimension(:,:), intent(out) :: qgrs_dsave
real(kind=kind_phys), intent(in) :: dtp

! CCPP error handling
Expand Down Expand Up @@ -420,6 +422,15 @@ subroutine GFS_MP_generic_post_run(
endif if_tendency_diagnostics
endif if_save_fields

!If prognostic updraft area fraction is used in saSAS
if(progsigma)then
do k=1,levs
do i=1,im
dqdt_qmicro(i,k)=(gq0(i,k,1)-save_q(i,k,1))/dtp
enddo
enddo
endif

if (cplflx .or. cplchm) then
do i = 1, im
dsnow_cpl(i)= max(zero, rain(i) * srflag(i))
Expand Down Expand Up @@ -455,6 +466,11 @@ subroutine GFS_MP_generic_post_run(
pwat(i) = pwat(i) * onebg
enddo

do k = 1, levs
do i=1, im
qgrs_dsave(i,k) = gq0(i,k,1)
enddo
enddo

end subroutine GFS_MP_generic_post_run
!> @}
Expand Down
23 changes: 23 additions & 0 deletions physics/GFS_MP_generic.meta
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@
dimensions = ()
type = logical
intent = in
[progsigma]
standard_name = flag_for_prognostic_sigma
long_name = flag for prognostic sigma
units = flag
dimensions = ()
type = logical
intent = in
[con_g]
standard_name = gravitational_acceleration
long_name = gravitational acceleration
Expand Down Expand Up @@ -844,6 +851,22 @@
dimensions = ()
type = logical
intent = in
[dqdt_qmicro]
standard_name = instantanious_moisture_tendency_due_to_microphysics
long_name = moisture tendency due to microphysics
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
[qgrs_dsave]
standard_name = tracer_concentration_dsave
long_name = model layer mean tracer concentration dsave
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
intent = out
[lssav]
standard_name = flag_for_diagnostics
long_name = logical flag for storing diagnostics
Expand Down
33 changes: 4 additions & 29 deletions physics/progsigma_calc.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
!!\section progsigma General Algorithm
!> @{

subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_deep, &
subroutine progsigma_calc (im,km,flag_init,flag_restart, &
del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,hvap,delt, &
qgrs_dsave,q,kbcon1,ktcon,cnvflg,gdx, &
do_ca, ca_closure, ca_entr, ca_trigger, nthresh, ca_deep, &
ca_turb,ca_micro,ca_shal,ca_rad,convcount,ca1,ca2,ca3,ca4, &
sigmain,sigmaout,sigmab,errmsg,errflg)
ca_micro,sigmain,sigmaout,sigmab,errmsg,errflg)
!
!
use machine, only : kind_phys
Expand All @@ -31,12 +30,10 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_deep, &
real, intent(in) :: qgrs_dsave(im,km), q(im,km),del(im,km), &
qmicro(im,km),tmf(im,km),dbyo1(im,km),zdqca(im,km), &
omega_u(im,km),zeta(im,km),gdx(im)
logical, intent(in) :: flag_init,flag_restart,flag_deep,cnvflg(im)
logical, intent(in) :: flag_init,flag_restart,cnvflg(im)
real(kind=kind_phys), intent(in) :: nthresh
real(kind=kind_phys), intent(in) :: ca_deep(im)
real(kind=kind_phys), intent(out):: ca_turb(im), &
ca_micro(im),ca_rad(im),ca_shal(im),convcount(im),ca1(im), &
ca2(im),ca3(im),ca4(im)
real(kind=kind_phys), intent(out):: ca_micro(im)
logical, intent(in) :: do_ca,ca_closure,ca_entr,ca_trigger

real(kind=kind_phys), intent(in) :: sigmain(im,km)
Expand Down Expand Up @@ -87,19 +84,6 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_deep, &
mcons(i)=0.
enddo

!Temporary Initialization output:
do i = 1,im
if(flag_deep)then
!ca_turb(i)=0.
ca_shal(i)=0.
endif
if(.not. flag_deep)then
ca_rad(i)=0.
convcount(i)=0.
ca1(i)=0.
endif
enddo

!Initial computations, place maximum sigmain in sigmab

do k=2,km
Expand Down Expand Up @@ -232,15 +216,6 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_deep, &
sigmab(i)=MAX(sigmab(i),0.01)
endif

if(flag_deep)then
!ca_turb(i)=ZCVG
ca_shal(i)=termC(i)
else
ca_rad(i)=ZCVG
ca1(i)=termC(i)
endif
!ca3(i)=sigmab(i)

endif!cnvflg
enddo

Expand Down
Loading

0 comments on commit 842eae3

Please sign in to comment.