From 34921a8580dbbc79cfcedfdb7093f441324852f1 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 9 Jan 2026 00:34:37 +0000 Subject: [PATCH 1/6] initial connection to TEMPO microphysics --- src/core_atmosphere/Externals.cfg | 7 +++++++ src/core_atmosphere/physics/Makefile | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/core_atmosphere/Externals.cfg b/src/core_atmosphere/Externals.cfg index 84dc47d1d8..1dd261ca47 100644 --- a/src/core_atmosphere/Externals.cfg +++ b/src/core_atmosphere/Externals.cfg @@ -12,5 +12,12 @@ repo_url = https://github.com/NOAA-GSL/UGWP.git tag = MPAS_20241223 required = True +[GSL_MP] +local_path = ./physics_noaa/TEMPO +protocol = git +repo_url = https://github.com/AndersJensen-NOAA/TEMPO.git +tag = v3.0.0_b +required = True + [externals_description] schema_version = 1.0.0 diff --git a/src/core_atmosphere/physics/Makefile b/src/core_atmosphere/physics/Makefile index 75eec25931..18352d7603 100644 --- a/src/core_atmosphere/physics/Makefile +++ b/src/core_atmosphere/physics/Makefile @@ -6,7 +6,7 @@ endif all: ./../tools/manage_externals/checkout_externals --externals ./../Externals.cfg - $(MAKE) lookup_tables core_physics_init core_physics_mmm core_UGWP core_physics_wrf core_physics_noahmp core_physics + $(MAKE) lookup_tables core_physics_init core_physics_mmm core_UGWP core_physics_wrf core_physics_noahmp core_physics core_TEMPO dummy: echo "****** compiling physics ******" @@ -63,6 +63,9 @@ core_physics_mmm: core_physics_init core_UGWP: core_physics_init (cd physics_noaa/UGWP; $(MAKE) all) +core_TEMPO: core_physics_init + (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas) + core_physics_wrf: core_physics_init core_physics_mmm core_UGWP (cd physics_wrf; $(MAKE) all COREDEF="$(COREDEF)") @@ -254,6 +257,7 @@ clean: ( cd physics_noahmp/src; $(MAKE) clean ) ( cd physics_noahmp/utility; $(MAKE) clean ) ( if [ -d physics_noaa/UGWP ]; then cd physics_noaa/UGWP; $(MAKE) clean; fi ) + ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas clean; fi ) @# Certain systems with intel compilers generate *.i files @# This removes them during the clean process $(RM) *.i From 894e86abe340829b06a0c4625db5a7e3a355cd23 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 9 Jan 2026 00:52:57 +0000 Subject: [PATCH 2/6] update tempo tag in externals --- src/core_atmosphere/Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/Externals.cfg b/src/core_atmosphere/Externals.cfg index 1dd261ca47..748da8e229 100644 --- a/src/core_atmosphere/Externals.cfg +++ b/src/core_atmosphere/Externals.cfg @@ -16,7 +16,7 @@ required = True local_path = ./physics_noaa/TEMPO protocol = git repo_url = https://github.com/AndersJensen-NOAA/TEMPO.git -tag = v3.0.0_b +tag = v3.0.0_c required = True [externals_description] From 97f8af743f770003dfd24e8533ce3473344ed1be Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 16 Jan 2026 14:25:00 +0000 Subject: [PATCH 3/6] - updates TEMPO tag - adds TEMPO registry - adds include flags and module use statements to connect tempo to microphysics driver --- src/core_atmosphere/Externals.cfg | 4 ++-- src/core_atmosphere/physics/Makefile | 6 +++--- src/core_atmosphere/physics/Registry_tempo.xml | 17 +++++++++++++++++ .../physics/mpas_atmphys_driver_microphysics.F | 3 +++ 4 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 src/core_atmosphere/physics/Registry_tempo.xml diff --git a/src/core_atmosphere/Externals.cfg b/src/core_atmosphere/Externals.cfg index 748da8e229..b3f1f3db26 100644 --- a/src/core_atmosphere/Externals.cfg +++ b/src/core_atmosphere/Externals.cfg @@ -12,11 +12,11 @@ repo_url = https://github.com/NOAA-GSL/UGWP.git tag = MPAS_20241223 required = True -[GSL_MP] +[TEMPO_MP] local_path = ./physics_noaa/TEMPO protocol = git repo_url = https://github.com/AndersJensen-NOAA/TEMPO.git -tag = v3.0.0_c +tag = v3.0.0_g required = True [externals_description] diff --git a/src/core_atmosphere/physics/Makefile b/src/core_atmosphere/physics/Makefile index 18352d7603..f5ec4c3175 100644 --- a/src/core_atmosphere/physics/Makefile +++ b/src/core_atmosphere/physics/Makefile @@ -6,7 +6,7 @@ endif all: ./../tools/manage_externals/checkout_externals --externals ./../Externals.cfg - $(MAKE) lookup_tables core_physics_init core_physics_mmm core_UGWP core_physics_wrf core_physics_noahmp core_physics core_TEMPO + $(MAKE) lookup_tables core_physics_init core_physics_mmm core_UGWP core_TEMPO core_physics_wrf core_physics_noahmp core_physics dummy: echo "****** compiling physics ******" @@ -266,7 +266,7 @@ clean: $(RM) $@ $*.mod ifeq "$(GEN_F90)" "true" $(CPP) $(CPPFLAGS) $(COREDEF) $(HYDROSTATIC) $(CPPINCLUDES) $< > $*.f90 - $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I.. -I../../framework -I../../external/esmf_time_f90 + $(FC) $(FFLAGS) -c $*.f90 $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I.. -I../../framework -I../../external/esmf_time_f90 else - $(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/UGWP -I.. -I../../framework -I../../external/esmf_time_f90 + $(FC) $(CPPFLAGS) $(COREDEF) $(HYDROSATIC) $(FFLAGS) -c $*.F $(CPPINCLUDES) $(FCINCLUDES) -I./physics_mmm -I./physics_wrf -I./physics_noaa/TEMPO -I./physics_noahmp -I./physics_noahmp/utility -I./physics_noahmp/drivers/mpas -I./physics_noahmp/src -I./physics_noaa/UGWP -I.. -I../../framework -I../../external/esmf_time_f90 endif diff --git a/src/core_atmosphere/physics/Registry_tempo.xml b/src/core_atmosphere/physics/Registry_tempo.xml new file mode 100644 index 0000000000..604c3a57b6 --- /dev/null +++ b/src/core_atmosphere/physics/Registry_tempo.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index bbc78b8ed2..c16c44b2ce 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -22,6 +22,9 @@ module mpas_atmphys_driver_microphysics use module_mp_wsm6,only: wsm6 use mp_wsm6,only: mp_wsm6_init,refl10cm_wsm6 + use module_mp_tempo_cfgs,only: ty_tempo_cfgs + use module_mp_tempo_driver,only: tempo_init, tempo_driver, & + ty_tempo_driver_diags, tempo_aerosol_surface_emissions implicit none private From 3835c657fd43917b77a7e51f2fcc9e93815c42a2 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Tue, 20 Jan 2026 23:35:28 +0000 Subject: [PATCH 4/6] - adds tempo microphysics to list of available microphysics options - adds substepping to tempo microphysics when dt > 90s - adds tempo and aerosolaware options to interface --- src/core_atmosphere/Externals.cfg | 2 +- .../physics/mpas_atmphys_control.F | 1 + .../mpas_atmphys_driver_microphysics.F | 2 +- .../physics/mpas_atmphys_interface.F | 217 +++++++++++++++++- .../physics/mpas_atmphys_manager.F | 4 +- 5 files changed, 219 insertions(+), 7 deletions(-) diff --git a/src/core_atmosphere/Externals.cfg b/src/core_atmosphere/Externals.cfg index b3f1f3db26..004706ab05 100644 --- a/src/core_atmosphere/Externals.cfg +++ b/src/core_atmosphere/Externals.cfg @@ -16,7 +16,7 @@ required = True local_path = ./physics_noaa/TEMPO protocol = git repo_url = https://github.com/AndersJensen-NOAA/TEMPO.git -tag = v3.0.0_g +tag = v3.0.0_h required = True [externals_description] diff --git a/src/core_atmosphere/physics/mpas_atmphys_control.F b/src/core_atmosphere/physics/mpas_atmphys_control.F index b3162019e5..d27a6cb89f 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_control.F +++ b/src/core_atmosphere/physics/mpas_atmphys_control.F @@ -177,6 +177,7 @@ subroutine physics_namelist_check(configs) config_microp_scheme .eq. 'mp_kessler' .or. & config_microp_scheme .eq. 'mp_thompson' .or. & config_microp_scheme .eq. 'mp_thompson_aerosols' .or. & + config_microp_scheme .eq. 'mp_tempo' .or. & config_microp_scheme .eq. 'mp_wsm6')) then write(mpas_err_message,'(A,A20)') 'illegal value for config_microp_scheme:', & diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index c16c44b2ce..2a349e30f7 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -23,7 +23,7 @@ module mpas_atmphys_driver_microphysics use mp_wsm6,only: mp_wsm6_init,refl10cm_wsm6 use module_mp_tempo_cfgs,only: ty_tempo_cfgs - use module_mp_tempo_driver,only: tempo_init, tempo_driver, & + use module_mp_tempo_driver,only: tempo_init, tempo_run, & ty_tempo_driver_diags, tempo_aerosol_surface_emissions implicit none diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index 71e46dfcd2..203ab01e64 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -78,11 +78,13 @@ subroutine allocate_forall_physics(configs) !local pointers: character(len=StrKIND),pointer:: microp_scheme,pbl_scheme + logical,pointer:: config_tempo_aerosolaware !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) call mpas_pool_get_config(configs,'config_pbl_scheme' ,pbl_scheme ) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware', config_tempo_aerosolaware) if(.not.allocated(psfc_p) ) allocate(psfc_p(ims:ime,jms:jme) ) if(.not.allocated(ptop_p) ) allocate(ptop_p(ims:ime,jms:jme) ) @@ -120,6 +122,13 @@ subroutine allocate_forall_physics(configs) if(.not.allocated(nifa_p)) allocate(nifa_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(nwfa_p)) allocate(nwfa_p(ims:ime,kms:kme,jms:jme)) + case("mp_tempo") + if(config_tempo_aerosolaware) then + if(.not.allocated(nc_p)) allocate(nc_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(nifa_p)) allocate(nifa_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(nwfa_p)) allocate(nwfa_p(ims:ime,kms:kme,jms:jme)) + endif + case default end select microp_select @@ -153,11 +162,13 @@ subroutine deallocate_forall_physics(configs) !local pointers: character(len=StrKIND),pointer:: microp_scheme,pbl_scheme + logical,pointer:: config_tempo_aerosolaware !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) call mpas_pool_get_config(configs,'config_pbl_scheme' ,pbl_scheme ) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware', config_tempo_aerosolaware) if(allocated(psfc_p) ) deallocate(psfc_p ) if(allocated(ptop_p) ) deallocate(ptop_p ) @@ -195,6 +206,13 @@ subroutine deallocate_forall_physics(configs) if(allocated(nifa_p)) deallocate(nifa_p) if(allocated(nwfa_p)) deallocate(nwfa_p) + case("mp_tempo") + if(config_tempo_aerosolaware) then + if(allocated(nc_p)) deallocate(nc_p) + if(allocated(nifa_p)) deallocate(nifa_p) + if(allocated(nwfa_p)) deallocate(nwfa_p) + endif + case default end select microp_select @@ -236,6 +254,7 @@ subroutine MPAS_to_physics(configs,mesh,state,time_lev,diag,diag_physics,its,ite !local pointers: character(len=StrKIND),pointer:: microp_scheme,pbl_scheme + logical,pointer:: config_tempo_aerosolaware integer,pointer:: index_qv,index_qc,index_qr,index_qi,index_qs,index_qg integer,pointer:: index_nc,index_ni,index_nifa,index_nwfa @@ -270,6 +289,7 @@ subroutine MPAS_to_physics(configs,mesh,state,time_lev,diag,diag_physics,its,ite !initialization: call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) call mpas_pool_get_config(configs,'config_pbl_scheme' ,pbl_scheme ) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware', config_tempo_aerosolaware) call mpas_pool_get_array(mesh,'latCell',latCell) call mpas_pool_get_array(mesh,'lonCell',lonCell) @@ -358,6 +378,28 @@ subroutine MPAS_to_physics(configs,mesh,state,time_lev,diag,diag_physics,its,ite enddo enddo + case("mp_tempo") + if(config_tempo_aerosolaware) then + nullify(nc) + nullify(nifa) + nullify(nwfa) + call mpas_pool_get_dimension(state,'index_nc',index_nc) + call mpas_pool_get_dimension(state,'index_nifa',index_nifa) + call mpas_pool_get_dimension(state,'index_nwfa',index_nwfa) + nc => scalars(index_nc,:,:) + nifa => scalars(index_nifa,:,:) + nwfa => scalars(index_nwfa,:,:) + do j = jts,jte + do k = kts,kte + do i = its,ite + nc_p(i,k,j) = max(0.,nc(k,i)) + nifa_p(i,k,j) = max(0.,nifa(k,i)) + nwfa_p(i,k,j) = max(0.,nwfa(k,i)) + enddo + enddo + enddo + endif + case default end select microp_select @@ -566,6 +608,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, character(len=StrKIND),pointer:: mp_scheme integer,pointer:: index_qv,index_qc,index_qr,index_qi,index_qs,index_qg integer,pointer:: index_nc,index_ni,index_nr,index_nifa,index_nwfa + logical,pointer:: config_tempo_aerosolaware real(kind=RKIND),dimension(:),pointer :: nifa2d,nwfa2d,nt_c,mu_c real(kind=RKIND),dimension(:,:),pointer :: zgrid,w real(kind=RKIND),dimension(:,:),pointer :: zz,exner,pressure_b @@ -584,6 +627,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_microp_scheme',mp_scheme) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware', config_tempo_aerosolaware) call mpas_pool_get_array(mesh,'zgrid',zgrid) call mpas_pool_get_array(mesh,'zz' ,zz ) @@ -657,6 +701,32 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, enddo enddo + case("mp_tempo") + call mpas_pool_get_dimension(state,'index_qi',index_qi) + call mpas_pool_get_dimension(state,'index_qs',index_qs) + call mpas_pool_get_dimension(state,'index_qg',index_qg) + qi => scalars(index_qi,:,:) + qs => scalars(index_qs,:,:) + qg => scalars(index_qg,:,:) + + call mpas_pool_get_array(diag_physics,'re_cloud',re_cloud) + call mpas_pool_get_array(diag_physics,'re_ice' ,re_ice ) + call mpas_pool_get_array(diag_physics,'re_snow' ,re_snow ) + + do j = jts, jte + do k = kts, kte + do i = its, ite + qi_p(i,k,j) = qi(k,i) + qs_p(i,k,j) = qs(k,i) + qg_p(i,k,j) = qg(k,i) + + recloud_p(i,k,j) = re_cloud(k,i) + reice_p(i,k,j) = re_ice(k,i) + resnow_p(i,k,j) = re_snow(k,i) + enddo + enddo + enddo + mp2_select: select case(trim(mp_scheme)) case("mp_thompson","mp_thompson_aerosols") call mpas_pool_get_dimension(state,'index_ni',index_ni) @@ -679,6 +749,20 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, enddo enddo + case("mp_tempo") + call mpas_pool_get_dimension(state,'index_ni',index_ni) + call mpas_pool_get_dimension(state,'index_nr',index_nr) + ni => scalars(index_ni,:,:) + nr => scalars(index_nr,:,:) + do j = jts,jte + do k = kts, kte + do i = its, ite + ni_p(i,k,j) = ni(k,i) + nr_p(i,k,j) = nr(k,i) + enddo + enddo + enddo + mp3_select: select case(trim(mp_scheme)) case("mp_thompson_aerosols") call mpas_pool_get_dimension(state,'index_nc' ,index_nc ) @@ -704,6 +788,32 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, enddo enddo + case("mp_tempo") + if(config_tempo_aerosolaware) then + call mpas_pool_get_dimension(state,'index_nc' ,index_nc ) + call mpas_pool_get_dimension(state,'index_nifa',index_nifa) + call mpas_pool_get_dimension(state,'index_nwfa',index_nwfa) + nc => scalars(index_nc,:,:) + nifa => scalars(index_nifa,:,:) + nwfa => scalars(index_nwfa,:,:) + + call mpas_pool_get_array(diag_physics,'nifa2d',nifa2d) + call mpas_pool_get_array(diag_physics,'nwfa2d',nwfa2d) + do j = jts,jte + do i = its,ite + nifa2d_p(i,j) = nifa2d(i) + nwfa2d_p(i,j) = nwfa2d(i) + enddo + do k = kts, kte + do i = its, ite + nc_p(i,k,j) = nc(k,i) + nifa_p(i,k,j) = nifa(k,i) + nwfa_p(i,k,j) = nwfa(k,i) + enddo + enddo + enddo + endif + case default end select mp3_select @@ -715,7 +825,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, !begin calculation of cloud microphysics tendencies: mp_tend_select: select case(trim(mp_scheme)) - case("mp_thompson","mp_thompson_aerosols","mp_wsm6") + case("mp_thompson","mp_thompson_aerosols","mp_wsm6","mp_tempo") call mpas_pool_get_array(tend_physics,'rthmpten',rthmpten) call mpas_pool_get_array(tend_physics,'rqvmpten',rqvmpten) call mpas_pool_get_array(tend_physics,'rqcmpten',rqcmpten) @@ -737,7 +847,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, enddo mp2_tend_select: select case(trim(mp_scheme)) - case("mp_thompson","mp_thompson_aerosols") + case("mp_thompson","mp_thompson_aerosols","mp_tempo") call mpas_pool_get_array(tend_physics,'rnimpten',rnimpten) call mpas_pool_get_array(tend_physics,'rnrmpten',rnrmpten) @@ -761,6 +871,20 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, rnwfampten(k,i) = nwfa(k,i) enddo enddo + case("mp_tempo") + if(config_tempo_aerosolaware) then + call mpas_pool_get_array(tend_physics,'rncmpten',rncmpten) + call mpas_pool_get_array(tend_physics,'rnifampten',rnifampten) + call mpas_pool_get_array(tend_physics,'rnwfampten',rnwfampten) + + do k = kts,kte + do i = its,ite + rncmpten(k,i) = nc(k,i) + rnifampten(k,i) = nifa(k,i) + rnwfampten(k,i) = nwfa(k,i) + enddo + enddo + endif case default end select mp3_tend_select @@ -796,6 +920,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te character(len=StrKIND),pointer:: mp_scheme integer,pointer:: index_qv,index_qc,index_qr,index_qi,index_qs,index_qg integer,pointer:: index_nc,index_ni,index_nr,index_nifa,index_nwfa + logical,pointer:: config_tempo_aerosolaware real(kind=RKIND),dimension(:),pointer :: surface_pressure,tend_sfc_pressure real(kind=RKIND),dimension(:),pointer :: nifa2d,nwfa2d real(kind=RKIND),dimension(:,:),pointer :: zgrid @@ -819,6 +944,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_microp_scheme',mp_scheme) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware', config_tempo_aerosolaware) call mpas_pool_get_array(mesh,'zz' ,zz ) call mpas_pool_get_array(mesh,'zgrid',zgrid) @@ -932,6 +1058,33 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te enddo enddo + case("mp_tempo") + call mpas_pool_get_dimension(state,'index_qi',index_qi) + call mpas_pool_get_dimension(state,'index_qs',index_qs) + call mpas_pool_get_dimension(state,'index_qg',index_qg) + qi => scalars(index_qi,:,:) + qs => scalars(index_qs,:,:) + qg => scalars(index_qg,:,:) + + call mpas_pool_get_array(diag_physics,'re_cloud',re_cloud) + call mpas_pool_get_array(diag_physics,'re_ice' ,re_ice ) + call mpas_pool_get_array(diag_physics,'re_snow' ,re_snow ) + call mpas_pool_get_array(diag_physics,'refl10cm',refl10cm) + + do j = jts,jte + do k = kts,kte + do i = its,ite + qi(k,i) = qi_p(i,k,j) + qs(k,i) = qs_p(i,k,j) + qg(k,i) = qg_p(i,k,j) + + re_cloud(k,i) = recloud_p(i,k,j) + re_ice(k,i) = reice_p(i,k,j) + re_snow(k,i) = resnow_p(i,k,j) + enddo + enddo + enddo + mp2_select: select case(trim(mp_scheme)) case("mp_thompson","mp_thompson_aerosols") call mpas_pool_get_dimension(state,'index_ni',index_ni) @@ -948,6 +1101,21 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te enddo enddo + case("mp_tempo") + call mpas_pool_get_dimension(state,'index_ni',index_ni) + call mpas_pool_get_dimension(state,'index_nr',index_nr) + ni => scalars(index_ni,:,:) + nr => scalars(index_nr,:,:) + + do j = jts,jte + do k = kts,kte + do i = its,ite + ni(k,i) = ni_p(i,k,j) + nr(k,i) = nr_p(i,k,j) + enddo + enddo + enddo + mp3_select: select case(trim(mp_scheme)) case("mp_thompson_aerosols") call mpas_pool_get_dimension(state,'index_nc' ,index_nc ) @@ -973,6 +1141,32 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te enddo enddo + case("mp_tempo") + if(config_tempo_aerosolaware) then + call mpas_pool_get_dimension(state,'index_nc' ,index_nc ) + call mpas_pool_get_dimension(state,'index_nifa',index_nifa) + call mpas_pool_get_dimension(state,'index_nwfa',index_nwfa) + nc => scalars(index_nc,:,:) + nifa => scalars(index_nifa,:,:) + nwfa => scalars(index_nwfa,:,:) + + call mpas_pool_get_array(diag_physics,'nifa2d',nifa2d) + call mpas_pool_get_array(diag_physics,'nwfa2d',nwfa2d) + do j = jts,jte + do i = its,ite + nifa2d(i) = nifa2d_p(i,j) + nwfa2d(i) = nwfa2d_p(i,j) + enddo + do k = kts, kte + do i = its, ite + nc(k,i) = nc_p(i,k,j) + nifa(k,i) = nifa_p(i,k,j) + nwfa(k,i) = nwfa_p(i,k,j) + enddo + enddo + enddo + endif + case default end select mp3_select @@ -984,7 +1178,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te !end calculation of cloud microphysics tendencies: mp_tend_select: select case(trim(mp_scheme)) - case("mp_thompson","mp_thompson_aerosols","mp_wsm6") + case("mp_thompson","mp_thompson_aerosols","mp_wsm6","mp_tempo") call mpas_pool_get_array(tend_physics,'rthmpten',rthmpten) call mpas_pool_get_array(tend_physics,'rqvmpten',rqvmpten) call mpas_pool_get_array(tend_physics,'rqcmpten',rqcmpten) @@ -1006,7 +1200,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te enddo mp2_tend_select: select case(trim(mp_scheme)) - case("mp_thompson","mp_thompson_aerosols") + case("mp_thompson","mp_thompson_aerosols","mp_tempo") call mpas_pool_get_array(tend_physics,'rnimpten',rnimpten) call mpas_pool_get_array(tend_physics,'rnrmpten',rnrmpten) @@ -1031,6 +1225,21 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te enddo enddo + case("mp_tempo") + if(config_tempo_aerosolaware) then + call mpas_pool_get_array(tend_physics,'rncmpten',rncmpten) + call mpas_pool_get_array(tend_physics,'rnifampten',rnifampten) + call mpas_pool_get_array(tend_physics,'rnwfampten',rnwfampten) + + do k = kts,kte + do i = its,ite + rncmpten(k,i) = (nc(k,i)-rncmpten(k,i))/dt_dyn + rnifampten(k,i) = (nifa(k,i)-rnifampten(k,i))/dt_dyn + rnwfampten(k,i) = (nwfa(k,i)-rnwfampten(k,i))/dt_dyn + enddo + enddo + endif + case default end select mp3_tend_select diff --git a/src/core_atmosphere/physics/mpas_atmphys_manager.F b/src/core_atmosphere/physics/mpas_atmphys_manager.F index 2057148725..57158aa1f8 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_manager.F +++ b/src/core_atmosphere/physics/mpas_atmphys_manager.F @@ -686,7 +686,8 @@ subroutine physics_run_init(configs,mesh,state,clock,stream_manager) dt_microp = dt_dyn n_microp = 1 if(trim(config_microp_scheme)=='mp_thompson' .or. & - trim(config_microp_scheme)=='mp_thompson_aerosols') then + trim(config_microp_scheme)=='mp_thompson_aerosols' .or. & + trim(config_microp_scheme)=='mp_tempo') then dt_microp = 90._RKIND n_microp = max(nint(dt_dyn/dt_microp),1) dt_microp = dt_dyn / n_microp @@ -750,6 +751,7 @@ subroutine physics_run_init(configs,mesh,state,clock,stream_manager) if(config_microp_re) then if(trim(config_microp_scheme)=='mp_thompson' .or. & trim(config_microp_scheme)=='mp_thompson_aerosols' .or. & + trim(config_microp_scheme)=='mp_tempo' .or. & trim(config_microp_scheme)=='mp_wsm6') then if(trim(config_radt_lw_scheme)=='rrtmg_lw' .and. trim(config_radt_sw_scheme)=='rrtmg_sw') then has_reqc = 1 From 9c08bb3870fe17316ef6a252227e74c4d271d40f Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 21 Jan 2026 16:52:56 +0000 Subject: [PATCH 5/6] - adds aerosol initialization for tempo - adds initialization routines for tempo with aerosolaware option --- .../mpas_atmphys_driver_microphysics.F | 78 ++++++++- .../physics/mpas_atmphys_init_microphysics.F | 158 +++++++++++++++++- 2 files changed, 233 insertions(+), 3 deletions(-) diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index 2a349e30f7..af2abcd436 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -92,7 +92,7 @@ module mpas_atmphys_driver_microphysics !--- initialization option for WSM6 from WRF version 3.8.1. this option could also be set as a namelist parameter. integer,parameter:: hail_opt = 0 - + type(ty_tempo_cfgs) tempo_cfgs contains @@ -106,10 +106,12 @@ subroutine allocate_microphysics(configs) !local pointers: character(len=StrKIND),pointer:: microp_scheme + logical,pointer:: config_tempo_aerosolaware !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) !sounding variables: if(.not.allocated(rho_p) ) allocate(rho_p(ims:ime,kms:kme,jms:jme) ) @@ -152,6 +154,24 @@ subroutine allocate_microphysics(configs) if(.not.allocated(rainprod_p)) allocate(rainprod_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(evapprod_p)) allocate(evapprod_p(ims:ime,kms:kme,jms:jme)) + case ("mp_tempo") + !mass mixing ratios: + if(.not.allocated(qi_p)) allocate(qi_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qs_p)) allocate(qs_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qg_p)) allocate(qg_p(ims:ime,kms:kme,jms:jme)) + + !surface precipitation: + if(.not.allocated(sr_p) ) allocate(sr_p(ims:ime,jms:jme) ) + if(.not.allocated(snownc_p) ) allocate(snownc_p(ims:ime,jms:jme) ) + if(.not.allocated(snowncv_p) ) allocate(snowncv_p(ims:ime,jms:jme) ) + if(.not.allocated(graupelnc_p) ) allocate(graupelnc_p(ims:ime,jms:jme) ) + if(.not.allocated(graupelncv_p)) allocate(graupelncv_p(ims:ime,jms:jme)) + + !cloud water,cloud ice,and snow effective radii: + if(.not.allocated(recloud_p)) allocate(recloud_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(reice_p) ) allocate(reice_p(ims:ime,kms:kme,jms:jme) ) + if(.not.allocated(resnow_p) ) allocate(resnow_p(ims:ime,kms:kme,jms:jme) ) + microp2_select: select case(trim(microp_scheme)) case("mp_thompson","mp_thompson_aerosols") if(.not.allocated(ntc_p)) allocate(ntc_p(ims:ime,jms:jme)) @@ -159,6 +179,10 @@ subroutine allocate_microphysics(configs) if(.not.allocated(ni_p) ) allocate(ni_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(nr_p) ) allocate(nr_p(ims:ime,kms:kme,jms:jme)) + case("mp_tempo") + if(.not.allocated(ni_p) ) allocate(ni_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(nr_p) ) allocate(nr_p(ims:ime,kms:kme,jms:jme)) + microp3_select: select case(trim(microp_scheme)) case("mp_thompson_aerosols") if(.not.allocated(nifa2d_p)) allocate(nifa2d_p(ims:ime,jms:jme)) @@ -167,6 +191,15 @@ subroutine allocate_microphysics(configs) if(.not.allocated(nifa_p) ) allocate(nifa_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(nwfa_p) ) allocate(nwfa_p(ims:ime,kms:kme,jms:jme)) + case("mp_tempo") + if(config_tempo_aerosolaware) then + if(.not.allocated(nifa2d_p)) allocate(nifa2d_p(ims:ime,jms:jme)) + if(.not.allocated(nwfa2d_p)) allocate(nwfa2d_p(ims:ime,jms:jme)) + if(.not.allocated(nc_p) ) allocate(nc_p(ims:ime,kms:kme,jms:jme) ) + if(.not.allocated(nifa_p) ) allocate(nifa_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(nwfa_p) ) allocate(nwfa_p(ims:ime,kms:kme,jms:jme)) + endif + case default end select microp3_select @@ -187,10 +220,12 @@ subroutine deallocate_microphysics(configs) !local pointers: character(len=StrKIND),pointer:: microp_scheme + logical,pointer:: config_tempo_aerosolaware !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) !sounding variables: if(allocated(rho_p) ) deallocate(rho_p ) @@ -233,6 +268,24 @@ subroutine deallocate_microphysics(configs) if(allocated(rainprod_p)) deallocate(rainprod_p) if(allocated(evapprod_p)) deallocate(evapprod_p) + case ("mp_tempo") + !mass mixing ratios: + if(allocated(qi_p)) deallocate(qi_p) + if(allocated(qs_p)) deallocate(qs_p) + if(allocated(qg_p)) deallocate(qg_p) + + !surface precipitation: + if(allocated(sr_p) ) deallocate(sr_p ) + if(allocated(snownc_p) ) deallocate(snownc_p ) + if(allocated(snowncv_p) ) deallocate(snowncv_p ) + if(allocated(graupelnc_p) ) deallocate(graupelnc_p ) + if(allocated(graupelncv_p)) deallocate(graupelncv_p) + + !cloud water,cloud ice,and snow effective radii: + if(allocated(recloud_p)) deallocate(recloud_p) + if(allocated(reice_p) ) deallocate(reice_p ) + if(allocated(resnow_p) ) deallocate(resnow_p ) + microp2_select: select case(trim(microp_scheme)) case("mp_thompson","mp_thompson_aerosols") if(allocated(ntc_p)) deallocate(ntc_p) @@ -240,6 +293,10 @@ subroutine deallocate_microphysics(configs) if(allocated(ni_p) ) deallocate(ni_p ) if(allocated(nr_p) ) deallocate(nr_p ) + case("mp_tempo") + if(allocated(ni_p) ) deallocate(ni_p ) + if(allocated(nr_p) ) deallocate(nr_p ) + microp3_select: select case(trim(microp_scheme)) case("mp_thompson_aerosols") if(allocated(nifa2d_p)) deallocate(nifa2d_p) @@ -248,6 +305,15 @@ subroutine deallocate_microphysics(configs) if(allocated(nifa_p) ) deallocate(nifa_p ) if(allocated(nwfa_p) ) deallocate(nwfa_p ) + case("mp_tempo") + if(config_tempo_aerosolaware) then + if(allocated(nifa2d_p)) deallocate(nifa2d_p) + if(allocated(nwfa2d_p)) deallocate(nwfa2d_p) + if(allocated(nc_p) ) deallocate(nc_p ) + if(allocated(nifa_p) ) deallocate(nifa_p ) + if(allocated(nwfa_p) ) deallocate(nwfa_p ) + endif + case default end select microp3_select @@ -277,6 +343,7 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p !local pointer: logical,pointer:: do_restart character(len=StrKIND),pointer:: microp_scheme + logical,pointer:: config_tempo_aerosolaware !CCPP-compliant flags: character(len=StrKIND):: errmsg @@ -292,15 +359,24 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) call mpas_pool_get_config(configs,'config_do_restart' ,do_restart ) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) microp_select: select case(trim(microp_scheme)) case("mp_thompson","mp_thompson_aerosols") call thompson_init(l_mp_tables) call init_thompson_clouddroplets_forMPAS(mesh,sfc_input,diag_physics) + case("mp_tempo") + call tempo_init(aerosolaware_flag=config_tempo_aerosolaware, & + tempo_cfgs=tempo_cfgs) + microp2_select: select case(trim(microp_scheme)) case("mp_thompson_aerosols") call init_thompson_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) + case("mp_tempo") + if(config_tempo_aerosolaware) then + call init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) + endif case default end select microp2_select diff --git a/src/core_atmosphere/physics/mpas_atmphys_init_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_init_microphysics.F index f2a75d6c90..dfc4536b61 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_init_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_init_microphysics.F @@ -17,11 +17,12 @@ module mpas_atmphys_init_microphysics use mpas_atmphys_utilities use module_mp_thompson, only: is_aerosol_aware,naCCN0,naCCN1,naIN0,naIN1,ntb_arc,ntb_arw,ntb_art,ntb_arr, & ntb_ark,tnccn_act - + use module_mp_tempo_params, only: aero_max, nwfa_default implicit none private public:: init_thompson_clouddroplets_forMPAS, & - init_thompson_aerosols_forMPAS + init_thompson_aerosols_forMPAS, & + init_tempo_aerosols_forMPAS !MPAS main initialization of the Thompson parameterization of cloud microphysics with nucleation of cloud !droplets based on distributions of CCNs and INs (aerosol-aware parameterization). @@ -252,6 +253,159 @@ subroutine init_thompson_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev, end subroutine init_thompson_aerosols_forMPAS +!================================================================================================================= + subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) +!================================================================================================================= + +!input variables: + type(dm_info),intent(in):: dminfo + type(mpas_pool_type),intent(in):: mesh + logical,intent(in):: do_restart + integer,intent(in):: time_lev + +!inout variables: + type(mpas_pool_type),intent(inout):: diag_physics + type(mpas_pool_type),intent(inout):: state + +!local variables and pointers: + integer,pointer:: nCellsSolve,nVertLevels + integer,pointer:: index_nifa,index_nwfa + + real(kind=RKIND),dimension(:),pointer :: areaCell + real(kind=RKIND),dimension(:),pointer :: nifa2d,nwfa2d + real(kind=RKIND),dimension(:,:),pointer :: zgrid,zz + real(kind=RKIND),dimension(:,:),pointer :: rho_zz,nifa,nwfa + real(kind=RKIND),dimension(:,:,:),pointer:: scalars + + character(len=StrKIND):: mess + + integer:: iCell, k + + real(kind=RKIND):: max_test + real(kind=RKIND):: deltaz + real(kind=RKIND):: h_01 + real(kind=RKIND):: niIN3,niCCN3 + real(kind=RKIND):: nifa_max,nifa_min,global_nifa_max,global_nifa_min + real(kind=RKIND):: nwfa_max,nwfa_min,global_nwfa_max,global_nwfa_min + real(kind=RKIND),dimension(:,:),allocatable:: hgt + +!----------------------------------------------------------------------------------------------------------------- + +!... if do_restart is true, then we do not need to check the initialization of nwfa, nifa, and nwfa2d. If false, +! then, we proceed with the initialization: + if(do_restart) return + + call mpas_pool_get_dimension(mesh,'nCellsSolve',nCellsSolve) + call mpas_pool_get_dimension(mesh,'nVertLevels',nVertLevels) + + call mpas_pool_get_array(mesh,'areaCell',areaCell) + call mpas_pool_get_array(mesh,'zgrid' ,zgrid ) + call mpas_pool_get_array(mesh,'zz' ,zz ) + + call mpas_pool_get_array(diag_physics,'nifa2d',nifa2d) + call mpas_pool_get_array(diag_physics,'nwfa2d',nwfa2d) + + call mpas_pool_get_dimension(state,'index_nifa' ,index_nifa ) + call mpas_pool_get_dimension(state,'index_nwfa' ,index_nwfa ) + + call mpas_pool_get_array(state,'scalars',scalars,time_lev) + nifa => scalars(index_nifa,:,:) + nwfa => scalars(index_nwfa,:,:) + + call mpas_pool_get_array(state,'rho_zz',rho_zz,time_lev) + + if(.not.allocated(hgt)) allocate(hgt(1:nVertLevels,1:nCellsSolve)) + do iCell = 1, nCellsSolve + do k = 1, nVertLevels + hgt(k,iCell) = 0.5_RKIND * (zgrid(k,iCell)+zgrid(k+1,iCell)) + enddo + enddo + +!... initialize the distribution of hygroscopic ("water friendly") aerosols if not already initialized using +! GOCART data: + global_nwfa_min = 0._RKIND + global_nwfa_max = 0._RKIND + nwfa_min = minval(nwfa(:,1:nCellsSolve)) + nwfa_max = maxval(nwfa(:,1:nCellsSolve)) + call mpas_dmpar_min_real(dminfo,nwfa_min,global_nwfa_min) + call mpas_dmpar_max_real(dminfo,nwfa_max,global_nwfa_max) + call mpas_log_write('--- global_nwfa_min = $r',realArgs=(/global_nwfa_min/)) + call mpas_log_write('--- global_nwfa_max = $r',realArgs=(/global_nwfa_max/)) + + if(global_nwfa_min == 0._RKIND .and. global_nwfa_max == 0._RKIND) then + call mpas_log_write('--- initialize nwfa using an exponential distribution of CCN as a function of height.') + do iCell = 1, nCellsSolve + if(hgt(1,iCell).le.1000.0) then + h_01 = 0.8 + elseif(hgt(1,iCell).ge.2500.0) then + h_01 = 0.01 + else + h_01 = 0.8*cos(hgt(1,iCell)*0.001 - 1.0) + endif + niCCN3 = -1.0*ALOG(naCCN1/naCCN0)/h_01 + nwfa(1,iCell) = naCCN1+naCCN0*exp(-((hgt(2,iCell)-hgt(1,iCell))/1000.)*niCCN3) + do k = 2, nVertLevels + nwfa(k,iCell) = naCCN1+naCCN0*exp(-((hgt(k,iCell)-hgt(1,iCell))/1000.)*niCCN3) + enddo + enddo + else + call mpas_log_write('--- initialize nwfa using the climatological GOCART data.') + endif + +!... initialize the distribution of nonhygroscopic ("ice friendly") aerosols if not already initialized using +! GOCART data: + global_nifa_min = 0._RKIND + global_nifa_max = 0._RKIND + nifa_min = minval(nifa(:,1:nCellsSolve)) + nifa_max = maxval(nifa(:,1:nCellsSolve)) + call mpas_dmpar_min_real(dminfo,nifa_min,global_nifa_min) + call mpas_dmpar_max_real(dminfo,nifa_max,global_nifa_max) + call mpas_log_write('--- global_nifa_min = $r',realArgs=(/global_nifa_min/)) + call mpas_log_write('--- global_nifa_max = $r',realArgs=(/global_nifa_max/)) + + if(global_nifa_min == 0._RKIND .and. global_nifa_max == 0._RKIND) then + call mpas_log_write('--- initialize nifa using an exponential distribution of IN as a function of height.') + do iCell = 1, nCellsSolve + if(hgt(1,iCell).le.1000.0) then + h_01 = 0.8 + elseif(hgt(1,iCell).ge.2500.0) then + h_01 = 0.01 + else + h_01 = 0.8*cos(hgt(1,iCell)*0.001 - 1.0) + endif + niIN3 = -1.0*ALOG(naIN1/naIN0)/h_01 + nifa(1,iCell) = naIN1+naIN0*exp(-((hgt(2,iCell)-hgt(1,iCell))/1000.)*niIN3) + do k = 2, nVertLevels + nifa(k,iCell) = naIN1+naIN0*exp(-((hgt(k,iCell)-hgt(1,iCell))/1000.)*niIN3) + enddo + enddo + else + call mpas_log_write('--- initialize nifa using the climatological GOCART data.') + endif + +!... scale the lowest level aerosol data into an emissions rate. This is very far from ideal, but +!... need higher emissions where larger amount of (climo) existing and lesser emissions where there +!... exists fewer to begin as a first-order simplistic approach. Later, proper connection to emission +!... inventory would be better, but, for now, scale like this: +!... where: Nwfa=50 per cc, emit 0.875E4 aerosols per second per grid box unit +!... that was tested as ~(20kmx20kmx50m = 2.E10 m**3). + + k = 1 + do iCell = 1, nCellsSolve + deltaz = zgrid(k+1,iCell)-zgrid(k,iCell) + if (deltaz < 9.0) then + deltaz = 9.0 + endif + nwfa2d(iCell) = max(nwfa_default, min(aero_max, nwfa(k,iCell))) * & + 0.000196 * (5.0 / deltaz) * (areaCell(iCell) / 9.e6) + nifa2d(iCell) = 0._RKIND + enddo + +!... deallocate local arrays: + if(allocated(hgt)) deallocate(hgt) + + end subroutine init_tempo_aerosols_forMPAS + !================================================================================================================= subroutine table_ccnAct(dminfo) !================================================================================================================= From 634d4c0e83fc1768594135cf71f67365bd3e8861 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 21 Jan 2026 21:14:10 +0000 Subject: [PATCH 6/6] -adds tempo and supported diagnostics to microphysics driver --- src/core_atmosphere/Externals.cfg | 2 +- .../mpas_atmphys_driver_microphysics.F | 60 +++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/src/core_atmosphere/Externals.cfg b/src/core_atmosphere/Externals.cfg index 004706ab05..79950d5bbf 100644 --- a/src/core_atmosphere/Externals.cfg +++ b/src/core_atmosphere/Externals.cfg @@ -16,7 +16,7 @@ required = True local_path = ./physics_noaa/TEMPO protocol = git repo_url = https://github.com/AndersJensen-NOAA/TEMPO.git -tag = v3.0.0_h +tag = v3.0.0_i required = True [externals_description] diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index af2abcd436..d2106c67ed 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -418,11 +418,14 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten !local variables and arrays: integer:: istep + integer:: i,j,k !CCPP-compliant flags: character(len=StrKIND):: errmsg integer:: errflg + type(ty_tempo_driver_diags) :: tempo_driver_diags + !----------------------------------------------------------------------------------------------------------------- !call mpas_log_write('') !call mpas_log_write('---enter subroutine driver_microphysics:') @@ -463,6 +466,63 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten ) call mpas_timer_stop('mp_kessler') + case ("mp_tempo") + + if (allocated(nwfa_p) .and. allocated(nwfa2d_p)) then + call tempo_aerosol_surface_emissions(dt=dt_microp, nwfa=nwfa_p, nwfa2d=nwfa2d_p, & + ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, kts=kts) + endif + + call mpas_timer_start('mp_tempo') + + istep = 1 + do while (istep .le. n_microp) + call tempo_run( tempo_cfgs=tempo_cfgs, & + dt = dt_microp , itimestep = itimestep , & + th = th_p , qv = qv_p , qc = qc_p , & + qr = qr_p , qi = qi_p , qs = qs_p , & + qg = qg_p , ni = ni_p , nr = nr_p , & + w = w_p , & +! ng = ng_p , qb = volg_p , w = w_p , & + nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & + pii = pi_p , p = pres_p , dz = dz_p , & + ids = ids , ide = ide , jds = jds , jde = jde , kds = kds , kde = kde , & + ims = ims , ime = ime , jms = jms , jme = jme , kms = kms , kme = kme , & + its = its , ite = ite , jts = jts , jte = jte , kts = kts , kte = kte , & + tempo_diags = tempo_driver_diags) + do j = jts, jte + do i = its, ite + ! precipitation variables are summed in case of multiple calls when n_microp > 1 + snowncv_p(i,j) = snowncv_p(i,j) + tempo_driver_diags%ice_liquid_equiv_precip(i,j) + & + tempo_driver_diags%snow_liquid_equiv_precip(i,j) + snownc_p(i,j) = snownc_p(i,j) + tempo_driver_diags%ice_liquid_equiv_precip(i,j) + & + tempo_driver_diags%snow_liquid_equiv_precip(i,j) + graupelncv_p(i,j) = graupelncv_p(i,j) + tempo_driver_diags%graupel_liquid_equiv_precip(i,j) + graupelnc_p(i,j) = graupelnc_p(i,j) + tempo_driver_diags%graupel_liquid_equiv_precip(i,j) + rainncv_p(i,j) = rainncv_p(i,j) + tempo_driver_diags%rain_precip(i,j) + & + tempo_driver_diags%ice_liquid_equiv_precip(i,j) + & + tempo_driver_diags%snow_liquid_equiv_precip(i,j) + & + tempo_driver_diags%graupel_liquid_equiv_precip(i,j) + rainnc_p(i,j) = rainnc_p(i,j) + tempo_driver_diags%rain_precip(i,j) + & + tempo_driver_diags%ice_liquid_equiv_precip(i,j) + & + tempo_driver_diags%snow_liquid_equiv_precip(i,j) + & + tempo_driver_diags%graupel_liquid_equiv_precip(i,j) + sr_p(i,j) = tempo_driver_diags%frozen_fraction(i,j) + !frainnc_p = frainnc_p + tempo_driver_diags%frz_rain_precip + !max_hail_diameter_sfc_p = tempo_driver_diags%max_hail_diameter_sfc + !max_hail_diameter_column_p = tempo_driver_diags%max_hail_diameter_column + do k = kts, kte + !refl10cm_p = tempo_driver_diags%refl10cm + recloud_p(i,k,j) = tempo_driver_diags%re_cloud(i,k,j) + reice_p(i,k,j) = tempo_driver_diags%re_ice(i,k,j) + resnow_p(i,k,j) = tempo_driver_diags%re_snow(i,k,j) + enddo + enddo + enddo + istep = istep + 1 + enddo + call mpas_timer_stop('mp_tempo') + case ("mp_thompson") call mpas_timer_start('mp_thompson') istep = 1