Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
branch = main
[submodule "ccpp/physics"]
path = ccpp/physics
url = https://github.com/NCAR/ccpp-physics
branch = main
url = https://github.com/RuiyuSun/ccpp-physics
branch = innerloop
7 changes: 6 additions & 1 deletion ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ module GFS_typedefs
logical :: lradar !< flag for radar reflectivity
real(kind=kind_phys) :: nsradar_reset !< seconds between resetting radar reflectivity calculation
real(kind=kind_phys) :: ttendlim !< temperature tendency limiter per time step in K/s
real(kind=kind_phys) :: dt_inner !< time step for the inner loop in s

!--- GFDL microphysical paramters
logical :: lgfdlmprad !< flag for GFDL mp scheme and radiation consistency
Expand Down Expand Up @@ -3155,6 +3156,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: lradar = .false. !< flag for radar reflectivity
real(kind=kind_phys) :: nsradar_reset = -999.0 !< seconds between resetting radar reflectivity calculation, set to <0 for every time step
real(kind=kind_phys) :: ttendlim = -999.0 !< temperature tendency limiter, set to <0 to deactivate
real(kind=kind_phys) :: dt_inner = 600. !< time step for the inner loop

!--- GFDL microphysical parameters
logical :: lgfdlmprad = .false. !< flag for GFDLMP radiation interaction
Expand Down Expand Up @@ -3503,7 +3505,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
mg_ncnst, mg_ninst, mg_ngnst, sed_supersat, do_sb_physics, &
mg_alf, mg_qcmin, mg_do_ice_gmao, mg_do_liq_liu, &
ltaerosol, lradar, nsradar_reset, lrefres, ttendlim, &
lgfdlmprad, &
lgfdlmprad, dt_inner, &
!--- max hourly
avg_max_length, &
!--- land/surface model control
Expand Down Expand Up @@ -3930,6 +3932,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%lradar = lradar
Model%nsradar_reset = nsradar_reset
Model%ttendlim = ttendlim
Model%dt_inner = dt_inner
!--- F-A MP parameters
Model%rhgrd = rhgrd
Model%spec_adv = spec_adv
Expand Down Expand Up @@ -4795,6 +4798,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
if (Model%me == Model%master) print *,' Using Thompson double moment microphysics', &
' ltaerosol = ',Model%ltaerosol, &
' ttendlim =',Model%ttendlim, &
' dt_inner =',Model%dt_inner, &
' effr_in =',Model%effr_in, &
' lradar =',Model%lradar, &
' nsradar_reset =',Model%nsradar_reset, &
Expand Down Expand Up @@ -5104,6 +5108,7 @@ subroutine control_print(Model)
print *, ' nsradar_reset : ', Model%nsradar_reset
print *, ' lrefres : ', Model%lrefres
print *, ' ttendlim : ', Model%ttendlim
print *, ' dt_inner : ', Model%dt_inner
print *, ' '
endif
if (Model%imp_physics == Model%imp_physics_mg) then
Expand Down
7 changes: 7 additions & 0 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -3426,6 +3426,13 @@
dimensions = ()
type = real
kind = kind_phys
[dt_inner]
standard_name = time_step_for_inner_loop
long_name = time step for inner loop
units = s
dimensions = ()
type = real
kind = kind_phys
[lgfdlmprad]
standard_name = flag_for_GFDL_microphysics_radiation_interaction
long_name = flag for GFDL microphysics-radiation interaction
Expand Down
2 changes: 1 addition & 1 deletion ccpp/physics
61 changes: 56 additions & 5 deletions io/post_gfs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ subroutine post_run_gfs(wrt_int_state,mypei,mpicomp,lead_write, &
!
! revision history:
! Jul 2019 J. Wang create interface to run inline post for FV3
! Apr 2021 R. Sun Added variables for Thomspon MP
!
!-----------------------------------------------------------------------
!*** run post on write grid comp
Expand Down Expand Up @@ -342,7 +343,7 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, &
use vrbls3d, only: t, q, uh, vh, wh, alpint, dpres, zint, zmid, o3, &
qqr, qqs, cwm, qqi, qqw, qqg, omga, cfr, pmid, &
q2, rlwtt, rswtt, tcucn, tcucns, train, el_pbl, &
pint, exch_h, ref_10cm
pint, exch_h, ref_10cm, qqni,qqnr,qqnwfa,qqnifa
use vrbls2d, only: f, pd, sigt4, fis, pblh, ustar, z0, ths, qs, twbs,&
qwbs, avgcprate, cprate, avgprec, prec, lspa, sno,&
cldefi, th10, q10, tshltr, pshltr, tshltr, albase,&
Expand Down Expand Up @@ -2182,8 +2183,8 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, &
enddo
endif

! for GFDL MP
if (imp_physics == 11) then
! for GFDL MP or Thompson MP
if (imp_physics == 11 .or. imp_physics == 8) then
! model level cloud water mixing ratio
if(trim(fieldname)=='clwmr') then
!$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,qqw,arrayr43d)
Expand Down Expand Up @@ -2243,6 +2244,56 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, &
enddo
enddo
endif

if(imp_physics == 8) then
! model level rain number
if(trim(fieldname)=='ncrain') then
!$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,qqnr,arrayr43d)
do l=1,lm
do j=jsta,jend
do i=ista, iend
qqnr(i,j,l)=arrayr43d(i,j,l)
enddo
enddo
enddo
endif

! model level rain number
if(trim(fieldname)=='ncice') then
!$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,qqni,arrayr43d)
do l=1,lm
do j=jsta,jend
do i=ista, iend
qqni(i,j,l)=arrayr43d(i,j,l)
enddo
enddo
enddo
endif

! model level rain number
if(trim(fieldname)=='nwfa') then
!$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,qqnwfa,arrayr43d)
do l=1,lm
do j=jsta,jend
do i=ista, iend
qqnwfa(i,j,l)=arrayr43d(i,j,l)
enddo
enddo
enddo
endif

! model level rain number
if(trim(fieldname)=='nifa') then
!$omp parallel do default(none) private(i,j,l) shared(lm,jsta,jend,ista,iend,qqnifa,arrayr43d)
do l=1,lm
do j=jsta,jend
do i=ista, iend
qqnifa(i,j,l)=arrayr43d(i,j,l)
enddo
enddo
enddo
endif
endif !if(imp_physics == 8) then
!gfdlmp
endif

Expand Down Expand Up @@ -2400,8 +2451,8 @@ subroutine set_postvars_gfs(wrt_int_state,mpicomp,setvar_atmfile, &
enddo
enddo

! compute cwm for gfdlmp
if( imp_physics == 11 ) then
! compute cwm for gfdlmp or Thompson
if( imp_physics == 11 .or. imp_physics == 8) then
do l=1,lm
!$omp parallel do default(none) private(i,j) shared(l,jsta,jend,ista,iend,cwm,qqg,qqs,qqr,qqi,qqw)
do j=jsta,jend
Expand Down