From 9b0332527948cf8785a9aa43e7e3a619b2e7aee4 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Thu, 12 Dec 2024 12:13:08 -0500 Subject: [PATCH 1/2] Implement dependent stub for cam_thermo_water_update --- .../thermo_water_update.F90 | 50 +++++++++++++++++++ .../thermo_water_update.meta | 50 +++++++++++++++++++ suites/suite_cam7.xml | 3 ++ 3 files changed, 103 insertions(+) create mode 100644 schemes/thermo_water_update/thermo_water_update.F90 create mode 100644 schemes/thermo_water_update/thermo_water_update.meta diff --git a/schemes/thermo_water_update/thermo_water_update.F90 b/schemes/thermo_water_update/thermo_water_update.F90 new file mode 100644 index 00000000..ab06f614 --- /dev/null +++ b/schemes/thermo_water_update/thermo_water_update.F90 @@ -0,0 +1,50 @@ +! This is a non-portable wrapper subroutine for cam_thermo_water_update +! in the cam_thermo module. +module thermo_water_update + use ccpp_kinds, only: kind_phys + + implicit none + private + + public :: thermo_water_update_run + +contains + + ! Update water dependent properties +!> \section arg_table_thermo_water_update_run Argument Table +!! \htmlinclude arg_table_thermo_water_update_run.html + subroutine thermo_water_update_run( & + mmr, & + ncol, pver, & + energy_formula_dycore, & + pdel, pdeldry, & + cp_or_cv_dycore) + + ! This scheme is non-portable due to dependencies on cam_thermo + ! for the actual logic of cam_thermo_water_update, which depends on air_composition + ! and a series of other subroutines/module properties + use cam_thermo, only: cam_thermo_water_update + + ! Input arguments + real(kind_phys), intent(in) :: mmr(:,:,:) ! constituent mass mixing ratios [kg kg-1] + integer, intent(in) :: ncol ! number of atmospheric columns + integer, intent(in) :: pver ! number of vertical layers + integer, intent(in) :: energy_formula_dycore ! total energy formulation dycore + real(kind_phys), intent(in) :: pdel(:,:) ! layer thickness [Pa] + real(kind_phys), intent(in) :: pdeldry(:,:) ! dry layer thickness [Pa] + + ! Output arguments + real(kind_phys), intent(out) :: cp_or_cv_dycore(:,:) ! enthalpy or heat capacity, dycore dependent [J K-1 kg-1] + + call cam_thermo_water_update( & + mmr = mmr, & ! mmr*factor is a dry mixing ratio + ncol = ncol, & + pver = pver, & + energy_formula = energy_formula_dycore, & + cp_or_cv_dycore = cp_or_cv_dycore(:ncol,:), & + to_dry_factor = pdel(:ncol,:)/pdeldry(:ncol,:) & ! factor to convert to dry + ) + + end subroutine thermo_water_update_run + +end module thermo_water_update diff --git a/schemes/thermo_water_update/thermo_water_update.meta b/schemes/thermo_water_update/thermo_water_update.meta new file mode 100644 index 00000000..395b8ae5 --- /dev/null +++ b/schemes/thermo_water_update/thermo_water_update.meta @@ -0,0 +1,50 @@ +[ccpp-table-properties] + name = thermo_water_update + type = scheme + dependencies = ../../../../data/cam_thermo.F90 + +[ccpp-arg-table] + name = thermo_water_update_run + type = scheme +[ mmr ] + standard_name = ccpp_constituents + units = none + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent, vertical_layer_dimension, number_of_ccpp_constituents) + intent = in +[ ncol ] + standard_name = horizontal_loop_extent + units = count + type = integer + dimensions = () + intent = in +[ pver ] + standard_name = vertical_layer_dimension + units = count + type = integer + dimensions = () + intent = in +[ energy_formula_dycore ] + standard_name = total_energy_formula_for_dycore + units = 1 + type = integer + dimensions = () + intent = in +[ pdel ] + standard_name = air_pressure_thickness + units = Pa + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent, vertical_layer_dimension) + intent = in +[ pdeldry ] + standard_name = air_pressure_thickness_of_dry_air + units = Pa + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent, vertical_layer_dimension) + intent = in +[ cp_or_cv_dycore ] + standard_name = specific_heat_of_air_used_in_dycore + units = J kg-1 K-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent, vertical_layer_dimension) + intent = out diff --git a/suites/suite_cam7.xml b/suites/suite_cam7.xml index 7351223d..2be27b19 100644 --- a/suites/suite_cam7.xml +++ b/suites/suite_cam7.xml @@ -37,6 +37,9 @@ check_energy_save_teout + + thermo_water_update + From e7580c0ccc81fb3fe6f016690ca111730354cbf6 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Thu, 12 Dec 2024 16:35:06 -0500 Subject: [PATCH 2/2] Use constituent tendency updater for dadadj --- suites/suite_cam7.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suites/suite_cam7.xml b/suites/suite_cam7.xml index 2be27b19..7794e325 100644 --- a/suites/suite_cam7.xml +++ b/suites/suite_cam7.xml @@ -19,7 +19,7 @@ dadadj - dadadj_apply_qv_tendency + apply_constituent_tendencies apply_heating_rate qneg geopotential_temp