From 38b48a96341d424231ef0b93829eaf3b2717c019 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Thu, 10 Jul 2025 20:07:17 +0000 Subject: [PATCH 01/46] Adds TEMPO cloud fraction control flag and initial variables -- sgs cloud fraction and cloud water --- src/core_atmosphere/Registry.xml | 30 +++++++++++++++++++ .../physics/mpas_atmphys_packages.F | 13 ++++++-- .../physics/mpas_atmphys_vars.F | 5 +++- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 312cd857a9..57415f1b52 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -414,6 +414,7 @@ + @@ -1865,6 +1866,14 @@ + + + + #endif @@ -2256,6 +2265,14 @@ + + + + #endif @@ -2355,6 +2372,14 @@ + + + + @@ -2523,6 +2548,11 @@ description="Logical flag to turn on/off prognostic graupel number concentration and rime density" possible_values=".true. or .false."/> + + Date: Fri, 11 Jul 2025 15:28:03 +0000 Subject: [PATCH 02/46] Adds SGS prognostic cloud fraction and water to MPAS interface, microphysics driver, and to TEMPO driver --- .../mpas_atmphys_driver_microphysics.F | 18 ++++++++ .../physics/mpas_atmphys_interface.F | 44 ++++++++++++++++++- .../physics/physics_noaa/TEMPO | 2 +- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index b8fc9a4d7d..ccf0cab781 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -111,6 +111,7 @@ subroutine allocate_microphysics(configs) character(len=StrKIND),pointer:: nssl_moments logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware logical,pointer:: config_tempo_ml_nc_pbl + logical,pointer:: config_tempo_cldfra !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) @@ -118,6 +119,7 @@ subroutine allocate_microphysics(configs) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) call mpas_pool_get_config(configs,'config_tempo_ml_nc_pbl',config_tempo_ml_nc_pbl) + call mpas_pool_get_config(configs,'config_tempo_cldfra',config_tempo_cldfra) !sounding variables: if(.not.allocated(rho_p) ) allocate(rho_p(ims:ime,kms:kme,jms:jme) ) @@ -223,6 +225,11 @@ subroutine allocate_microphysics(configs) if(.not.allocated(volg_p)) allocate(volg_p(ims:ime,kms:kme,jms:jme)) endif + if (config_tempo_cldfra) then + if(.not.allocated(qasgs_p)) allocate(qasgs_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qcsgs_p)) allocate(qcsgs_p(ims:ime,kms:kme,jms:jme)) + endif + if (config_tempo_ml_nc_pbl) then if(.not.allocated(cldfrac_p) ) allocate(cldfrac_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(qcbl_p) ) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) @@ -275,6 +282,7 @@ subroutine deallocate_microphysics(configs) character(len=StrKIND),pointer:: nssl_moments logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware logical,pointer:: config_tempo_ml_nc_pbl + logical,pointer:: config_tempo_cldfra !----------------------------------------------------------------------------------------------------------------- @@ -283,6 +291,7 @@ subroutine deallocate_microphysics(configs) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) call mpas_pool_get_config(configs,'config_tempo_ml_nc_pbl',config_tempo_ml_nc_pbl) + call mpas_pool_get_config(configs,'config_tempo_cldfra',config_tempo_cldfra) !sounding variables: if(allocated(rho_p) ) deallocate(rho_p ) @@ -386,6 +395,11 @@ subroutine deallocate_microphysics(configs) if(allocated(volg_p) ) deallocate(volg_p ) endif + if (config_tempo_cldfra) then + if(allocated(qasgs_p)) deallocate(qasgs_p) + if(allocated(qcsgs_p)) deallocate(qcsgs_p) + endif + if (config_tempo_ml_nc_pbl) then if(allocated(cldfrac_p) ) deallocate(cldfrac_p) if(allocated(qcbl_p) ) deallocate(qcbl_p) @@ -607,6 +621,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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 , & + qasgs = qasgs_p , qcsgs = qcsgs_p , & !! ng = ng_p , qb = volg_p , & !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & @@ -629,6 +644,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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 , & + qasgs = qasgs_p , qcsgs = qcsgs_p , & !! ng = ng_p , qb = volg_p , & nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & @@ -652,6 +668,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten qr = qr_p , qi = qi_p , qs = qs_p , & qg = qg_p , ni = ni_p , nr = nr_p , & ng = ng_p , qb = volg_p , & + qasgs = qasgs_p , qcsgs = qcsgs_p , & !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & pii = pi_p , p = pres_p , dz = dz_p , & @@ -679,6 +696,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten ng = ng_p , qb = volg_p , & nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & + qasgs = qasgs_p , qcsgs = qcsgs_p , & pii = pi_p , p = pres_p , dz = dz_p , & w = w_p , dt_in = dt_microp , itimestep = itimestep , & rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index 35d577efab..79cf7c9c8d 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -665,17 +665,20 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, character(len=StrKIND),pointer:: nssl_moments logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware logical,pointer:: config_tempo_ml_nc_pbl + logical,pointer:: config_tempo_cldfra integer,pointer:: index_qh integer,pointer:: index_zrw,index_zgw,index_zhw integer,pointer:: index_ns,index_ng,index_nh,index_nccn integer,pointer:: index_volg,index_volh - + integer,pointer:: index_qasgs, index_qcsgs + real(kind=RKIND),dimension(:,:),pointer :: zgrid,w real(kind=RKIND),dimension(:,:),pointer :: zz,exner,pressure_b real(kind=RKIND),dimension(:,:),pointer :: rho_zz,theta_m,pressure_p real(kind=RKIND),dimension(:,:),pointer :: qv,qc,qr,qi,qs,qg real(kind=RKIND),dimension(:,:),pointer :: qh real(kind=RKIND),dimension(:,:),pointer :: nc,ni,nr,nifa,nwfa + real(kind=RKIND),dimension(:,:),pointer :: qa_sgs, qc_sgs real(kind=RKIND),dimension(:,:),pointer :: ns,ng,nh,nccn real(kind=RKIND),dimension(:,:),pointer :: volg,volh,zrw,zgw,zhw real(kind=RKIND),dimension(:,:),pointer :: rainprod,evapprod @@ -697,6 +700,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) call mpas_pool_get_config(configs,'config_tempo_ml_nc_pbl',config_tempo_ml_nc_pbl) + call mpas_pool_get_config(configs,'config_tempo_cldfra',config_tempo_cldfra) call mpas_pool_get_array(mesh,'zgrid',zgrid) call mpas_pool_get_array(mesh,'zz' ,zz ) @@ -943,6 +947,23 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, enddo endif + if (config_tempo_cldfra) then + call mpas_pool_get_dimension(state,'index_qasgs' ,index_qasgs ) + call mpas_pool_get_dimension(state,'index_qcsgs' ,index_qcsgs ) + + qa_sgs => scalars(index_qasgs,:,:) + qc_sgs => scalars(index_qcsgs,:,:) + + do j = jts, jte + do k = kts, kte + do i = its, ite + qasgs_p(i,k,j) = qa_sgs(k,i) + qcsgs_p(i,k,j) = qc_sgs(k,i) + enddo + enddo + enddo + endif + case("mp_nssl2m") call mpas_pool_get_dimension(state,'index_ni',index_ni) call mpas_pool_get_dimension(state,'index_nr',index_nr) @@ -1151,8 +1172,10 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te character(len=StrKIND),pointer:: mp_scheme character(len=StrKIND),pointer:: nssl_moments logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware + logical,pointer:: config_tempo_cldfra 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 + integer,pointer:: index_qasgs, index_qcsgs !TEMPO/NSSL integer,pointer:: index_qh integer,pointer:: index_zrw,index_zgw,index_zhw @@ -1169,6 +1192,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te real(kind=RKIND),dimension(:,:),pointer :: qv,qc,qr,qi,qs,qg real(kind=RKIND),dimension(:,:),pointer :: qh real(kind=RKIND),dimension(:,:),pointer :: nc,ni,nr,nifa,nwfa + real(kind=RKIND),dimension(:,:),pointer :: qa_sgs, qc_sgs real(kind=RKIND),dimension(:,:),pointer :: ns,ng,nh,nccn real(kind=RKIND),dimension(:,:),pointer :: volg,volh,zrw,zgw,zhw real(kind=RKIND),dimension(:) ,pointer :: max_hail_diameter_sfc, max_hail_diameter_column @@ -1189,6 +1213,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) + call mpas_pool_get_config(configs,'config_tempo_cldfra',config_tempo_cldfra) call mpas_pool_get_array(mesh,'zz' ,zz ) call mpas_pool_get_array(mesh,'zgrid',zgrid) @@ -1449,6 +1474,23 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te enddo endif + if (config_tempo_cldfra) then + call mpas_pool_get_dimension(state,'index_qasgs' ,index_qasgs ) + call mpas_pool_get_dimension(state,'index_qcsgs' ,index_qcsgs ) + + qa_sgs => scalars(index_qasgs,:,:) + qc_sgs => scalars(index_qcsgs,:,:) + + do j = jts, jte + do k = kts, kte + do i = its, ite + qa_sgs(k,i) = qasgs_p(i,k,j) + qc_sgs(k,i) = qcsgs_p(i,k,j) + enddo + enddo + enddo + endif + case("mp_nssl2m") call mpas_pool_get_dimension(state,'index_ni' ,index_ni ) call mpas_pool_get_dimension(state,'index_nc' ,index_nc ) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 1ddf4e2030..27247b670a 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 1ddf4e20303412bff68e380a516cf33d0f023140 +Subproject commit 27247b670adad82a80320f31ba5b07b9aa61fe26 From a41b88ff6f3a7ef303b062dd7d81c19cf9d7f03d Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Fri, 11 Jul 2025 15:48:22 +0000 Subject: [PATCH 03/46] Adds cloud fraction module to TEMPO --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 27247b670a..3a4bf5a878 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 27247b670adad82a80320f31ba5b07b9aa61fe26 +Subproject commit 3a4bf5a878dbe75a93fcb6bd442051fe0baa346c From 531dc29857167fd63f8b274711b3e82613377dbc Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Fri, 11 Jul 2025 20:38:01 +0000 Subject: [PATCH 04/46] Fix cloud fraction scalar index names --- .../physics/mpas_atmphys_interface.F | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index 79cf7c9c8d..75987d0bd6 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -670,7 +670,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, integer,pointer:: index_zrw,index_zgw,index_zhw integer,pointer:: index_ns,index_ng,index_nh,index_nccn integer,pointer:: index_volg,index_volh - integer,pointer:: index_qasgs, index_qcsgs + integer,pointer:: index_qa_sgs, index_qc_sgs real(kind=RKIND),dimension(:,:),pointer :: zgrid,w real(kind=RKIND),dimension(:,:),pointer :: zz,exner,pressure_b @@ -948,11 +948,11 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, endif if (config_tempo_cldfra) then - call mpas_pool_get_dimension(state,'index_qasgs' ,index_qasgs ) - call mpas_pool_get_dimension(state,'index_qcsgs' ,index_qcsgs ) + call mpas_pool_get_dimension(state,'index_qa_sgs' ,index_qa_sgs ) + call mpas_pool_get_dimension(state,'index_qc_sgs' ,index_qc_sgs ) - qa_sgs => scalars(index_qasgs,:,:) - qc_sgs => scalars(index_qcsgs,:,:) + qa_sgs => scalars(index_qa_sgs,:,:) + qc_sgs => scalars(index_qc_sgs,:,:) do j = jts, jte do k = kts, kte @@ -1175,7 +1175,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te logical,pointer:: config_tempo_cldfra 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 - integer,pointer:: index_qasgs, index_qcsgs + integer,pointer:: index_qa_sgs, index_qc_sgs !TEMPO/NSSL integer,pointer:: index_qh integer,pointer:: index_zrw,index_zgw,index_zhw @@ -1475,11 +1475,11 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te endif if (config_tempo_cldfra) then - call mpas_pool_get_dimension(state,'index_qasgs' ,index_qasgs ) - call mpas_pool_get_dimension(state,'index_qcsgs' ,index_qcsgs ) + call mpas_pool_get_dimension(state,'index_qa_sgs' ,index_qa_sgs ) + call mpas_pool_get_dimension(state,'index_qc_sgs' ,index_qc_sgs ) - qa_sgs => scalars(index_qasgs,:,:) - qc_sgs => scalars(index_qcsgs,:,:) + qa_sgs => scalars(index_qa_sgs,:,:) + qc_sgs => scalars(index_qc_sgs,:,:) do j = jts, jte do k = kts, kte From c24a70931b7e52d7a841c71fd6897296b8a9661b Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Fri, 11 Jul 2025 20:38:36 +0000 Subject: [PATCH 05/46] Intial version of cloud fraction scheme for testing: creates sgs cloud water and cloud fraction --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 3a4bf5a878..84b4551746 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 3a4bf5a878dbe75a93fcb6bd442051fe0baa346c +Subproject commit 84b455174680f59a8a68353c310add96dc42c956 From 609d1d3696315d7fb42ef541caa98131b9cffeac Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Fri, 11 Jul 2025 21:52:57 +0000 Subject: [PATCH 06/46] Cloud fraction module with large-scale evolution and erosion --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 84b4551746..754d930a82 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 84b455174680f59a8a68353c310add96dc42c956 +Subproject commit 754d930a82b9ef49162d6449e6c9353691b459bd From b2b0550d8310b4eb42670b9af000ca6524679287 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Sun, 13 Jul 2025 13:02:54 +0000 Subject: [PATCH 07/46] Cloud fraction tuning and addition of in-cloud calculations for qr --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 754d930a82..0f16a688c3 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 754d930a82b9ef49162d6449e6c9353691b459bd +Subproject commit 0f16a688c356655d37ea284b5c5f04628bee0ce5 From d44d9f10cc66d5ece4c4e80aa8fa646ab259d78e Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Mon, 14 Jul 2025 17:24:03 +0000 Subject: [PATCH 08/46] Adds qi_sgs, sgs cloud ice --- src/core_atmosphere/Registry.xml | 14 +++++++++++++- .../physics/mpas_atmphys_driver_microphysics.F | 10 ++++++---- .../physics/mpas_atmphys_interface.F | 14 ++++++++++---- src/core_atmosphere/physics/mpas_atmphys_vars.F | 2 +- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 57415f1b52..838ea7b48c 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -1874,6 +1874,10 @@ + + #endif @@ -2271,7 +2275,11 @@ packages="tempo_cldfra_in"/> + + #endif @@ -2380,6 +2388,10 @@ + + diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index ccf0cab781..a723967dea 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -228,6 +228,7 @@ subroutine allocate_microphysics(configs) if (config_tempo_cldfra) then if(.not.allocated(qasgs_p)) allocate(qasgs_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(qcsgs_p)) allocate(qcsgs_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qisgs_p)) allocate(qisgs_p(ims:ime,kms:kme,jms:jme)) endif if (config_tempo_ml_nc_pbl) then @@ -398,6 +399,7 @@ subroutine deallocate_microphysics(configs) if (config_tempo_cldfra) then if(allocated(qasgs_p)) deallocate(qasgs_p) if(allocated(qcsgs_p)) deallocate(qcsgs_p) + if(allocated(qisgs_p)) deallocate(qisgs_p) endif if (config_tempo_ml_nc_pbl) then @@ -621,7 +623,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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 , & - qasgs = qasgs_p , qcsgs = qcsgs_p , & + qasgs = qasgs_p , qcsgs = qcsgs_p , qisgs = qisgs_p , & !! ng = ng_p , qb = volg_p , & !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & @@ -644,7 +646,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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 , & - qasgs = qasgs_p , qcsgs = qcsgs_p , & + qasgs = qasgs_p , qcsgs = qcsgs_p , qisgs = qisgs_p , & !! ng = ng_p , qb = volg_p , & nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & @@ -668,7 +670,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten qr = qr_p , qi = qi_p , qs = qs_p , & qg = qg_p , ni = ni_p , nr = nr_p , & ng = ng_p , qb = volg_p , & - qasgs = qasgs_p , qcsgs = qcsgs_p , & + qasgs = qasgs_p , qcsgs = qcsgs_p , qisgs = qisgs_p , & !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & pii = pi_p , p = pres_p , dz = dz_p , & @@ -696,7 +698,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten ng = ng_p , qb = volg_p , & nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - qasgs = qasgs_p , qcsgs = qcsgs_p , & + qasgs = qasgs_p , qcsgs = qcsgs_p , qisgs = qisgs_p , & pii = pi_p , p = pres_p , dz = dz_p , & w = w_p , dt_in = dt_microp , itimestep = itimestep , & rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index 75987d0bd6..c88ff50db1 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -670,7 +670,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, integer,pointer:: index_zrw,index_zgw,index_zhw integer,pointer:: index_ns,index_ng,index_nh,index_nccn integer,pointer:: index_volg,index_volh - integer,pointer:: index_qa_sgs, index_qc_sgs + integer,pointer:: index_qa_sgs, index_qc_sgs, index_qi_sgs real(kind=RKIND),dimension(:,:),pointer :: zgrid,w real(kind=RKIND),dimension(:,:),pointer :: zz,exner,pressure_b @@ -678,7 +678,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, real(kind=RKIND),dimension(:,:),pointer :: qv,qc,qr,qi,qs,qg real(kind=RKIND),dimension(:,:),pointer :: qh real(kind=RKIND),dimension(:,:),pointer :: nc,ni,nr,nifa,nwfa - real(kind=RKIND),dimension(:,:),pointer :: qa_sgs, qc_sgs + real(kind=RKIND),dimension(:,:),pointer :: qa_sgs, qc_sgs, qi_sgs real(kind=RKIND),dimension(:,:),pointer :: ns,ng,nh,nccn real(kind=RKIND),dimension(:,:),pointer :: volg,volh,zrw,zgw,zhw real(kind=RKIND),dimension(:,:),pointer :: rainprod,evapprod @@ -950,15 +950,18 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, if (config_tempo_cldfra) then call mpas_pool_get_dimension(state,'index_qa_sgs' ,index_qa_sgs ) call mpas_pool_get_dimension(state,'index_qc_sgs' ,index_qc_sgs ) + call mpas_pool_get_dimension(state,'index_qi_sgs' ,index_qi_sgs ) qa_sgs => scalars(index_qa_sgs,:,:) qc_sgs => scalars(index_qc_sgs,:,:) + qi_sgs => scalars(index_qi_sgs,:,:) do j = jts, jte do k = kts, kte do i = its, ite qasgs_p(i,k,j) = qa_sgs(k,i) qcsgs_p(i,k,j) = qc_sgs(k,i) + qisgs_p(i,k,j) = qi_sgs(k,i) enddo enddo enddo @@ -1175,7 +1178,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te logical,pointer:: config_tempo_cldfra 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 - integer,pointer:: index_qa_sgs, index_qc_sgs + integer,pointer:: index_qa_sgs, index_qc_sgs, index_qi_sgs !TEMPO/NSSL integer,pointer:: index_qh integer,pointer:: index_zrw,index_zgw,index_zhw @@ -1192,7 +1195,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te real(kind=RKIND),dimension(:,:),pointer :: qv,qc,qr,qi,qs,qg real(kind=RKIND),dimension(:,:),pointer :: qh real(kind=RKIND),dimension(:,:),pointer :: nc,ni,nr,nifa,nwfa - real(kind=RKIND),dimension(:,:),pointer :: qa_sgs, qc_sgs + real(kind=RKIND),dimension(:,:),pointer :: qa_sgs, qc_sgs, qi_sgs real(kind=RKIND),dimension(:,:),pointer :: ns,ng,nh,nccn real(kind=RKIND),dimension(:,:),pointer :: volg,volh,zrw,zgw,zhw real(kind=RKIND),dimension(:) ,pointer :: max_hail_diameter_sfc, max_hail_diameter_column @@ -1477,15 +1480,18 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te if (config_tempo_cldfra) then call mpas_pool_get_dimension(state,'index_qa_sgs' ,index_qa_sgs ) call mpas_pool_get_dimension(state,'index_qc_sgs' ,index_qc_sgs ) + call mpas_pool_get_dimension(state,'index_qi_sgs' ,index_qi_sgs ) qa_sgs => scalars(index_qa_sgs,:,:) qc_sgs => scalars(index_qc_sgs,:,:) + qi_sgs => scalars(index_qi_sgs,:,:) do j = jts, jte do k = kts, kte do i = its, ite qa_sgs(k,i) = qasgs_p(i,k,j) qc_sgs(k,i) = qcsgs_p(i,k,j) + qi_sgs(k,i) = qisgs_p(i,k,j) enddo enddo enddo diff --git a/src/core_atmosphere/physics/mpas_atmphys_vars.F b/src/core_atmosphere/physics/mpas_atmphys_vars.F index 7d7e402014..d62fb7ad71 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_vars.F +++ b/src/core_atmosphere/physics/mpas_atmphys_vars.F @@ -221,7 +221,7 @@ module mpas_atmphys_vars nifa2d_p real(kind=RKIND),dimension(:,:,:),allocatable:: & - qasgs_p, qcsgs_p + qasgs_p, qcsgs_p, qisgs_p !... arrays located at w (vertical velocity) points, or at interface between layers: real(kind=RKIND),dimension(:,:,:),allocatable:: & From ce48a4fafd5324d29e5c9b0bd87631f03e1eb0a1 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Mon, 14 Jul 2025 17:30:24 +0000 Subject: [PATCH 09/46] Adds full hookup of sgs cloud water, ice, rain, snow --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 0f16a688c3..76d7e92b02 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 0f16a688c356655d37ea284b5c5f04628bee0ce5 +Subproject commit 76d7e92b024095faaabe3ce5e6c79ed66c85f9aa From ae12a471c6dda11edd0379052c5b0315723d0ff2 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Mon, 14 Jul 2025 19:19:20 +0000 Subject: [PATCH 10/46] Adds connection between TEMPO cloud fraction and radiation --- src/core_atmosphere/Registry.xml | 2 +- .../physics/mpas_atmphys_control.F | 11 +++ .../physics/mpas_atmphys_driver.F | 2 +- .../physics/mpas_atmphys_driver_cloudiness.F | 82 ++++++++++++++++++- 4 files changed, 92 insertions(+), 5 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 838ea7b48c..36c820d46c 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -2633,7 +2633,7 @@ + possible_values="`suite',`cld_fraction',`cld_incidence',`cld_fraction_thompson',`cld_fraction_mynn',`cld_tempo'"/> scalars(index_qa_sgs,:,:) + qcsgs => scalars(index_qc_sgs,:,:) + qisgs => scalars(index_qi_sgs,:,:) + do j = jts,jte + do k = kts,kte + do i = its,ite + qasgs_p(i,k,j) = qasgs(k,i) + cldfrac_p(i,k,j) = qasgs(k,i) + qcsgs_p(i,k,j) = qcsgs(k,i) + qisgs_p(i,k,j) = qisgs(k,i) + enddo + enddo + enddo case default end select cld_fraction_select @@ -288,12 +322,13 @@ subroutine cloudiness_to_MPAS(diag_physics,its,ite) end subroutine cloudiness_to_MPAS !================================================================================================================= - subroutine driver_cloudiness(itimestep,configs,mesh,diag_physics,sfc_input,its,ite) + subroutine driver_cloudiness(itimestep,configs,mesh,state,diag_physics,sfc_input,its,ite) !================================================================================================================= !input arguments: type(mpas_pool_type),intent(in) :: configs type(mpas_pool_type),intent(in) :: mesh + type(mpas_pool_type),intent(in) :: state type(mpas_pool_type),intent(in) :: sfc_input integer,intent(in):: its,ite @@ -316,7 +351,7 @@ subroutine driver_cloudiness(itimestep,configs,mesh,diag_physics,sfc_input,its,i call mpas_pool_get_config(configs,'config_convection_scheme',convection_scheme) !copy MPAS arrays to local arrays: - call cloudiness_from_MPAS(itimestep,configs,mesh,diag_physics,sfc_input,its,ite) + call cloudiness_from_MPAS(itimestep,configs,mesh,state,diag_physics,sfc_input,its,ite) cld_fraction_select: select case (trim(radt_cld_scheme)) case("cld_incidence") @@ -349,6 +384,12 @@ subroutine driver_cloudiness(itimestep,configs,mesh,diag_physics,sfc_input,its,i its, ite , jts , jte , kts , kte ) call mpas_timer_stop('cal_mynncld') + case("cld_tempo") + call mpas_timer_start('cal_cldfra_tempo') + call cal_cldfra_tempo(qasgs_p , qcrad_p , qirad_p , & + qcsgs_p , qisgs_p , & + its, ite , jts , jte , kts , kte ) + call mpas_timer_stop('cal_cldfra_tempo') case default end select cld_fraction_select @@ -573,6 +614,41 @@ subroutine cal_gflcld(cldfrac,qc,qi,qc_cu,qi_cu,its,ite,jts,jte,kts,kte) enddo end subroutine cal_gflcld +!================================================================================================================= +!================================================================================================================= + subroutine cal_cldfra_tempo(cldfrac,qc,qi,qc_sgs,qi_sgs,its,ite,jts,jte,kts,kte) +!================================================================================================================= + +!input arguments: + integer,intent(in):: its,ite,jts,jte,kts,kte + real(kind=RKIND),intent(inout),dimension(ims:ime,kms:kme,jms:jme):: qc,qi + real(kind=RKIND),intent(in), dimension(ims:ime,kms:kme,jms:jme):: qc_sgs,qi_sgs + real(kind=RKIND),intent(in), dimension(ims:ime,kms:kme,jms:jme):: cldfrac + +!local variables: + integer:: i,j,k + + real(kind=RKIND),parameter:: qc_thresh = 1.e-06 + real(kind=RKIND),parameter:: qi_thresh = 1.e-09 + real(kind=RKIND),parameter:: cld_thresh = 1.e-03 + + do j = jts,jte + do k = kts,kte + do i = its,ite + + if (qc(i,k,j) < qc_thresh .AND. cldfrac(i,k,j) > cld_thresh) THEN + !call mpas_log_write("Adding in cldfra_bl to qc at $i,$i,$i", intArgs=(/i,j,k/)) + qc(i,k,j)=qc(i,k,j) + qc_sgs(i,k,j) + endif + if (qi(i,k,j) < qi_thresh .AND. cldfrac(i,k,j) > cld_thresh) THEN + !call mpas_log_write("Adding in cldfra_bl to qi at $i,$i,$i", intArgs=(/i,j,k/)) + qi(i,k,j)=qi(i,k,j) + qi_sgs(i,k,j) + endif + enddo + enddo + enddo + + end subroutine cal_cldfra_tempo !================================================================================================================= end module mpas_atmphys_driver_cloudiness !================================================================================================================= From 84e925ec374bc443aa20e361a24635003b6e32e9 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Sun, 10 Aug 2025 18:46:41 +0000 Subject: [PATCH 11/46] refactored cloud fraction / separate liquid and ice --- src/core_atmosphere/Registry.xml | 42 +++++-------- .../physics/mpas_atmphys_control.F | 9 ++- .../physics/mpas_atmphys_driver_cloudiness.F | 49 +++++++-------- .../mpas_atmphys_driver_microphysics.F | 38 +++++++++--- .../physics/mpas_atmphys_interface.F | 62 ++++++++++++------- .../physics/mpas_atmphys_vars.F | 2 +- .../physics/physics_noaa/TEMPO | 2 +- 7 files changed, 112 insertions(+), 92 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 36c820d46c..6fdb9926bc 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -1867,17 +1867,13 @@ description="Water-friendly aerosol number concentration" packages="mp_thompson_aers_in;tempo_aerosolaware_in"/> - - - - + #endif @@ -2270,17 +2266,13 @@ description="Tendency of water-friendly aerosol number concentration multiplied by dry air density divided by d(zeta)/dz" packages="mp_thompson_aers_in;tempo_aerosolaware_in"/> - - - - + #endif @@ -2381,17 +2373,13 @@ units="m^{-3} s^{-1}" description="Lateral boundary tendency of water-friendly aerosol number concentration"/> - - - + description="Lateral boundary tendency of sgs prognostic cloud liquid fraction"/> - + diff --git a/src/core_atmosphere/physics/mpas_atmphys_control.F b/src/core_atmosphere/physics/mpas_atmphys_control.F index 32ce44969a..5e85a0ceb0 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_control.F +++ b/src/core_atmosphere/physics/mpas_atmphys_control.F @@ -108,7 +108,7 @@ subroutine physics_namelist_check(configs) config_sfclayer_scheme logical,pointer:: config_tempo_cldfra - + integer,pointer:: config_mynn_cloudpdf !----------------------------------------------------------------------------------------------------------------- !call mpas_log_write('') !call mpas_log_write('--- enter subroutine physics_namelist_check:') @@ -124,6 +124,7 @@ subroutine physics_namelist_check(configs) call mpas_pool_get_config(configs,'config_radt_sw_scheme' ,config_radt_sw_scheme ) call mpas_pool_get_config(configs,'config_sfclayer_scheme' ,config_sfclayer_scheme ) call mpas_pool_get_config(configs,'config_tempo_cldfra' ,config_tempo_cldfra ) + call mpas_pool_get_config(configs,'config_mynn_cloudpdf' ,config_mynn_cloudpdf ) call mpas_log_write('') call mpas_log_write('----- Setting up physics suite '''//trim(config_physics_suite)//''' -----') @@ -303,6 +304,12 @@ subroutine physics_namelist_check(configs) ' setting cloud fraction to config_radt_cld_scheme = cld_tempo' call physics_message(mpas_err_message) config_radt_cld_scheme = "cld_tempo" + if ((config_pbl_scheme == 'bl_mynn') .and. (config_mynn_cloudpdf .ge. 0)) then + write(mpas_err_message,'(A,A20)') & + ' setting config_mynn_cloudpdf to -2 when using tempo prognostic clouds' + call physics_message(mpas_err_message) + config_mynn_cloudpdf = -2 + endif endif !surface-layer scheme: diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F index ea14e5dccb..cf53e2e99a 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F @@ -88,9 +88,8 @@ subroutine allocate_cloudiness(configs) if(.not.allocated(qcbl_p)) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) case("cld_tempo") - if(.not.allocated(qasgs_p)) allocate(qasgs_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(qcsgs_p)) allocate(qcsgs_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(qisgs_p)) allocate(qisgs_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qalsgs_p)) allocate(qalsgs_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qaisgs_p)) allocate(qaisgs_p(ims:ime,kms:kme,jms:jme)) case default end select cld_fraction_select @@ -131,9 +130,8 @@ subroutine deallocate_cloudiness(configs) if(allocated(qcbl_p)) deallocate(qcbl_p) case("cld_tempo") - if(allocated(qasgs_p)) deallocate(qasgs_p) - if(allocated(qcsgs_p)) deallocate(qcsgs_p) - if(allocated(qisgs_p)) deallocate(qisgs_p) + if(allocated(qalsgs_p)) deallocate(qalsgs_p) + if(allocated(qaisgs_p)) deallocate(qaisgs_p) case default end select cld_fraction_select @@ -175,9 +173,9 @@ subroutine cloudiness_from_MPAS(itimestep,configs,mesh,state,diag_physics,sfc_in character(len=StrKIND),pointer:: radt_cld_scheme character(len=StrKIND),pointer:: convection_scheme - integer,pointer:: index_qa_sgs, index_qc_sgs, index_qi_sgs + integer,pointer:: index_qal_sgs, index_qai_sgs real(kind=RKIND),dimension(:,:,:),pointer:: scalars - real(kind=RKIND),dimension(:,:),pointer:: qasgs, qcsgs, qisgs + real(kind=RKIND),dimension(:,:),pointer:: qalsgs, qaisgs !----------------------------------------------------------------------------------------------------------------- @@ -252,20 +250,17 @@ subroutine cloudiness_from_MPAS(itimestep,configs,mesh,state,diag_physics,sfc_in case("cld_tempo") call mpas_pool_get_array(state,'scalars',scalars) - call mpas_pool_get_dimension(state,'index_qa_sgs',index_qa_sgs) - call mpas_pool_get_dimension(state,'index_qc_sgs',index_qc_sgs) - call mpas_pool_get_dimension(state,'index_qi_sgs',index_qi_sgs) + call mpas_pool_get_dimension(state,'index_qal_sgs',index_qal_sgs) + call mpas_pool_get_dimension(state,'index_qai_sgs',index_qai_sgs) - qasgs => scalars(index_qa_sgs,:,:) - qcsgs => scalars(index_qc_sgs,:,:) - qisgs => scalars(index_qi_sgs,:,:) + qalsgs => scalars(index_qal_sgs,:,:) + qaisgs => scalars(index_qai_sgs,:,:) do j = jts,jte do k = kts,kte do i = its,ite - qasgs_p(i,k,j) = qasgs(k,i) - cldfrac_p(i,k,j) = qasgs(k,i) - qcsgs_p(i,k,j) = qcsgs(k,i) - qisgs_p(i,k,j) = qisgs(k,i) + qalsgs_p(i,k,j) = qalsgs(k,i) + qaisgs_p(i,k,j) = qaisgs(k,i) + cldfrac_p(i,k,j) = max(qalsgs(k,i), qaisgs(k,i)) enddo enddo enddo @@ -386,8 +381,7 @@ subroutine driver_cloudiness(itimestep,configs,mesh,state,diag_physics,sfc_input case("cld_tempo") call mpas_timer_start('cal_cldfra_tempo') - call cal_cldfra_tempo(qasgs_p , qcrad_p , qirad_p , & - qcsgs_p , qisgs_p , & + call cal_cldfra_tempo(qalsgs_p , qaisgs_p, qcrad_p , qirad_p , & its, ite , jts , jte , kts , kte ) call mpas_timer_stop('cal_cldfra_tempo') case default @@ -616,33 +610,32 @@ subroutine cal_gflcld(cldfrac,qc,qi,qc_cu,qi_cu,its,ite,jts,jte,kts,kte) end subroutine cal_gflcld !================================================================================================================= !================================================================================================================= - subroutine cal_cldfra_tempo(cldfrac,qc,qi,qc_sgs,qi_sgs,its,ite,jts,jte,kts,kte) + subroutine cal_cldfra_tempo(cldfracl,cldfraci,qc,qi,its,ite,jts,jte,kts,kte) !================================================================================================================= !input arguments: integer,intent(in):: its,ite,jts,jte,kts,kte real(kind=RKIND),intent(inout),dimension(ims:ime,kms:kme,jms:jme):: qc,qi - real(kind=RKIND),intent(in), dimension(ims:ime,kms:kme,jms:jme):: qc_sgs,qi_sgs - real(kind=RKIND),intent(in), dimension(ims:ime,kms:kme,jms:jme):: cldfrac + real(kind=RKIND),intent(in), dimension(ims:ime,kms:kme,jms:jme):: cldfracl, cldfraci !local variables: integer:: i,j,k real(kind=RKIND),parameter:: qc_thresh = 1.e-06 real(kind=RKIND),parameter:: qi_thresh = 1.e-09 - real(kind=RKIND),parameter:: cld_thresh = 1.e-03 + real(kind=RKIND),parameter:: cld_thresh = 1.e-02 do j = jts,jte do k = kts,kte do i = its,ite - if (qc(i,k,j) < qc_thresh .AND. cldfrac(i,k,j) > cld_thresh) THEN + if (qc(i,k,j) < qc_thresh .AND. cldfracl(i,k,j) > cld_thresh) THEN !call mpas_log_write("Adding in cldfra_bl to qc at $i,$i,$i", intArgs=(/i,j,k/)) - qc(i,k,j)=qc(i,k,j) + qc_sgs(i,k,j) + qc(i,k,j)=qc(i,k,j) endif - if (qi(i,k,j) < qi_thresh .AND. cldfrac(i,k,j) > cld_thresh) THEN + if (qi(i,k,j) < qi_thresh .AND. cldfraci(i,k,j) > cld_thresh) THEN !call mpas_log_write("Adding in cldfra_bl to qi at $i,$i,$i", intArgs=(/i,j,k/)) - qi(i,k,j)=qi(i,k,j) + qi_sgs(i,k,j) + qi(i,k,j)=qi(i,k,j) endif enddo enddo diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index a723967dea..7e3e743f62 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -226,9 +226,17 @@ subroutine allocate_microphysics(configs) endif if (config_tempo_cldfra) then - if(.not.allocated(qasgs_p)) allocate(qasgs_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(qcsgs_p)) allocate(qcsgs_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(qisgs_p)) allocate(qisgs_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qalsgs_p)) allocate(qalsgs_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qaisgs_p)) allocate(qaisgs_p(ims:ime,kms:kme,jms:jme)) + + if(.not.allocated(rthblten_p)) allocate(rthblten_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(rqvblten_p)) allocate(rqvblten_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(rqcblten_p)) allocate(rqcblten_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(rqiblten_p)) allocate(rqiblten_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(rthratenlw_p)) allocate(rthratenlw_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(rthratensw_p)) allocate(rthratensw_p(ims:ime,kms:kme,jms:jme)) +! if(.not.allocated(cldfrac_p) ) allocate(cldfrac_p(ims:ime,kms:kme,jms:jme)) +! if(.not.allocated(qcbl_p) ) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) endif if (config_tempo_ml_nc_pbl) then @@ -397,9 +405,17 @@ subroutine deallocate_microphysics(configs) endif if (config_tempo_cldfra) then - if(allocated(qasgs_p)) deallocate(qasgs_p) - if(allocated(qcsgs_p)) deallocate(qcsgs_p) - if(allocated(qisgs_p)) deallocate(qisgs_p) + if(allocated(qalsgs_p)) deallocate(qalsgs_p) + if(allocated(qaisgs_p)) deallocate(qaisgs_p) + + if(allocated(rthblten_p)) deallocate(rthblten_p) + if(allocated(rqvblten_p)) deallocate(rqvblten_p) + if(allocated(rqcblten_p)) deallocate(rqcblten_p) + if(allocated(rqiblten_p)) deallocate(rqiblten_p) + if(allocated(rthratenlw_p)) deallocate(rthratenlw_p) + if(allocated(rthratensw_p)) deallocate(rthratensw_p) +! if(allocated(cldfrac_p) ) deallocate(cldfrac_p) +! if(allocated(qcbl_p) ) deallocate(qcbl_p) endif if (config_tempo_ml_nc_pbl) then @@ -623,7 +639,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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 , & - qasgs = qasgs_p , qcsgs = qcsgs_p , qisgs = qisgs_p , & + qalsgs = qalsgs_p , qaisgs = qaisgs_p , & !! ng = ng_p , qb = volg_p , & !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & @@ -646,7 +662,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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 , & - qasgs = qasgs_p , qcsgs = qcsgs_p , qisgs = qisgs_p , & + qalsgs = qalsgs_p , qaisgs = qaisgs_p , & !! ng = ng_p , qb = volg_p , & nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & @@ -670,7 +686,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten qr = qr_p , qi = qi_p , qs = qs_p , & qg = qg_p , ni = ni_p , nr = nr_p , & ng = ng_p , qb = volg_p , & - qasgs = qasgs_p , qcsgs = qcsgs_p , qisgs = qisgs_p , & + qalsgs = qalsgs_p , qaisgs = qaisgs_p , & !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & pii = pi_p , p = pres_p , dz = dz_p , & @@ -698,7 +714,9 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten ng = ng_p , qb = volg_p , & nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - qasgs = qasgs_p , qcsgs = qcsgs_p , qisgs = qisgs_p , & + qalsgs = qalsgs_p , qaisgs = qaisgs_p , & + rthbl = rthblten_p, rqvbl = rqvblten_p, rqcbl = rqcblten_p, rqibl = rqiblten_p , & + rthlw = rthratenlw_p, rthsw = rthratensw_p , & pii = pi_p , p = pres_p , dz = dz_p , & w = w_p , dt_in = dt_microp , itimestep = itimestep , & rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index c88ff50db1..4b10aa1496 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -670,7 +670,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, integer,pointer:: index_zrw,index_zgw,index_zhw integer,pointer:: index_ns,index_ng,index_nh,index_nccn integer,pointer:: index_volg,index_volh - integer,pointer:: index_qa_sgs, index_qc_sgs, index_qi_sgs + integer,pointer:: index_qal_sgs, index_qai_sgs real(kind=RKIND),dimension(:,:),pointer :: zgrid,w real(kind=RKIND),dimension(:,:),pointer :: zz,exner,pressure_b @@ -678,7 +678,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, real(kind=RKIND),dimension(:,:),pointer :: qv,qc,qr,qi,qs,qg real(kind=RKIND),dimension(:,:),pointer :: qh real(kind=RKIND),dimension(:,:),pointer :: nc,ni,nr,nifa,nwfa - real(kind=RKIND),dimension(:,:),pointer :: qa_sgs, qc_sgs, qi_sgs + real(kind=RKIND),dimension(:,:),pointer :: qal_sgs, qai_sgs real(kind=RKIND),dimension(:,:),pointer :: ns,ng,nh,nccn real(kind=RKIND),dimension(:,:),pointer :: volg,volh,zrw,zgw,zhw real(kind=RKIND),dimension(:,:),pointer :: rainprod,evapprod @@ -688,6 +688,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, real(kind=RKIND),dimension(:,:),pointer :: qc_bl, cldfrac_bl real(kind=RKIND),dimension(:,:),pointer :: rthmpten,rqvmpten,rqcmpten,rqrmpten,rqimpten,rqsmpten,rqgmpten real(kind=RKIND),dimension(:,:),pointer :: rncmpten,rnimpten,rnrmpten,rnifampten,rnwfampten + real(kind=RKIND),dimension(:,:),pointer :: rthblten, rqvblten, rqcblten, rqiblten, rthratenlw, rthratensw real(kind=RKIND),dimension(:,:,:),pointer:: scalars !local variables: @@ -948,20 +949,36 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, endif if (config_tempo_cldfra) then - call mpas_pool_get_dimension(state,'index_qa_sgs' ,index_qa_sgs ) - call mpas_pool_get_dimension(state,'index_qc_sgs' ,index_qc_sgs ) - call mpas_pool_get_dimension(state,'index_qi_sgs' ,index_qi_sgs ) - - qa_sgs => scalars(index_qa_sgs,:,:) - qc_sgs => scalars(index_qc_sgs,:,:) - qi_sgs => scalars(index_qi_sgs,:,:) + call mpas_pool_get_dimension(state,'index_qal_sgs' ,index_qal_sgs ) + call mpas_pool_get_dimension(state,'index_qai_sgs' ,index_qai_sgs ) + + call mpas_pool_get_array(tend_physics,'rthblten',rthblten) + call mpas_pool_get_array(tend_physics,'rqvblten',rqvblten) + call mpas_pool_get_array(tend_physics,'rqcblten',rqcblten) + call mpas_pool_get_array(tend_physics,'rqiblten',rqiblten) + call mpas_pool_get_array(tend_physics,'rthratenlw',rthratenlw) + call mpas_pool_get_array(tend_physics,'rthratensw',rthratensw) + +! call mpas_pool_get_array(diag_physics,'qc_bl',qc_bl) +! call mpas_pool_get_array(diag_physics,'cldfrac_bl',cldfrac_bl) + + qal_sgs => scalars(index_qal_sgs,:,:) + qai_sgs => scalars(index_qai_sgs,:,:) do j = jts, jte do k = kts, kte do i = its, ite - qasgs_p(i,k,j) = qa_sgs(k,i) - qcsgs_p(i,k,j) = qc_sgs(k,i) - qisgs_p(i,k,j) = qi_sgs(k,i) + qalsgs_p(i,k,j) = qal_sgs(k,i) + qaisgs_p(i,k,j) = qai_sgs(k,i) + + rthblten_p(i,k,j) = rthblten(k,i) + rqvblten_p(i,k,j) = rqvblten(k,i) + rqcblten_p(i,k,j) = rqcblten(k,i) + rqiblten_p(i,k,j) = rqiblten(k,i) + rthratenlw_p(i,k,j) = rthratenlw(k,i) + rthratensw_p(i,k,j) = rthratensw(k,i) +! qcbl_p(i,k,j) = qc_bl(k,i) +! cldfrac_p(i,k,j) = cldfrac_bl(k,i) enddo enddo enddo @@ -1178,7 +1195,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te logical,pointer:: config_tempo_cldfra 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 - integer,pointer:: index_qa_sgs, index_qc_sgs, index_qi_sgs + integer,pointer:: index_qal_sgs, index_qai_sgs !TEMPO/NSSL integer,pointer:: index_qh integer,pointer:: index_zrw,index_zgw,index_zhw @@ -1195,7 +1212,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te real(kind=RKIND),dimension(:,:),pointer :: qv,qc,qr,qi,qs,qg real(kind=RKIND),dimension(:,:),pointer :: qh real(kind=RKIND),dimension(:,:),pointer :: nc,ni,nr,nifa,nwfa - real(kind=RKIND),dimension(:,:),pointer :: qa_sgs, qc_sgs, qi_sgs + real(kind=RKIND),dimension(:,:),pointer :: qal_sgs, qai_sgs real(kind=RKIND),dimension(:,:),pointer :: ns,ng,nh,nccn real(kind=RKIND),dimension(:,:),pointer :: volg,volh,zrw,zgw,zhw real(kind=RKIND),dimension(:) ,pointer :: max_hail_diameter_sfc, max_hail_diameter_column @@ -1478,20 +1495,17 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te endif if (config_tempo_cldfra) then - call mpas_pool_get_dimension(state,'index_qa_sgs' ,index_qa_sgs ) - call mpas_pool_get_dimension(state,'index_qc_sgs' ,index_qc_sgs ) - call mpas_pool_get_dimension(state,'index_qi_sgs' ,index_qi_sgs ) - - qa_sgs => scalars(index_qa_sgs,:,:) - qc_sgs => scalars(index_qc_sgs,:,:) - qi_sgs => scalars(index_qi_sgs,:,:) + call mpas_pool_get_dimension(state,'index_qal_sgs' ,index_qal_sgs ) + call mpas_pool_get_dimension(state,'index_qai_sgs' ,index_qai_sgs ) + + qal_sgs => scalars(index_qal_sgs,:,:) + qai_sgs => scalars(index_qai_sgs,:,:) do j = jts, jte do k = kts, kte do i = its, ite - qa_sgs(k,i) = qasgs_p(i,k,j) - qc_sgs(k,i) = qcsgs_p(i,k,j) - qi_sgs(k,i) = qisgs_p(i,k,j) + qal_sgs(k,i) = qalsgs_p(i,k,j) + qai_sgs(k,i) = qaisgs_p(i,k,j) enddo enddo enddo diff --git a/src/core_atmosphere/physics/mpas_atmphys_vars.F b/src/core_atmosphere/physics/mpas_atmphys_vars.F index d62fb7ad71..d553711b92 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_vars.F +++ b/src/core_atmosphere/physics/mpas_atmphys_vars.F @@ -221,7 +221,7 @@ module mpas_atmphys_vars nifa2d_p real(kind=RKIND),dimension(:,:,:),allocatable:: & - qasgs_p, qcsgs_p, qisgs_p + qalsgs_p, qaisgs_p !... arrays located at w (vertical velocity) points, or at interface between layers: real(kind=RKIND),dimension(:,:,:),allocatable:: & diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 76d7e92b02..e1e6770ecf 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 76d7e92b024095faaabe3ce5e6c79ed66c85f9aa +Subproject commit e1e6770ecf0f645774bd07702d4e873693ae4006 From 92beb5140081514488eddc6750c2caf4016660ca Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 15 Aug 2025 16:49:12 +0000 Subject: [PATCH 12/46] Final refactor --- src/core_atmosphere/Registry.xml | 29 +++++---- .../physics/mpas_atmphys_control.F | 2 +- .../physics/mpas_atmphys_driver_cloudiness.F | 65 ++++--------------- .../mpas_atmphys_driver_microphysics.F | 26 ++++---- .../physics/mpas_atmphys_interface.F | 47 +++++++------- .../physics/mpas_atmphys_vars.F | 2 +- 6 files changed, 70 insertions(+), 101 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 6fdb9926bc..3c58cf223b 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -1867,12 +1867,12 @@ description="Water-friendly aerosol number concentration" packages="mp_thompson_aers_in;tempo_aerosolaware_in"/> - - #endif @@ -2266,13 +2266,13 @@ description="Tendency of water-friendly aerosol number concentration multiplied by dry air density divided by d(zeta)/dz" packages="mp_thompson_aers_in;tempo_aerosolaware_in"/> - - + #endif @@ -2373,13 +2373,13 @@ units="m^{-3} s^{-1}" description="Lateral boundary tendency of water-friendly aerosol number concentration"/> - + description="Lateral boundary tendency of prognostic cloud liquid fraction"/> - + description="Lateral boundary tendency of prognostic cloud ice fraction"/> @@ -2940,6 +2940,9 @@ + diff --git a/src/core_atmosphere/physics/mpas_atmphys_control.F b/src/core_atmosphere/physics/mpas_atmphys_control.F index 5e85a0ceb0..7d15148256 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_control.F +++ b/src/core_atmosphere/physics/mpas_atmphys_control.F @@ -124,7 +124,7 @@ subroutine physics_namelist_check(configs) call mpas_pool_get_config(configs,'config_radt_sw_scheme' ,config_radt_sw_scheme ) call mpas_pool_get_config(configs,'config_sfclayer_scheme' ,config_sfclayer_scheme ) call mpas_pool_get_config(configs,'config_tempo_cldfra' ,config_tempo_cldfra ) - call mpas_pool_get_config(configs,'config_mynn_cloudpdf' ,config_mynn_cloudpdf ) + call mpas_pool_get_config(configs,'config_mynn_cloudpdf' ,config_mynn_cloudpdf ) call mpas_log_write('') call mpas_log_write('----- Setting up physics suite '''//trim(config_physics_suite)//''' -----') diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F index cf53e2e99a..2f2fb1db45 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F @@ -88,8 +88,8 @@ subroutine allocate_cloudiness(configs) if(.not.allocated(qcbl_p)) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) case("cld_tempo") - if(.not.allocated(qalsgs_p)) allocate(qalsgs_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(qaisgs_p)) allocate(qaisgs_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qal_p)) allocate(qal_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qai_p)) allocate(qai_p(ims:ime,kms:kme,jms:jme)) case default end select cld_fraction_select @@ -130,8 +130,8 @@ subroutine deallocate_cloudiness(configs) if(allocated(qcbl_p)) deallocate(qcbl_p) case("cld_tempo") - if(allocated(qalsgs_p)) deallocate(qalsgs_p) - if(allocated(qaisgs_p)) deallocate(qaisgs_p) + if(allocated(qal_p)) deallocate(qal_p) + if(allocated(qai_p)) deallocate(qai_p) case default end select cld_fraction_select @@ -173,9 +173,9 @@ subroutine cloudiness_from_MPAS(itimestep,configs,mesh,state,diag_physics,sfc_in character(len=StrKIND),pointer:: radt_cld_scheme character(len=StrKIND),pointer:: convection_scheme - integer,pointer:: index_qal_sgs, index_qai_sgs + integer,pointer:: index_qal, index_qai real(kind=RKIND),dimension(:,:,:),pointer:: scalars - real(kind=RKIND),dimension(:,:),pointer:: qalsgs, qaisgs + real(kind=RKIND),dimension(:,:),pointer:: qal, qai !----------------------------------------------------------------------------------------------------------------- @@ -250,17 +250,17 @@ subroutine cloudiness_from_MPAS(itimestep,configs,mesh,state,diag_physics,sfc_in case("cld_tempo") call mpas_pool_get_array(state,'scalars',scalars) - call mpas_pool_get_dimension(state,'index_qal_sgs',index_qal_sgs) - call mpas_pool_get_dimension(state,'index_qai_sgs',index_qai_sgs) + call mpas_pool_get_dimension(state,'index_qal',index_qal) + call mpas_pool_get_dimension(state,'index_qai',index_qai) - qalsgs => scalars(index_qal_sgs,:,:) - qaisgs => scalars(index_qai_sgs,:,:) + qal => scalars(index_qal,:,:) + qai => scalars(index_qai,:,:) do j = jts,jte do k = kts,kte do i = its,ite - qalsgs_p(i,k,j) = qalsgs(k,i) - qaisgs_p(i,k,j) = qaisgs(k,i) - cldfrac_p(i,k,j) = max(qalsgs(k,i), qaisgs(k,i)) + qal_p(i,k,j) = qal(k,i) + qai_p(i,k,j) = qai(k,i) + cldfrac_p(i,k,j) = max(qal(k,i), qai(k,i)) enddo enddo enddo @@ -379,11 +379,6 @@ subroutine driver_cloudiness(itimestep,configs,mesh,state,diag_physics,sfc_input its, ite , jts , jte , kts , kte ) call mpas_timer_stop('cal_mynncld') - case("cld_tempo") - call mpas_timer_start('cal_cldfra_tempo') - call cal_cldfra_tempo(qalsgs_p , qaisgs_p, qcrad_p , qirad_p , & - its, ite , jts , jte , kts , kte ) - call mpas_timer_stop('cal_cldfra_tempo') case default end select cld_fraction_select @@ -608,40 +603,6 @@ subroutine cal_gflcld(cldfrac,qc,qi,qc_cu,qi_cu,its,ite,jts,jte,kts,kte) enddo end subroutine cal_gflcld -!================================================================================================================= -!================================================================================================================= - subroutine cal_cldfra_tempo(cldfracl,cldfraci,qc,qi,its,ite,jts,jte,kts,kte) -!================================================================================================================= - -!input arguments: - integer,intent(in):: its,ite,jts,jte,kts,kte - real(kind=RKIND),intent(inout),dimension(ims:ime,kms:kme,jms:jme):: qc,qi - real(kind=RKIND),intent(in), dimension(ims:ime,kms:kme,jms:jme):: cldfracl, cldfraci - -!local variables: - integer:: i,j,k - - real(kind=RKIND),parameter:: qc_thresh = 1.e-06 - real(kind=RKIND),parameter:: qi_thresh = 1.e-09 - real(kind=RKIND),parameter:: cld_thresh = 1.e-02 - - do j = jts,jte - do k = kts,kte - do i = its,ite - - if (qc(i,k,j) < qc_thresh .AND. cldfracl(i,k,j) > cld_thresh) THEN - !call mpas_log_write("Adding in cldfra_bl to qc at $i,$i,$i", intArgs=(/i,j,k/)) - qc(i,k,j)=qc(i,k,j) - endif - if (qi(i,k,j) < qi_thresh .AND. cldfraci(i,k,j) > cld_thresh) THEN - !call mpas_log_write("Adding in cldfra_bl to qi at $i,$i,$i", intArgs=(/i,j,k/)) - qi(i,k,j)=qi(i,k,j) - endif - enddo - enddo - enddo - - end subroutine cal_cldfra_tempo !================================================================================================================= end module mpas_atmphys_driver_cloudiness !================================================================================================================= diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index 7e3e743f62..334c9664c2 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -226,17 +226,18 @@ subroutine allocate_microphysics(configs) endif if (config_tempo_cldfra) then - if(.not.allocated(qalsgs_p)) allocate(qalsgs_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(qaisgs_p)) allocate(qaisgs_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qal_p)) allocate(qal_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(qai_p)) allocate(qai_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(precipfrac_p)) allocate(precipfrac_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rthblten_p)) allocate(rthblten_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rqvblten_p)) allocate(rqvblten_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rqcblten_p)) allocate(rqcblten_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rqiblten_p)) allocate(rqiblten_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rthratenlw_p)) allocate(rthratenlw_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(rthratensw_p)) allocate(rthratensw_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(rthratensw_p)) allocate(rthratensw_p(ims:ime,kms:kme,jms:jme)) ! if(.not.allocated(cldfrac_p) ) allocate(cldfrac_p(ims:ime,kms:kme,jms:jme)) -! if(.not.allocated(qcbl_p) ) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) +! if(.not.allocated(qcbl_p) ) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) endif if (config_tempo_ml_nc_pbl) then @@ -405,17 +406,18 @@ subroutine deallocate_microphysics(configs) endif if (config_tempo_cldfra) then - if(allocated(qalsgs_p)) deallocate(qalsgs_p) - if(allocated(qaisgs_p)) deallocate(qaisgs_p) + if(allocated(qal_p)) deallocate(qal_p) + if(allocated(qai_p)) deallocate(qai_p) + if(allocated(precipfrac_p)) deallocate(precipfrac_p) if(allocated(rthblten_p)) deallocate(rthblten_p) if(allocated(rqvblten_p)) deallocate(rqvblten_p) if(allocated(rqcblten_p)) deallocate(rqcblten_p) if(allocated(rqiblten_p)) deallocate(rqiblten_p) if(allocated(rthratenlw_p)) deallocate(rthratenlw_p) - if(allocated(rthratensw_p)) deallocate(rthratensw_p) + if(allocated(rthratensw_p)) deallocate(rthratensw_p) ! if(allocated(cldfrac_p) ) deallocate(cldfrac_p) -! if(allocated(qcbl_p) ) deallocate(qcbl_p) +! if(allocated(qcbl_p) ) deallocate(qcbl_p) endif if (config_tempo_ml_nc_pbl) then @@ -639,7 +641,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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 , & - qalsgs = qalsgs_p , qaisgs = qaisgs_p , & + qal = qal_p , qai = qai_p , precipfrac = precipfrac_p , & !! ng = ng_p , qb = volg_p , & !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & @@ -662,7 +664,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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 , & - qalsgs = qalsgs_p , qaisgs = qaisgs_p , & + qal = qal_p , qai = qai_p , precipfrac = precipfrac_p , & !! ng = ng_p , qb = volg_p , & nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & @@ -686,7 +688,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten qr = qr_p , qi = qi_p , qs = qs_p , & qg = qg_p , ni = ni_p , nr = nr_p , & ng = ng_p , qb = volg_p , & - qalsgs = qalsgs_p , qaisgs = qaisgs_p , & + qal = qal_p , qai = qai_p , precipfrac = precipfrac_p , & !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & pii = pi_p , p = pres_p , dz = dz_p , & @@ -714,7 +716,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten ng = ng_p , qb = volg_p , & nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - qalsgs = qalsgs_p , qaisgs = qaisgs_p , & + qal = qal_p , qai = qai_p , precipfrac = precipfrac_p , & rthbl = rthblten_p, rqvbl = rqvblten_p, rqcbl = rqcblten_p, rqibl = rqiblten_p , & rthlw = rthratenlw_p, rthsw = rthratensw_p , & pii = pi_p , p = pres_p , dz = dz_p , & diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index 4b10aa1496..a716252db7 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -670,7 +670,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, integer,pointer:: index_zrw,index_zgw,index_zhw integer,pointer:: index_ns,index_ng,index_nh,index_nccn integer,pointer:: index_volg,index_volh - integer,pointer:: index_qal_sgs, index_qai_sgs + integer,pointer:: index_qal, index_qai real(kind=RKIND),dimension(:,:),pointer :: zgrid,w real(kind=RKIND),dimension(:,:),pointer :: zz,exner,pressure_b @@ -678,7 +678,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, real(kind=RKIND),dimension(:,:),pointer :: qv,qc,qr,qi,qs,qg real(kind=RKIND),dimension(:,:),pointer :: qh real(kind=RKIND),dimension(:,:),pointer :: nc,ni,nr,nifa,nwfa - real(kind=RKIND),dimension(:,:),pointer :: qal_sgs, qai_sgs + real(kind=RKIND),dimension(:,:),pointer :: qal, qai, precipfrac real(kind=RKIND),dimension(:,:),pointer :: ns,ng,nh,nccn real(kind=RKIND),dimension(:,:),pointer :: volg,volh,zrw,zgw,zhw real(kind=RKIND),dimension(:,:),pointer :: rainprod,evapprod @@ -949,36 +949,37 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, endif if (config_tempo_cldfra) then - call mpas_pool_get_dimension(state,'index_qal_sgs' ,index_qal_sgs ) - call mpas_pool_get_dimension(state,'index_qai_sgs' ,index_qai_sgs ) - + call mpas_pool_get_dimension(state,'index_qal' ,index_qal ) + call mpas_pool_get_dimension(state,'index_qai' ,index_qai ) + call mpas_pool_get_array(diag_physics,'precipfrac', precipfrac) call mpas_pool_get_array(tend_physics,'rthblten',rthblten) call mpas_pool_get_array(tend_physics,'rqvblten',rqvblten) call mpas_pool_get_array(tend_physics,'rqcblten',rqcblten) call mpas_pool_get_array(tend_physics,'rqiblten',rqiblten) call mpas_pool_get_array(tend_physics,'rthratenlw',rthratenlw) - call mpas_pool_get_array(tend_physics,'rthratensw',rthratensw) + call mpas_pool_get_array(tend_physics,'rthratensw',rthratensw) ! call mpas_pool_get_array(diag_physics,'qc_bl',qc_bl) ! call mpas_pool_get_array(diag_physics,'cldfrac_bl',cldfrac_bl) - - qal_sgs => scalars(index_qal_sgs,:,:) - qai_sgs => scalars(index_qai_sgs,:,:) + + qal => scalars(index_qal,:,:) + qai => scalars(index_qai,:,:) do j = jts, jte do k = kts, kte do i = its, ite - qalsgs_p(i,k,j) = qal_sgs(k,i) - qaisgs_p(i,k,j) = qai_sgs(k,i) + qal_p(i,k,j) = qal(k,i) + qai_p(i,k,j) = qai(k,i) + precipfrac_p(i,k,j) = precipfrac(k,i) rthblten_p(i,k,j) = rthblten(k,i) rqvblten_p(i,k,j) = rqvblten(k,i) rqcblten_p(i,k,j) = rqcblten(k,i) rqiblten_p(i,k,j) = rqiblten(k,i) rthratenlw_p(i,k,j) = rthratenlw(k,i) - rthratensw_p(i,k,j) = rthratensw(k,i) + rthratensw_p(i,k,j) = rthratensw(k,i) ! qcbl_p(i,k,j) = qc_bl(k,i) -! cldfrac_p(i,k,j) = cldfrac_bl(k,i) +! cldfrac_p(i,k,j) = cldfrac_bl(k,i) enddo enddo enddo @@ -1195,7 +1196,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te logical,pointer:: config_tempo_cldfra 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 - integer,pointer:: index_qal_sgs, index_qai_sgs + integer,pointer:: index_qal, index_qai !TEMPO/NSSL integer,pointer:: index_qh integer,pointer:: index_zrw,index_zgw,index_zhw @@ -1212,7 +1213,7 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te real(kind=RKIND),dimension(:,:),pointer :: qv,qc,qr,qi,qs,qg real(kind=RKIND),dimension(:,:),pointer :: qh real(kind=RKIND),dimension(:,:),pointer :: nc,ni,nr,nifa,nwfa - real(kind=RKIND),dimension(:,:),pointer :: qal_sgs, qai_sgs + real(kind=RKIND),dimension(:,:),pointer :: qal, qai, precipfrac real(kind=RKIND),dimension(:,:),pointer :: ns,ng,nh,nccn real(kind=RKIND),dimension(:,:),pointer :: volg,volh,zrw,zgw,zhw real(kind=RKIND),dimension(:) ,pointer :: max_hail_diameter_sfc, max_hail_diameter_column @@ -1495,17 +1496,19 @@ subroutine microphysics_to_MPAS(configs,mesh,state,time_lev,diag,diag_physics,te endif if (config_tempo_cldfra) then - call mpas_pool_get_dimension(state,'index_qal_sgs' ,index_qal_sgs ) - call mpas_pool_get_dimension(state,'index_qai_sgs' ,index_qai_sgs ) - - qal_sgs => scalars(index_qal_sgs,:,:) - qai_sgs => scalars(index_qai_sgs,:,:) + call mpas_pool_get_dimension(state,'index_qal' ,index_qal ) + call mpas_pool_get_dimension(state,'index_qai' ,index_qai ) + call mpas_pool_get_array(diag_physics,'precipfrac' ,precipfrac ) + + qal => scalars(index_qal,:,:) + qai => scalars(index_qai,:,:) do j = jts, jte do k = kts, kte do i = its, ite - qal_sgs(k,i) = qalsgs_p(i,k,j) - qai_sgs(k,i) = qaisgs_p(i,k,j) + qal(k,i) = qal_p(i,k,j) + qai(k,i) = qai_p(i,k,j) + precipfrac(k,i) = precipfrac_p(i,k,j) enddo enddo enddo diff --git a/src/core_atmosphere/physics/mpas_atmphys_vars.F b/src/core_atmosphere/physics/mpas_atmphys_vars.F index d553711b92..c2a5de6e7f 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_vars.F +++ b/src/core_atmosphere/physics/mpas_atmphys_vars.F @@ -221,7 +221,7 @@ module mpas_atmphys_vars nifa2d_p real(kind=RKIND),dimension(:,:,:),allocatable:: & - qalsgs_p, qaisgs_p + qal_p, qai_p, precipfrac_p !... arrays located at w (vertical velocity) points, or at interface between layers: real(kind=RKIND),dimension(:,:,:),allocatable:: & From b9a19d32fa80f7aff8b4b1726dce562d6bda376b Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Tue, 19 Aug 2025 03:35:17 +0000 Subject: [PATCH 13/46] Complete hookup to TEMPO --- src/core_atmosphere/Registry.xml | 5 +++++ .../physics/mpas_atmphys_driver_microphysics.F | 6 +++++- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 3c58cf223b..bb26623e83 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -2553,6 +2553,11 @@ description="Logical flag to turn on/off prognostic cloud fraction" possible_values=".true. or .false."/> + + Date: Wed, 20 Aug 2025 17:50:13 +0000 Subject: [PATCH 14/46] Addss prognostic cloud fraction to PBL driver --- .../physics/mpas_atmphys_driver.F | 2 +- .../physics/mpas_atmphys_driver_pbl.F | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver.F b/src/core_atmosphere/physics/mpas_atmphys_driver.F index da9d6a1135..3771a1aa7b 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver.F @@ -337,7 +337,7 @@ subroutine physics_driver(domain,itimestep,xtime_s,exchange_halo_group) call allocate_pbl(block%configs) !$OMP PARALLEL DO do thread=1,nThreads - call driver_pbl(itimestep,block%configs,mesh,sfc_input,diag_physics,tend_physics, & + call driver_pbl(itimestep,block%configs,mesh,state,sfc_input,diag_physics,tend_physics, & cellSolveThreadStart(thread),cellSolveThreadEnd(thread)) end do !$OMP END PARALLEL DO diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_pbl.F b/src/core_atmosphere/physics/mpas_atmphys_driver_pbl.F index e88f9e0c9c..728a2024b3 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_pbl.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_pbl.F @@ -440,12 +440,13 @@ subroutine deallocate_pbl(configs) end subroutine deallocate_pbl !================================================================================================================= - subroutine pbl_from_MPAS(configs,mesh,sfc_input,diag_physics,tend_physics,its,ite) + subroutine pbl_from_MPAS(configs,mesh,state,sfc_input,diag_physics,tend_physics,its,ite) !================================================================================================================= !input arguments: type(mpas_pool_type),intent(in):: configs type(mpas_pool_type),intent(in):: mesh + type(mpas_pool_type),intent(in):: state type(mpas_pool_type),intent(in):: diag_physics type(mpas_pool_type),intent(in):: sfc_input type(mpas_pool_type),intent(in):: tend_physics @@ -474,7 +475,10 @@ subroutine pbl_from_MPAS(configs,mesh,sfc_input,diag_physics,tend_physics,its,it real(kind=RKIND),dimension(:,:),pointer:: cldfrac_bl,qc_bl,qi_bl real(kind=RKIND),dimension(:,:),pointer:: edmf_a,edmf_ent,edmf_qc,edmf_qt,edmf_thl,edmf_w real(kind=RKIND),dimension(:,:),pointer:: sub_thl,sub_qv,det_thl,det_qv - + real(kind=RKIND),dimension(:,:),pointer :: qal, qai + real(kind=RKIND),dimension(:,:,:),pointer :: scalars + integer,pointer:: index_qal, index_qai + !local pointers for MYJ scheme: real(kind=RKIND),dimension(:),pointer :: chlowq,thz0,qz0,uz0,vz0,ct,akhs,akms,lh,mixht real(kind=RKIND),dimension(:,:),pointer :: zgrid @@ -675,6 +679,13 @@ subroutine pbl_from_MPAS(configs,mesh,sfc_input,diag_physics,tend_physics,its,it call mpas_pool_get_array(diag_physics,'det_thl' ,det_thl ) call mpas_pool_get_array(diag_physics,'det_qv' ,det_qv ) + call mpas_pool_get_array(state,'scalars',scalars) + call mpas_pool_get_dimension(state,'index_qal' ,index_qal ) + call mpas_pool_get_dimension(state,'index_qai' ,index_qai ) + + qal => scalars(index_qal,:,:) + qai => scalars(index_qai,:,:) + do j = jts,jte do i = its,ite dx_p(i,j) = len_disp / meshDensity(i)**0.25 @@ -695,7 +706,8 @@ subroutine pbl_from_MPAS(configs,mesh,sfc_input,diag_physics,tend_physics,its,it qkeadv_p(i,k,j) = qke_adv(k,i) sh3d_p(i,k,j) = sh3d(k,i) sm3d_p(i,k,j) = sm3d(k,i) - cldfrabl_p(i,k,j) = cldfrac_bl(k,i) +! cldfrabl_p(i,k,j) = cldfrac_bl(k,i) + cldfrabl_p(i,k,j) = max(qal(k,i), qai(k,i)) qcbl_p(i,k,j) = qc_bl(k,i) qibl_p(i,k,j) = qi_bl(k,i) edmfa_p(i,k,j) = edmf_a(k,i) @@ -1176,12 +1188,13 @@ subroutine init_pbl(configs) end subroutine init_pbl !================================================================================================================= - subroutine driver_pbl(itimestep,configs,mesh,sfc_input,diag_physics,tend_physics,its,ite) + subroutine driver_pbl(itimestep,configs,mesh,state,sfc_input,diag_physics,tend_physics,its,ite) !================================================================================================================= !input arguments: type(mpas_pool_type),intent(in):: configs type(mpas_pool_type),intent(in):: mesh + type(mpas_pool_type),intent(in):: state integer,intent(in):: its,ite integer,intent(in):: itimestep @@ -1241,7 +1254,7 @@ subroutine driver_pbl(itimestep,configs,mesh,sfc_input,diag_physics,tend_physics call mpas_pool_get_config(configs,'config_pbl_scheme' ,pbl_scheme ) !copy MPAS arrays to local arrays: - call pbl_from_MPAS(configs,mesh,sfc_input,diag_physics,tend_physics,its,ite) + call pbl_from_MPAS(configs,mesh,state,sfc_input,diag_physics,tend_physics,its,ite) initflag = 1 if(config_do_restart .or. itimestep > 1) initflag = 0 From d2398f6830f0301f956f6836ec982159b93121d4 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 5 Sep 2025 19:47:23 +0000 Subject: [PATCH 15/46] Correct pointer to MYNN --- src/core_atmosphere/physics/physics_noaa/MYNN-EDMF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF b/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF index d35871833b..7c14493e29 160000 --- a/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF +++ b/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF @@ -1 +1 @@ -Subproject commit d35871833b9d008fe235eb6ac7f7483623c3e574 +Subproject commit 7c14493e294c18f0318dd859b6fe328439cc7e3b From 8c8f91c2e55b3fb881f6a9261a478e2c4a6872c8 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 10 Sep 2025 23:30:06 +0000 Subject: [PATCH 16/46] Roll back MYNN to pre-smoke changes --- src/core_atmosphere/physics/physics_noaa/MYNN-EDMF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF b/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF index 7c14493e29..c1ba7d97e1 160000 --- a/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF +++ b/src/core_atmosphere/physics/physics_noaa/MYNN-EDMF @@ -1 +1 @@ -Subproject commit 7c14493e294c18f0318dd859b6fe328439cc7e3b +Subproject commit c1ba7d97e1553519c82b11ca9fbca91ead21a9c9 From 73a282fd38542bada61a12d461401e5fa05f40e7 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 17 Sep 2025 17:47:36 +0000 Subject: [PATCH 17/46] Tuning cloud fraction scheme to reduce clouds and precipitation --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 677f43a006..34c437660c 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 677f43a006c3ded23cfc8deb1a9872d0258b7e67 +Subproject commit 34c437660c008cee9b4542bcb58374fea40d3326 From 5099110c56c3852b4a55297b27d4f2536a8babf1 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 19 Sep 2025 14:53:58 +0000 Subject: [PATCH 18/46] Update pointer to TEMPO with bugfix changes --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 34c437660c..af2d160f10 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 34c437660c008cee9b4542bcb58374fea40d3326 +Subproject commit af2d160f10917a9612ad4f1fea255e5a59c7cf7d From e58c0702af37b58026c53f13fd9817435cf1d2e0 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Mon, 22 Sep 2025 16:56:23 +0000 Subject: [PATCH 19/46] Cloud fraction v3 tuning --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index af2d160f10..2294c3e09c 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit af2d160f10917a9612ad4f1fea255e5a59c7cf7d +Subproject commit 2294c3e09c5e5a676f72b4e51fad08577203fe58 From 78503975cc4139671a91c46b460af536fd662cfd Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Tue, 30 Sep 2025 15:46:59 +0000 Subject: [PATCH 20/46] Add snow to cloud ice for radiation if significant amount of cloud ice --- .../physics/mpas_atmphys_driver_cloudiness.F | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F index 2f2fb1db45..7704bbb20b 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F @@ -261,6 +261,12 @@ subroutine cloudiness_from_MPAS(itimestep,configs,mesh,state,diag_physics,sfc_in qal_p(i,k,j) = qal(k,i) qai_p(i,k,j) = qai(k,i) cldfrac_p(i,k,j) = max(qal(k,i), qai(k,i)) + + if (qirad_p(i,k,j) > 1.e-7) then + qirad_p(i,k,j) = qirad_p(i,k,j) + qsrad_p(i,k,j) + qsrad_p(i,k,j) = 0. + endif + enddo enddo enddo From 917c9d5645be6eeb1f4badca5bd9e7b4fd00d093 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Tue, 30 Sep 2025 15:47:13 +0000 Subject: [PATCH 21/46] Update TEMPO pointer --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 2294c3e09c..ab1d16f793 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 2294c3e09c5e5a676f72b4e51fad08577203fe58 +Subproject commit ab1d16f793afb3547de606d4c768b0b4b59a545f From c61d9f194415061b28380ddd3a69136e337c412e Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Mon, 1 Dec 2025 23:49:21 +0000 Subject: [PATCH 22/46] - removed unused configuration variable - added graupel volume to init_atmosphere registry - formatted code --- src/core_init_atmosphere/Registry.xml | 26 +++++++++---------- .../mpas_init_atm_cases.F | 4 --- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/core_init_atmosphere/Registry.xml b/src/core_init_atmosphere/Registry.xml index 8e3b34bed2..9dc479f15b 100644 --- a/src/core_init_atmosphere/Registry.xml +++ b/src/core_init_atmosphere/Registry.xml @@ -326,11 +326,6 @@ description="Whether to interpolate first-guess fields from intermediate file" possible_values="true or false"/> - - - - - + + + @@ -1234,7 +1229,7 @@ description="Graupel mixing ratio"/> + description="Hail mixing ratio"/> @@ -1251,6 +1246,9 @@ + + @@ -1302,7 +1300,7 @@ - - + - + diff --git a/src/core_init_atmosphere/mpas_init_atm_cases.F b/src/core_init_atmosphere/mpas_init_atm_cases.F index ef31596e99..9120567727 100644 --- a/src/core_init_atmosphere/mpas_init_atm_cases.F +++ b/src/core_init_atmosphere/mpas_init_atm_cases.F @@ -70,7 +70,6 @@ subroutine init_atm_setup_case(domain, stream_manager) logical, pointer :: config_native_gwd_static logical, pointer :: config_native_gwd_gsl_static logical, pointer :: config_met_interp - logical, pointer :: config_aerosol_climo logical, pointer :: config_blend_bdy_terrain character (len=StrKIND), pointer :: config_start_time character (len=StrKIND), pointer :: config_met_prefix @@ -232,7 +231,6 @@ subroutine init_atm_setup_case(domain, stream_manager) call mpas_pool_get_config(block_ptr % configs, 'config_native_gwd_static', config_native_gwd_static) call mpas_pool_get_config(block_ptr % configs, 'config_native_gwd_gsl_static', config_native_gwd_gsl_static) call mpas_pool_get_config(block_ptr % configs, 'config_met_interp', config_met_interp) - call mpas_pool_get_config(block_ptr % configs, 'config_aerosol_climo', config_aerosol_climo) call mpas_pool_get_config(block_ptr % configs, 'config_blend_bdy_terrain', config_blend_bdy_terrain) call mpas_pool_get_subpool(block_ptr % structs, 'mesh', mesh) @@ -397,8 +395,6 @@ subroutine init_atm_setup_case(domain, stream_manager) call mpas_pool_get_dimension(block_ptr % dimensions, 'nEdges', nEdges) call mpas_pool_get_dimension(block_ptr % dimensions, 'nVertLevels', nVertLevels) - call mpas_pool_get_config(block_ptr % configs, 'config_aerosol_climo', config_aerosol_climo) - call mpas_get_time(curr_time, dateTimeString=timeString) xtime = timeString ! Set field valid time, xtime, to the current time in the time loop time_since_start = curr_time - start_time From 4e732be9034983c0e4994fb9cbe3969a69690bcf Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Tue, 2 Dec 2025 01:02:36 +0000 Subject: [PATCH 23/46] - cleaned up core_atmosphere registry for tempo --- src/core_atmosphere/Registry.xml | 60 ++++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index e10a20dcfa..b04e0e420d 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -421,9 +421,9 @@ - - - + + + @@ -2765,29 +2765,34 @@ units="-" description="configuration for cloud microphysics schemes" possible_values="`suite',`mp_wsm6',`mp_tempo',`mp_thompson',`mp_thompson_aerosols', `mp_kessler',`mp_nssl2m',`off'"/> + + - - - - - - @@ -2988,11 +2993,6 @@ description="configuration for spp boundary layer" possible_values="`0: off',`1: activated'"/> - - - - - - - Date: Sat, 13 Dec 2025 22:55:25 +0000 Subject: [PATCH 24/46] cleaned up mpas tempo driver call and removed tempo table build from mpas --- src/core_atmosphere/physics/Makefile | 4 +- .../mpas_atmphys_driver_microphysics.F | 137 ++++----------- .../physics/mpas_atmphys_init_tempo.F | 158 +----------------- .../physics/physics_noaa/TEMPO | 2 +- src/core_atmosphere/utils/Makefile | 14 +- 5 files changed, 37 insertions(+), 278 deletions(-) diff --git a/src/core_atmosphere/physics/Makefile b/src/core_atmosphere/physics/Makefile index 2fe1019b08..fa2dd14cb6 100644 --- a/src/core_atmosphere/physics/Makefile +++ b/src/core_atmosphere/physics/Makefile @@ -65,7 +65,7 @@ core_physics_mmm: core_physics_init (cd physics_mmm; $(MAKE) -f Makefile.mpas all) core_microphysics: core_physics_init core_physics_mmm - (cd physics_noaa/TEMPO; cp ./drivers/mpas/module_mp_tempo.F90 .; $(MAKE) all COREDEF="$(COREDEF)") + (cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas) core_SMOKE: core_physics_init (cd physics_noaa/SMOKE; cp ./MPAS/Makefile .; cp ./MPAS/mpas_smoke_wrapper.F90 .; $(MAKE) all) @@ -286,7 +286,7 @@ clean: ( cd physics_noahmp/drivers/mpas; $(MAKE) clean ) ( cd physics_noahmp/src; $(MAKE) clean ) ( cd physics_noahmp/utility; $(MAKE) clean ) - ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) clean; fi ) + ( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas clean; fi ) ( if [ -d physics_noaa/UGWP ]; then cd physics_noaa/UGWP; $(MAKE) clean; fi ) ( if [ -d physics_noaa/RUCLSM ]; then cd physics_noaa/RUCLSM; $(MAKE) -f MPAS/Makefile clean; fi ) ( if [ -d physics_noaa/MYNN-EDMF ]; then cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; $(MAKE) clean; fi ) diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index d78d56bec3..5e8cdff5ca 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -21,8 +21,8 @@ module mpas_atmphys_driver_microphysics !wrf physics: use module_mp_kessler use module_mp_thompson - use module_mp_tempo,only: tempo_3d_to_1d_driver, tempo_init - ! use module_mp_tempo_utils + use module_mp_tempo_driver,only: tempo_driver + use module_mp_tempo_init,only: tempo_init use module_mp_wsm6,only: wsm6 use mp_wsm6,only: mp_wsm6_init,refl10cm_wsm6 use module_mp_nssl_2mom @@ -485,8 +485,8 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p end select microp2_select case("mp_tempo") - call tempo_init(l_mp_tables=l_mp_tables, & - hail_aware_flag=config_tempo_hailaware, aerosol_aware_flag=config_tempo_aerosolaware) + call tempo_init(aerosolaware_flag=config_tempo_aerosolaware, & + hailaware_flag=config_tempo_hailaware) if (config_tempo_aerosolaware) then call init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) @@ -532,11 +532,9 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten !local pointers: character(len=StrKIND),pointer:: microp_scheme - logical,pointer:: config_tempo_aerosolaware,config_tempo_hailaware + logical,pointer:: config_tempo_aerosolaware, config_tempo_hailaware character(len=StrKIND),pointer:: nssl_moments - integer :: tempo_options - !local variables and arrays: integer:: istep integer, pointer :: do_diag_dbz @@ -595,111 +593,32 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten case ("mp_tempo") call mpas_timer_start('mp_tempo') - tempo_options = 0 - if (config_tempo_hailaware) tempo_options = tempo_options + 1 - if (config_tempo_aerosolaware) tempo_options = tempo_options + 1 istep = 1 do while (istep .le. n_microp) - - tempo_opts: select case(tempo_options) - case(0) - call tempo_3d_to_1d_driver( & - 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 , & - !! ng = ng_p , qb = volg_p , & - !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & - !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - pii = pi_p , p = pres_p , dz = dz_p , & - w = w_p , dt_in = dt_microp , itimestep = itimestep , & - rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & - snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & - sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & - re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & - has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & - !! ntc = ntc_p , muc = muc_p , & - refl_10cm = refl10cm_p , frainnc = frainnc_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 & - ) - case(1) - if (config_tempo_aerosolaware) then - call tempo_3d_to_1d_driver( & - 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 , & - !! ng = ng_p , qb = volg_p , & - nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & - nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - pii = pi_p , p = pres_p , dz = dz_p , & - w = w_p , dt_in = dt_microp , itimestep = itimestep , & - rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & - snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & - sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & - re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & - has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & - !! ntc = ntc_p , muc = muc_p , & - refl_10cm = refl10cm_p , frainnc = frainnc_p , & - qcbl = qcbl_p , cldfrac = cldfrac_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 & - ) - elseif (config_tempo_hailaware) then - call tempo_3d_to_1d_driver( & - 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 , & - ng = ng_p , qb = volg_p , & - !! nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & - !! nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - pii = pi_p , p = pres_p , dz = dz_p , & - w = w_p , dt_in = dt_microp , itimestep = itimestep , & - rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & - snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & - sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & - re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & - has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & - !! ntc = ntc_p , muc = muc_p , & - refl_10cm = refl10cm_p , frainnc = frainnc_p , & - !! qcbl = qcbl_p , cldfrac = cldfrac_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 & - ) - else - call physics_error_fatal('driver_microphysics(): TEMPO called with invalid options -- case 1') - endif - case(2) - call tempo_3d_to_1d_driver( & - 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 , & - ng = ng_p , qb = volg_p , & - nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & - nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - pii = pi_p , p = pres_p , dz = dz_p , & - w = w_p , dt_in = dt_microp , itimestep = itimestep , & - rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & - snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & - sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & - re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & - has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & - !! ntc = ntc_p , muc = muc_p , & - refl_10cm = refl10cm_p , frainnc = frainnc_p , & - max_hail_diameter_sfc = max_hail_diameter_sfc_p , & - max_hail_diameter_column = max_hail_diameter_column_p , & - qcbl = qcbl_p , cldfrac = cldfrac_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 & - ) - case default - call physics_error_fatal('driver_microphysics(): TEMPO called with invalid options -- case default') - end select tempo_opts - + call tempo_driver( & + 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 , & + ng = ng_p , qb = volg_p , & + nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & + nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & + pii = pi_p , p = pres_p , dz = dz_p , & + w = w_p , dt_in = dt_microp , itimestep = itimestep , & + rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & + snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & + sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & + re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & + has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & + !! ntc = ntc_p , muc = muc_p , & + refl_10cm = refl10cm_p , frainnc = frainnc_p , & + max_hail_diameter_sfc = max_hail_diameter_sfc_p , & + max_hail_diameter_column = max_hail_diameter_column_p , & + qcbl = qcbl_p , cldfrac = cldfrac_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 & + ) istep = istep + 1 enddo call mpas_timer_stop('mp_tempo') diff --git a/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F b/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F index dac3b2d20a..5ce5a01ebe 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F +++ b/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F @@ -15,9 +15,7 @@ module mpas_atmphys_init_tempo use mpas_pool_routines use mpas_atmphys_utilities - use module_mp_tempo_params, only: ntb_arc,ntb_arw,ntb_art,ntb_arr,ntb_ark,tnccn_act, & - naCCN1,naCCN0,naIN0,naIN1,nwfa_default,aero_max, & - nc_ml_input, nc_ml_nodes, nc_ml_output, & + use module_mp_tempo_params, only: nc_ml_input, nc_ml_nodes, nc_ml_output, & nr_ml_input, nr_ml_nodes, nr_ml_output, & nc_ml_trans_mean, nc_ml_trans_var, & nc_ml_w00, nc_ml_w01, nc_ml_b00, nc_ml_b01 @@ -30,7 +28,6 @@ module mpas_atmphys_init_tempo !MPAS main initialization of the TEMPO parameterization of cloud microphysics with nucleation of cloud !droplets based on distributions of CCNs and INs (aerosol-aware parameterization). - contains !================================================================================================================= @@ -127,10 +124,8 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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 :: nifa,nwfa real(kind=RKIND),dimension(:,:,:),pointer:: scalars character(len=StrKIND):: mess @@ -138,21 +133,10 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia integer:: iCell, k real(kind=RKIND):: max_test - real(kind=RKIND):: airmass, 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 !----------------------------------------------------------------------------------------------------------------- -!call mpas_log_write('--- enter subroutine init_tempo_aerosols_forMPAS:') - -!... read a static file containing CCN activation of aerosols. The data were created from a parcel model by -!... Feingold & Heymsfield with further changes by Eidhammer and Kriedenweis. - call table_ccnAct(dminfo) - call mpas_log_write('--- end read table_ccnAct:') - !... 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 @@ -160,10 +144,6 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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) @@ -174,15 +154,6 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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 @@ -194,24 +165,8 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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.') + if(global_nwfa_min /= 0._RKIND .and. global_nwfa_max /= 0._RKIND) then + call mpas_log_write('--- tempo() info: initialized nwfa using the climatological GOCART data.') endif !... initialize the distribution of nonhygroscopic ("ice friendly") aerosols if not already initialized using @@ -226,114 +181,11 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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.') + 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 - ! airmass = rho_zz(k,iCell)*zz(k,iCell) - ! airmass = airmass*(zgrid(k+1,iCell)-zgrid(k,iCell))*areaCell(iCell) ! (in kg) - ! nwfa2d(iCell) = nwfa(k,iCell)*0.000196*airmass*0.5e-10 - - 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 -! call mpas_log_write('$i $r $r $r',intArgs=(/iCell/),realArgs=(/airmass,nwfa2d(iCell),nifa2d(iCell)/)) - enddo - -!... deallocate local arrays: - if(allocated(hgt)) deallocate(hgt) - -!call mpas_log_write('--- end subroutine init_tempo_aerosols_forMPAS.') - end subroutine init_tempo_aerosols_forMPAS -!================================================================================================================= - subroutine table_ccnAct(dminfo) -!================================================================================================================= - -!input variables: - type(dm_info),intent(in):: dminfo - -!local variables: - logical:: opened - integer:: ccn_unit,i,istat - character(len=StrKIND):: errmess -!----------------------------------------------------------------------------------------------------------------- - - if(.not.allocated(tnccn_act)) allocate(tnccn_act(ntb_arc,ntb_arw,ntb_art,ntb_arr,ntb_ark)) - -!get a unit to open binary file: - istat = -999 - if(dminfo % my_proc_id == IO_NODE) then - do i = 10,99 - inquire(i,opened = opened,iostat=istat) - if(.not. opened ) then - ccn_unit = i - exit - endif - enddo - if(istat /= 0) & - call physics_error_fatal('mpas_atmphys_init_microphysics table_ccnAct: Can not '// & - 'find unused fortran unit to read in lookup table.' ) - endif - -!distribute unit to other processors: - call mpas_dmpar_bcast_int(dminfo,ccn_unit) - -!open binary file: - istat = -999 - if(dminfo % my_proc_id == IO_NODE) then - open(ccn_unit,file='CCN_ACTIVATE_DATA',form='UNFORMATTED',status='OLD',iostat=istat) - if(istat /= 0) then - write(errmess,'(A,I4)') 'mpas_atmphys_init_microphysics table_ccnAct:: '// & - 'error opening CCN_ACTIVATE_DATA on unit', ccn_unit - call physics_error_fatal(errmess) - endif - endif - -!read and broadcast data to all nodes: - istat = -999 - if(dminfo % my_proc_id == IO_NODE) then - read(ccn_unit,iostat=istat) tnccn_act - if(istat /= 0) then - write(errmess,'(A,I4)') 'mpas_atmphys_init_microphysics table_ccnAct:: '// & - 'error reading tnccn_act on unit', ccn_unit - call physics_error_fatal(errmess) - endif - endif - - DM_BCAST_MACRO(tnccn_act) - - end subroutine table_ccnAct - !================================================================================================================= end module mpas_atmphys_init_tempo !================================================================================================================= diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index f325c9d778..f6ab1773c3 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit f325c9d778ca34ecb781ed92757791749a373a52 +Subproject commit f6ab1773c36af85199519afed5c52ddceb2a829d diff --git a/src/core_atmosphere/utils/Makefile b/src/core_atmosphere/utils/Makefile index cf4e2fd172..ede5830d5a 100644 --- a/src/core_atmosphere/utils/Makefile +++ b/src/core_atmosphere/utils/Makefile @@ -4,27 +4,15 @@ ifdef PHYSICS UTILS = build_tables endif -all: $(UTILS) build_tables_tempo +all: $(UTILS) build_tables: build_tables.o atmphys_build_tables_thompson.o $(LINKER) $(LDFLAGS) -o build_tables build_tables.o atmphys_build_tables_thompson.o -L../../framework -L../physics -lphys -lframework $(LIBS) -L../../external/esmf_time_f90 -lesmf_time mv build_tables ../../.. -build_tables_tempo: build_tables_tempo.o atmphys_build_tables_tempo.o - $(LINKER) $(LDFLAGS) -o build_tables_tempo build_tables_tempo.o atmphys_build_tables_tempo.o -L../../framework -L../physics -lphys -lframework $(LIBS) -L../../external/esmf_time_f90 -lesmf_time - mv build_tables_tempo ../../.. - build_tables.o: \ atmphys_build_tables_thompson.o -build_tables_tempo.o: \ - atmphys_build_tables_tempo.o - -atmphys_build_tables_tempo.o: \ - ../physics/physics_noaa/TEMPO/module_mp_tempo.o \ - ../physics/physics_noaa/TEMPO/module_mp_tempo_utils.o \ - ../physics/physics_noaa/TEMPO/module_mp_tempo_params.o - clean: $(RM) ../../../build_tables $(RM) *.o *.mod *.f90 From 79bc0efb58f713b0fa594977f8eb7524e87e1b66 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 17 Dec 2025 23:56:20 +0000 Subject: [PATCH 25/46] mods to radiation coupling based on suggestions from Dustin --- .../physics/mpas_atmphys_driver_cloudiness.F | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F index 7704bbb20b..7ac26fcfe7 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F @@ -260,13 +260,17 @@ subroutine cloudiness_from_MPAS(itimestep,configs,mesh,state,diag_physics,sfc_in do i = its,ite qal_p(i,k,j) = qal(k,i) qai_p(i,k,j) = qai(k,i) - cldfrac_p(i,k,j) = max(qal(k,i), qai(k,i)) - - if (qirad_p(i,k,j) > 1.e-7) then - qirad_p(i,k,j) = qirad_p(i,k,j) + qsrad_p(i,k,j) - qsrad_p(i,k,j) = 0. + cldfrac_p(i,k,j) = max(0., max(qal(k,i), qai(k,i))) ! Avoid cldfrac < 0 + if (cldfrac_p(i,k,j) > 0.) then + if (qirad_p(i,k,j) > 1.e-7) then + qirad_p(i,k,j) = max(0. , qirad_p(i,k,j) + qsrad_p(i,k,j)) + qsrad_p(i,k,j) = 0. + endif + else + qcrad_p(i,k,j) = 0. ! No cloud + qirad_p(i,k,j) = 0. ! No cloud + qsrad_p(i,k,j) = 0. ! No cloud endif - enddo enddo enddo From 4f47418f918bba914db81d08d3aee3ffc00dc106 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Tue, 6 Jan 2026 00:25:29 +0000 Subject: [PATCH 26/46] v3.0.0 updates consistent with tempo refactor --- src/core_atmosphere/Registry.xml | 11 +- src/core_atmosphere/mpas_atm_core.F | 1 - .../physics/Registry_tempo.xml | 20 ++ .../mpas_atmphys_driver_microphysics.F | 66 ++++--- .../physics/mpas_atmphys_init_tempo.F | 183 +++++++++--------- 5 files changed, 150 insertions(+), 131 deletions(-) create mode 100644 src/core_atmosphere/physics/Registry_tempo.xml diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index b04e0e420d..ecd53d4258 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -2766,16 +2766,6 @@ description="configuration for cloud microphysics schemes" possible_values="`suite',`mp_wsm6',`mp_tempo',`mp_thompson',`mp_thompson_aerosols', `mp_kessler',`mp_nssl2m',`off'"/> - - - - diff --git a/src/core_atmosphere/mpas_atm_core.F b/src/core_atmosphere/mpas_atm_core.F index 3f628a0cce..e10171e8c8 100644 --- a/src/core_atmosphere/mpas_atm_core.F +++ b/src/core_atmosphere/mpas_atm_core.F @@ -588,7 +588,6 @@ subroutine atm_mpas_init_block(dminfo, stream_manager, block, mesh, dt) !initialization of all physics: call physics_init(dminfo, stream_manager, clock, block % configs, mesh, diag, tend, state, 1, & diag_physics, diag_physics_noahmp, ngw_input, atm_input, sfc_input, output_noahmp) - call tempo_ml_init(block % configs) endif #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..88d6f2de9f --- /dev/null +++ b/src/core_atmosphere/physics/Registry_tempo.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index 5e8cdff5ca..12c2e7a4c1 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -21,7 +21,8 @@ module mpas_atmphys_driver_microphysics !wrf physics: use module_mp_kessler use module_mp_thompson - use module_mp_tempo_driver,only: tempo_driver + use module_mp_tempo_cfgs,only: ty_tempo_cfgs + use module_mp_tempo_driver,only: tempo_driver, ty_tempo_driver_diags, tempo_aerosol_surface_emissions use module_mp_tempo_init,only: tempo_init use module_mp_wsm6,only: wsm6 use mp_wsm6,only: mp_wsm6_init,refl10cm_wsm6 @@ -94,7 +95,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 @@ -486,7 +487,7 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p case("mp_tempo") call tempo_init(aerosolaware_flag=config_tempo_aerosolaware, & - hailaware_flag=config_tempo_hailaware) + hailaware_flag=config_tempo_hailaware, tempo_cfgs=tempo_cfgs) if (config_tempo_aerosolaware) then call init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) @@ -532,7 +533,6 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten !local pointers: character(len=StrKIND),pointer:: microp_scheme - logical,pointer:: config_tempo_aerosolaware, config_tempo_hailaware character(len=StrKIND),pointer:: nssl_moments !local variables and arrays: @@ -544,6 +544,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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:') @@ -553,8 +554,6 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten errflg = 0 call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) - call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) - call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_array(diag_physics,'do_diag_dbz',do_diag_dbz) @@ -592,33 +591,42 @@ 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_driver( & - 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 , & - ng = ng_p , qb = volg_p , & - nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & - nwfa2d = nwfa2d_p , nifa2d = nifa2d_p , & - pii = pi_p , p = pres_p , dz = dz_p , & - w = w_p , dt_in = dt_microp , itimestep = itimestep , & - rainnc = rainnc_p , rainncv = rainncv_p , snownc = snownc_p , & - snowncv = snowncv_p , graupelnc = graupelnc_p , graupelncv = graupelncv_p , & - sr = sr_p , rainprod = rainprod_p , evapprod = evapprod_p , & - re_cloud = recloud_p , re_ice = reice_p , re_snow = resnow_p , & - has_reqc = has_reqc , has_reqi = has_reqi , has_reqs = has_reqs , & - !! ntc = ntc_p , muc = muc_p , & - refl_10cm = refl10cm_p , frainnc = frainnc_p , & - max_hail_diameter_sfc = max_hail_diameter_sfc_p , & - max_hail_diameter_column = max_hail_diameter_column_p , & - qcbl = qcbl_p , cldfrac = cldfrac_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 & - ) + call tempo_driver( 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 , & + 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) + snownc_p = tempo_driver_diags%snow_liquid_equiv_precip + snowncv_p = tempo_driver_diags%snow_liquid_equiv_precip + graupelnc_p = tempo_driver_diags%graupel_liquid_equiv_precip + graupelncv_p = tempo_driver_diags%graupel_liquid_equiv_precip + rainnc_p = tempo_driver_diags%rain_precip+ snownc_p + graupelnc_p + tempo_driver_diags%ice_liquid_equiv_precip + rainncv_p = tempo_driver_diags%rain_precip + snownc_p + graupelnc_p + tempo_driver_diags%ice_liquid_equiv_precip + frainnc_p = tempo_driver_diags%frz_rain_precip + refl10cm_p = tempo_driver_diags%refl10cm + recloud_p = tempo_driver_diags%re_cloud + reice_p = tempo_driver_diags%re_ice + resnow_p = tempo_driver_diags%re_snow + sr_p = tempo_driver_diags%frozen_fraction + max_hail_diameter_sfc_p = tempo_driver_diags%max_hail_diameter_sfc + max_hail_diameter_column_p = tempo_driver_diags%max_hail_diameter_column istep = istep + 1 enddo call mpas_timer_stop('mp_tempo') diff --git a/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F b/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F index 5ce5a01ebe..743dee98d4 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F +++ b/src/core_atmosphere/physics/mpas_atmphys_init_tempo.F @@ -15,99 +15,19 @@ module mpas_atmphys_init_tempo use mpas_pool_routines use mpas_atmphys_utilities - use module_mp_tempo_params, only: nc_ml_input, nc_ml_nodes, nc_ml_output, & - nr_ml_input, nr_ml_nodes, nr_ml_output, & - nc_ml_trans_mean, nc_ml_trans_var, & - nc_ml_w00, nc_ml_w01, nc_ml_b00, nc_ml_b01 - use module_mp_tempo_ml, only: MLdata, tempo_save_or_read_ml_data + use module_mp_tempo_params, only: nwfa_default, aero_max, & + naCCN1,naCCN0,naIN0,naIN1 implicit none private - public:: init_tempo_aerosols_forMPAS, tempo_ml_init + public:: init_tempo_aerosols_forMPAS -!MPAS main initialization of the TEMPO parameterization of cloud microphysics with nucleation of cloud -!droplets based on distributions of CCNs and INs (aerosol-aware parameterization). +!MPAS initialization of aerosols for TEMPO parameterization. contains !================================================================================================================= - subroutine tempo_ml_init(configs) -! Called once to initial data for tempo_ml -!================================================================================================================= - -!input arguments: -type(mpas_pool_type),intent(in):: configs - -!local variables and pointers: - type(MLdata), dimension(2) :: tempo_ml_data - logical,pointer:: config_tempo_ml_nc_pbl,config_tempo_ml_nc,config_tempo_ml_nr - - call mpas_pool_get_config(configs, 'config_tempo_ml_nc_pbl', config_tempo_ml_nc_pbl) - call mpas_pool_get_config(configs, 'config_tempo_ml_nc', config_tempo_ml_nc) - call mpas_pool_get_config(configs, 'config_tempo_ml_nr', config_tempo_ml_nr) - - if(.not. (config_tempo_ml_nc_pbl .or. config_tempo_ml_nc .or. config_tempo_ml_nr)) then - call mpas_log_write('--- All configuration flags for TEMPO ML are false... TEMPO ML will not be used') - return - endif - - if(config_tempo_ml_nc .or. config_tempo_ml_nr) then - call mpas_log_write('--- TEMPO ML for nc and nr prediction not yet working... These flags will be ignored') - endif - - if(config_tempo_ml_nc_pbl) then - call mpas_log_write('--- Using TEMPO ML prediction to give life to the PBL clouds') - endif - - ! Cloud water - tempo_ml_data(1)%input_size = nc_ml_input - tempo_ml_data(1)%node_size = nc_ml_nodes - tempo_ml_data(1)%output_size = nc_ml_output - - if (.not.allocated(tempo_ml_data(1)%transform_mean)) allocate(tempo_ml_data(1)%transform_mean(nc_ml_input)) - if (.not.allocated(tempo_ml_data(1)%transform_var)) allocate(tempo_ml_data(1)%transform_var(nc_ml_input)) - - tempo_ml_data(1)%transform_mean = nc_ml_trans_mean - tempo_ml_data(1)%transform_var = nc_ml_trans_var - - if (.not.allocated(tempo_ml_data(1)%weights00)) allocate(tempo_ml_data(1)%weights00(nc_ml_nodes,nc_ml_input)) - if (.not.allocated(tempo_ml_data(1)%weights01)) allocate(tempo_ml_data(1)%weights01(nc_ml_output,nc_ml_nodes)) - if (.not.allocated(tempo_ml_data(1)%bias00)) allocate(tempo_ml_data(1)%bias00(nc_ml_nodes)) - if (.not.allocated(tempo_ml_data(1)%bias01)) allocate(tempo_ml_data(1)%bias01(nc_ml_output)) - - tempo_ml_data(1)%weights00 = reshape(nc_ml_w00, (/nc_ml_nodes, nc_ml_input/)) - tempo_ml_data(1)%weights01 = reshape(nc_ml_w01, (/nc_ml_output, nc_ml_nodes/)) - tempo_ml_data(1)%bias00 = nc_ml_b00 - tempo_ml_data(1)%bias01 = nc_ml_b01 - - ! Rain water - tempo_ml_data(2)%input_size = nc_ml_input - tempo_ml_data(2)%node_size = nc_ml_nodes - tempo_ml_data(2)%output_size = nc_ml_output - - if (.not.allocated(tempo_ml_data(2)%transform_mean)) allocate(tempo_ml_data(2)%transform_mean(nc_ml_input)) - if (.not.allocated(tempo_ml_data(2)%transform_var)) allocate(tempo_ml_data(2)%transform_var(nc_ml_input)) - - tempo_ml_data(2)%transform_mean = nc_ml_trans_mean - tempo_ml_data(2)%transform_var = nc_ml_trans_var - - if (.not.allocated(tempo_ml_data(2)%weights00)) allocate(tempo_ml_data(2)%weights00(nc_ml_nodes,nc_ml_input)) - if (.not.allocated(tempo_ml_data(2)%weights01)) allocate(tempo_ml_data(2)%weights01(nc_ml_output,nc_ml_nodes)) - if (.not.allocated(tempo_ml_data(2)%bias00)) allocate(tempo_ml_data(2)%bias00(nc_ml_nodes)) - if (.not.allocated(tempo_ml_data(2)%bias01)) allocate(tempo_ml_data(2)%bias01(nc_ml_output)) - - tempo_ml_data(2)%weights00 = reshape(nc_ml_w00, (/nc_ml_nodes, nc_ml_input/)) - tempo_ml_data(2)%weights01 = reshape(nc_ml_w01, (/nc_ml_output, nc_ml_nodes/)) - tempo_ml_data(2)%bias00 = nc_ml_b00 - tempo_ml_data(2)%bias01 = nc_ml_b01 - - ! Save neural network - call tempo_save_or_read_ml_data(ml_data_in=tempo_ml_data) - - end subroutine tempo_ml_init - -!================================================================================================================= - subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) +subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) !================================================================================================================= !input variables: @@ -124,8 +44,10 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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 :: nifa,nwfa + 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 @@ -133,10 +55,16 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia integer:: iCell, k real(kind=RKIND):: max_test + real(kind=RKIND):: airmass, 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 !----------------------------------------------------------------------------------------------------------------- +!call mpas_log_write('--- enter subroutine init_tempo_aerosols_forMPAS:') + !... 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 @@ -144,6 +72,10 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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) @@ -154,6 +86,15 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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 @@ -165,8 +106,24 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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('--- tempo() info: initialized nwfa using the climatological GOCART data.') + 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 @@ -181,11 +138,55 @@ subroutine init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,dia 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 the climatological GOCART data.') + 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 + ! airmass = rho_zz(k,iCell)*zz(k,iCell) + ! airmass = airmass*(zgrid(k+1,iCell)-zgrid(k,iCell))*areaCell(iCell) ! (in kg) + ! nwfa2d(iCell) = nwfa(k,iCell)*0.000196*airmass*0.5e-10 + + 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 +! call mpas_log_write('$i $r $r $r',intArgs=(/iCell/),realArgs=(/airmass,nwfa2d(iCell),nifa2d(iCell)/)) + enddo + +!... deallocate local arrays: + if(allocated(hgt)) deallocate(hgt) + +!call mpas_log_write('--- end subroutine init_tempo_aerosols_forMPAS.') + end subroutine init_tempo_aerosols_forMPAS -!================================================================================================================= + !================================================================================================================= end module mpas_atmphys_init_tempo -!================================================================================================================= +!================================================================================================================= \ No newline at end of file From 7306023cb401689b08dde06f36eac09ed1853f4f Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Tue, 6 Jan 2026 00:27:11 +0000 Subject: [PATCH 27/46] update pointer to tempo refactor --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index f6ab1773c3..1abd31ada0 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit f6ab1773c36af85199519afed5c52ddceb2a829d +Subproject commit 1abd31ada0df486059c8d21e3ea8f607f10ed441 From 50294c1a15b87e1947fab9bf1b18a2e6af446329 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 7 Jan 2026 00:06:24 +0000 Subject: [PATCH 28/46] v3.0.0 tempo refactor with ml prediction for bl clouds --- src/core_atmosphere/Registry.xml | 5 --- .../physics/Registry_tempo.xml | 28 ++++++++------- .../mpas_atmphys_driver_microphysics.F | 35 +++++++++++-------- .../physics/mpas_atmphys_interface.F | 6 ++-- .../physics/physics_noaa/TEMPO | 2 +- 5 files changed, 41 insertions(+), 35 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index ecd53d4258..03446df61d 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -2765,11 +2765,6 @@ units="-" description="configuration for cloud microphysics schemes" possible_values="`suite',`mp_wsm6',`mp_tempo',`mp_thompson',`mp_thompson_aerosols', `mp_kessler',`mp_nssl2m',`off'"/> - - - + - - - + + + - + - + + \ No newline at end of file diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index 12c2e7a4c1..fba1db829c 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -111,14 +111,14 @@ subroutine allocate_microphysics(configs) character(len=StrKIND),pointer:: microp_scheme character(len=StrKIND),pointer:: nssl_moments logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware - logical,pointer:: config_tempo_ml_nc_pbl + logical,pointer:: config_tempo_ml_for_bl_nc !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_microp_scheme',microp_scheme) call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) - call mpas_pool_get_config(configs,'config_tempo_ml_nc_pbl',config_tempo_ml_nc_pbl) + call mpas_pool_get_config(configs,'config_tempo_ml_for_bl_nc',config_tempo_ml_for_bl_nc) !sounding variables: if(.not.allocated(rho_p) ) allocate(rho_p(ims:ime,kms:kme,jms:jme) ) @@ -224,7 +224,7 @@ subroutine allocate_microphysics(configs) if(.not.allocated(volg_p)) allocate(volg_p(ims:ime,kms:kme,jms:jme)) endif - if (config_tempo_ml_nc_pbl) then + if (config_tempo_ml_for_bl_nc) then if(.not.allocated(cldfrac_p) ) allocate(cldfrac_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(qcbl_p) ) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) endif @@ -276,7 +276,7 @@ subroutine deallocate_microphysics(configs) character(len=StrKIND),pointer:: microp_scheme character(len=StrKIND),pointer:: nssl_moments logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware - logical,pointer:: config_tempo_ml_nc_pbl + logical,pointer:: config_tempo_ml_for_bl_nc !----------------------------------------------------------------------------------------------------------------- @@ -284,7 +284,7 @@ subroutine deallocate_microphysics(configs) call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) - call mpas_pool_get_config(configs,'config_tempo_ml_nc_pbl',config_tempo_ml_nc_pbl) + call mpas_pool_get_config(configs,'config_tempo_ml_for_bl_nc',config_tempo_ml_for_bl_nc) !sounding variables: if(allocated(rho_p) ) deallocate(rho_p ) @@ -388,7 +388,7 @@ subroutine deallocate_microphysics(configs) if(allocated(volg_p) ) deallocate(volg_p ) endif - if (config_tempo_ml_nc_pbl) then + if (config_tempo_ml_for_bl_nc) then if(allocated(cldfrac_p) ) deallocate(cldfrac_p) if(allocated(qcbl_p) ) deallocate(qcbl_p) endif @@ -451,6 +451,7 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p logical,pointer:: do_restart character(len=StrKIND),pointer:: microp_scheme logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware + logical,pointer:: config_tempo_ml_for_bl_nc character(len=StrKIND),pointer:: nssl_moments logical :: outputon = .false. @@ -470,6 +471,7 @@ 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_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) + call mpas_pool_get_config(configs,'config_tempo_ml_for_bl_nc',config_tempo_ml_for_bl_nc) call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_config(configs,'config_do_restart' ,do_restart ) @@ -487,7 +489,8 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p case("mp_tempo") call tempo_init(aerosolaware_flag=config_tempo_aerosolaware, & - hailaware_flag=config_tempo_hailaware, tempo_cfgs=tempo_cfgs) + hailaware_flag=config_tempo_hailaware, & + ml_for_bl_nc_flag = config_tempo_ml_for_bl_nc, tempo_cfgs=tempo_cfgs) if (config_tempo_aerosolaware) then call init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) @@ -609,17 +612,21 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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 , & + qc_bl = qcbl_p , qcfrac_bl = cldfrac_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) - snownc_p = tempo_driver_diags%snow_liquid_equiv_precip - snowncv_p = tempo_driver_diags%snow_liquid_equiv_precip - graupelnc_p = tempo_driver_diags%graupel_liquid_equiv_precip - graupelncv_p = tempo_driver_diags%graupel_liquid_equiv_precip - rainnc_p = tempo_driver_diags%rain_precip+ snownc_p + graupelnc_p + tempo_driver_diags%ice_liquid_equiv_precip - rainncv_p = tempo_driver_diags%rain_precip + snownc_p + graupelnc_p + tempo_driver_diags%ice_liquid_equiv_precip - frainnc_p = tempo_driver_diags%frz_rain_precip + ! precipitation variables are added in case of multiple calls when n_microp > 1 + snownc_p = snownc_p + tempo_driver_diags%snow_liquid_equiv_precip + snowncv_p = snowncv_p + tempo_driver_diags%snow_liquid_equiv_precip + graupelnc_p = graupelnc_p + tempo_driver_diags%graupel_liquid_equiv_precip + graupelncv_p = graupelncv_p + tempo_driver_diags%graupel_liquid_equiv_precip + rainnc_p = rainnc_p + tempo_driver_diags%rain_precip + & + snownc_p + graupelnc_p + tempo_driver_diags%ice_liquid_equiv_precip + rainncv_p = rainncv_p + tempo_driver_diags%rain_precip + & + snownc_p + graupelnc_p + tempo_driver_diags%ice_liquid_equiv_precip + frainnc_p = frainnc_p + tempo_driver_diags%frz_rain_precip refl10cm_p = tempo_driver_diags%refl10cm recloud_p = tempo_driver_diags%re_cloud reice_p = tempo_driver_diags%re_ice diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index 35d577efab..156950af30 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -664,7 +664,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, !TEMPO/NSSL character(len=StrKIND),pointer:: nssl_moments logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware - logical,pointer:: config_tempo_ml_nc_pbl + logical,pointer:: config_tempo_ml_for_bl_nc integer,pointer:: index_qh integer,pointer:: index_zrw,index_zgw,index_zhw integer,pointer:: index_ns,index_ng,index_nh,index_nccn @@ -696,7 +696,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, call mpas_pool_get_config(configs,'config_nssl_moments',nssl_moments) call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) - call mpas_pool_get_config(configs,'config_tempo_ml_nc_pbl',config_tempo_ml_nc_pbl) + call mpas_pool_get_config(configs,'config_tempo_ml_for_bl_nc',config_tempo_ml_for_bl_nc) call mpas_pool_get_array(mesh,'zgrid',zgrid) call mpas_pool_get_array(mesh,'zz' ,zz ) @@ -888,7 +888,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, enddo enddo - if(config_tempo_ml_nc_pbl) then + if(config_tempo_ml_for_bl_nc) then call mpas_pool_get_array(diag_physics,'qc_bl',qc_bl) call mpas_pool_get_array(diag_physics,'cldfrac_bl',cldfrac_bl) do j = jts, jte diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 1abd31ada0..3060f842ba 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 1abd31ada0df486059c8d21e3ea8f607f10ed441 +Subproject commit 3060f842bad28414fe6dce63358ac0bee33e297d From ec6fdad03979395616571edcd90b9f83f1f92a22 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 7 Jan 2026 02:58:39 +0000 Subject: [PATCH 29/46] move cldfra option to tempo registry --- src/core_atmosphere/Registry.xml | 17 ++--------------- src/core_atmosphere/physics/Registry_tempo.xml | 4 ++++ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 2aed3d3d7d..dc4c4fe0cc 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -424,7 +424,7 @@ - + @@ -2116,7 +2116,7 @@ packages="mp_thompson_aers_in;tempo_aerosolaware_in"/> - - - - @@ -2791,11 +2783,6 @@ description="configuration for cloud microphysics schemes" possible_values="`suite',`mp_wsm6',`mp_tempo',`mp_thompson',`mp_thompson_aerosols', `mp_kessler',`mp_nssl2m',`off'"/> - - + \ No newline at end of file From 978b2d559735f981f0df6bbcac47422633c41653 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 7 Jan 2026 03:33:21 +0000 Subject: [PATCH 30/46] add cloud fraction variables to driver --- .../mpas_atmphys_driver_microphysics.F | 39 ++----------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index 6f7f19ad5d..58a57f0364 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -237,23 +237,6 @@ subroutine allocate_microphysics(configs) if(.not.allocated(rqiblten_p)) allocate(rqiblten_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rthratenlw_p)) allocate(rthratenlw_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rthratensw_p)) allocate(rthratensw_p(ims:ime,kms:kme,jms:jme)) -! if(.not.allocated(cldfrac_p) ) allocate(cldfrac_p(ims:ime,kms:kme,jms:jme)) -! if(.not.allocated(qcbl_p) ) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) - endif - - if (config_tempo_cldfra) then - if(.not.allocated(qal_p)) allocate(qal_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(qai_p)) allocate(qai_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(precipfrac_p)) allocate(precipfrac_p(ims:ime,kms:kme,jms:jme)) - - if(.not.allocated(rthblten_p)) allocate(rthblten_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(rqvblten_p)) allocate(rqvblten_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(rqcblten_p)) allocate(rqcblten_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(rqiblten_p)) allocate(rqiblten_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(rthratenlw_p)) allocate(rthratenlw_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(rthratensw_p)) allocate(rthratensw_p(ims:ime,kms:kme,jms:jme)) -! if(.not.allocated(cldfrac_p) ) allocate(cldfrac_p(ims:ime,kms:kme,jms:jme)) -! if(.not.allocated(qcbl_p) ) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) endif if (config_tempo_ml_for_bl_nc) then @@ -432,23 +415,6 @@ subroutine deallocate_microphysics(configs) if(allocated(rqiblten_p)) deallocate(rqiblten_p) if(allocated(rthratenlw_p)) deallocate(rthratenlw_p) if(allocated(rthratensw_p)) deallocate(rthratensw_p) -! if(allocated(cldfrac_p) ) deallocate(cldfrac_p) -! if(allocated(qcbl_p) ) deallocate(qcbl_p) - endif - - if (config_tempo_cldfra) then - if(allocated(qal_p)) deallocate(qal_p) - if(allocated(qai_p)) deallocate(qai_p) - if(allocated(precipfrac_p)) deallocate(precipfrac_p) - - if(allocated(rthblten_p)) deallocate(rthblten_p) - if(allocated(rqvblten_p)) deallocate(rqvblten_p) - if(allocated(rqcblten_p)) deallocate(rqcblten_p) - if(allocated(rqiblten_p)) deallocate(rqiblten_p) - if(allocated(rthratenlw_p)) deallocate(rthratenlw_p) - if(allocated(rthratensw_p)) deallocate(rthratensw_p) -! if(allocated(cldfrac_p) ) deallocate(cldfrac_p) -! if(allocated(qcbl_p) ) deallocate(qcbl_p) endif if (config_tempo_ml_for_bl_nc) then @@ -677,7 +643,10 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten nc = nc_p , nwfa = nwfa_p , nifa = nifa_p , & pii = pi_p , p = pres_p , dz = dz_p , & qc_bl = qcbl_p , qcfrac_bl = cldfrac_p , & - qcfrac = qal_p , qifrac = qai_p , & + qcfrac = qal_p , qifrac = qai_p , & + thten_bl=rthblten_p , qvten_bl = rqvblten_p , & + qcten_bl=rqcblten_p , qiten_bl = rqiblten_p , & + thten_lwrad=rthratenlw_p, thten_swrad=rthratensw_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 , & From abd6351b8d0b21a3e862c6bf5639c5a146584a38 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 7 Jan 2026 17:10:34 +0000 Subject: [PATCH 31/46] update tempo pointer --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 3060f842ba..62122bfe4b 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 3060f842bad28414fe6dce63358ac0bee33e297d +Subproject commit 62122bfe4be6125facb72d43109a066601979775 From 563d91eb674aa00b85aa3c2a07a92cccd15e94ba Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Wed, 7 Jan 2026 17:22:21 +0000 Subject: [PATCH 32/46] update tempo pointer --- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 62122bfe4b..68c8c18c86 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 62122bfe4be6125facb72d43109a066601979775 +Subproject commit 68c8c18c863e72da4a80c092fc0de7a21b517bee From df1e4d4946e34fada71b22899921640497853499 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 5 Feb 2026 17:08:20 +0000 Subject: [PATCH 33/46] update point to tempo v3 and clean up code to better match NCAR implementation --- .../physics/mpas_atmphys_control.F | 31 ------ .../mpas_atmphys_driver_microphysics.F | 95 ++++++++++--------- .../physics/mpas_atmphys_interface.F | 2 +- .../physics/mpas_atmphys_packages.F | 14 +-- .../physics/mpas_atmphys_todynamics.F | 14 +-- .../physics/physics_noaa/TEMPO | 2 +- src/core_init_atmosphere/Registry.xml | 1 - 7 files changed, 64 insertions(+), 95 deletions(-) diff --git a/src/core_atmosphere/physics/mpas_atmphys_control.F b/src/core_atmosphere/physics/mpas_atmphys_control.F index 7922727ed5..6c0b81327a 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_control.F +++ b/src/core_atmosphere/physics/mpas_atmphys_control.F @@ -462,7 +462,6 @@ subroutine physics_tables_init(dminfo,configs) !local variables: character(len=StrKIND),pointer:: config_microp_scheme - logical,pointer:: config_tempo_hailaware logical:: l_qr_acr_qg,l_qr_acr_qs,l_qi_aut_qs,l_freezeH2O !----------------------------------------------------------------------------------------------------------------- @@ -473,37 +472,8 @@ subroutine physics_tables_init(dminfo,configs) call mpas_pool_get_config(configs,'config_microp_scheme',config_microp_scheme) if(config_microp_scheme /= "mp_thompson" .or. & - config_microp_scheme /= "mp_tempo" .or. & config_microp_scheme /= "mp_thompson_aerosols") return - if (config_microp_scheme == "mp_tempo") then - l_qr_acr_qg = .false. - l_qr_acr_qs = .false. - l_qi_aut_qs = .false. - l_freezeH2O = .false. - - ! hailaware scheme needs hailaware table, non hailaware scheme can use either table - call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) - if (config_tempo_hailaware) then - inquire(file='MP_TEMPO_HAILAWARE_QRacrQG_DATA.DBL' ,exist=l_qr_acr_qg) - else - inquire(file='MP_TEMPO_HAILAWARE_QRacrQG_DATA.DBL' ,exist=l_qr_acr_qg) - if (.not. l_qr_acr_qg) then - inquire(file='MP_TEMPO_QRacrQG_DATA.DBL' ,exist=l_qr_acr_qg) - endif - endif - inquire(file='MP_TEMPO_QRacrQS_DATA.DBL' ,exist=l_qr_acr_qs) - inquire(file='MP_TEMPO_QIautQS_DATA.DBL' ,exist=l_qi_aut_qs) - inquire(file='MP_TEMPO_freezeH2O_DATA.DBL',exist=l_freezeH2O) - - if(.not. (l_qr_acr_qg .and. l_qr_acr_qs .and. l_qi_aut_qs .and. l_freezeH2O)) then - write(mpas_err_message,'(A)') & - '--- tables to run the TEMPO cloud microphysics do not exist: run build_tables_tempo first.' - call physics_error_fatal(mpas_err_message) - endif - ! call mpas_log_write('l_mp_tables = $l',logicArgs=(/l_mp_tables/)) - else - l_qr_acr_qg = .false. l_qr_acr_qs = .false. l_qi_aut_qs = .false. @@ -527,7 +497,6 @@ subroutine physics_tables_init(dminfo,configs) call physics_error_fatal(mpas_err_message) endif ! call mpas_log_write('l_mp_tables = $l',logicArgs=(/l_mp_tables/)) - endif endif diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index fba1db829c..87d7780da8 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -22,8 +22,7 @@ module mpas_atmphys_driver_microphysics use module_mp_kessler use module_mp_thompson use module_mp_tempo_cfgs,only: ty_tempo_cfgs - use module_mp_tempo_driver,only: tempo_driver, ty_tempo_driver_diags, tempo_aerosol_surface_emissions - use module_mp_tempo_init,only: tempo_init + use module_mp_tempo_driver,only: tempo_init,tempo_run,ty_tempo_driver_diags,tempo_aerosol_surface_emissions use module_mp_wsm6,only: wsm6 use mp_wsm6,only: mp_wsm6_init,refl10cm_wsm6 use module_mp_nssl_2mom @@ -110,7 +109,7 @@ subroutine allocate_microphysics(configs) !local pointers: character(len=StrKIND),pointer:: microp_scheme character(len=StrKIND),pointer:: nssl_moments - logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware + logical,pointer:: config_tempo_aerosolaware,config_tempo_hailaware logical,pointer:: config_tempo_ml_for_bl_nc !----------------------------------------------------------------------------------------------------------------- @@ -207,8 +206,6 @@ subroutine allocate_microphysics(configs) microp2a_select: select case(trim(microp_scheme)) case("mp_tempo") -! if(.not.allocated(ntc_p)) allocate(ntc_p(ims:ime,jms:jme)) -! if(.not.allocated(muc_p)) allocate(muc_p(ims:ime,jms:jme)) 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)) if(.not.allocated(refl10cm_p) ) allocate(refl10cm_p(ims:ime,kms:kme,jms:jme) ) @@ -217,8 +214,14 @@ subroutine allocate_microphysics(configs) if(.not.allocated(max_hail_diameter_sfc_p) ) allocate(max_hail_diameter_sfc_p(ims:ime,jms:jme) ) if(.not.allocated(max_hail_diameter_column_p) ) allocate(max_hail_diameter_column_p(ims:ime,jms:jme) ) - ! Allocate TEMPO options based on config flags insead of adding more nested select cases - ! These flags are associated with appropriate packages in mpas_atmphys_packages.F + 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 + if (config_tempo_hailaware) then if(.not.allocated(ng_p) ) allocate(ng_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(volg_p)) allocate(volg_p(ims:ime,kms:kme,jms:jme)) @@ -229,14 +232,6 @@ subroutine allocate_microphysics(configs) if(.not.allocated(qcbl_p) ) allocate(qcbl_p(ims:ime,kms:kme,jms:jme)) endif - 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("mp_nssl2m") if(.not.allocated(qh_p) ) allocate(qh_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(nc_p) ) allocate(nc_p(ims:ime,kms:kme,jms:jme)) @@ -373,8 +368,6 @@ subroutine deallocate_microphysics(configs) microp2a_select: select case(trim(microp_scheme)) case("mp_tempo") -! if(allocated(ntc_p)) deallocate(ntc_p) -! if(allocated(muc_p)) deallocate(muc_p) if(allocated(ni_p) ) deallocate(ni_p ) if(allocated(nr_p) ) deallocate(nr_p ) if(allocated(refl10cm_p) ) deallocate(refl10cm_p ) @@ -383,6 +376,14 @@ subroutine deallocate_microphysics(configs) if(allocated(max_hail_diameter_sfc_p) ) deallocate(max_hail_diameter_sfc_p) if(allocated(max_hail_diameter_column_p) ) deallocate(max_hail_diameter_column_p) + 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 + if (config_tempo_hailaware) then if(allocated(ng_p) ) deallocate(ng_p ) if(allocated(volg_p) ) deallocate(volg_p ) @@ -393,14 +394,6 @@ subroutine deallocate_microphysics(configs) if(allocated(qcbl_p) ) deallocate(qcbl_p) endif - 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("mp_nssl2m") if(allocated(qh_p) ) deallocate(qh_p ) if(allocated(nc_p) ) deallocate(nc_p ) @@ -490,7 +483,7 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p case("mp_tempo") call tempo_init(aerosolaware_flag=config_tempo_aerosolaware, & hailaware_flag=config_tempo_hailaware, & - ml_for_bl_nc_flag = config_tempo_ml_for_bl_nc, tempo_cfgs=tempo_cfgs) + ml_for_bl_nc_flag=config_tempo_ml_for_bl_nc, tempo_cfgs=tempo_cfgs) if (config_tempo_aerosolaware) then call init_tempo_aerosols_forMPAS(do_restart,dminfo,mesh,state,time_lev,diag_physics) @@ -540,6 +533,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten !local variables and arrays: integer:: istep + integer:: i,j,k integer, pointer :: do_diag_dbz logical :: do_diag_dbz_flag @@ -594,7 +588,6 @@ 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) @@ -604,7 +597,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten istep = 1 do while (istep .le. n_microp) - call tempo_driver( tempo_cfgs=tempo_cfgs, & + 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 , & @@ -617,23 +610,35 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten 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) - ! precipitation variables are added in case of multiple calls when n_microp > 1 - snownc_p = snownc_p + tempo_driver_diags%snow_liquid_equiv_precip - snowncv_p = snowncv_p + tempo_driver_diags%snow_liquid_equiv_precip - graupelnc_p = graupelnc_p + tempo_driver_diags%graupel_liquid_equiv_precip - graupelncv_p = graupelncv_p + tempo_driver_diags%graupel_liquid_equiv_precip - rainnc_p = rainnc_p + tempo_driver_diags%rain_precip + & - snownc_p + graupelnc_p + tempo_driver_diags%ice_liquid_equiv_precip - rainncv_p = rainncv_p + tempo_driver_diags%rain_precip + & - snownc_p + graupelnc_p + tempo_driver_diags%ice_liquid_equiv_precip - frainnc_p = frainnc_p + tempo_driver_diags%frz_rain_precip - refl10cm_p = tempo_driver_diags%refl10cm - recloud_p = tempo_driver_diags%re_cloud - reice_p = tempo_driver_diags%re_ice - resnow_p = tempo_driver_diags%re_snow - sr_p = tempo_driver_diags%frozen_fraction - 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 j = jts, jte + do i = its, ite + ! precipitation variables are added 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(i,j) = frainnc_p(i,j) + tempo_driver_diags%frz_rain_precip(i,j) + max_hail_diameter_sfc_p(i,j) = tempo_driver_diags%max_hail_diameter_sfc(i,j) + max_hail_diameter_column_p(i,j) = tempo_driver_diags%max_hail_diameter_column(i,j) + do k = kts, kte + refl10cm_p(i,k,j) = tempo_driver_diags%refl10cm(i,k,j) + 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') diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index 156950af30..4faa5fbe38 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -663,7 +663,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, real(kind=RKIND),dimension(:),pointer :: nifa2d,nwfa2d,nt_c,mu_c !TEMPO/NSSL character(len=StrKIND),pointer:: nssl_moments - logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware + logical,pointer:: config_tempo_aerosolaware,config_tempo_hailaware logical,pointer:: config_tempo_ml_for_bl_nc integer,pointer:: index_qh integer,pointer:: index_zrw,index_zgw,index_zhw diff --git a/src/core_atmosphere/physics/mpas_atmphys_packages.F b/src/core_atmosphere/physics/mpas_atmphys_packages.F index e1a9513669..620701ee0f 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_packages.F +++ b/src/core_atmosphere/physics/mpas_atmphys_packages.F @@ -41,9 +41,9 @@ function atmphys_setup_packages(configs,streamInfo,packages,iocontext) result(ie character(len=StrKIND),pointer:: config_lsm_scheme character(len=StrKIND),pointer:: config_smoke_scheme character(len=StrKIND),pointer:: config_dust_scheme - logical,pointer:: config_tempo_hailaware, config_tempo_aerosolaware + logical,pointer:: config_tempo_aerosolaware,config_tempo_hailaware logical,pointer:: mp_kessler_in,mp_thompson_in,mp_thompson_aers_in,mp_wsm6_in,mp_nssl2m_in,nssl3m_in - logical,pointer:: mp_tempo_in, tempo_hailaware_in, tempo_aerosolaware_in + logical,pointer:: mp_tempo_in,tempo_hailaware_in,tempo_aerosolaware_in logical,pointer:: cu_grell_freitas_in,cu_grell_freitas_li_in,cu_kain_fritsch_in,cu_ntiedtke_in logical,pointer:: bl_mynn_in,bl_mynnedmf_in,bl_ysu_in,bl_myj_in logical,pointer:: lsm_noah_in,lsm_ruc_in @@ -66,8 +66,8 @@ function atmphys_setup_packages(configs,streamInfo,packages,iocontext) result(ie call mpas_pool_get_config(configs,'config_microp_scheme',config_microp_scheme) call mpas_pool_get_config(configs,'config_nssl_moments',config_nssl_moments) - call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) + call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware) nullify(mp_kessler_in) call mpas_pool_get_package(packages,'mp_kessler_inActive',mp_kessler_in) @@ -129,12 +129,8 @@ function atmphys_setup_packages(configs,streamInfo,packages,iocontext) result(ie mp_wsm6_in = .true. elseif(config_microp_scheme == 'mp_tempo') then mp_tempo_in = .true. - if (config_tempo_aerosolaware) then - tempo_aerosolaware_in = .true. - endif - if (config_tempo_hailaware) then - tempo_hailaware_in = .true. - endif + if (config_tempo_aerosolaware) tempo_aerosolaware_in = .true. + if (config_tempo_hailaware) tempo_hailaware_in = .true. elseif(config_microp_scheme == 'mp_nssl2m') then mp_nssl2m_in = .true. IF ( config_nssl_moments == 'nssl3m' ) THEN diff --git a/src/core_atmosphere/physics/mpas_atmphys_todynamics.F b/src/core_atmosphere/physics/mpas_atmphys_todynamics.F index 4cc141bca5..155bbbaab6 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_todynamics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_todynamics.F @@ -89,7 +89,7 @@ subroutine physics_get_tend(block,mesh,state,diag,tend,tend_physics,configs,rk_s radt_lw_scheme, & radt_sw_scheme - logical,pointer::tempo_aerosolaware + logical,pointer::config_tempo_aerosolaware integer:: i,iCell,k,n integer,pointer:: index_qv,index_qc,index_qr,index_qi,index_qs integer,pointer:: index_nc,index_ni,index_nifa,index_nwfa @@ -127,7 +127,7 @@ subroutine physics_get_tend(block,mesh,state,diag,tend,tend_physics,configs,rk_s call mpas_pool_get_config(configs,'config_pbl_scheme' ,pbl_scheme ) call mpas_pool_get_config(configs,'config_radt_lw_scheme' ,radt_lw_scheme ) call mpas_pool_get_config(configs,'config_radt_sw_scheme' ,radt_sw_scheme ) - call mpas_pool_get_config(configs,'config_tempo_aerosolaware',tempo_aerosolaware) + call mpas_pool_get_config(configs,'config_tempo_aerosolaware',config_tempo_aerosolaware) call mpas_pool_get_array(state,'theta_m' ,theta_m,1) call mpas_pool_get_array(state,'scalars' ,scalars,1) @@ -211,7 +211,7 @@ subroutine physics_get_tend(block,mesh,state,diag,tend,tend_physics,configs,rk_s call physics_get_tend_work( & block,mesh,nCells,nEdges,nCellsSolve,nEdgesSolve,rk_step,dynamics_substep, & pbl_scheme,convection_scheme,microp_scheme,radt_lw_scheme,radt_sw_scheme, & - tempo_aerosolaware,index_qv,index_qc,index_qr,index_qi,index_qs, & + config_tempo_aerosolaware,index_qv,index_qc,index_qr,index_qi,index_qs, & index_nc,index_ni,index_nifa,index_nwfa, & mass,mass_edge,theta_m,scalars, & rublten,rvblten,rthblten,rqvblten,rqcblten,rqiblten,rqsblten, & @@ -251,7 +251,7 @@ end subroutine physics_get_tend subroutine physics_get_tend_work( & block,mesh,nCells,nEdges,nCellsSolve,nEdgesSolve,rk_step,dynamics_substep, & pbl_scheme,convection_scheme,microp_scheme,radt_lw_scheme,radt_sw_scheme, & - tempo_aerosolaware,index_qv,index_qc,index_qr,index_qi,index_qs, & + config_tempo_aerosolaware,index_qv,index_qc,index_qr,index_qi,index_qs, & index_nc,index_ni,index_nifa,index_nwfa, & mass,mass_edge,theta_m,scalars, & rublten,rvblten,rthblten,rqvblten,rqcblten,rqiblten,rqsblten, & @@ -273,7 +273,7 @@ subroutine physics_get_tend_work( & character(len=StrKIND),intent(in):: pbl_scheme character(len=StrKIND),intent(in):: radt_lw_scheme character(len=StrKIND),intent(in):: radt_sw_scheme - logical,intent(in):: tempo_aerosolaware + logical,intent(in):: config_tempo_aerosolaware integer,intent(in):: nCells,nEdges,nCellsSolve,nEdgesSolve integer,intent(in):: rk_step,dynamics_substep @@ -369,7 +369,7 @@ subroutine physics_get_tend_work( & enddo endif - if((trim(microp_scheme) == 'mp_tempo') .and. (tempo_aerosolaware)) then + if((trim(microp_scheme) == 'mp_tempo') .and. (config_tempo_aerosolaware)) then do i = 1, nCellsSolve do k = 1, nVertLevels tend_scalars(index_nc,k,i) = tend_scalars(index_nc,k,i) + rncblten(k,i)*mass(k,i) @@ -397,7 +397,7 @@ subroutine physics_get_tend_work( & enddo endif - if((trim(microp_scheme) == 'mp_tempo') .and. (tempo_aerosolaware)) then + if((trim(microp_scheme) == 'mp_tempo') .and. (config_tempo_aerosolaware)) then do i = 1, nCellsSolve do k = 1, nVertLevels tend_scalars(index_nc,k,i) = tend_scalars(index_nc,k,i) + rncblten(k,i)*mass(k,i) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 68c8c18c86..b29fb2da35 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 68c8c18c863e72da4a80c092fc0de7a21b517bee +Subproject commit b29fb2da35f342f18b384b37a3091901c7a86381 diff --git a/src/core_init_atmosphere/Registry.xml b/src/core_init_atmosphere/Registry.xml index 8c2f94ec88..8177dcb3a0 100644 --- a/src/core_init_atmosphere/Registry.xml +++ b/src/core_init_atmosphere/Registry.xml @@ -409,7 +409,6 @@ - From a4e601583707b73a8b520f2922a64ca05db14b0d Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 5 Feb 2026 20:57:29 +0000 Subject: [PATCH 34/46] code clean up --- src/core_atmosphere/Registry.xml | 9 +++++++++ .../physics/mpas_atmphys_driver_cloudiness.F | 12 +----------- .../physics/mpas_atmphys_driver_microphysics.F | 5 ++--- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index dc4c4fe0cc..0e1b904ee7 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -2620,6 +2620,15 @@ + + + + + diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F index 7ac26fcfe7..383c1670ed 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_cloudiness.F @@ -260,17 +260,7 @@ subroutine cloudiness_from_MPAS(itimestep,configs,mesh,state,diag_physics,sfc_in do i = its,ite qal_p(i,k,j) = qal(k,i) qai_p(i,k,j) = qai(k,i) - cldfrac_p(i,k,j) = max(0., max(qal(k,i), qai(k,i))) ! Avoid cldfrac < 0 - if (cldfrac_p(i,k,j) > 0.) then - if (qirad_p(i,k,j) > 1.e-7) then - qirad_p(i,k,j) = max(0. , qirad_p(i,k,j) + qsrad_p(i,k,j)) - qsrad_p(i,k,j) = 0. - endif - else - qcrad_p(i,k,j) = 0. ! No cloud - qirad_p(i,k,j) = 0. ! No cloud - qsrad_p(i,k,j) = 0. ! No cloud - endif + cldfrac_p(i,k,j) = max(0., max(qal(k,i), qai(k,i))) ! Avoid negative cldfrac enddo enddo enddo diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index 58a57f0364..f77b9a2066 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -22,8 +22,7 @@ module mpas_atmphys_driver_microphysics use module_mp_kessler use module_mp_thompson use module_mp_tempo_cfgs,only: ty_tempo_cfgs - use module_mp_tempo_driver,only: tempo_driver, ty_tempo_driver_diags, tempo_aerosol_surface_emissions - use module_mp_tempo_init,only: tempo_init + use module_mp_tempo_driver,only: tempo_init, tempo_driver, ty_tempo_driver_diags, tempo_aerosol_surface_emissions use module_mp_wsm6,only: wsm6 use mp_wsm6,only: mp_wsm6_init,refl10cm_wsm6 use module_mp_nssl_2mom @@ -233,7 +232,7 @@ subroutine allocate_microphysics(configs) if(.not.allocated(rthblten_p)) allocate(rthblten_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rqvblten_p)) allocate(rqvblten_p(ims:ime,kms:kme,jms:jme)) - if(.not.allocated(rqcblten_p)) allocate(rqcblten_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(rqcblten_p)) allocate(rqcblten_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rqiblten_p)) allocate(rqiblten_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rthratenlw_p)) allocate(rthratenlw_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rthratensw_p)) allocate(rthratensw_p(ims:ime,kms:kme,jms:jme)) diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index c8ed622582..87a9c8659d 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit c8ed622582f6c7de4a67c5d01a553e557617ff72 +Subproject commit 87a9c8659d4200e9cd9c94fa03047560a647c0f5 From 810ff4547cd43138bb85d9d37fe85eeb1cfcc465 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 5 Feb 2026 21:50:58 +0000 Subject: [PATCH 35/46] change tempo_driver to tempo_run --- .../physics/mpas_atmphys_driver_microphysics.F | 4 ++-- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 2 files changed, 3 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 f77b9a2066..6dff14e413 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -22,7 +22,7 @@ module mpas_atmphys_driver_microphysics use module_mp_kessler use module_mp_thompson 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 + use module_mp_tempo_driver,only: tempo_init, tempo_run, ty_tempo_driver_diags, tempo_aerosol_surface_emissions use module_mp_wsm6,only: wsm6 use mp_wsm6,only: mp_wsm6_init,refl10cm_wsm6 use module_mp_nssl_2mom @@ -633,7 +633,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten istep = 1 do while (istep .le. n_microp) - call tempo_driver( tempo_cfgs=tempo_cfgs, & + 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 , & diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 87a9c8659d..7daccf1a24 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 87a9c8659d4200e9cd9c94fa03047560a647c0f5 +Subproject commit 7daccf1a240509541509616e5fa8ec874b8e459a From 0aa138b6278ee03432da78c581f04025ba93f8df Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 12 Feb 2026 14:11:14 +0000 Subject: [PATCH 36/46] Update CMakeList for tempo v3 --- src/core_atmosphere/CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core_atmosphere/CMakeLists.txt b/src/core_atmosphere/CMakeLists.txt index ea4f57448e..a6a5104218 100644 --- a/src/core_atmosphere/CMakeLists.txt +++ b/src/core_atmosphere/CMakeLists.txt @@ -217,11 +217,14 @@ else() endif() set(ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES - module_mp_tempo_main.F90 - module_mp_tempo_params.F90 - module_mp_tempo_utils.F90 - module_mp_tempo_ml.F90 - drivers/mpas/module_mp_tempo.F90 + src/module_mp_tempo_cfgs.F90 + src/module_mp_tempo_params.F90 + src/module_mp_tempo_ml.F90 + src/module_mp_tempo_utils.F90 + src/module_mp_tempo_diags.F90 + src/module_mp_tempo_aerosols.F99 + src/module_mp_tempo_main.F90 + src/module_mp_tempo_driver.F90 ) list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES PREPEND physics/physics_noaa/TEMPO/) From 93f087f50ce8a5287c5667db0449e35c2f9c647c Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 12 Feb 2026 14:29:19 +0000 Subject: [PATCH 37/46] fix the typo in CMakeList --- src/core_atmosphere/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/CMakeLists.txt b/src/core_atmosphere/CMakeLists.txt index a6a5104218..86504e00c9 100644 --- a/src/core_atmosphere/CMakeLists.txt +++ b/src/core_atmosphere/CMakeLists.txt @@ -222,7 +222,7 @@ set(ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES src/module_mp_tempo_ml.F90 src/module_mp_tempo_utils.F90 src/module_mp_tempo_diags.F90 - src/module_mp_tempo_aerosols.F99 + src/module_mp_tempo_aerosols.F90 src/module_mp_tempo_main.F90 src/module_mp_tempo_driver.F90 ) From 2f6b931953aa8c62afad80335a16ded2c30d58eb Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 12 Feb 2026 17:31:37 +0000 Subject: [PATCH 38/46] add compile option for tempo --- src/core_atmosphere/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core_atmosphere/CMakeLists.txt b/src/core_atmosphere/CMakeLists.txt index 86504e00c9..8775bd3389 100644 --- a/src/core_atmosphere/CMakeLists.txt +++ b/src/core_atmosphere/CMakeLists.txt @@ -227,6 +227,7 @@ set(ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES src/module_mp_tempo_driver.F90 ) list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES PREPEND physics/physics_noaa/TEMPO/) +set_source_files_properties(physics/physics_noaa/TEMPO/src/module_mp_tempo_params.F90 PROPERTIES COMPILE_OPTIONS "-Dtempo_mpas") set(ATMOSPHERE_CORE_PHYSICS_MYNN-EDMF_DIR ${CMAKE_CURRENT_SOURCE_DIR}/physics/physics_noaa/MYNN-EDMF) From 8f2f0b0c569938750180f68fa76ffb08a545fa3c Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 12 Feb 2026 20:05:29 +0000 Subject: [PATCH 39/46] More updates to github runners for tempo v3 --- .github/workflows/run_mpas_hrrr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_mpas_hrrr.yml b/.github/workflows/run_mpas_hrrr.yml index 2eafc7dd44..5636fe1b72 100644 --- a/.github/workflows/run_mpas_hrrr.yml +++ b/.github/workflows/run_mpas_hrrr.yml @@ -298,7 +298,6 @@ jobs: key: cache-tempo-data-key - name: Download TEMPO MP tables - if: steps.cache-tempo-data.outputs.cache-hit != 'true' run: | cd ${runner_ROOT} && mkdir tempo && cd tempo wget -q -e robots=off -nH --cut-dirs N -nc -r -lX --accept-regex='_tempo_v3' -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \ @@ -368,6 +367,7 @@ jobs: ln -sf ${mpas_rt_ROOT}/MPAS-Model/atmosphere_model atmosphere_model ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.ugwp_file}} mpas.ugwp_oro_data.nc ln -sf ${runner_ROOT}/tempo/* . + ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_noaa/TEMPO/tables/ccn_activate.bin . ln -sf ${runner_ROOT}/ugw/ugwp_limb_tau.nc . - name: Link lateral boundary condition file for regional MPAS (feature) From 5663e4018fb795064fc14009755c914b89b1fa54 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 12 Feb 2026 20:31:11 +0000 Subject: [PATCH 40/46] this might fix failing regression tests --- .github/workflows/run_mpas_hrrr.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/run_mpas_hrrr.yml b/.github/workflows/run_mpas_hrrr.yml index 5636fe1b72..41e127cb20 100644 --- a/.github/workflows/run_mpas_hrrr.yml +++ b/.github/workflows/run_mpas_hrrr.yml @@ -290,13 +290,6 @@ jobs: cd ${mpas_run_ROOT} git clone --recursive --branch main https://github.com/barlage/mpas_testcase.git - - name: Cache TEMPO MP tables - id: cache-tempo-data - uses: actions/cache@v4 - with: - path: /home/runner/tempo - key: cache-tempo-data-key - - name: Download TEMPO MP tables run: | cd ${runner_ROOT} && mkdir tempo && cd tempo From 5a5d15e0145aaecc9de4b800cbdc30a2c5253350 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 12 Feb 2026 22:10:41 +0000 Subject: [PATCH 41/46] update pointer to new test data fork --- .github/workflows/run_mpas.yml | 4 ++-- .github/workflows/run_mpas_hrrr.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_mpas.yml b/.github/workflows/run_mpas.yml index 2e998264fb..0bf236fe7f 100644 --- a/.github/workflows/run_mpas.yml +++ b/.github/workflows/run_mpas.yml @@ -22,7 +22,7 @@ on: [push, pull_request, workflow_dispatch] # - The test build/run configurations matrix is described below. # - This script uses a matrix run configuration with exclusions to achieve the desired "run list" # -# - List of physics configuration to test. See https://github.com/barlage/mpas_testcase.git +# - List of physics configuration to test. See https://github.com/AndersJensen-NOAA/mpas_testcase.git # - Baseline codebase repository. # - Baseline codebase repository branch. # @@ -285,7 +285,7 @@ jobs: - name: Download MPAS testing repository with runtime configurations. run: | cd ${mpas_run_ROOT} - git clone --recursive --branch main https://github.com/barlage/mpas_testcase.git + git clone --recursive --branch main https://github.com/AndersJensen-NOAA/mpas_testcase.git - name: Cache Thompson MP tables id: cache-thompson-data diff --git a/.github/workflows/run_mpas_hrrr.yml b/.github/workflows/run_mpas_hrrr.yml index 41e127cb20..d4a47130b4 100644 --- a/.github/workflows/run_mpas_hrrr.yml +++ b/.github/workflows/run_mpas_hrrr.yml @@ -22,7 +22,7 @@ on: [push, pull_request, workflow_dispatch] # - The test build/run configurations matrix is described below. # - This script uses a matrix run configuration with exclusions to achieve the desired "run list" # -# - List of physics configuration to test. See https://github.com/barlage/mpas_testcase.git +# - List of physics configuration to test. See https://github.com/AndersJensen-NOAA/mpas_testcase.git # - Baseline codebase repository. # - Baseline codebase repository branch. # @@ -288,7 +288,7 @@ jobs: - name: Download MPAS testing repository with runtime configurations. run: | cd ${mpas_run_ROOT} - git clone --recursive --branch main https://github.com/barlage/mpas_testcase.git + git clone --recursive --branch main https://github.com/AndersJensen-NOAA/mpas_testcase.git - name: Download TEMPO MP tables run: | From 76f84ba63fe352565f105585fbea4724c914a82d Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Thu, 12 Feb 2026 23:27:34 +0000 Subject: [PATCH 42/46] change workflow to pull tempo v2 and v3 tables --- .github/workflows/run_mpas_hrrr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_mpas_hrrr.yml b/.github/workflows/run_mpas_hrrr.yml index d4a47130b4..73c7cb1eec 100644 --- a/.github/workflows/run_mpas_hrrr.yml +++ b/.github/workflows/run_mpas_hrrr.yml @@ -293,7 +293,7 @@ jobs: - name: Download TEMPO MP tables run: | cd ${runner_ROOT} && mkdir tempo && cd tempo - wget -q -e robots=off -nH --cut-dirs N -nc -r -lX --accept-regex='_tempo_v3' -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \ + wget -q -e robots=off -nH --cut-dirs N -nc -r -lX -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \ https://gsl.noaa.gov/thredds/catalog/${mpdata_dir}/catalog.html mv thredds/fileServer/${mpdata_dir}/* . rm -rf thredds From 1da637465304096eb4ae89d1b5d85098bad910e9 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 13 Feb 2026 02:54:59 +0000 Subject: [PATCH 43/46] change RT to debug --- .github/workflows/run_mpas_hrrr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_mpas_hrrr.yml b/.github/workflows/run_mpas_hrrr.yml index 73c7cb1eec..deaa692db0 100644 --- a/.github/workflows/run_mpas_hrrr.yml +++ b/.github/workflows/run_mpas_hrrr.yml @@ -271,7 +271,7 @@ jobs: if: contains(matrix.build-type, 'Release') run: | cd ${mpas_rt_ROOT}/MPAS-Model - make gfortran CORE=atmosphere + make gfortran CORE=atmosphere DEBUG=true ########################################################################################## # Step 3: Fetch any data/files needed for MPAS runs. From f9760f960dbab9b50cb3c97400bd87cb09c17101 Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 13 Feb 2026 04:58:05 +0000 Subject: [PATCH 44/46] revert debug testing in CI and update tempo pointer --- .github/workflows/run_mpas_hrrr.yml | 2 +- src/core_atmosphere/physics/physics_noaa/TEMPO | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_mpas_hrrr.yml b/.github/workflows/run_mpas_hrrr.yml index deaa692db0..73c7cb1eec 100644 --- a/.github/workflows/run_mpas_hrrr.yml +++ b/.github/workflows/run_mpas_hrrr.yml @@ -271,7 +271,7 @@ jobs: if: contains(matrix.build-type, 'Release') run: | cd ${mpas_rt_ROOT}/MPAS-Model - make gfortran CORE=atmosphere DEBUG=true + make gfortran CORE=atmosphere ########################################################################################## # Step 3: Fetch any data/files needed for MPAS runs. diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index b29fb2da35..fcbbf145b3 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit b29fb2da35f342f18b384b37a3091901c7a86381 +Subproject commit fcbbf145b3a4a0f28d6fd6ee245ac6b18013c4a6 From 0b29d0331f95c35f4e8c3cd3c863f738ca17869a Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 13 Feb 2026 17:15:57 +0000 Subject: [PATCH 45/46] revert baseline runtime configs to original repo --- .github/workflows/run_mpas_hrrr.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_mpas_hrrr.yml b/.github/workflows/run_mpas_hrrr.yml index 73c7cb1eec..643c2bb321 100644 --- a/.github/workflows/run_mpas_hrrr.yml +++ b/.github/workflows/run_mpas_hrrr.yml @@ -290,6 +290,11 @@ jobs: cd ${mpas_run_ROOT} git clone --recursive --branch main https://github.com/AndersJensen-NOAA/mpas_testcase.git + - name: Download MPAS testing repository with runtime configurations for baselines. + run: | + cd ${mpas_run_ROOT} + git clone --recursive --branch main https://github.com/barlage/mpas_testcase.git mpas_testcase_bl + - name: Download TEMPO MP tables run: | cd ${runner_ROOT} && mkdir tempo && cd tempo @@ -320,7 +325,7 @@ jobs: - name: Create and populate run directory (baselines) run: | cd ${mpas_run_ROOT} && mkdir run_bl && cd run_bl - cp ${mpas_run_ROOT}/mpas_testcase/run_case/case_files/${nml_version}/${domain}/${{matrix.ic_source}}.${yyyy}${mm}${dd}${hh}/${{env.physics}}/* . + cp ${mpas_run_ROOT}/mpas_testcase_bl/run_case/case_files/${nml_version}/${domain}/${{matrix.ic_source}}.${yyyy}${mm}${dd}${hh}/${{env.physics}}/* . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.TBL . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.DBL . ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*DATA . From a220e44ad595ff1d0ede42df2f1090740dfa920a Mon Sep 17 00:00:00 2001 From: AndersJensen-NOAA Date: Fri, 13 Feb 2026 20:47:30 +0000 Subject: [PATCH 46/46] - adds land and pbl to set cloud fraction rh in low-levels over water - adds check for prognostic cloud fraction to pbl driver --- .../dynamics/mpas_atm_time_integration.F | 4 ++- .../mpas_atmphys_driver_microphysics.F | 10 +++++-- .../physics/mpas_atmphys_driver_pbl.F | 30 +++++++++++++------ .../physics/mpas_atmphys_interface.F | 14 +++++++-- .../physics/physics_noaa/TEMPO | 2 +- 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F index 0601020cde..26c0cd0568 100644 --- a/src/core_atmosphere/dynamics/mpas_atm_time_integration.F +++ b/src/core_atmosphere/dynamics/mpas_atm_time_integration.F @@ -860,6 +860,7 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group) character(len=StrKIND), pointer :: config_IAU_option type (mpas_pool_type), pointer :: state + type (mpas_pool_type), pointer :: sfc_input type (mpas_pool_type), pointer :: diag type (mpas_pool_type), pointer :: diag_physics type (mpas_pool_type), pointer :: mesh @@ -906,6 +907,7 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group) ! call mpas_pool_get_subpool(block % structs, 'state', state) call mpas_pool_get_subpool(block % structs, 'mesh', mesh) + call mpas_pool_get_subpool(block % structs, 'sfc_input', sfc_input) call mpas_pool_get_subpool(block % structs, 'diag', diag) call mpas_pool_get_subpool(block % structs, 'tend', tend) call mpas_pool_get_subpool(block % structs, 'tend_physics', tend_physics) @@ -1656,7 +1658,7 @@ subroutine atm_srk3(domain, dt, itimestep, exchange_halo_group) call mpas_timer_start('microphysics') !$OMP PARALLEL DO do thread=1,nThreads - call driver_microphysics ( block % configs, mesh, state, 2, diag, diag_physics, tend_physics, tend, itimestep, & + call driver_microphysics ( block % configs, mesh, state, 2, sfc_input, diag, diag_physics, tend_physics, tend, itimestep, & cellSolveThreadStart(thread), cellSolveThreadEnd(thread)) end do !$OMP END PARALLEL DO diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F index 6dff14e413..3502d14101 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_microphysics.F @@ -236,6 +236,8 @@ subroutine allocate_microphysics(configs) if(.not.allocated(rqiblten_p)) allocate(rqiblten_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rthratenlw_p)) allocate(rthratenlw_p(ims:ime,kms:kme,jms:jme)) if(.not.allocated(rthratensw_p)) allocate(rthratensw_p(ims:ime,kms:kme,jms:jme)) + if(.not.allocated(hpbl_p)) allocate(hpbl_p(ims:ime,jms:jme)) + if(.not.allocated(xland_p)) allocate(xland_p(ims:ime,jms:jme)) endif if (config_tempo_ml_for_bl_nc) then @@ -414,6 +416,8 @@ subroutine deallocate_microphysics(configs) if(allocated(rqiblten_p)) deallocate(rqiblten_p) if(allocated(rthratenlw_p)) deallocate(rthratenlw_p) if(allocated(rthratensw_p)) deallocate(rthratensw_p) + if(allocated(hpbl_p)) deallocate(hpbl_p) + if(allocated(xland_p)) deallocate(xland_p) endif if (config_tempo_ml_for_bl_nc) then @@ -544,7 +548,7 @@ subroutine init_microphysics(dminfo,configs,mesh,state,time_lev,sfc_input,diag_p end subroutine init_microphysics !================================================================================================================= - subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,tend_physics,tend,itimestep,its,ite) + subroutine driver_microphysics(configs,mesh,state,time_lev,sfc_input,diag,diag_physics,tend_physics,tend,itimestep,its,ite) !================================================================================================================= use mpas_constants, only : rvord @@ -558,6 +562,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten integer,intent(in):: its,ite !inout arguments: type(mpas_pool_type),intent(inout):: state + type(mpas_pool_type),intent(inout):: sfc_input type(mpas_pool_type),intent(inout):: diag type(mpas_pool_type),intent(inout):: diag_physics type(mpas_pool_type),intent(inout):: tend_physics @@ -602,7 +607,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten call precip_from_MPAS(configs,diag_physics,its,ite) !... initialization of soundings for non-hydrostatic dynamical cores. - call microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics,tend_physics,its,ite) + call microphysics_from_MPAS(configs,mesh,state,time_lev,sfc_input,diag,diag_physics,tend_physics,its,ite) !... call to different cloud microphysics schemes: microp_select: select case(trim(microp_scheme)) @@ -646,6 +651,7 @@ subroutine driver_microphysics(configs,mesh,state,time_lev,diag,diag_physics,ten thten_bl=rthblten_p , qvten_bl = rqvblten_p , & qcten_bl=rqcblten_p , qiten_bl = rqiblten_p , & thten_lwrad=rthratenlw_p, thten_swrad=rthratensw_p , & + hpbl = hpbl_p , xland = xland_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 , & diff --git a/src/core_atmosphere/physics/mpas_atmphys_driver_pbl.F b/src/core_atmosphere/physics/mpas_atmphys_driver_pbl.F index d4c9961e67..c247f2f9a5 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_driver_pbl.F +++ b/src/core_atmosphere/physics/mpas_atmphys_driver_pbl.F @@ -474,7 +474,7 @@ subroutine pbl_from_MPAS(configs,state,mesh,sfc_input,diag_physics,tend_physics, !local pointers: character(len=StrKIND),pointer:: pbl_scheme - + logical,pointer:: config_tempo_cldfra real(kind=RKIND),dimension(:),pointer:: hfx,hpbl,qfx,ust,wspd,xland,znt real(kind=RKIND),dimension(:),pointer:: delta,wstar @@ -511,7 +511,8 @@ subroutine pbl_from_MPAS(configs,state,mesh,sfc_input,diag_physics,tend_physics, !----------------------------------------------------------------------------------------------------------------- call mpas_pool_get_config(configs,'config_pbl_scheme',pbl_scheme) - + call mpas_pool_get_config(configs,'config_tempo_cldfra',config_tempo_cldfra) + call mpas_pool_get_array(diag_physics,'hfx' ,hfx ) call mpas_pool_get_array(diag_physics,'hpbl',hpbl) call mpas_pool_get_array(diag_physics,'qfx' ,qfx ) @@ -756,12 +757,14 @@ subroutine pbl_from_MPAS(configs,state,mesh,sfc_input,diag_physics,tend_physics, call mpas_pool_get_array(diag_physics,'det_qv' ,det_qv ) call mpas_pool_get_array(state,'scalars',scalars) - call mpas_pool_get_dimension(state,'index_qal' ,index_qal ) - call mpas_pool_get_dimension(state,'index_qai' ,index_qai ) - - qal => scalars(index_qal,:,:) - qai => scalars(index_qai,:,:) + if (config_tempo_cldfra) then + call mpas_pool_get_dimension(state,'index_qal' ,index_qal ) + call mpas_pool_get_dimension(state,'index_qai' ,index_qai ) + qal => scalars(index_qal,:,:) + qai => scalars(index_qai,:,:) + endif + do j = jts,jte do i = its,ite dx_p(i,j) = len_disp / meshDensity(i)**0.25 @@ -782,8 +785,7 @@ subroutine pbl_from_MPAS(configs,state,mesh,sfc_input,diag_physics,tend_physics, qkeadv_p(i,k,j) = qke_adv(k,i) sh3d_p(i,k,j) = sh3d(k,i) sm3d_p(i,k,j) = sm3d(k,i) -! cldfrabl_p(i,k,j) = cldfrac_bl(k,i) - cldfrabl_p(i,k,j) = max(qal(k,i), qai(k,i)) + cldfrabl_p(i,k,j) = cldfrac_bl(k,i) qcbl_p(i,k,j) = qc_bl(k,i) qibl_p(i,k,j) = qi_bl(k,i) edmfa_p(i,k,j) = edmf_a(k,i) @@ -814,6 +816,16 @@ subroutine pbl_from_MPAS(configs,state,mesh,sfc_input,diag_physics,tend_physics, enddo enddo + if (config_tempo_cldfra) then + do j = jts,jte + do k = kts,kte + do i = its,ite + cldfrabl_p(i,k,j) = max(qal(k,i), qai(k,i)) + enddo + enddo + enddo + endif + do j = jts,jte do i = its,ite maxwidthbl_p(i,j) = 0._RKIND diff --git a/src/core_atmosphere/physics/mpas_atmphys_interface.F b/src/core_atmosphere/physics/mpas_atmphys_interface.F index 76e0180e47..351123d6ff 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_interface.F +++ b/src/core_atmosphere/physics/mpas_atmphys_interface.F @@ -640,13 +640,14 @@ subroutine MPAS_to_physics(configs,mesh,state,time_lev,diag,diag_physics,its,ite end subroutine MPAS_to_physics !================================================================================================================= - subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics,tend_physics,its,ite) + subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,sfc_input,diag,diag_physics,tend_physics,its,ite) !================================================================================================================= !input variables: type(mpas_pool_type),intent(in):: configs type(mpas_pool_type),intent(in):: mesh type(mpas_pool_type),intent(in):: state + type(mpas_pool_type),intent(in):: sfc_input type(mpas_pool_type),intent(in):: diag type(mpas_pool_type),intent(in):: diag_physics @@ -684,6 +685,7 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, real(kind=RKIND),dimension(:,:),pointer :: rainprod,evapprod real(kind=RKIND),dimension(:,:),pointer :: refl10cm real(kind=RKIND),dimension(:) ,pointer :: max_hail_diameter_sfc, max_hail_diameter_column + real(kind=RKIND),dimension(:) ,pointer :: hpbl,xland real(kind=RKIND),dimension(:,:),pointer :: re_cloud,re_ice,re_snow real(kind=RKIND),dimension(:,:),pointer :: qc_bl, cldfrac_bl real(kind=RKIND),dimension(:,:),pointer :: rthmpten,rqvmpten,rqcmpten,rqrmpten,rqimpten,rqsmpten,rqgmpten @@ -958,7 +960,8 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, call mpas_pool_get_array(tend_physics,'rqiblten',rqiblten) call mpas_pool_get_array(tend_physics,'rthratenlw',rthratenlw) call mpas_pool_get_array(tend_physics,'rthratensw',rthratensw) - + call mpas_pool_get_array(diag_physics,'hpbl', hpbl) + call mpas_pool_get_array(sfc_input,'xland', xland) ! call mpas_pool_get_array(diag_physics,'qc_bl',qc_bl) ! call mpas_pool_get_array(diag_physics,'cldfrac_bl',cldfrac_bl) @@ -983,6 +986,13 @@ subroutine microphysics_from_MPAS(configs,mesh,state,time_lev,diag,diag_physics, enddo enddo enddo + + do j = jts, jte + do i = its, ite + hpbl_p(i,j) = hpbl(i) + xland_p(i,j) = xland(i) + enddo + enddo endif case("mp_nssl2m") diff --git a/src/core_atmosphere/physics/physics_noaa/TEMPO b/src/core_atmosphere/physics/physics_noaa/TEMPO index 7daccf1a24..0251402e03 160000 --- a/src/core_atmosphere/physics/physics_noaa/TEMPO +++ b/src/core_atmosphere/physics/physics_noaa/TEMPO @@ -1 +1 @@ -Subproject commit 7daccf1a240509541509616e5fa8ec874b8e459a +Subproject commit 0251402e03855d41edc4cbfcaf09894ff72e592e