Skip to content

Commit

Permalink
Merge branch 'ufs/dev' into rrfsv1-to-ufs/dev4
Browse files Browse the repository at this point in the history
  • Loading branch information
grantfirl committed Dec 2, 2024
2 parents ebc3fb3 + 6e0467a commit c2fb52e
Show file tree
Hide file tree
Showing 8 changed files with 4,638 additions and 3,092 deletions.
6,196 changes: 3,112 additions & 3,084 deletions physics/MP/Thompson/module_mp_thompson.F90

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
!>\ingroup aathompson
module module_mp_thompson_make_number_concentrations

use physcons, only: PI => con_pi
use module_mp_thompson, only: PI

implicit none

Expand Down Expand Up @@ -137,13 +137,15 @@ elemental real function make_DropletNumber (Q_cloud, qnwfa)
real, intent(in):: Q_cloud, qnwfa

!real, parameter:: PI = 3.1415926536
real, parameter:: am_r = PI*1000./6.
real :: am_r
real, dimension(15), parameter:: g_ratio = (/24,60,120,210,336, &
& 504,720,990,1320,1716,2184,2730,3360,4080,4896/)
double precision:: lambda, qnc
real:: q_nwfa, x1, xDc
integer:: nu_c

am_r = PI*1000./6.

if (Q_cloud == 0) then
make_DropletNumber = 0
return
Expand Down Expand Up @@ -176,7 +178,9 @@ elemental real function make_RainNumber (Q_rain, temp)
real, intent(in):: Q_rain, temp
double precision:: lambda, N0, qnr
!real, parameter:: PI = 3.1415926536
real, parameter:: am_r = PI*1000./6.
real :: am_r

am_r = PI*1000./6.

if (Q_rain == 0) then
make_RainNumber = 0
Expand Down
66 changes: 63 additions & 3 deletions physics/MP/Thompson/mp_thompson.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ module mp_thompson
!! \section arg_table_mp_thompson_init Argument Table
!! \htmlinclude mp_thompson_init.html
!!
subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, &
subroutine mp_thompson_init(ncol, nlev, con_pi, con_t0c, con_rv, &
con_cp, con_rgas, con_boltz, con_amd, &
con_amw, con_avgd, con_hvap, con_hfus, &
con_g, con_rd, con_eps, &
restart, imp_physics, &
imp_physics_thompson, convert_dry_rho, &
spechum, qc, qr, qi, qs, qg, ni, nr, &
Expand All @@ -39,13 +42,17 @@ subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, &
aerfld, mpicomm, mpirank, mpiroot, &
threads, ext_diag, diag3d, &
is_initialized, errmsg, errflg)

use module_mp_thompson, only : PI, T_0, Rv, R, RoverRv, Cp
use module_mp_thompson, only : R_uni, k_b, M_w, M_a, N_avo, lvap0, lfus

implicit none

! Interface variables
integer, intent(in ) :: ncol
integer, intent(in ) :: nlev
real(kind_phys), intent(in ) :: con_g, con_rd, con_eps
real(kind_phys), intent(in ) :: con_pi, con_t0c, con_rv, con_cp, con_rgas, &
con_boltz, con_amd, con_amw, con_avgd, &
con_hvap, con_hfus, con_g, con_rd, con_eps
logical, intent(in ) :: restart
logical, intent(inout) :: is_initialized
integer, intent(in ) :: imp_physics
Expand Down Expand Up @@ -103,6 +110,21 @@ subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, &

if (is_initialized) return

! Set local Thompson MP module constants from host model
PI = con_pi
T_0 = con_t0c
Rv = con_Rv
R = con_rd
RoverRv = con_eps
Cp = con_cp
R_uni = con_rgas
k_b = con_boltz
M_w = con_amw*1.0E-3 !module_mp_thompson expects kg/mol
M_a = con_amd*1.0E-3 !module_mp_thompson expects kg/mol
N_avo = con_avgd
lvap0 = con_hvap
lfus = con_hfus

! Consistency checks
if (imp_physics/=imp_physics_thompson) then
write(errmsg,'(*(a))') "Logic error: namelist choice of microphysics is different from Thompson MP"
Expand Down Expand Up @@ -687,6 +709,44 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, &
nrten3 => diag3d(:,:,35:35)
ncten3 => diag3d(:,:,36:36)
qcten3 => diag3d(:,:,37:37)
else
allocate(prw_vcdc (0,0,0))
allocate(prw_vcde (0,0,0))
allocate(tpri_inu (0,0,0))
allocate(tpri_ide_d (0,0,0))
allocate(tpri_ide_s (0,0,0))
allocate(tprs_ide (0,0,0))
allocate(tprs_sde_d (0,0,0))
allocate(tprs_sde_s (0,0,0))
allocate(tprg_gde_d (0,0,0))
allocate(tprg_gde_s (0,0,0))
allocate(tpri_iha (0,0,0))
allocate(tpri_wfz (0,0,0))
allocate(tpri_rfz (0,0,0))
allocate(tprg_rfz (0,0,0))
allocate(tprs_scw (0,0,0))
allocate(tprg_scw (0,0,0))
allocate(tprg_rcs (0,0,0))
allocate(tprs_rcs (0,0,0))
allocate(tprr_rci (0,0,0))
allocate(tprg_rcg (0,0,0))
allocate(tprw_vcd_c (0,0,0))
allocate(tprw_vcd_e (0,0,0))
allocate(tprr_sml (0,0,0))
allocate(tprr_gml (0,0,0))
allocate(tprr_rcg (0,0,0))
allocate(tprr_rcs (0,0,0))
allocate(tprv_rev (0,0,0))
allocate(tten3 (0,0,0))
allocate(qvten3 (0,0,0))
allocate(qrten3 (0,0,0))
allocate(qsten3 (0,0,0))
allocate(qgten3 (0,0,0))
allocate(qiten3 (0,0,0))
allocate(niten3 (0,0,0))
allocate(nrten3 (0,0,0))
allocate(ncten3 (0,0,0))
allocate(qcten3 (0,0,0))
end if set_extended_diagnostic_pointers
!> - Call mp_gt_driver() with or without aerosols, with or without effective radii, ...
if (is_aerosol_aware) then
Expand Down
88 changes: 88 additions & 0 deletions physics/MP/Thompson/mp_thompson.meta
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,94 @@
dimensions = ()
type = integer
intent = in
[con_pi]
standard_name = pi
long_name = ratio of a circle's circumference to its diameter
units = none
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_t0c]
standard_name = temperature_at_zero_celsius
long_name = temperature at 0 degrees Celsius
units = K
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_rv]
standard_name = gas_constant_water_vapor
long_name = ideal gas constant for water vapor
units = J kg-1 K-1
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_cp]
standard_name = specific_heat_of_dry_air_at_constant_pressure
long_name = specific heat of dry air at constant pressure
units = J kg-1 K-1
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_rgas]
standard_name = molar_gas_constant
long_name = universal ideal molar gas constant
units = J K-1 mol-1
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_boltz]
standard_name = boltzmann_constant
long_name = Boltzmann constant
units = J K-1
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_amd]
standard_name = molecular_weight_of_dry_air
long_name = molecular weight of dry air
units = g mol-1
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_amw]
standard_name = molecular_weight_of_water_vapor
long_name = molecular weight of water vapor
units = g mol-1
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_avgd]
standard_name = avogadro_consant
long_name = Avogadro constant
units = mol-1
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_hvap]
standard_name = latent_heat_of_vaporization_of_water_at_0C
long_name = latent heat of evaporation/sublimation
units = J kg-1
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_hfus]
standard_name = latent_heat_of_fusion_of_water_at_0C
long_name = latent heat of fusion
units = J kg-1
dimensions = ()
type = real
kind = kind_phys
intent = in
[con_g]
standard_name = gravitational_acceleration
long_name = gravitational acceleration
Expand Down
Loading

0 comments on commit c2fb52e

Please sign in to comment.