From 43a3319e43a67d52eff727ba27f4a9a8979662c9 Mon Sep 17 00:00:00 2001 From: Courtney Peverley Date: Wed, 14 Feb 2024 13:20:50 -0700 Subject: [PATCH 1/4] update units; add dynamic_constituents allocatable for new constituent handling --- Externals_CAM.cfg | 11 ++++++++--- src/control/cam_comp.F90 | 3 ++- src/data/registry.xml | 6 +++--- src/physics/utils/cam_constituents.F90 | 2 +- src/physics/utils/phys_comp.meta | 4 ++-- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index f179217c..a67e3f95 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -2,7 +2,9 @@ local_path = ccpp_framework protocol = git repo_url = https://github.com/peverwhee/ccpp-framework -tag = CPF_0.2.050 +#tag = CPF_0.2.050 +#TODO: ADD TAG WHEN MADE +branch = peverwhee-fork-dynamic-constituents required = True [mpas] @@ -16,8 +18,11 @@ required = True [ncar-physics] local_path = src/physics/ncar_ccpp protocol = git -repo_url = https://github.com/ESCOMP/atmospheric_physics -tag = atmos_phys0_01_000 +#repo_url = https://github.com/ESCOMP/atmospheric_physics +#tag = atmos_phys0_01_000 +#TODO: ADD TAG WHEN MADE +repo_url = https://github.com/peverwhee/atmospheric_physics +branch = framework-update required = True [externals_description] diff --git a/src/control/cam_comp.F90 b/src/control/cam_comp.F90 index 9ac8f179..dfb56436 100644 --- a/src/control/cam_comp.F90 +++ b/src/control/cam_comp.F90 @@ -512,6 +512,7 @@ subroutine cam_register_constituents(cam_runtime_opts) integer :: errflg character(len=512) :: errmsg type(ccpp_constituent_prop_ptr_t), pointer :: const_props(:) + type(ccpp_constituent_properties_t), allocatable, target :: dynamic_constituents(:) character(len=*), parameter :: subname = 'cam_register_constituents: ' ! Initalize error flag and message: @@ -563,7 +564,7 @@ subroutine cam_register_constituents(cam_runtime_opts) !Combine host and physics constituents into a single !constituents object: call cam_ccpp_register_constituents(cam_runtime_opts%suite_as_list(), & - host_constituents, errcode=errflg, errmsg=errmsg) + host_constituents, dynamic_constituents, errcode=errflg, errmsg=errmsg) if (errflg /= 0) then call endrun(subname//trim(errmsg), file=__FILE__, line=__LINE__) diff --git a/src/data/registry.xml b/src/data/registry.xml index 8c6c0890..ea01fc06 100644 --- a/src/data/registry.xml +++ b/src/data/registry.xml @@ -106,7 +106,7 @@ horizontal_dimension vertical_layer_dimension rpdel state_rpdel @@ -260,7 +260,7 @@ dvdt tend_dvdt flag indicating if vertical coordinate is lagrangian .false. @@ -349,7 +349,7 @@ Composition-dependent ratio of water vapor to dry air gas constants minus one horizontal_dimension vertical_layer_dimension diff --git a/src/physics/utils/cam_constituents.F90 b/src/physics/utils/cam_constituents.F90 index feb17323..0921398a 100644 --- a/src/physics/utils/cam_constituents.F90 +++ b/src/physics/utils/cam_constituents.F90 @@ -272,7 +272,7 @@ function const_molec_weight(const_ind) character(len=*), parameter :: subname = 'const_molec_weight: ' if (check_index_bounds(const_ind, subname)) then - call const_props(const_ind)%molec_weight(const_molec_weight, & + call const_props(const_ind)%molar_mass(const_molec_weight, & err_code, err_msg) if (err_code /= 0) then call endrun(subname//"Error "//to_str(err_code)//": "// & diff --git a/src/physics/utils/phys_comp.meta b/src/physics/utils/phys_comp.meta index 84d0673d..c36023c0 100644 --- a/src/physics/utils/phys_comp.meta +++ b/src/physics/utils/phys_comp.meta @@ -25,13 +25,13 @@ [ errmsg ] standard_name = ccpp_error_message long_name = Error message for error handling in CCPP - units = 1 + units = none dimensions = () type = character kind = len=512 [ errcode ] standard_name = ccpp_error_code long_name = Error flag for error handling in CCPP - units = flag + units = 1 dimensions = () type = integer From 6298b3a80574d8068ce21d289243fb8f65be09fc Mon Sep 17 00:00:00 2001 From: Courtney Peverley Date: Tue, 5 Mar 2024 18:33:52 -0700 Subject: [PATCH 2/4] update standard names --- Externals_CAM.cfg | 11 +++-------- src/data/physconst.meta | 2 +- src/data/ref_pres.F90 | 2 +- src/data/ref_pres.meta | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index a67e3f95..1265498e 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -2,9 +2,7 @@ local_path = ccpp_framework protocol = git repo_url = https://github.com/peverwhee/ccpp-framework -#tag = CPF_0.2.050 -#TODO: ADD TAG WHEN MADE -branch = peverwhee-fork-dynamic-constituents +tag = CPF_0.2.053 required = True [mpas] @@ -18,11 +16,8 @@ required = True [ncar-physics] local_path = src/physics/ncar_ccpp protocol = git -#repo_url = https://github.com/ESCOMP/atmospheric_physics -#tag = atmos_phys0_01_000 -#TODO: ADD TAG WHEN MADE -repo_url = https://github.com/peverwhee/atmospheric_physics -branch = framework-update +repo_url = https://github.com/ESCOMP/atmospheric_physics +tag = atmos_phys0_02_002 required = True [externals_description] diff --git a/src/data/physconst.meta b/src/data/physconst.meta index d1682e03..b3646d73 100644 --- a/src/data/physconst.meta +++ b/src/data/physconst.meta @@ -68,7 +68,7 @@ dimensions = () protected = True [ pref ] - standard_name = reference_pressure + standard_name = surface_reference_pressure units = Pa type = real | kind = kind_phys dimensions = () diff --git a/src/data/ref_pres.F90 b/src/data/ref_pres.F90 index ad2be0d8..137c1e6d 100644 --- a/src/data/ref_pres.F90 +++ b/src/data/ref_pres.F90 @@ -173,7 +173,7 @@ subroutine ref_pres_init(pref_edge_in, pref_mid_in, num_pr_lev_in) ! pref_mid_in call mark_as_initialized("reference_pressure_in_atmosphere_layer") ! pref_mid_norm - call mark_as_initialized("reference_pressure_in_atmosphere_layer_normalized_by_reference_pressure") + call mark_as_initialized("reference_pressure_in_atmosphere_layer_normalized_by_surface_reference_pressure") ! ptop_ref call mark_as_initialized("air_pressure_at_top_of_atmosphere_model") ! num_pr_lev diff --git a/src/data/ref_pres.meta b/src/data/ref_pres.meta index 002e149c..2d1f591f 100644 --- a/src/data/ref_pres.meta +++ b/src/data/ref_pres.meta @@ -17,7 +17,7 @@ dimensions = (vertical_layer_dimension) protected = True [ pref_mid_norm ] - standard_name = reference_pressure_in_atmosphere_layer_normalized_by_reference_pressure + standard_name = reference_pressure_in_atmosphere_layer_normalized_by_surface_reference_pressure units = 1 type = real | kind = kind_phys dimensions = (vertical_layer_dimension) From 56d9a0e37ddbe60e79f3861bbb0dc7dcd68ad4f8 Mon Sep 17 00:00:00 2001 From: Courtney Peverley Date: Mon, 11 Mar 2024 13:33:06 -0600 Subject: [PATCH 3/4] update externals --- Externals_CAM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 1265498e..9fb4f034 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -17,7 +17,7 @@ required = True local_path = src/physics/ncar_ccpp protocol = git repo_url = https://github.com/ESCOMP/atmospheric_physics -tag = atmos_phys0_02_002 +tag = atmos_phys0_02_003 required = True [externals_description] From f3f7cc9b388627dd0657c1174ddfd6493ca26814 Mon Sep 17 00:00:00 2001 From: Courtney Peverley Date: Tue, 12 Mar 2024 09:41:27 -0600 Subject: [PATCH 4/4] actually use latest framework tag --- Externals_CAM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index 9fb4f034..8dd66555 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -2,7 +2,7 @@ local_path = ccpp_framework protocol = git repo_url = https://github.com/peverwhee/ccpp-framework -tag = CPF_0.2.053 +tag = CPF_0.2.056 required = True [mpas]