Skip to content

Commit

Permalink
Connect TEMPO microphysics to CCPP
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersJensen-NOAA committed Jun 17, 2024
1 parent 9b0ac7b commit aec5804
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
path = physics/Radiation/RRTMGP/rte-rrtmgp
url = https://github.com/earth-system-radiation/rte-rrtmgp
branch = main
[submodule "physics/MP/TEMPO"]
path = physics/MP/TEMPO
url = https://github.com/NCAR/TEMPO.git
14 changes: 7 additions & 7 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
use surface_perturbation, only: cdfnor,ppfbet

! For Thompson MP
use module_mp_thompson, only: calc_effectRad, &
Nt_c_l, Nt_c_o, &
use module_mp_thompson_params, only: Nt_c_l, Nt_c_o, &
re_qc_min, re_qc_max, &
re_qi_min, re_qi_max, &
re_qs_min, re_qs_max
use module_mp_thompson_make_number_concentrations, only: &
re_qs_min, re_qs_max, configs
use module_mp_thompson_utils, only: calc_effectRad, &
make_IceNumber, &
make_DropletNumber, &
make_RainNumber
Expand Down Expand Up @@ -899,9 +898,10 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
!tgs: progclduni has different limits for ice radii (10.0-150.0) than
! calc_effectRad (4.99-125.0 for WRFv3.8.1; 2.49-125.0 for WRFv4+)
! it will raise the low limit from 5 to 10, but the high limit will remain 125.
call calc_effectRad (tlyr(i,:), plyr(i,:)*100., qv_mp(i,:), qc_mp(i,:), &
nc_mp(i,:), qi_mp(i,:), ni_mp(i,:), qs_mp(i,:), &
effrl(i,:), effri(i,:), effrs(i,:), islmsk, 1, lm )
call calc_effectRad (t1d=tlyr(i,:), p1d=plyr(i,:)*100., qv1d=qv_mp(i,:), qc1d=qc_mp(i,:), &
nc1d=nc_mp(i,:), qi1d=qi_mp(i,:), ni1d=ni_mp(i,:), qs1d=qs_mp(i,:), &
re_qc1d=effrl(i,:), re_qi1d=effri(i,:), re_qs1d=effrs(i,:), kts=1, kte=lm, &
lsml=islmsk, configs=configs )
! Scale Thompson's effective radii from meter to micron
do k=1,lm
effrl(i,k) = MAX(re_qc_min, MIN(effrl(i,k), re_qc_max))*1.e6
Expand Down
2 changes: 1 addition & 1 deletion physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type = scheme
relative_path = ../../
dependencies = tools/funcphys.f90,hooks/machine.F
dependencies = MP/Thompson/module_mp_thompson.F90,MP/Thompson/module_mp_thompson_make_number_concentrations.F90
dependencies = MP/TEMPO/drivers/ccpp/module_mp_thompson.F90,MP/TEMPO/module_mp_thompson_utils.F90
dependencies = Radiation/RRTMG/radcons.f90,Radiation/radiation_aerosols.f
dependencies = Radiation/radiation_astronomy.f,Radiation/radiation_clouds.f,Radiation/radiation_gases.f
dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f,Radiation/radiation_cloud_overlap.F90
Expand Down
2 changes: 1 addition & 1 deletion physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
dependencies = Radiation/radiation_aerosols.f
dependencies = Radiation/radiation_astronomy.f,Radiation/radiation_clouds.f,Radiation/radiation_gases.f
dependencies = Radiation/RRTMG/radlw_main.F90,Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_main.F90,Radiation/RRTMG/radsw_param.f
dependencies = MP/Thompson/module_mp_thompson.F90,photochem/module_ozphys.F90
dependencies = MP/TEMPO/drivers/ccpp/module_mp_thompson.F90,photochem/module_ozphys.F90

########################################################################
[ccpp-arg-table]
Expand Down
16 changes: 9 additions & 7 deletions physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ module GFS_rrtmgp_cloud_mp
use rrtmgp_lw_cloud_optics, only: &
radliq_lwr => radliq_lwrLW, radliq_upr => radliq_uprLW,&
radice_lwr => radice_lwrLW, radice_upr => radice_uprLW
use module_mp_thompson, only: calc_effectRad, Nt_c_l, Nt_c_o, re_qc_min, re_qc_max, &
re_qi_min, re_qi_max, re_qs_min, re_qs_max
use module_mp_thompson_make_number_concentrations, only: make_IceNumber, &
use module_mp_thompson_utils, only: calc_effectRad, make_IceNumber, &
make_DropletNumber, make_RainNumber
use module_mp_thompson_params, only: Nt_c_l, Nt_c_o, re_qc_min, re_qc_max, &
re_qi_min, re_qi_max, re_qs_min, re_qs_max, configs


real (kind_phys), parameter :: &
cld_limit_lower = 0.001, &
Expand Down Expand Up @@ -897,10 +898,11 @@ subroutine cmp_reff_Thompson(nLev, nCol, i_cldliq, i_cldice, i_cldsnow, i_cldice
! Compute effective radii for liquid/ice/snow.
do iCol=1,nCol
ilsmask = nint(lsmask(iCol))
call calc_effectRad (t_lay(iCol,:), p_lay(iCol,:), qv_mp(iCol,:), qc_mp(iCol,:), &
nc_mp(iCol,:), qi_mp(iCol,:), ni_mp(iCol,:), qs_mp(iCol,:), &
re_cloud(iCol,:), re_ice(iCol,:), re_snow(iCol,:), ilsmask, &
1, nLev )
call calc_effectRad (t1d=t_lay(iCol,:), p1d=p_lay(iCol,:), qv1d=qv_mp(iCol,:), qc1d=qc_mp(iCol,:), &
nc1d=nc_mp(iCol,:), qi1d=qi_mp(iCol,:), ni1d=ni_mp(iCol,:), qs1d=qs_mp(iCol,:), &
re_qc1d=re_cloud(iCol,:), re_qi1d=re_ice(iCol,:), re_qs1d=re_snow(iCol,:), kts=1, kte=nLev, &
lsml=ilsmask, configs=configs)

do iLay = 1, nLev
re_cloud(iCol,iLay) = MAX(re_qc_min, MIN(re_cloud(iCol,iLay), re_qc_max))
re_ice(iCol,iLay) = MAX(re_qi_min, MIN(re_ice(iCol,iLay), re_qi_max))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
relative_path = ../../
dependencies = hooks/machine.F
dependencies = Radiation/radiation_tools.F90,Radiation/radiation_clouds.f,Radiation/RRTMGP/rrtmgp_lw_cloud_optics.F90
dependencies = MP/Thompson/module_mp_thompson_make_number_concentrations.F90,MP/Thompson/module_mp_thompson.F90
dependencies = MP/TEMPO/module_mp_thompson_utils.F90,MP/TEMPO/drivers/ccpp/module_mp_thompson.F90

########################################################################
[ccpp-arg-table]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = GFS_rrtmgp_setup
type = scheme
relative_path = ../../
dependencies = hooks/machine.F,MP/Thompson/module_mp_thompson.F90
dependencies = hooks/machine.F,MP/TEMPO/drivers/ccpp/module_mp_thompson.F90
dependencies = Radiation/radiation_aerosols.f,photochem/module_ozphys.F90
dependencies = Radiation/radiation_gases.f,Radiation/radiation_astronomy.f

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr
qdiag3d, save_lnc, save_inc, ntk, ntke, otsptflag, errmsg, errflg)

use machine, only: kind_phys
use module_mp_thompson_make_number_concentrations, only: make_IceNumber, make_DropletNumber
use module_mp_thompson_utils, only: make_IceNumber, make_DropletNumber

implicit none

Expand Down Expand Up @@ -290,4 +290,4 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr

end subroutine GFS_suite_interstitial_4_run

end module GFS_suite_interstitial_4
end module GFS_suite_interstitial_4
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
type = scheme
relative_path = ../../
dependencies = hooks/machine.F
dependencies = MP/Thompson/module_mp_thompson_make_number_concentrations.F90
dependencies = MP/TEMPO/module_mp_thompson_utils.F90

########################################################################
[ccpp-arg-table]
Expand Down
2 changes: 1 addition & 1 deletion physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
relative_path = ../../
dependencies = tools/funcphys.f90,hooks/machine.F
dependencies = hooks/physcons.F90,Radiation/RRTMG/radcons.f90
dependencies = Radiation/radiation_clouds.f,MP/Thompson/module_mp_thompson.F90
dependencies = Radiation/radiation_clouds.f,MP/TEMPO/drivers/ccpp/module_mp_thompson.F90

########################################################################
[ccpp-arg-table]
Expand Down
1 change: 1 addition & 0 deletions physics/MP/TEMPO
Submodule TEMPO added at a2c9fd
9 changes: 4 additions & 5 deletions physics/MP/Thompson/mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ module mp_thompson
use mpi_f08
use machine, only : kind_phys

use module_mp_thompson, only : thompson_init, mp_gt_driver, thompson_finalize, calc_effectRad
use module_mp_thompson, only : naIN0, naIN1, naCCN0, naCCN1, eps, Nt_c_l, Nt_c_o
use module_mp_thompson, only : re_qc_min, re_qc_max, re_qi_min, re_qi_max, re_qs_min, re_qs_max

use module_mp_thompson_make_number_concentrations, only: make_IceNumber, make_DropletNumber, make_RainNumber
use module_mp_thompson_params
use module_mp_thompson_utils
use module_mp_thompson_main
use module_mp_thompson, only : thompson_init, mp_gt_driver, thompson_finalize

implicit none

Expand Down
5 changes: 4 additions & 1 deletion physics/MP/Thompson/mp_thompson.meta
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
type = scheme
dependencies = ../../hooks/machine.F
dependencies = ../module_mp_radar.F90
dependencies = module_mp_thompson.F90,module_mp_thompson_make_number_concentrations.F90
dependencies = ../TEMPO/module_mp_thompson_params.F90
dependencies = ../TEMPO/module_mp_thompson_main.F90
dependencies = ../TEMPO/module_mp_thompson_utils.F90
dependencies = ../TEMPO/drivers/ccpp/module_mp_thompson.F90

########################################################################
[ccpp-arg-table]
Expand Down
2 changes: 1 addition & 1 deletion physics/Radiation/radiation_clouds.f
Original file line number Diff line number Diff line change
Expand Up @@ -3315,7 +3315,7 @@ SUBROUTINE cal_cldfra3(CLDFRA, qv, qc, qi, qs, dz, &
& modify_qvapor, max_relh, &
& kts,kte, debug_flag)
!
USE module_mp_thompson , ONLY : rsif, rslf
USE module_mp_thompson_utils , ONLY : rsif, rslf
IMPLICIT NONE
!
INTEGER, INTENT(IN):: kts, kte
Expand Down

0 comments on commit aec5804

Please sign in to comment.