Skip to content

Commit f506b43

Browse files
v8.3.1-2.14: TEMPO code cleanup and refactor for v3.0.0 and MPAS release (#192)
* removed unused configuration variable - added graupel volume to init_atmosphere registry - formatted code * cleaned up core_atmosphere registry for tempo * cleaned up mpas tempo driver call and removed tempo table build from mpas * v3.0.0 updates consistent with tempo refactor * v3.0.0 tempo refactor with ml prediction for bl clouds * update point to tempo v3 and clean up code to better match NCAR implementation * Update CMakeList for tempo v3 * add compile option for tempo * More updates to github runners for tempo v3 * change workflow to pull tempo v2 and v3 tables * adds flag to turn on/off ability to calculate reflectivity from melting snow/graupel * update pointer to tempo v3.0.2 * update to version 3.0.3 with more ccpp changes * Update version number in README --------- Co-authored-by: Clark Evans <clark.evans@noaa.gov>
1 parent 51d092b commit f506b43

18 files changed

Lines changed: 190 additions & 434 deletions

.github/workflows/run_mpas.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on: [push, pull_request, workflow_dispatch]
2222
# - The test build/run configurations matrix is described below.
2323
# - This script uses a matrix run configuration with exclusions to achieve the desired "run list"
2424
#
25-
# <physics> - List of physics configuration to test. See https://github.com/barlage/mpas_testcase.git
25+
# <physics> - List of physics configuration to test. See https://github.com/AndersJensen-NOAA/mpas_testcase.git
2626
# <repo> - Baseline codebase repository.
2727
# <branch> - Baseline codebase repository branch.
2828
#
@@ -285,7 +285,7 @@ jobs:
285285
- name: Download MPAS testing repository with runtime configurations.
286286
run: |
287287
cd ${mpas_run_ROOT}
288-
git clone --recursive --branch main https://github.com/barlage/mpas_testcase.git
288+
git clone --recursive --branch main https://github.com/AndersJensen-NOAA/mpas_testcase.git
289289
290290
- name: Cache Thompson MP tables
291291
id: cache-thompson-data

.github/workflows/run_mpas_hrrr.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on: [push, pull_request, workflow_dispatch]
2222
# - The test build/run configurations matrix is described below.
2323
# - This script uses a matrix run configuration with exclusions to achieve the desired "run list"
2424
#
25-
# <physics> - List of physics configuration to test. See https://github.com/barlage/mpas_testcase.git
25+
# <physics> - List of physics configuration to test. See https://github.com/AndersJensen-NOAA/mpas_testcase.git
2626
# <repo> - Baseline codebase repository.
2727
# <branch> - Baseline codebase repository branch.
2828
#
@@ -288,20 +288,17 @@ jobs:
288288
- name: Download MPAS testing repository with runtime configurations.
289289
run: |
290290
cd ${mpas_run_ROOT}
291-
git clone --recursive --branch main https://github.com/barlage/mpas_testcase.git
291+
git clone --recursive --branch main https://github.com/AndersJensen-NOAA/mpas_testcase.git
292292
293-
- name: Cache TEMPO MP tables
294-
id: cache-tempo-data
295-
uses: actions/cache@v4
296-
with:
297-
path: /home/runner/tempo
298-
key: cache-tempo-data-key
293+
- name: Download MPAS testing repository with runtime configurations for baselines.
294+
run: |
295+
cd ${mpas_run_ROOT}
296+
git clone --recursive --branch main https://github.com/barlage/mpas_testcase.git mpas_testcase_bl
299297
300298
- name: Download TEMPO MP tables
301-
if: steps.cache-tempo-data.outputs.cache-hit != 'true'
302299
run: |
303300
cd ${runner_ROOT} && mkdir tempo && cd tempo
304-
wget -q -e robots=off -nH --cut-dirs N -nc -r -lX --accept-regex='_tempo_v3' -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \
301+
wget -q -e robots=off -nH --cut-dirs N -nc -r -lX -A '*' -R 'catalog*' -I /thredds/fileServer/,/thredds/catalog/ \
305302
https://gsl.noaa.gov/thredds/catalog/${mpdata_dir}/catalog.html
306303
mv thredds/fileServer/${mpdata_dir}/* .
307304
rm -rf thredds
@@ -328,7 +325,7 @@ jobs:
328325
- name: Create and populate run directory (baselines)
329326
run: |
330327
cd ${mpas_run_ROOT} && mkdir run_bl && cd run_bl
331-
cp ${mpas_run_ROOT}/mpas_testcase/run_case/case_files/${nml_version}/${domain}/${{matrix.ic_source}}.${yyyy}${mm}${dd}${hh}/${{env.physics}}/* .
328+
cp ${mpas_run_ROOT}/mpas_testcase_bl/run_case/case_files/${nml_version}/${domain}/${{matrix.ic_source}}.${yyyy}${mm}${dd}${hh}/${{env.physics}}/* .
332329
ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.TBL .
333330
ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*.DBL .
334331
ln -sf ${mpas_bl_ROOT}/src/core_atmosphere/physics/physics_wrf/files/*DATA .
@@ -368,6 +365,7 @@ jobs:
368365
ln -sf ${mpas_rt_ROOT}/MPAS-Model/atmosphere_model atmosphere_model
369366
ln -sf ${mpas_run_ROOT}/run_data/${{steps.set_vars.outputs.ugwp_file}} mpas.ugwp_oro_data.nc
370367
ln -sf ${runner_ROOT}/tempo/* .
368+
ln -sf ${mpas_rt_ROOT}/MPAS-Model/src/core_atmosphere/physics/physics_noaa/TEMPO/tables/ccn_activate.bin .
371369
ln -sf ${runner_ROOT}/ugw/ugwp_limb_tau.nc .
372370
373371
- name: Link lateral boundary condition file for regional MPAS (feature)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MPAS-v8.3.1-2.13
1+
MPAS-v8.3.1-2.14
22
====
33

44
The Model for Prediction Across Scales (MPAS) is a collaborative project for

src/core_atmosphere/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,17 @@ else()
217217
endif()
218218

219219
set(ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES
220-
module_mp_tempo_main.F90
221-
module_mp_tempo_params.F90
222-
module_mp_tempo_utils.F90
223-
module_mp_tempo_ml.F90
224-
drivers/mpas/module_mp_tempo.F90
220+
src/module_mp_tempo_cfgs.F90
221+
src/module_mp_tempo_params.F90
222+
src/module_mp_tempo_ml.F90
223+
src/module_mp_tempo_utils.F90
224+
src/module_mp_tempo_diags.F90
225+
src/module_mp_tempo_aerosols.F90
226+
src/module_mp_tempo_main.F90
227+
src/module_mp_tempo_driver.F90
225228
)
226229
list(TRANSFORM ATMOSPHERE_CORE_PHYSICS_TEMPO_SOURCES PREPEND physics/physics_noaa/TEMPO/)
230+
set_source_files_properties(physics/physics_noaa/TEMPO/src/module_mp_tempo_params.F90 PROPERTIES COMPILE_OPTIONS "-Dtempo_mpas")
227231

228232
set(ATMOSPHERE_CORE_PHYSICS_MYNN-EDMF_DIR ${CMAKE_CURRENT_SOURCE_DIR}/physics/physics_noaa/MYNN-EDMF)
229233

src/core_atmosphere/Registry.xml

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@
421421
<package name="mp_kessler_in" description="parameterization of kessler microphysics."/>
422422
<package name="mp_thompson_in" description="parameterization of Thompson cloud microphysics."/>
423423
<package name="mp_thompson_aers_in" description="parameterization of aerosol-aware Thompson cloud microphysics."/>
424-
<package name="mp_tempo_in" description="parameterization of TEMPO cloud microphysics."/>
425-
<package name="tempo_aerosolaware_in" description="variables for TEMPO with aerosol-aware microphysics."/>
426-
<package name="tempo_hailaware_in" description="variables for TEMPO hail-aware microphysics."/>
424+
<package name="mp_tempo_in" description="parameterization of TEMPO cloud microphysics."/>
425+
<package name="tempo_aerosolaware_in" description="variables for TEMPO with aerosol-aware microphysics."/>
426+
<package name="tempo_hailaware_in" description="variables for TEMPO hail-aware microphysics."/>
427427
<package name="mp_wsm6_in" description="parameterization of WSM6 cloud microphysics."/>
428428
<package name="mp_nssl2m_in" description="parameterization of NSSL 2-moment microphysics."/>
429429
<package name="nssl3m_in" description="variables for NSSL 3-moment microphysics."/>
@@ -2725,28 +2725,18 @@
27252725
description="configuration for cloud microphysics schemes"
27262726
possible_values="`suite',`mp_wsm6',`mp_tempo',`mp_thompson',`mp_thompson_aerosols', `mp_kessler',`mp_nssl2m',`off'"/>
27272727

2728-
<nml_option name="config_tempo_hailaware" type="logical" default_value="false" in_defaults="false"
2729-
units="-"
2730-
description="Logical flag to turn on/off prognostic graupel number concentration and rime density"
2731-
possible_values=".true. or .false."/>
2732-
2733-
<nml_option name="config_tempo_cldfra" type="logical" default_value="false" in_defaults="false"
2734-
units="-"
2728+
<nml_option name="config_tempo_cldfra" type="logical" default_value="false" in_defaults="false"
2729+
units="-"
27352730
description="Logical flag to turn on/off prognostic cloud fraction"
27362731
possible_values=".true. or .false."/>
27372732

2738-
<nml_option name="config_tempo_ml_nc_pbl" type="logical" default_value="false" in_defaults="false"
2739-
units="-"
2740-
description="Logical flag to turn on/off ML prediction of boundary layer cloud number concentrations"
2741-
possible_values=".true. or .false."/>
2742-
2743-
<nml_option name="config_tempo_ml_nc" type="logical" default_value="false" in_defaults="false"
2744-
units="-"
2733+
<nml_option name="config_tempo_ml_nc" type="logical" default_value="false" in_defaults="false"
2734+
units="-"
27452735
description="Logical flag to turn on/off ML prediction of microphysics cloud number concentrations"
27462736
possible_values=".true. or .false."/>
27472737

2748-
<nml_option name="config_tempo_ml_nr" type="logical" default_value="false" in_defaults="false"
2749-
units="-"
2738+
<nml_option name="config_tempo_ml_nr" type="logical" default_value="false" in_defaults="false"
2739+
units="-"
27502740
description="Logical flag to turn on/off ML prediction of microphysics rain number concentrations"
27512741
possible_values=".true. or .false."/>
27522742

@@ -2947,11 +2937,6 @@
29472937
description="configuration for spp boundary layer"
29482938
possible_values="`0: off',`1: activated'"/>
29492939

2950-
<nml_option name="config_tempo_aerosolaware" type="logical" default_value="true" in_defaults="false"
2951-
units="-"
2952-
description="Logical flag to turn on/off prognostic cloud droplet and aerosol number concentrations"
2953-
possible_values=".true. or .false."/>
2954-
29552940
<nml_option name="config_bucket_radt" type="real" default_value="1.0e9" in_defaults="false"
29562941
units="-"
29572942
description="threshold above which accumulated radiation diagnostics are reset"
@@ -3018,20 +3003,20 @@
30183003
<!-- ... PARAMETERIZATION OF CLOUD MICROPHYSICS: -->
30193004
<!-- ================================================================================================== -->
30203005

3021-
<var name="max_hail_diameter_sfc" type="real" dimensions="nCells Time" units="mm"
3022-
description="Maximum hail diameter at the surface"
3006+
<var name="max_hail_diameter_sfc" type="real" dimensions="nCells Time" units="mm"
3007+
description="Instantaneous maximum hail diameter at the surface"
30233008
packages="mp_tempo_in"/>
30243009

3025-
<var name="max_hail_diameter_column" type="real" dimensions="nCells Time" units="mm"
3026-
description="Maximum hail diameter in the vertical column"
3010+
<var name="max_hail_diameter_column" type="real" dimensions="nCells Time" units="mm"
3011+
description="Instantaneous maximum hail diameter in the vertical column"
30273012
packages="mp_tempo_in"/>
30283013

3029-
<var name="max_hail_diameter_column_acc" type="real" dimensions="nCells Time" units="mm"
3030-
description="Maximum hail diameter in the vertical column accumulated over diagnostic output"
3014+
<var name="max_hail_diameter_sfc_acc" type="real" dimensions="nCells Time" units="mm"
3015+
description="Maximum hail diameter at the surface during the diagnostic output time window"
30313016
packages="mp_tempo_in"/>
3032-
3033-
<var name="max_hail_diameter_sfc_acc" type="real" dimensions="nCells Time" units="mm"
3034-
description="Maximum hail diameter at the surface accumulated over diagnostic output"
3017+
3018+
<var name="max_hail_diameter_column_acc" type="real" dimensions="nCells Time" units="mm"
3019+
description="Maximum hail diameter in the vertical column during the diagnostic output time window"
30353020
packages="mp_tempo_in"/>
30363021

30373022
<var name="do_diag_dbz" type="integer" dimensions="" units = ""
@@ -4675,6 +4660,7 @@
46754660

46764661
#ifdef DO_PHYSICS
46774662
#include "physics/Registry_noahmp.xml"
4663+
#include "physics/Registry_tempo.xml"
46784664
#include "physics/registry.chemistry.xml"
46794665
#endif
46804666
</registry>

src/core_atmosphere/mpas_atm_core.F

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ subroutine atm_mpas_init_block(dminfo, stream_manager, block, mesh, dt)
588588
!initialization of all physics:
589589
call physics_init(dminfo, stream_manager, clock, block % configs, mesh, diag, tend, state, 1, &
590590
diag_physics, diag_physics_noahmp, ngw_input, atm_input, sfc_input, output_noahmp)
591-
call tempo_ml_init(block % configs)
592591
endif
593592
#endif
594593

src/core_atmosphere/physics/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ core_physics_mmm: core_physics_init
6565
(cd physics_mmm; $(MAKE) -f Makefile.mpas all)
6666

6767
core_microphysics: core_physics_init core_physics_mmm
68-
(cd physics_noaa/TEMPO; cp ./drivers/mpas/module_mp_tempo.F90 .; $(MAKE) all COREDEF="$(COREDEF)")
68+
(cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas)
6969

7070
core_SMOKE: core_physics_init
7171
(cd physics_noaa/SMOKE; cp ./MPAS/Makefile .; cp ./MPAS/mpas_smoke_wrapper.F90 .; $(MAKE) all)
@@ -286,7 +286,7 @@ clean:
286286
( cd physics_noahmp/drivers/mpas; $(MAKE) clean )
287287
( cd physics_noahmp/src; $(MAKE) clean )
288288
( cd physics_noahmp/utility; $(MAKE) clean )
289-
( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) clean; fi )
289+
( if [ -d physics_noaa/TEMPO ]; then cd physics_noaa/TEMPO; $(MAKE) -f Makefile.mpas clean; fi )
290290
( if [ -d physics_noaa/UGWP ]; then cd physics_noaa/UGWP; $(MAKE) clean; fi )
291291
( if [ -d physics_noaa/RUCLSM ]; then cd physics_noaa/RUCLSM; $(MAKE) -f MPAS/Makefile clean; fi )
292292
( if [ -d physics_noaa/MYNN-EDMF ]; then cd physics_noaa/MYNN-EDMF; cp ./MPAS/Makefile .; $(MAKE) clean; fi )
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!-- ========================================================================================================= -->
2+
<!-- ARRAYS SPECIFIC TO TEMPO: -->
3+
<!-- ========================================================================================================= -->
4+
5+
<nml_record name="physics_mp_tempo" in_defaults="true">
6+
7+
<nml_option name="config_tempo_aerosolaware" type="logical" default_value="true" in_defaults="false"
8+
units="-"
9+
description="Logical flag to turn on/off prognostic cloud droplet and aerosol number concentrations"
10+
possible_values=".true. or .false."/>
11+
12+
<nml_option name="config_tempo_hailaware" type="logical" default_value="true" in_defaults="false"
13+
units="-"
14+
description="Logical flag to turn on/off prognostic graupel number concentration and rime density"
15+
possible_values=".true. or .false."/>
16+
17+
<nml_option name="config_tempo_ml_for_bl_nc" type="logical" default_value="false" in_defaults="false"
18+
units="-"
19+
description="Logical flag to turn on/off ML prediction of boundary layer cloud number concentrations"
20+
possible_values=".true. or .false."/>
21+
22+
<nml_option name="config_tempo_refl10cm_from_melting" type="logical" default_value="false" in_defaults="false"
23+
units="-"
24+
description="Logical flag to turn on/off reflectivity calculation from melting snow and graupel"
25+
possible_values=".true. or .false."/>
26+
27+
</nml_record>
28+
29+
<!-- ========================================================================================================= -->

src/core_atmosphere/physics/mpas_atmphys_control.F

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ subroutine physics_tables_init(dminfo,configs)
462462

463463
!local variables:
464464
character(len=StrKIND),pointer:: config_microp_scheme
465-
logical,pointer:: config_tempo_hailaware
466465
logical:: l_qr_acr_qg,l_qr_acr_qs,l_qi_aut_qs,l_freezeH2O
467466

468467
!-----------------------------------------------------------------------------------------------------------------
@@ -473,37 +472,8 @@ subroutine physics_tables_init(dminfo,configs)
473472

474473
call mpas_pool_get_config(configs,'config_microp_scheme',config_microp_scheme)
475474
if(config_microp_scheme /= "mp_thompson" .or. &
476-
config_microp_scheme /= "mp_tempo" .or. &
477475
config_microp_scheme /= "mp_thompson_aerosols") return
478476

479-
if (config_microp_scheme == "mp_tempo") then
480-
l_qr_acr_qg = .false.
481-
l_qr_acr_qs = .false.
482-
l_qi_aut_qs = .false.
483-
l_freezeH2O = .false.
484-
485-
! hailaware scheme needs hailaware table, non hailaware scheme can use either table
486-
call mpas_pool_get_config(configs,'config_tempo_hailaware',config_tempo_hailaware)
487-
if (config_tempo_hailaware) then
488-
inquire(file='MP_TEMPO_HAILAWARE_QRacrQG_DATA.DBL' ,exist=l_qr_acr_qg)
489-
else
490-
inquire(file='MP_TEMPO_HAILAWARE_QRacrQG_DATA.DBL' ,exist=l_qr_acr_qg)
491-
if (.not. l_qr_acr_qg) then
492-
inquire(file='MP_TEMPO_QRacrQG_DATA.DBL' ,exist=l_qr_acr_qg)
493-
endif
494-
endif
495-
inquire(file='MP_TEMPO_QRacrQS_DATA.DBL' ,exist=l_qr_acr_qs)
496-
inquire(file='MP_TEMPO_QIautQS_DATA.DBL' ,exist=l_qi_aut_qs)
497-
inquire(file='MP_TEMPO_freezeH2O_DATA.DBL',exist=l_freezeH2O)
498-
499-
if(.not. (l_qr_acr_qg .and. l_qr_acr_qs .and. l_qi_aut_qs .and. l_freezeH2O)) then
500-
write(mpas_err_message,'(A)') &
501-
'--- tables to run the TEMPO cloud microphysics do not exist: run build_tables_tempo first.'
502-
call physics_error_fatal(mpas_err_message)
503-
endif
504-
! call mpas_log_write('l_mp_tables = $l',logicArgs=(/l_mp_tables/))
505-
else
506-
507477
l_qr_acr_qg = .false.
508478
l_qr_acr_qs = .false.
509479
l_qi_aut_qs = .false.
@@ -527,7 +497,6 @@ subroutine physics_tables_init(dminfo,configs)
527497
call physics_error_fatal(mpas_err_message)
528498
endif
529499
! call mpas_log_write('l_mp_tables = $l',logicArgs=(/l_mp_tables/))
530-
endif
531500

532501
endif
533502

0 commit comments

Comments
 (0)