Skip to content

Commit 02726fa

Browse files
Merge pull request ufs-community#11 from AndersJensen-NOAA/ncar_merge_v2
Fixing more merge conflicts
2 parents 250dacb + 5fa2d6f commit 02726fa

14 files changed

+66
-55
lines changed

src/core_atmosphere/Registry.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2677,7 +2677,7 @@
26772677
description="maximum diagnosed 10 cm radar reflectivity at 1 km AGL since last output time"
26782678
packages="mp_thompson_in;mp_thompson_aers_in;mp_wsm6_in;mp_nssl2m_in;mp_tempo_in"/>
26792679

2680-
<var name="do_diag_dbz" type="logical" dimensions="" units = ""
2680+
<var name="do_diag_dbz" type="integer" dimensions="" units = ""
26812681
description="flag for whether to compute refelctivity at every time step for use in computing output-time-max 1km reflectivity"/>
26822682

26832683
<var name="i_rainnc" type="integer" dimensions="nCells Time" units="unitless"

src/core_atmosphere/diagnostics/mpas_convective_diagnostics.F

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module mpas_convective_diagnostics
5959
logical :: is_needed_prec_acc_nc
6060
logical :: is_needed_snow_acc_nc
6161
logical :: do_any_uh, do_any_diags
62-
logical,pointer :: do_diag_dbz
62+
integer,pointer :: do_diag_dbz
6363

6464
contains
6565

@@ -123,9 +123,9 @@ subroutine convective_diagnostics_setup(all_pools, simulation_clock)
123123
is_needed_snow_acc_nc = .false.
124124
do_any_uh = .false.
125125
do_any_diags = .false.
126-
do_diag_dbz = .false.
126+
do_diag_dbz = 0
127127
if (mpas_stream_inclusion_count('refl10cm_1km_max', direction=MPAS_STREAM_OUTPUT) > 0) then
128-
do_diag_dbz = .true.
128+
do_diag_dbz = 1
129129
endif
130130
! - UH Variables
131131
if (mpas_stream_inclusion_count('updraft_helicity_max', direction=MPAS_STREAM_OUTPUT) > 0) then

src/core_atmosphere/physics/mpas_atmphys_control.F

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ subroutine physics_namelist_check(configs)
177177
config_microp_scheme .eq. 'mp_kessler' .or. &
178178
config_microp_scheme .eq. 'mp_thompson' .or. &
179179
config_microp_scheme .eq. 'mp_thompson_aerosols' .or. &
180+
config_microp_scheme .eq. 'mp_tempo' .or. &
180181
config_microp_scheme .eq. 'mp_nssl2m' .or. &
181182
config_microp_scheme .eq. 'mp_wsm6')) then
182183

@@ -401,19 +402,6 @@ subroutine physics_registry_init(mesh,configs,sfc_input)
401402
dzs(9,iCell) = 0.70_RKIND
402403
enddo
403404

404-
case("sf_ruc")
405-
do iCell = 1,nCells
406-
dzs(1,iCell) = 0.005_RKIND
407-
dzs(2,iCell) = 0.025_RKIND
408-
dzs(3,iCell) = 0.045_RKIND
409-
dzs(4,iCell) = 0.13_RKIND
410-
dzs(5,iCell) = 0.25_RKIND
411-
dzs(6,iCell) = 0.35_RKIND
412-
dzs(7,iCell) = 0.50_RKIND
413-
dzs(8,iCell) = 1.00_RKIND
414-
dzs(9,iCell) = 0.70_RKIND
415-
enddo
416-
417405
case default
418406

419407
end select lsm_select
@@ -445,6 +433,7 @@ subroutine physics_tables_init(dminfo,configs)
445433

446434
call mpas_pool_get_config(configs,'config_microp_scheme',config_microp_scheme)
447435
if(config_microp_scheme /= "mp_thompson" .or. &
436+
config_microp_scheme /= "mp_tempo" .or. &
448437
config_microp_scheme /= "mp_thompson_aerosols") return
449438

450439
l_qr_acr_qg = .false.

src/core_atmosphere/physics/mpas_atmphys_driver.F

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ subroutine physics_driver(domain,itimestep,xtime_s)
278278
if(config_oml1d) call driver_oml1d(block%configs,mesh,diag,diag_physics,sfc_input)
279279

280280
!call to land-surface scheme:
281-
if(config_lsm_scheme .eq. 'sf_noah' .or. config_lsm_scheme .eq. 'sf_ruc') then
281+
if(config_lsm_scheme .eq. 'sf_noah' .or. config_lsm_scheme .eq. 'sf_ruc') then
282282
call allocate_lsm(config_lsm_scheme)
283283
!$OMP PARALLEL DO
284284
do thread=1,nThreads
@@ -297,14 +297,12 @@ subroutine physics_driver(domain,itimestep,xtime_s)
297297
!$OMP END PARALLEL DO
298298
call deallocate_seaice(config_lsm_scheme)
299299

300-
elseif(config_lsm_scheme == 'sf_noahmp') then
301-
do thread=1,nThreads
302-
call driver_lsm_noahmp(block%configs,mesh,state,time_lev,diag,diag_physics, &
303-
diag_physics_noahmp,output_noahmp,sfc_input,itimestep, &
304-
cellSolveThreadStart(thread),cellSolveThreadEnd(thread))
305-
enddo
306-
endif
307-
300+
elseif(config_lsm_scheme == 'sf_noahmp') then
301+
do thread=1,nThreads
302+
call driver_lsm_noahmp(block%configs,mesh,state,time_lev,diag,diag_physics, &
303+
diag_physics_noahmp,output_noahmp,sfc_input,itimestep, &
304+
cellSolveThreadStart(thread),cellSolveThreadEnd(thread))
305+
enddo
308306
endif
309307

310308
!call to pbl schemes:

src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module mpas_atmphys_driver_microphysics
2020
!wrf physics:
2121
use module_mp_kessler
2222
use module_mp_thompson
23-
use module_mp_tempo
23+
use module_mp_tempo,only: tempo_3d_to_1d_driver
2424
! use module_mp_tempo_utils
2525
use module_mp_wsm6,only: wsm6
2626
use mp_wsm6,only: mp_wsm6_init,refl10cm_wsm6
@@ -108,7 +108,7 @@ subroutine allocate_microphysics(configs)
108108
!local pointers:
109109
character(len=StrKIND),pointer:: microp_scheme
110110
character(len=StrKIND),pointer:: nssl_moments
111-
logical,pointer:: thompson_hail_aware
111+
logical,pointer:: tempo_hailaware
112112

113113
!-----------------------------------------------------------------------------------------------------------------
114114

@@ -182,7 +182,7 @@ subroutine allocate_microphysics(configs)
182182
if (tempo_hailaware) then
183183
if(.not.allocated(ng_p) ) allocate(ng_p(ims:ime,kms:kme,jms:jme))
184184
if(.not.allocated(volg_p)) allocate(volg_p(ims:ime,kms:kme,jms:jme))
185-
if(.not.allocated(refl10cm_1km_p) ) allocate(refl10cm_p(ims:ime,jms:jme) )
185+
if(.not.allocated(refl10cm_1km_p) ) allocate(refl10cm_1km_p(ims:ime,jms:jme) )
186186
endif
187187

188188
case default
@@ -199,7 +199,7 @@ subroutine allocate_microphysics(configs)
199199
if(.not.allocated(nccn_p) ) allocate(nccn_p(ims:ime,kms:kme,jms:jme))
200200
if(.not.allocated(volg_p)) allocate(volg_p(ims:ime,kms:kme,jms:jme))
201201
if(.not.allocated(volh_p)) allocate(volh_p(ims:ime,kms:kme,jms:jme))
202-
if(.not.allocated(refl10cm_1km_p) ) allocate(refl10cm_p(ims:ime,jms:jme) )
202+
if(.not.allocated(refl10cm_1km_p) ) allocate(refl10cm_1km_p(ims:ime,jms:jme) )
203203

204204
if (nssl_moments == "nssl3m") then
205205
if(.not.allocated(zrw_p) ) allocate(zrw_p(ims:ime,kms:kme,jms:jme))
@@ -225,7 +225,7 @@ subroutine deallocate_microphysics(configs)
225225
!local pointers:
226226
character(len=StrKIND),pointer:: microp_scheme
227227
character(len=StrKIND),pointer:: nssl_moments
228-
logical,pointer:: thompson_hail_aware
228+
logical,pointer:: tempo_hailaware
229229

230230
!-----------------------------------------------------------------------------------------------------------------
231231

@@ -348,7 +348,7 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p
348348
!inout arguments:
349349
type(mpas_pool_type),intent(inout):: diag_physics
350350
type(mpas_pool_type),intent(inout):: state
351-
type(mpas_pool_type),intent(in):: diag
351+
! type(mpas_pool_type),intent(in):: diag
352352

353353
!local pointer:
354354
logical,pointer:: do_restart
@@ -428,19 +428,18 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten
428428

429429
!local pointers:
430430
character(len=StrKIND),pointer:: microp_scheme
431-
logical,pointer:: thompson_aerosol_aware,thompson_hail_aware
432-
character(len=StrKIND),pointer:: nssl_moments
431+
logical,pointer:: thompson_aerosol_aware,tempo_hailaware
432+
character(len=StrKIND),pointer:: nssl_moments
433433

434434
!local variables and arrays:
435435
integer:: istep
436-
logical, pointer :: do_diag_dbz
436+
integer, pointer :: do_diag_dbz
437+
logical :: do_diag_dbz_flag
437438

438439
!CCPP-compliant flags:
439440
character(len=StrKIND):: errmsg
440441
integer:: errflg
441442

442-
call mpas_pool_get_array(diag_physics,'do_diag_dbz',do_diag_dbz)
443-
444443
!-----------------------------------------------------------------------------------------------------------------
445444
!call mpas_log_write('')
446445
!call mpas_log_write('---enter subroutine driver_microphysics:')
@@ -452,6 +451,10 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten
452451
call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme)
453452
call mpas_pool_get_config(configs,'config_tempo_hailaware',tempo_hailaware)
454453
call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments)
454+
call mpas_pool_get_array(diag_physics,'do_diag_dbz',do_diag_dbz)
455+
456+
do_diag_dbz_flag = .false.
457+
if (do_diag_dbz == 1) do_diag_dbz_flag = .true.
455458

456459
!... allocation of microphysics arrays:
457460
!$OMP MASTER
@@ -646,7 +649,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten
646649
sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , &
647650
re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , &
648651
has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , &
649-
diagflag = l_diags , dbz = refl10cm_p , diag_dbz = do_diag_dbz , &
652+
diagflag = l_diags , dbz = refl10cm_p , diag_dbz = do_diag_dbz_flag , &
650653
ntmul = n_microp , ntcnt = 1 , lastloop = .true. , &
651654
refl_diagnostic = refl10cm_1km_p , &
652655
ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , &
@@ -668,7 +671,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten
668671
sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , &
669672
re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , &
670673
has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , &
671-
diagflag = l_diags , dbz = refl10cm_p , diag_dbz = do_diag_dbz , &
674+
diagflag = l_diags , dbz = refl10cm_p , diag_dbz = do_diag_dbz_flag , &
672675
ntmul = n_microp , ntcnt = 1 , lastloop = .true. , &
673676
refl_diagnostic = refl10cm_1km_p , &
674677
ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , &
@@ -705,7 +708,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten
705708

706709
end if
707710

708-
if (do_diag_dbz) then
711+
if (do_diag_dbz_flag) then
709712
if(trim(microp_scheme) == "mp_wsm6" .or. &
710713
trim(microp_scheme) == "mp_tempo" .or. &
711714
trim(microp_scheme) == "mp_nssl2m" ) then

src/core_atmosphere/physics/mpas_atmphys_driver_seaice.F

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module mpas_atmphys_driver_seaice
3333
!urban physics: MPAS does not plan to run the urban physics option.
3434
integer,parameter:: sf_urban_physics = 0 !activate urban canopy model (=0: no urban canopy)
3535

36-
integer :: targetcell= 0 !99975 !81442 !107619
36+
integer :: targetcell_= 0 !99975 !81442 !107619
3737

3838
!MPAS driver for parameterization of surface processes over seaice points.
3939
!Laura D. Fowler (laura@ucar.edu) / 2024-03-13.
@@ -415,7 +415,7 @@ subroutine seaice_from_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
415415
if (lsm_scheme == 'sf_ruc') then
416416
dew_p(i,j) = dew(i)
417417
sfcevp_p(i,j) = sfcevp(i)
418-
if (globalcells(i)==targetcell) then
418+
if (globalcells(i)==targetcell_) then
419419
print *,'from MPAS '
420420
print *,'globalcells(i),cqs_p,cqs2_p,chs_p,chs2_p',globalcells(i),cqs_p(i,j),cqs2_p(i,j),chs_p(i,j),chs2_p(i,j)
421421
print *,'flqc(i),mavail(i),rho_p(i,kts,j)',flqc(i),mavail(i),rho_p(i,kts,j)
@@ -581,7 +581,7 @@ subroutine seaice_to_MPAS(configs,mesh,diag_physics,sfc_input,its,ite)
581581
call mpas_log_write('--- call subroutine sfcdiags_ruclsm:')
582582
do j = jts,jte
583583
do i = its,ite
584-
if (globalcells(i)==targetcell) then
584+
if (globalcells(i)==targetcell_) then
585585
print *,' before call to sfcdiags_ruclsm'
586586
print *,'globalcells(i),cqs_p,cqs2_p,chs_p,chs2_p',globalcells(i),cqs_p(i,j),cqs2_p(i,j),chs_p(i,j),chs2_p(i,j)
587587
endif

src/core_atmosphere/physics/mpas_atmphys_finalize.F

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ subroutine atmphys_finalize(configs)
5050
call sf_noahmp_deallocate
5151

5252
if(trim(config_microp_scheme) == 'mp_thompson' .or. &
53+
trim(config_microp_scheme) == 'mp_tempo' .or. &
5354
trim(config_microp_scheme) == 'mp_thompson_aerosols') then
5455
call mp_thompson_deallocate
5556
endif

src/core_atmosphere/physics/mpas_atmphys_init.F

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ subroutine physics_init(dminfo,clock,configs,mesh,diag,tend,state,time_lev,diag_
364364

365365
!initialization of cloud microphysics processes:
366366
if(config_microp_scheme .ne. 'off') &
367-
call microphysics_init(dminfo,configs,mesh,sfc_input,diag,diag_physics,state)
367+
call init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_physics)
368368

369369
!initialization of PBL processes:
370370
if(config_pbl_scheme .ne. 'off') call init_pbl(configs)

src/core_atmosphere/physics/mpas_atmphys_init_microphysics.F

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module mpas_atmphys_init_microphysics
1515
use mpas_pool_routines
1616

1717
use mpas_atmphys_utilities
18-
use module_mp_thompson_params, only: Nt_c_l, Nt_c_o, aero_max, nwfa_default
18+
use module_mp_tempo_params !, only: Nt_c_l, Nt_c_o, aero_max, nwfa_default
1919
!use module_mp_thompson, only: is_aerosol_aware,naCCN0,naCCN1,naIN0,naIN1,ntb_arc,ntb_arw,ntb_art,ntb_arr, &
2020
! ntb_ark,tnccn_act
2121

@@ -184,7 +184,7 @@ subroutine init_thompson_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,
184184
!-----------------------------------------------------------------------------------------------------------------
185185
!call mpas_log_write('--- enter subroutine init_thompson_aerosols_forMPAS:')
186186

187-
is_aerosol_aware = .true.
187+
! is_aerosol_aware = .true.
188188

189189
!... read a static file containing CCN activation of aerosols. The data were created from a parcel model by
190190
!... Feingold & Heymsfield with further changes by Eidhammer and Kriedenweis.

src/core_atmosphere/physics/mpas_atmphys_manager.F

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,7 @@ subroutine physics_run_init(configs,mesh,state,clock,stream_manager)
690690
dt_microp = dt_dyn
691691
n_microp = 1
692692
if(trim(config_microp_scheme)=='mp_thompson' .or. &
693+
trim(config_microp_scheme)=='mp_tempo' .or. &
693694
trim(config_microp_scheme)=='mp_thompson_aerosols') then
694695
dt_microp = 90._RKIND
695696
n_microp = max(nint(dt_dyn/dt_microp),1)
@@ -759,6 +760,7 @@ subroutine physics_run_init(configs,mesh,state,clock,stream_manager)
759760
has_reqs = 0
760761
if(config_microp_re) then
761762
if(trim(config_microp_scheme)=='mp_thompson' .or. &
763+
trim(config_microp_scheme)=='mp_tempo' .or. &
762764
trim(config_microp_scheme)=='mp_thompson_aerosols' .or. &
763765
trim(config_microp_scheme)=='mp_wsm6' .or. trim(config_microp_scheme)=='mp_nssl2m') then
764766
if(trim(config_radt_lw_scheme)=='rrtmg_lw' .and. trim(config_radt_sw_scheme)=='rrtmg_sw') then

0 commit comments

Comments
 (0)