From c6f269905ed2b4f6faf22fa90dc68e85c74df4fc Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 17 May 2024 11:52:46 -0600 Subject: [PATCH 01/36] Metadata completed and partial namelist --- zhang_mcfarlane/zm_conv_convtran.meta | 26 ++-- zhang_mcfarlane/zm_conv_evap.meta | 65 +++++---- zhang_mcfarlane/zm_conv_momtran.F90 | 4 +- zhang_mcfarlane/zm_conv_momtran.meta | 72 +++++----- zhang_mcfarlane/zm_convr.meta | 142 ++++++++++---------- zhang_mcfarlane/zm_convr.xml | 181 ++++++++++++++++++++++++++ 6 files changed, 332 insertions(+), 158 deletions(-) create mode 100644 zhang_mcfarlane/zm_convr.xml diff --git a/zhang_mcfarlane/zm_conv_convtran.meta b/zhang_mcfarlane/zm_conv_convtran.meta index 71a4a36a..b1e3d6da 100644 --- a/zhang_mcfarlane/zm_conv_convtran.meta +++ b/zhang_mcfarlane/zm_conv_convtran.meta @@ -18,14 +18,14 @@ dimensions = () intent = in [ doconvtran ] - standard_name = flag_for_zhang_mcfarlane_deep_convective_transport? + standard_name = flag_for_tracer_transport_by_zhang_mcfarlane_deep_scheme units = flag type = logical dimensions = (1:number_of_ccpp_constituents) intent = in [ q ] standard_name = ccpp_constituents - units = none + units = kg kg-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension,1:number_of_ccpp_constituents) intent = in @@ -37,31 +37,31 @@ intent = in [ mu ] standard_name = atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = hPa s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ md ] standard_name = atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = hPa s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ du ] standard_name = atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ eu ] standard_name = atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ ed ] standard_name = atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in @@ -96,14 +96,14 @@ dimensions = (1:horizontal_loop_extent) intent = in [ il1g ] - standard_name = minimum_number_of_grid_cells_with_deep_convection? - units = 1 + standard_name = index_of_first_column_of_gathered_deep_convection_arrays + units = index type = integer dimensions = () intent = in [ il2g ] - standard_name = maximum_number_of_grid_cells_with_deep_convection? - units = 1 + standard_name = index_of_last_column_of_gathered_deep_convection_arrays + units = index type = integer dimensions = () intent = in @@ -120,13 +120,13 @@ dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension,1:number_of_ccpp_constituents) intent = in [ dqdt ] - standard_name = tendency_of_ccpp_constituents? + standard_name = tendency_of_ccpp_constituents units = none type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension,1:number_of_ccpp_constituents) intent = out [ dpdry ] - standard_name = pressure_thickness_of_dry_air_for_deep_convection_for_convective_columns? + standard_name = air_pressure_thickness_of_dry_air_for_deep_convection_for_gathered_convective_columns units = hPa type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) diff --git a/zhang_mcfarlane/zm_conv_evap.meta b/zhang_mcfarlane/zm_conv_evap.meta index 928bad07..be32c4fc 100644 --- a/zhang_mcfarlane/zm_conv_evap.meta +++ b/zhang_mcfarlane/zm_conv_evap.meta @@ -30,44 +30,44 @@ dimensions = () intent = in [ latice ] - standard_name = latent_heat_of_fusion_of_water_at_0c? - units = J kg-1? + standard_name = latent_heat_of_fusion_of_water_at_0c + units = J kg-1 type = real | kind = kind_phys dimensions = () intent = in [ latvap ] - standard_name = latent_heat_of_vaporization_of_water_at_0c? - units = J kg-1? + standard_name = latent_heat_of_vaporization_of_water_at_0c + units = J kg-1 type = real | kind = kind_phys dimensions = () intent = in [ tmelt ] - standard_name = freezing_point_of_water? - units = K? + standard_name = freezing_point_of_water + units = K type = real | kind = kind_phys dimensions = () intent = in [ cpres ] - standard_name = specific_heat_of_dry_air_at_constant_pressure? - units = J kg-1 K-1? + standard_name = specific_heat_of_dry_air_at_constant_pressure + units = J kg-1 K-1 type = real | kind = kind_phys dimensions = () intent = in [ ke ] - standard_name = tunable_evaporation_efficiency_in_zhang_mcfarlane_deep_convection_scheme? - units = 1? + standard_name = tunable_evaporation_efficiency_over_ocean_for_zhang_mcfarlane_deep_convection_scheme + units = 1 type = real | kind = kind_phys dimensions = () intent = in [ ke_lnd ] - standard_name = tunable_evaporation_efficiency_for_land_in_zhang_mcfarlane_deep_convection_scheme? - units = 1? + standard_name = tunable_evaporation_efficiency_over_land_for_zhang_mcfarlane_deep_convection_scheme + units = 1 type = real | kind = kind_phys dimensions = () intent = in [ zm_org ] - standard_name = flag_for_zhang_mcfarlane_convective_organization_parameterization? - units = flag? + standard_name = flag_for_convective_organization_parameterization_for_zhang_mcfarlane_deep_convection_scheme + units = flag type = logical dimensions = () intent = in @@ -84,7 +84,7 @@ dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ pdel ] - standard_name = pressure_thickness + standard_name = air_pressure_thickness units = Pa type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) @@ -108,20 +108,20 @@ dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = inout [ tend_s_snwprd ] - standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_in_deep_convection? - units = tbd + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_deep_convection + units = J kg-1 s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ tend_s_snwevmlt ] - standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_melt? - units = tbd + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_deep_convection + units = J kg-1 s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ tend_q ] - standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air and_condensed_water? - units = kg kg-1? + standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air and_condensed_water + units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = inout @@ -133,7 +133,7 @@ intent = in [ cldfrc ] standard_name = cloud_area_fraction - units = tbd + units = frac type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in @@ -156,33 +156,32 @@ dimensions = (1:horizontal_loop_extent) intent = out [ ntprprd ] - standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection? - units = kg kg-1 s-1? + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ ntsnprd ] - standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection? - units = kg kg-1 s-1? + standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ flxprec ] - standard_name = precipitation_mass_flux_at_interface_due_to_deep_convection? - units = kg m-2 s-1? + standard_name = precipitation_flux_at_interface_due_to_deep_convection + units = kg m-2 s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ flxsnow ] - standard_name = frozen_precipitation_mass_flux_at_interface_due_to_deep_convection? - units = kg m-2 s-1? + standard_name = frozen_precipitation_flux_at_interface_due_to_deep_convection + units = kg m-2 s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ prdsnow ] - standard_name = -tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation? - units = kg kg-1 s-1? + standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_source_processes + units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in diff --git a/zhang_mcfarlane/zm_conv_momtran.F90 b/zhang_mcfarlane/zm_conv_momtran.F90 index 55a40eea..f47584e8 100644 --- a/zhang_mcfarlane/zm_conv_momtran.F90 +++ b/zhang_mcfarlane/zm_conv_momtran.F90 @@ -7,6 +7,7 @@ module zm_conv_momtran save private ! Make default type private to the module public zm_conv_momtran_run ! convective momentum transport + integer, parameter, private :: num_winds=2 ! Number of wind directions (for historical purposes) contains @@ -16,7 +17,7 @@ module zm_conv_momtran !! \htmlinclude zm_conv_momtran_run.html !! subroutine zm_conv_momtran_run(ncol, pver, pverp, & - domomtran,windu, windv,num_winds, mu, md, & + domomtran,windu, windv, mu, md, & momcu, momcd, & du, eu, ed, dp, dsubcld , & jt, mx, ideep , il1g, il2g, & @@ -45,7 +46,6 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, & ! Input arguments ! integer, intent(in) :: ncol ! number of atmospheric columns - integer, intent(in) :: num_winds ! number of wind directions integer, intent(in) :: pver, pverp logical, intent(in) :: domomtran(:) ! flag for doing convective transport (num_winds) real(kind_phys), intent(in) :: windu(:,:) ! U Wind array (ncol,pver) diff --git a/zhang_mcfarlane/zm_conv_momtran.meta b/zhang_mcfarlane/zm_conv_momtran.meta index 82576cd8..8c94f9df 100644 --- a/zhang_mcfarlane/zm_conv_momtran.meta +++ b/zhang_mcfarlane/zm_conv_momtran.meta @@ -24,68 +24,62 @@ dimensions = () intent = in [ domomtran ] - standard_name = flag_for_zhang_mcfarlane_deep_momentum_transport? - units = flag? + standard_name = flag_for_momentum_transport_by_zhang_mcfarlane_deep_convection_scheme + units = flag type = logical dimensions = (2) intent = in [ windu ] - standard_name = enter_name - units = enter_name + standard_name = eastward_wind + units = m s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ windv ] - standard_name = enter_name - units = enter_name + standard_name = northward_wind + units = m s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in -[ num_winds ] - standard_name = enter_name - units = enter_name - type = integer - dimensions = () - intent = in [ mu ] standard_name = atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = hPa s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ md ] standard_name = atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = hPa s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ momcu ] - standard_name = momentum_upward_transport_parameter_for_zhang_mcfarlane? + standard_name = tbd units = tbd type = real | kind = kind_phys dimensions = () intent = in [ momcd ] - standard_name = momentum_downward_transport_parameter_for_zhang_mcfarlane? + standard_name = tbd units = tbd type = real | kind = kind_phys dimensions = () intent = in [ du ] standard_name = atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ eu ] standard_name = atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ ed ] standard_name = atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in @@ -120,14 +114,14 @@ dimensions = (1:horizontal_loop_extent) intent = in [ il1g ] - standard_name = minimum_number_of_grid_cells_with_deep_convection? - units = 1 + standard_name = index_of_first_column_of_gathered_deep_convection_arrays + units = index type = integer dimensions = () intent = in [ il2g ] - standard_name = maximum_number_of_grid_cells_with_deep_convection? - units = 1 + standard_name = index_of_last_column_of_gathered_deep_convection_arrays + units = index type = integer dimensions = () intent = in @@ -138,62 +132,62 @@ dimensions = () intent = in [ windu_tend ] - standard_name = enter_name - units = enter_name + standard_name = tendency_of_eastward_wind + units = m s-2 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ windv_tend ] - standard_name = enter_name - units = enter_name + standard_name = tendency_of_northward_wind + units = m s-2 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ pguallu ] standard_name = tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term - units = tbd + units = m s-2 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ pguallv ] standard_name = tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term - units = tbd + units = m s-2 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ pgdallu ] standard_name = tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term - units = tbd + units = m s-2 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ pgdallv ] standard_name = tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term - units = tbd + units = m s-2 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ icwuu ] - standard_name = eastward_wind - units = tbd + standard_name = in_cloud_eastward_wind_in_updraft_due_to_deep_convection + units = m s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ icwuv ] - standard_name = northward_wind - units = tbd + standard_name = in_cloud_northward_wind_in_updraft_due_to_deep_convection + units = m s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ icwdu ] - standard_name = eastward_and_northward_winds_in_deep_convective_downdrafts? - units = tbd + standard_name = in_cloud_eastward_wind_in_downdraft_due_to_deep_convection + units = m s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ icwdv ] - standard_name = eastward_and_northward_winds_in_deep_convective_downdrafts? - units = tbd + standard_name = in_cloud_northward_wind_in_downdraft_due_to_deep_convection + units = m s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index 9d5b7550..e11c29fa 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -12,26 +12,26 @@ dimensions = () intent = in [ epsilo ] - standard_name = ratio_of_h2o_to_dry_air_molecular_weights? - units = 1? + standard_name = ratio_of_water_vapor_to_dry_air_molecular_weights + units = 1 type = real | kind = kind_phys dimensions = () intent = in [ gravit ] - standard_name = gravitational_acceleration + standard_name = standard_gravitational_acceleration units = m s-2 type = real | kind = kind_phys dimensions = () intent = in [ latvap ] - standard_name = latent_heat_of_vaporization_of_water_at_0c? - units = J kg-1? + standard_name = latent_heat_of_vaporization_of_water_at_0c + units = J kg-1 type = real | kind = kind_phys dimensions = () intent = in [ tmelt ] - standard_name = freezing_point_of_water? - units = K? + standard_name = freezing_point_of_water + units = K type = real | kind = kind_phys dimensions = () intent = in @@ -42,104 +42,104 @@ dimensions = () intent = in [ limcnv_in ] - standard_name = vertical_interface_index_of_deep_convection_height_limit? - units = index? + standard_name = vertical_interface_index_of_deep_convection_height_limit + units = index type = integer dimensions = () intent = in [ zmconv_c0_lnd ] - standard_name = condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane? - units = 1? + standard_name = cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme + units = m-1 type = real | kind = kind_phys dimensions = () intent = in [ zmconv_c0_ocn ] - standard_name = condensate_to_precipitation_autoconversion_coefficient_over_ocean_for_zhang_mcfarlane? - units = 1? + standard_name = cloud_condensate_to_precipitation_autoconversion_coefficient_over_ocean_for_zhang_mcfarlane_deep_convection_scheme + units = m-1 type = real | kind = kind_phys dimensions = () intent = in [ zmconv_ke ] - standard_name = tunable_evaporation_efficiency_in_zhang_mcfarlane_deep_convection_scheme? - units = 1? + standard_name = tunable_evaporation_efficiency_over_ocean_for_zhang_mcfarlane_deep_convection_scheme + units = 1 type = real | kind = kind_phys dimensions = () intent = in [ zmconv_ke_lnd ] - standard_name = tunable_evaporation_efficiency_for_land_in zhang_mcfarlane_deep_convection_scheme? - units = 1? + standard_name = tunable_evaporation_efficiency_over_land_for_zhang_mcfarlane_deep_convection_scheme + units = 1 type = real | kind = kind_phys dimensions = () intent = in [ zmconv_momcu ] - standard_name = momentum_upward_transport_parameter_for_zhang_mcfarlane? - units = 1? + standard_name = momentum_transport_parameter_for_vertical_pressure_gradient_force_for_updraft_for_zhang_mcfarlane_deep_convection_scheme + units = 1 type = real | kind = kind_phys dimensions = () intent = in [ zmconv_momcd ] - standard_name = momentum_downward_transport_parameter_for_zhang_mcfarlane? - units = tbd + standard_name = momentum_transport_parameter_for_vertical_pressure_gradient_force_for_downdraft_for_zhang_mcfarlane_deep_convection_scheme + units = 1 type = real | kind = kind_phys dimensions = () intent = in [ zmconv_num_cin ] - standard_name = number_of_negative_buoyancy_regions_allowed_before_convection_top_for_zhang_mcfarlane? - units = count? + standard_name = number_of_negative_buoyancy_layers_allowed_before_convection_top_for_zhang_mcfarlane_deep_convection_scheme + units = count type = integer dimensions = () intent = in [ zmconv_org ] - standard_name = deep_convective_organization_amount_for_zhang_mcfarlane? - units = 1? + standard_name = flag_for_convective_organization_parameterization_for_zhang_mcfarlane_deep_convection_scheme + units = flag type = logical dimensions = () intent = in [ no_deep_pbl_in ] - standard_name = flag_for_no_deep_convection_in_pbl? - units = flag? + standard_name = flag_for_no_deep_convection_in_pbl + units = flag type = logical dimensions = () intent = in [ zmconv_tiedke_add ] - standard_name = parcel_temperature_perturbation_for_zhang_mcfarlane? - units = K? + standard_name = parcel_temperature_perturbation_for_zhang_mcfarlane_deep_convection_scheme + units = flag type = real | kind = kind_phys dimensions = () intent = in [ zmconv_capelmt ] - standard_name = deep_convection_triggering_cape_threshold_for_zhang_mcfarlane? - units = J kg-1? + standard_name = cape_threshold_for_zhang_mcfarlane_deep_convection_scheme + units = J kg-1 type = real | kind = kind_phys dimensions = () intent = in [ zmconv_dmpdz ] - standard_name = deep_convective_entrainment_rate_for_zhang_mcfarlane? - units = m-1? + standard_name = entrainment_rate_for_cape_for_zhang_mcfarlane_deep_convection_scheme + units = m-1 type = real | kind = kind_phys dimensions = () intent = in [ zmconv_parcel_pbl ] - standard_name = initial_parcel_property_as_function_of_well-mixed_pbl_for_zhang_mcfarlane? - units = flag? + standard_name = flag_for_well_mixed_pbl_parcel_property_for_zhang_mcfarlane_deep_convection_scheme + units = flag type = logical dimensions = () intent = in [ zmconv_tau ] - standard_name = deep_convective_adjustment_timescale_for_zhang_mcfarlane? - units = s? + standard_name = deep_convective_adjustment_timescale_for_zhang_mcfarlane_deep_convection_scheme + units = s type = real | kind = kind_phys dimensions = () intent = in [ masterproc ] - standard_name = enter_name - units = enter_name + standard_name = flag_for_mpi_root + units = flag type = logical dimensions = () intent = in [ iulog ] - standard_name = enter_name - units = enter_name + standard_name = log_output_unit + units = 1 type = integer dimensions = () intent = in @@ -186,26 +186,26 @@ dimensions = () intent = in [ latice ] - standard_name = latent_heat_of_fusion_of_water_at_0c? - units = J kg-1? + standard_name = latent_heat_of_fusion_of_water_at_0c + units = J kg-1 type = real | kind = kind_phys dimensions = () intent = in [ cpwv ] - standard_name = specific_heat_of_water_vapor_at_constant_pressure? + standard_name = specific_heat_of_water_vapor_at_constant_pressure units = J kg-1 K-1 type = real | kind = kind_phys dimensions = () intent = in [ cpliq ] - standard_name = specific_heat_of_liquid_water_at_20c + standard_name = specific_heat_of_liquid_water_at_constant_pressure units = J kg-1 K-1 type = real | kind = kind_phys dimensions = () intent = in [ rh2o ] - standard_name = gas_constant_of_water_vapor? - units = J kg-1 K-1? + standard_name = gas_constant_of_water_vapor + units = J kg-1 K-1 type = real | kind = kind_phys dimensions = () intent = in @@ -259,7 +259,7 @@ intent = out [ heat ] standard_name = dry_static_energy - units = tbd + units = J kg-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out @@ -282,26 +282,26 @@ dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ delt ] - standard_name = timestep_for_physics + standard_name = half_timestep_for_physics units = s type = real | kind = kind_phys dimensions = () intent = in [ mcon ] - standard_name = atmosphere_convective_mass_flux_due_to all_convection? - units = hPa s-1? + standard_name = atmosphere_convective_mass_flux_due_to deep_convection + units = hPa s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ cme ] - standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_cloud_condensation_minus_precipitation_evaporation_in_deep_convection? - units = kg kg-1 s-1? + standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_from_cloud_condensation_minus_precipitation_evaporation_due_to_deep_convection + units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ cape ] - standard_name = convective_available_potential_energy? - units = J kg-1? + standard_name = zhang_mcfarlane_convective_available_potential_energy + units = J kg-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent) intent = out @@ -319,7 +319,7 @@ intent = out [ zdu ] standard_name = detrainment_mass_flux_due_to_deep_convection - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out @@ -331,31 +331,31 @@ intent = out [ mu ] standard_name = atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = hPa s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ md ] standard_name = atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = hPa s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ du ] standard_name = atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ eu ] standard_name = atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ ed ] standard_name = atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = tbd + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out @@ -408,20 +408,20 @@ dimensions = (1:horizontal_loop_extent) intent = in [ org ] - standard_name = deep_convective_organization_amount? + standard_name = zhang_mcfarlane_organization_parameter_of_deep_convection units = 1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = in [ orgt ] - standard_name = deep_convective_organization_amount_at_single_vertical_layer_spread_over_whole_column? - units = 1 + standard_name = tendency_of_zhang_mcfarlane_organization_parameter_of_deep_convection + units = s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ org2d ] - standard_name = tendency_of_deep_convective_organization_amount? - units = s-1 + standard_name = zhang_mcfarlane_organization_parameter_of_deep_convection_copied_to_whole_column + units = 1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out @@ -432,20 +432,20 @@ dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ dnlf ] - standard_name = detrained_cloud_droplet_number_concentration_from_deep_convection? - units = kg-1? + standard_name = tbd + units = tbd type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ dnif ] - standard_name = detrained_cloud_ice_crystal_number_concentration_from_deep_convection? - units = kg-1 + standard_name = tbd + units = tbd type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out [ rice ] standard_name = vertically_integrated_cloud_ice_tendency_due_to_all_convection_to_be_applied_later_in_time_loop - units = tbd + units = m s-1 type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent) intent = out diff --git a/zhang_mcfarlane/zm_convr.xml b/zhang_mcfarlane/zm_convr.xml new file mode 100644 index 00000000..b987f97f --- /dev/null +++ b/zhang_mcfarlane/zm_convr.xml @@ -0,0 +1,181 @@ + + + + + + + + conv + zmconv_nl + cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme + m-1 + real + kind_phys + Autoconversion coefficient over land in ZM deep convection scheme. + + unset + + + + conv + zmconv_nl + cloud_condensate_to_precipitation_autoconversion_coefficient_over_ocean_for_zhang_mcfarlane_deep_convection_scheme + m-1 + real + kind_phys + Autoconversion coefficient over ocean in ZM deep convection scheme. + + MANY VALUES IN NAMELIST DEFAULTS FILE + + + + + conv + zmconv_nl + number_of_negative_buoyancy_layers_allowed_before_convection_top_for_zhang_mcfarlane_deep_convection_scheme + count + integer + The number of negative buoyancy regions that are allowed before the convection top and CAPE calculations are completed. + + 5 + 1 + 1 + + + + + conv + zmconv_nl + tunable_evaporation_efficiency_over_ocean_for_zhang_mcfarlane_deep_convection_scheme + 1 + real> + kind_phys + Tunable evaporation efficiency in ZM deep convection scheme. + + unset + + + + + conv + zmconv_nl + flag_for_convective_organization_parameterization_for_zhang_mcfarlane_deep_convection_scheme + flag + logical + Include organization parameterization in ZM. This value is set to true automatically + if -zmconv_org is set in configure. + Default: .false., unless -zmconv_org set in configure + + + false + true + + + + + conv + zmconv_nl + momentum_transport_parameter_for_vertical_pressure_gradient_force_for_updraft_for_zhang_mcfarlane_deep_convection_scheme + 1 + real + kind_phys + + Convective momentum transport parameter (upward) + + + 0.7000D0 + + + + + + conv + zmconv_nl + momentum_transport_parameter_for_vertical_pressure_gradient_force_for_downdraft_for_zhang_mcfarlane_deep_convection_scheme + 1 + real + kind_phys + + Convective momentum transport parameter (downward) + + + 0.7000D0 + + + + + conv + zmconv_nl + entrainment_rate_for_cape_for_zhang_mcfarlane_deep_convection_scheme + m-1 + real + kind_phys + + Tunable entrainment rate in ZM deep convection scheme in units of (m-1). + + + -1.0E-3 + + + + + conv + zmconv_nl + parcel_temperature_perturbation_for_zhang_mcfarlane_deep_convection_scheme + flag + real + kind_phys + + Tunable parcel temperature perturbation in ZM deep convection scheme in units of (K). + + + 0.5 + + + + + conv + zmconv_nl + cape_threshold_for_zhang_mcfarlane_deep_convection_scheme + J kg-1 + real + kind_phys + + Tunable triggering threshold for convection in ZM deep scheme in units of (J kg-1). + + + 70.0 + + + + + conv + zmconv_nl + flag_for_well_mixed_pbl_parcel_property_for_zhang_mcfarlane_deep_convection_scheme + flag + logical + + Turn on ZM deep convection initial parcel properties as a function of a well mixed boundary layer + + + .false. + + + + + conv + zmconv_nl + deep_convective_adjustment_timescale_for_zhang_mcfarlane_deep_convection_scheme + s + real + kind_phys + + Convective adjustment timescale in units of (s) + + + 3600.0 + + + + + From c6ddcb4b6ec1d0402e7fe233b42df7ba157fe5c4 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 17 May 2024 14:48:00 -0600 Subject: [PATCH 02/36] Remove unused variables --- zhang_mcfarlane/zm_convr.F90 | 7 +------ zhang_mcfarlane/zm_convr.meta | 12 ------------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index 036912ec..d85bfe75 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -152,8 +152,7 @@ subroutine zm_convr_run( ncol ,pver , & dp ,dsubcld ,jt ,maxg ,ideep , & ql ,rliq ,landfrac, & org ,orgt ,org2d , & - dif ,dnlf ,dnif , & - rice ,errmsg ,errflg) + dif ,rice ,errmsg ,errflg) !----------------------------------------------------------------------- ! ! Purpose: @@ -299,8 +298,6 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys), intent(out) :: zdu(:,:) ! (ncol,pver) real(kind_phys), intent(out) :: rprd(:,:) ! rain production rate (ncol,pver) real(kind_phys), intent(out) :: dif(:,:) ! detrained convective cloud ice mixing ratio. (ncol,pver) - real(kind_phys), intent(out) :: dnlf(:,:) ! detrained convective cloud water num concen. (ncol,pver) - real(kind_phys), intent(out) :: dnif(:,:) ! detrained convective cloud ice num concen. (ncol,pver) ! move these vars from local storage to output so that convective ! transports can be done in outside of conv_cam. @@ -482,8 +479,6 @@ subroutine zm_convr_run( ncol ,pver , & qldeg(i,k) = 0._kind_phys dif(i,k) = 0._kind_phys - dnlf(i,k) = 0._kind_phys - dnif(i,k) = 0._kind_phys end do end do diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index e11c29fa..72171008 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -431,18 +431,6 @@ type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) intent = out -[ dnlf ] - standard_name = tbd - units = tbd - type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) - intent = out -[ dnif ] - standard_name = tbd - units = tbd - type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) - intent = out [ rice ] standard_name = vertically_integrated_cloud_ice_tendency_due_to_all_convection_to_be_applied_later_in_time_loop units = m s-1 From 2e967107cba3f6ca24c7a07c031d7230cef48a98 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 23 May 2024 12:37:37 -0600 Subject: [PATCH 03/36] Cleanup3 updates and namelist xml file added --- zhang_mcfarlane/zm_convr.F90 | 14 +++++--------- zhang_mcfarlane/zm_convr.xml | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index d85bfe75..d34dc877 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -152,7 +152,7 @@ subroutine zm_convr_run( ncol ,pver , & dp ,dsubcld ,jt ,maxg ,ideep , & ql ,rliq ,landfrac, & org ,orgt ,org2d , & - dif ,rice ,errmsg ,errflg) + rice ,errmsg ,errflg) !----------------------------------------------------------------------- ! ! Purpose: @@ -297,7 +297,6 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys), intent(out) :: cape(:) ! w convective available potential energy. (ncol) real(kind_phys), intent(out) :: zdu(:,:) ! (ncol,pver) real(kind_phys), intent(out) :: rprd(:,:) ! rain production rate (ncol,pver) - real(kind_phys), intent(out) :: dif(:,:) ! detrained convective cloud ice mixing ratio. (ncol,pver) ! move these vars from local storage to output so that convective ! transports can be done in outside of conv_cam. @@ -317,8 +316,7 @@ subroutine zm_convr_run( ncol ,pver , & character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg - - real(kind_phys), intent(in) :: org(:,:) ! Only used if zm_org is true ! in + real(kind_phys), intent(in) :: org(:,:) ! Only used if zm_org is true ! in real(kind_phys), intent(out) :: orgt(:,:) ! Only used if zm_org is true ! out real(kind_phys), intent(out) :: org2d(:,:) ! Only used if zm_org is true ! out @@ -478,8 +476,6 @@ subroutine zm_convr_run( ncol ,pver , & dlg(i,k) = 0._kind_phys qldeg(i,k) = 0._kind_phys - dif(i,k) = 0._kind_phys - end do end do @@ -780,7 +776,7 @@ subroutine zm_convr_run( ncol ,pver , & ! Compute precip by integrating change in water vapor minus detrained cloud water do k = pver,msg + 1,-1 do i = 1,ncol - prec(i) = prec(i) - dpp(i,k)* (q(i,k)-qh(i,k)) - dpp(i,k)*(dlf(i,k)+dif(i,k))*2._kind_phys*delt + prec(i) = prec(i) - dpp(i,k)* (q(i,k)-qh(i,k)) - dpp(i,k)*(dlf(i,k))*2._kind_phys*delt end do end do @@ -793,8 +789,8 @@ subroutine zm_convr_run( ncol ,pver , & ! Treat rliq as flux out bottom, to be added back later. do k = 1, pver do i = 1, ncol - rliq(i) = rliq(i) + (dlf(i,k)+dif(i,k))*dpp(i,k)/gravit - rice(i) = rice(i) + dif(i,k)*dpp(i,k)/gravit + rliq(i) = rliq(i) + (dlf(i,k))*dpp(i,k)/gravit + rice(i) = rice(i)/gravit end do end do rliq(:ncol) = rliq(:ncol) /1000._kind_phys diff --git a/zhang_mcfarlane/zm_convr.xml b/zhang_mcfarlane/zm_convr.xml index b987f97f..2cfda9dc 100644 --- a/zhang_mcfarlane/zm_convr.xml +++ b/zhang_mcfarlane/zm_convr.xml @@ -4,7 +4,7 @@ - + conv zmconv_nl cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme @@ -13,7 +13,7 @@ kind_phys Autoconversion coefficient over land in ZM deep convection scheme. - unset + 0.0075D0 @@ -25,7 +25,7 @@ kind_phys Autoconversion coefficient over ocean in ZM deep convection scheme. - MANY VALUES IN NAMELIST DEFAULTS FILE + 0.0300D0 @@ -52,7 +52,20 @@ kind_phys Tunable evaporation efficiency in ZM deep convection scheme. - unset + 5.0E-6 + + + + + conv + zmconv_nl + tunable_evaporation_efficiency_over_land_for_zhang_mcfarlane_deep_convection_scheme + 1 + real> + kind_phys + Tunable evaporation efficiency for land in ZM deep convection scheme. + + 1.0E-5 From 3c6447aa887b8ba4ee3e27ee7b9ab2f59c6bd994 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 24 May 2024 10:14:15 -0600 Subject: [PATCH 04/36] put back in dif inside zm_convr_run --- zhang_mcfarlane/zm_convr.F90 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index d34dc877..c633ba86 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -152,7 +152,7 @@ subroutine zm_convr_run( ncol ,pver , & dp ,dsubcld ,jt ,maxg ,ideep , & ql ,rliq ,landfrac, & org ,orgt ,org2d , & - rice ,errmsg ,errflg) + dif ,rice ,errmsg ,errflg) !----------------------------------------------------------------------- ! ! Purpose: @@ -316,12 +316,14 @@ subroutine zm_convr_run( ncol ,pver , & character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind_phys), intent(in) :: org(:,:) ! Only used if zm_org is true ! in + + real(kind_phys), intent(in) :: org(:,:) ! Only used if zm_org is true ! in real(kind_phys), intent(out) :: orgt(:,:) ! Only used if zm_org is true ! out real(kind_phys), intent(out) :: org2d(:,:) ! Only used if zm_org is true ! out ! Local variables + real(kind_phys) zs(ncol) real(kind_phys) dlg(ncol,pver) ! gathrd version of the detraining cld h2o tend real(kind_phys) cug(ncol,pver) ! gathered condensation rate @@ -332,6 +334,8 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys) mumax(ncol) + real(kind_phys) :: dif(ncol,pver) ! detrained convective cloud ice mixing ratio. + !CACNOTE - Figure out real intent for jt and maxg integer, intent(inout) :: jt(ncol) ! wg top level index of deep cumulus convection. integer, intent(inout) :: maxg(ncol) ! wg gathered values of maxi. @@ -476,6 +480,8 @@ subroutine zm_convr_run( ncol ,pver , & dlg(i,k) = 0._kind_phys qldeg(i,k) = 0._kind_phys + dif(i,k) = 0._kind_phys + end do end do @@ -776,7 +782,7 @@ subroutine zm_convr_run( ncol ,pver , & ! Compute precip by integrating change in water vapor minus detrained cloud water do k = pver,msg + 1,-1 do i = 1,ncol - prec(i) = prec(i) - dpp(i,k)* (q(i,k)-qh(i,k)) - dpp(i,k)*(dlf(i,k))*2._kind_phys*delt + prec(i) = prec(i) - dpp(i,k)* (q(i,k)-qh(i,k)) - dpp(i,k)*(dlf(i,k)+dif(i,k))*2._kind_phys*delt end do end do @@ -789,8 +795,8 @@ subroutine zm_convr_run( ncol ,pver , & ! Treat rliq as flux out bottom, to be added back later. do k = 1, pver do i = 1, ncol - rliq(i) = rliq(i) + (dlf(i,k))*dpp(i,k)/gravit - rice(i) = rice(i)/gravit + rliq(i) = rliq(i) + (dlf(i,k)+dif(i,k))*dpp(i,k)/gravit + rice(i) = rice(i) + dif(i,k)*dpp(i,k)/gravit end do end do rliq(:ncol) = rliq(:ncol) /1000._kind_phys From 2abb58d7134392c3710792f9099c105abe2aeb28 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 24 May 2024 10:51:14 -0600 Subject: [PATCH 05/36] Remove dif from calling list --- zhang_mcfarlane/zm_convr.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index c633ba86..bd01c7e1 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -152,7 +152,7 @@ subroutine zm_convr_run( ncol ,pver , & dp ,dsubcld ,jt ,maxg ,ideep , & ql ,rliq ,landfrac, & org ,orgt ,org2d , & - dif ,rice ,errmsg ,errflg) + rice ,errmsg ,errflg) !----------------------------------------------------------------------- ! ! Purpose: From 2d7b5898d322ea0041f5a18b73a9ada1cc0d24c1 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 29 May 2024 16:26:47 -0600 Subject: [PATCH 06/36] Bring limcnv calculation into init --- zhang_mcfarlane/zm_convr.F90 | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index bd01c7e1..98b2b4e8 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -55,20 +55,23 @@ module zm_convr !> \section arg_table_zm_convr_init Argument Table !! \htmlinclude zm_convr_init.html !! -subroutine zm_convr_init(cpair, epsilo, gravit, latvap, tmelt, rair, & - limcnv_in, zmconv_c0_lnd, zmconv_c0_ocn, zmconv_ke, zmconv_ke_lnd, & +subroutine zm_convr_init(plev, plevp, cpair, epsilo, gravit, latvap, tmelt, rair, & + pref_edge, zmconv_c0_lnd, zmconv_c0_ocn, zmconv_ke, zmconv_ke_lnd, & zmconv_momcu, zmconv_momcd, zmconv_num_cin, zmconv_org, & no_deep_pbl_in, zmconv_tiedke_add, & zmconv_capelmt, zmconv_dmpdz, zmconv_parcel_pbl, zmconv_tau, & masterproc, iulog, errmsg, errflg) + integer, intent(in) :: plev + integer, intent(in) :: plevp + real(kind_phys), intent(in) :: cpair ! specific heat of dry air (J K-1 kg-1) real(kind_phys), intent(in) :: epsilo ! ratio of h2o to dry air molecular weights real(kind_phys), intent(in) :: gravit ! gravitational acceleration (m s-2) real(kind_phys), intent(in) :: latvap ! Latent heat of vaporization (J kg-1) real(kind_phys), intent(in) :: tmelt ! Freezing point of water (K) real(kind_phys), intent(in) :: rair ! Dry air gas constant (J K-1 kg-1) - integer, intent(in) :: limcnv_in ! top interface level limit for convection + real(kind_phys), intent(in) :: pref_edge(:) ! reference pressures at interfaces integer, intent(in) :: zmconv_num_cin ! Number negative buoyancy regions that are allowed ! before the convection top and CAPE calculations are completed. real(kind_phys),intent(in) :: zmconv_c0_lnd @@ -89,11 +92,12 @@ subroutine zm_convr_init(cpair, epsilo, gravit, latvap, tmelt, rair, & character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg + integer :: k + errmsg ='' errflg = 0 ! Initialization of ZM constants - limcnv = limcnv_in tfreez = tmelt eps1 = epsilo rl = latvap @@ -120,7 +124,26 @@ subroutine zm_convr_init(cpair, epsilo, gravit, latvap, tmelt, rair, & tau = zmconv_tau - if ( masterproc ) then + ! + ! Limit deep convection to regions below 40 mb + ! Note this calculation is repeated in the shallow convection interface + ! + limcnv = 0 ! null value to check against below + if (pref_edge(1) >= 4.e3_kind_phys) then + limcnv = 1 + else + do k=1,plev + if (pref_edge(k) < 4.e3_kind_phys .and. pref_edge(k+1) >= 4.e3_kind_phys) then + limcnv = k + exit + end if + end do + if ( limcnv == 0 ) limcnv = plevp + end if + + if ( masterproc ) then + write(iulog,*)'ZM_CONV_INIT: Deep convection will be capped at intfc ',limcnv, & + ' which is ',pref_edge(limcnv),' pascals' write(iulog,*) 'tuning parameters zm_convr_init: tau',tau write(iulog,*) 'tuning parameters zm_convr_init: c0_lnd',c0_lnd, ', c0_ocn', c0_ocn write(iulog,*) 'tuning parameters zm_convr_init: num_cin', num_cin From 5b89cb5c8757a90b4085077e57da439882028593 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 14 Jun 2024 12:35:29 -0600 Subject: [PATCH 07/36] Update ZM metadata, add namelist and preliminary mods for CAM-SIMA compilation --- suite_zhang_mcfarlane.xml | 11 ++ zhang_mcfarlane/zm_conv_convtran.F90 | 26 ++++- zhang_mcfarlane/zm_conv_convtran.meta | 42 ++++--- zhang_mcfarlane/zm_conv_evap.F90 | 18 +-- zhang_mcfarlane/zm_conv_evap.meta | 52 ++++----- zhang_mcfarlane/zm_conv_momtran.F90 | 6 +- zhang_mcfarlane/zm_conv_momtran.meta | 58 +++++----- zhang_mcfarlane/zm_convr.meta | 107 ++++++++++-------- .../{zm_convr.xml => zm_convr_namelist.xml} | 29 ++++- 9 files changed, 199 insertions(+), 150 deletions(-) create mode 100644 suite_zhang_mcfarlane.xml rename zhang_mcfarlane/{zm_convr.xml => zm_convr_namelist.xml} (89%) diff --git a/suite_zhang_mcfarlane.xml b/suite_zhang_mcfarlane.xml new file mode 100644 index 00000000..7b55021c --- /dev/null +++ b/suite_zhang_mcfarlane.xml @@ -0,0 +1,11 @@ + + + + + zm_convr + zm_conv_evap + zm_conv_momtran + zm_conv_convtran + + + diff --git a/zhang_mcfarlane/zm_conv_convtran.F90 b/zhang_mcfarlane/zm_conv_convtran.F90 index d65723c5..efc3de73 100644 --- a/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/zhang_mcfarlane/zm_conv_convtran.F90 @@ -22,7 +22,9 @@ subroutine zm_conv_convtran_run(ncol, pver, & doconvtran,q ,ncnst ,mu ,md , & du ,eu ,ed ,dp ,dsubcld , & jt ,mx ,ideep ,il1g ,il2g , & - nstep ,fracis ,dqdt ,dpdry ,dt ) + nstep ,fracis ,dqdt ,dpdry ,dt, const_metadata ) +! ccpp_constituent_properties - standard name -- see chat + !----------------------------------------------------------------------- ! ! Purpose: @@ -37,8 +39,8 @@ subroutine zm_conv_convtran_run(ncol, pver, & ! Author: P. Rasch ! !----------------------------------------------------------------------- -! CACNOTE - replace with CCPP constituents - use constituents, only: cnst_get_type_byind +!!!! use constituents, only: cnst_get_type_byind + use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t implicit none !----------------------------------------------------------------------- @@ -70,6 +72,8 @@ subroutine zm_conv_convtran_run(ncol, pver, & real(kind_phys), intent(in) :: dt ! 2 delta t (model time increment) + type(ccpp_constituent_prop_ptr_t), intent(in) :: const_metadata(:) + ! input/output @@ -87,6 +91,8 @@ subroutine zm_conv_convtran_run(ncol, pver, & integer ktm ! Highest altitude index of cloud top integer m ! Work index + logical :: is_dry + real(kind_phys) cabv ! Mix ratio of constituent above real(kind_phys) cbel ! Mix ratio of constituent below real(kind_phys) cdifr ! Normalized diff between cabv and cbel @@ -112,6 +118,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & real(kind_phys) total(ncol) real(kind_phys) negadt,qtmp + !----------------------------------------------------------------------- ! small = 1.e-36_kind_phys @@ -127,10 +134,19 @@ subroutine zm_conv_convtran_run(ncol, pver, & end do ! Loop ever each constituent - do m = 2, ncnst +!CACNOTE - This should probably loop 1, ncnst - figure out what was being done for 1 + do m = 1, ncnst + + call const_metadata(m)%standard_name(standard_name, errcode, errmsg) + if (standard_name == 'water_vapor_wrt_moist_air_and_condensed_water') then + cycle + end if + if (doconvtran(m)) then - if (cnst_get_type_byind(m).eq.'dry') then +! if (cnst_get_type_byind(m).eq.'dry') then + call const_metadata(m)%is_dry(is_dry, errcode, errmsg) + if (is_dry) then do k = 1,pver do i =il1g,il2g dptmp(i,k) = dpdry(i,k) diff --git a/zhang_mcfarlane/zm_conv_convtran.meta b/zhang_mcfarlane/zm_conv_convtran.meta index b1e3d6da..95e3650c 100644 --- a/zhang_mcfarlane/zm_conv_convtran.meta +++ b/zhang_mcfarlane/zm_conv_convtran.meta @@ -21,13 +21,13 @@ standard_name = flag_for_tracer_transport_by_zhang_mcfarlane_deep_scheme units = flag type = logical - dimensions = (1:number_of_ccpp_constituents) + dimensions = (number_of_ccpp_constituents) intent = in [ q ] standard_name = ccpp_constituents - units = kg kg-1 + units = none type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension,1:number_of_ccpp_constituents) + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_ccpp_constituents) intent = in [ ncnst ] standard_name = number_of_ccpp_constituents @@ -39,61 +39,61 @@ standard_name = atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns units = hPa s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ md ] standard_name = atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns units = hPa s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ du ] standard_name = atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ eu ] standard_name = atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ ed ] standard_name = atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ dp ] standard_name = pressure_thickness_for_deep_convection_for_convective_columns units = hPa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ dsubcld ] standard_name = pressure_thickness_for_subcloud_layer_for_deep_convection_for_convective_columns units = hPa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ jt ] standard_name = vertical_index_at_top_of_deep_convection_for_convective_columns units = index type = integer - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ mx ] - standard_name = vertical_index_of_deep_conveciton_launch_level_for_convective_columns + standard_name = vertical_index_of_deep_convection_launch_level_for_convective_columns units = index type = integer - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ ideep ] standard_name = horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns units = index type = integer - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ il1g ] standard_name = index_of_first_column_of_gathered_deep_convection_arrays @@ -115,21 +115,21 @@ intent = in [ fracis ] standard_name = fraction_of_water_insoluble_convectively_transported_species - units = frac + units = fraction type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension,1:number_of_ccpp_constituents) + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_ccpp_constituents) intent = in [ dqdt ] standard_name = tendency_of_ccpp_constituents units = none type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension,1:number_of_ccpp_constituents) + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_ccpp_constituents) intent = out [ dpdry ] standard_name = air_pressure_thickness_of_dry_air_for_deep_convection_for_gathered_convective_columns units = hPa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ dt ] standard_name = timestep_for_physics @@ -137,3 +137,9 @@ type = real | kind = kind_phys dimensions = () intent = in +[ const_metadata ] + standard_name = ccpp_constituent_properties + units = None + type = ccpp_constituent_prop_ptr_t + dimensions = (number_of_ccpp_constituents) + intent = in diff --git a/zhang_mcfarlane/zm_conv_evap.F90 b/zhang_mcfarlane/zm_conv_evap.F90 index dc87fe42..325b09db 100644 --- a/zhang_mcfarlane/zm_conv_evap.F90 +++ b/zhang_mcfarlane/zm_conv_evap.F90 @@ -28,7 +28,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & landfrac, & tend_s, tend_s_snwprd, tend_s_snwevmlt, tend_q, & prdprec, cldfrc, deltat, & - prec, snow, ntprprd, ntsnprd, flxprec, flxsnow, prdsnow) + prec, snow, ntprprd, ntsnprd, flxprec, flxsnow) !----------------------------------------------------------------------- @@ -59,8 +59,8 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys),intent(in), dimension(:,:) :: pdel ! layer thickness (Pa) (ncol,pver) real(kind_phys),intent(in), dimension(:,:) :: q ! water vapor (kg/kg) (ncol,pver) real(kind_phys),intent(in), dimension(:) :: landfrac ! land fraction (ncol) - real(kind_phys),intent(inout), dimension(:,:) :: tend_s ! heating rate (J/kg/s) (ncol,pver) - real(kind_phys),intent(inout), dimension(:,:) :: tend_q ! water vapor tendency (kg/kg/s) (ncol,pver) + real(kind_phys),intent(out), dimension(:,:) :: tend_s ! heating rate (J/kg/s) (ncol,pver) + real(kind_phys),intent(out), dimension(:,:) :: tend_q ! water vapor tendency (kg/kg/s) (ncol,pver) real(kind_phys),intent(out), dimension(:,:) :: tend_s_snwprd ! Heating rate of snow production (ncol,pver) real(kind_phys),intent(out), dimension(:,:) :: tend_s_snwevmlt ! Heating rate of evap/melting of snow (ncol,pver) @@ -73,7 +73,6 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys), intent(inout) :: prec(:) ! Convective-scale preciptn rate (ncol) real(kind_phys), intent(out) :: snow(:) ! Convective-scale snowfall rate (ncol) - real(kind_phys), optional, intent(in), allocatable :: prdsnow(:,:) ! snow production (kg/ks/s) ! !---------------------------Local storage------------------------------- @@ -94,6 +93,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys) :: evpsnow(ncol) ! evaporation of snowfall (kg/kg/s) real(kind_phys) :: snowmlt(ncol) ! snow melt tendency in layer real(kind_phys) :: flxsntm(ncol) ! flux of snow into layer, after melting + real(kind_phys) allocatable :: prdsnow(:,:) ! snow production (kg/ks/s) real(kind_phys) :: kemask real(kind_phys) :: evplimit ! temp variable for evaporation limits @@ -110,11 +110,11 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & ! If prdsnow is passed in and allocated, then use it in the calculation, otherwise ! use the old snow calculation old_snow=.true. - if (present(prdsnow)) then - if (allocated(prdsnow)) then - old_snow=.false. - end if - end if +! if (present(prdsnow)) then +! if (allocated(prdsnow)) then +! old_snow=.false. +! end if +! end if ! convert input precip to kg/m2/s prec(:ncol) = prec(:ncol)*1000._kind_phys diff --git a/zhang_mcfarlane/zm_conv_evap.meta b/zhang_mcfarlane/zm_conv_evap.meta index be32c4fc..4fb11721 100644 --- a/zhang_mcfarlane/zm_conv_evap.meta +++ b/zhang_mcfarlane/zm_conv_evap.meta @@ -75,67 +75,67 @@ standard_name = air_temperature units = K type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ pmid ] standard_name = air_pressure units = Pa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ pdel ] standard_name = air_pressure_thickness units = Pa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ q ] standard_name = water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water units = kg kg-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ landfrac ] standard_name = land_area_fraction - units = frac + units = fraction type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ tend_s ] - standard_name = heating_rate + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure units = J kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) - intent = inout + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out [ tend_s_snwprd ] standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_deep_convection units = J kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ tend_s_snwevmlt ] standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_deep_convection units = J kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ tend_q ] - standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air and_condensed_water + standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water units = kg kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) - intent = inout + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out [ prdprec ] standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation units = kg kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ cldfrc ] standard_name = cloud_area_fraction - units = frac + units = fraction type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ deltat ] standard_name = timestep_for_physics @@ -147,41 +147,35 @@ standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = inout [ snow ] standard_name = lwe_frozen_precipitation_rate_at_surface_due_to_deep_convection units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = out [ ntprprd ] standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection units = kg kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ ntsnprd ] standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection units = kg kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ flxprec ] standard_name = precipitation_flux_at_interface_due_to_deep_convection units = kg m-2 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ flxsnow ] standard_name = frozen_precipitation_flux_at_interface_due_to_deep_convection units = kg m-2 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out -[ prdsnow ] - standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_source_processes - units = kg kg-1 s-1 - type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) - intent = in diff --git a/zhang_mcfarlane/zm_conv_momtran.F90 b/zhang_mcfarlane/zm_conv_momtran.F90 index f47584e8..45914b49 100644 --- a/zhang_mcfarlane/zm_conv_momtran.F90 +++ b/zhang_mcfarlane/zm_conv_momtran.F90 @@ -37,8 +37,6 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, & ! Author: J. Richter and P. Rasch ! !----------------------------------------------------------------------- -! CACNOTE - use CCPP constituents object - use constituents, only: cnst_get_type_byind implicit none !----------------------------------------------------------------------- @@ -47,7 +45,7 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, & ! integer, intent(in) :: ncol ! number of atmospheric columns integer, intent(in) :: pver, pverp - logical, intent(in) :: domomtran(:) ! flag for doing convective transport (num_winds) + logical, intent(in) :: domomtran ! flag for doing convective transport (num_winds) real(kind_phys), intent(in) :: windu(:,:) ! U Wind array (ncol,pver) real(kind_phys), intent(in) :: windv(:,:) ! V Wind array (ncol,pver) real(kind_phys), intent(in) :: mu(:,:) ! Mass flux up (ncol,pver) @@ -178,7 +176,7 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, & ! Loop ever each wind component do m = 1, num_winds !start at m = 1 to transport momentum - if (domomtran(m)) then + if (domomtran) then ! Gather up the winds and set tend to zero do k = 1,pver diff --git a/zhang_mcfarlane/zm_conv_momtran.meta b/zhang_mcfarlane/zm_conv_momtran.meta index 8c94f9df..eea65895 100644 --- a/zhang_mcfarlane/zm_conv_momtran.meta +++ b/zhang_mcfarlane/zm_conv_momtran.meta @@ -27,41 +27,41 @@ standard_name = flag_for_momentum_transport_by_zhang_mcfarlane_deep_convection_scheme units = flag type = logical - dimensions = (2) + dimensions = () intent = in [ windu ] standard_name = eastward_wind units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ windv ] standard_name = northward_wind units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ mu ] standard_name = atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns units = hPa s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ md ] standard_name = atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns units = hPa s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ momcu ] - standard_name = tbd - units = tbd + standard_name = momentum_transport_parameter_for_vertical_pressure_gradient_force_for_updraft_for_zhang_mcfarlane_deep_convection_scheme + units = 1 type = real | kind = kind_phys dimensions = () intent = in [ momcd ] - standard_name = tbd - units = tbd + standard_name = momentum_transport_parameter_for_vertical_pressure_gradient_force_for_downdraft_for_zhang_mcfarlane_deep_convection_scheme + units = 1 type = real | kind = kind_phys dimensions = () intent = in @@ -69,49 +69,49 @@ standard_name = atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ eu ] standard_name = atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ ed ] standard_name = atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ dp ] standard_name = pressure_thickness_for_deep_convection_for_convective_columns units = hPa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ dsubcld ] standard_name = pressure_thickness_for_subcloud_layer_for_deep_convection_for_convective_columns units = hPa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ jt ] standard_name = vertical_index_at_top_of_deep_convection_for_convective_columns units = index type = integer - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ mx ] - standard_name = vertical_index_of_deep_conveciton_launch_level_for_convective_columns + standard_name = vertical_index_of_deep_convection_launch_level_for_convective_columns units = index type = integer - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ ideep ] standard_name = horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns units = index type = integer - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ il1g ] standard_name = index_of_first_column_of_gathered_deep_convection_arrays @@ -135,61 +135,61 @@ standard_name = tendency_of_eastward_wind units = m s-2 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ windv_tend ] standard_name = tendency_of_northward_wind units = m s-2 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ pguallu ] standard_name = tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term units = m s-2 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ pguallv ] standard_name = tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term units = m s-2 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ pgdallu ] standard_name = tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term units = m s-2 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ pgdallv ] standard_name = tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term units = m s-2 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ icwuu ] standard_name = in_cloud_eastward_wind_in_updraft_due_to_deep_convection units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ icwuv ] standard_name = in_cloud_northward_wind_in_updraft_due_to_deep_convection units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ icwdu ] standard_name = in_cloud_eastward_wind_in_downdraft_due_to_deep_convection units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ icwdv ] standard_name = in_cloud_northward_wind_in_downdraft_due_to_deep_convection units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ dt ] standard_name = timestep_for_physics @@ -201,5 +201,5 @@ standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure units = J kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index 72171008..6cf347d5 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -5,6 +5,18 @@ [ccpp-arg-table] name = zm_convr_init type = scheme +[ plev ] + standard_name = vertical_layer_dimension + units = count + type = integer + dimensions = () + intent = in +[ plevp ] + standard_name = vertical_interface_dimension + units = count + type = integer + dimensions = () + intent = in [ cpair ] standard_name = composition_dependent_specific_heat_of_dry_air_at_constant_pressure units = J kg-1 K-1 @@ -18,7 +30,7 @@ dimensions = () intent = in [ gravit ] - standard_name = standard_gravitational_acceleration + standard_name = gravitational_acceleration units = m s-2 type = real | kind = kind_phys dimensions = () @@ -41,11 +53,11 @@ type = real | kind = kind_phys dimensions = () intent = in -[ limcnv_in ] - standard_name = vertical_interface_index_of_deep_convection_height_limit - units = index - type = integer - dimensions = () +[ pref_edge ] + standard_name = reference_pressure_at_interface + units = Pa + type = real | kind = kind_phys + dimensions = (vertical_interface_dimension) intent = in [ zmconv_c0_lnd ] standard_name = cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme @@ -213,73 +225,74 @@ standard_name = air_temperature units = K type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ qh ] standard_name = water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water + advected = true units = kg kg-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ prec ] standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = out [ pblh ] standard_name = atmosphere_boundary_layer_thickness units = m type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ zm ] standard_name = geopotential_height_wrt_surface units = m type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ geos ] standard_name = surface_geopotential units = m2 s-2 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ zi ] standard_name = geopotential_height_wrt_surface_at_interface units = m type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_interface_dimension) intent = in [ qtnd ] standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water units = kg kg-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ heat ] standard_name = dry_static_energy units = J kg-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ pap ] standard_name = air_pressure units = Pa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ paph ] standard_name = air_pressure_at_interface units = Pa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_interface_dimension) + dimensions = (horizontal_loop_extent,vertical_interface_dimension) intent = in [ dpp ] standard_name = air_pressure_thickness units = Pa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ delt ] standard_name = half_timestep_for_physics @@ -288,154 +301,148 @@ dimensions = () intent = in [ mcon ] - standard_name = atmosphere_convective_mass_flux_due_to deep_convection + standard_name = atmosphere_convective_mass_flux_due_to_deep_convection units = hPa s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ cme ] standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_from_cloud_condensation_minus_precipitation_evaporation_due_to_deep_convection units = kg kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ cape ] standard_name = zhang_mcfarlane_convective_available_potential_energy units = J kg-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = out [ tpert ] standard_name = convective_temperature_perturbation_due_to_pbl_eddies units = K type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ dlf ] standard_name = detrainment_of_cloud_liquid_due_to_deep_convection units = kg kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ zdu ] standard_name = detrainment_mass_flux_due_to_deep_convection units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ rprd ] standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation units = kg kg-1 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ mu ] standard_name = atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns units = hPa s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ md ] standard_name = atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns units = hPa s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ du ] standard_name = atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ eu ] standard_name = atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ ed ] standard_name = atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ dp ] standard_name = pressure_thickness_for_deep_convection_for_convective_columns units = hPa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ dsubcld ] standard_name = pressure_thickness_for_subcloud_layer_for_deep_convection_for_convective_columns units = hPa type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = out [ jt ] standard_name = vertical_index_at_top_of_deep_convection_for_convective_columns units = index type = integer - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = inout [ maxg ] standard_name = vertical_index_of_deep_convection_launch_level_for_convective_columns units = index type = integer - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = inout [ ideep ] standard_name = horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns units = index type = integer - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = out [ ql ] standard_name = in_cloud_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_deep_convection units = kg kg-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = inout [ rliq ] standard_name = vertically_integrated_cloud_liquid_tendency_due_to_all_convection_to_be_applied_later_in_time_loop units = kg m-2 s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = out [ landfrac ] standard_name = land_area_fraction - units = frac + units = fraction type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = in [ org ] standard_name = zhang_mcfarlane_organization_parameter_of_deep_convection units = 1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ orgt ] standard_name = tendency_of_zhang_mcfarlane_organization_parameter_of_deep_convection units = s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ org2d ] standard_name = zhang_mcfarlane_organization_parameter_of_deep_convection_copied_to_whole_column units = 1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) - intent = out -[ dif ] - standard_name = detrainment_of_cloud_ice_due_to_deep_convection - units = kg kg-1 s-1 - type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ rice ] standard_name = vertically_integrated_cloud_ice_tendency_due_to_all_convection_to_be_applied_later_in_time_loop units = m s-1 type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent) + dimensions = (horizontal_loop_extent) intent = out [ errmsg ] standard_name = ccpp_error_message diff --git a/zhang_mcfarlane/zm_convr.xml b/zhang_mcfarlane/zm_convr_namelist.xml similarity index 89% rename from zhang_mcfarlane/zm_convr.xml rename to zhang_mcfarlane/zm_convr_namelist.xml index 2cfda9dc..88a65b8d 100644 --- a/zhang_mcfarlane/zm_convr.xml +++ b/zhang_mcfarlane/zm_convr_namelist.xml @@ -7,7 +7,7 @@ conv zmconv_nl - cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme + cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme m-1 real kind_phys @@ -15,6 +15,7 @@ 0.0075D0 + conv @@ -48,7 +49,7 @@ zmconv_nl tunable_evaporation_efficiency_over_ocean_for_zhang_mcfarlane_deep_convection_scheme 1 - real> + real kind_phys Tunable evaporation efficiency in ZM deep convection scheme. @@ -61,7 +62,7 @@ zmconv_nl tunable_evaporation_efficiency_over_land_for_zhang_mcfarlane_deep_convection_scheme 1 - real> + real kind_phys Tunable evaporation efficiency for land in ZM deep convection scheme. @@ -80,8 +81,23 @@ Default: .false., unless -zmconv_org set in configure - false - true + .false. + .true. + + + + + conv + zmconv_nl + flag_for_no_deep_convection_in_pbl + flag + logical + Include organization parameterization in ZM. This value is set to true automatically + if -zmconv_org is set in configure. + Default: .false., unless -zmconv_org set in configure + + + .false. @@ -96,6 +112,7 @@ Convective momentum transport parameter (upward) + 0.4000D0 0.7000D0 @@ -112,6 +129,7 @@ Convective momentum transport parameter (downward) + 0.4000D0 0.7000D0 @@ -191,4 +209,3 @@ - From 2208d453b24f4ad1465fb0c0076d75be0a438a82 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 14 Jun 2024 13:01:41 -0600 Subject: [PATCH 08/36] Remove prdsnow completely --- zhang_mcfarlane/zm_conv_evap.F90 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/zhang_mcfarlane/zm_conv_evap.F90 b/zhang_mcfarlane/zm_conv_evap.F90 index 325b09db..890bf899 100644 --- a/zhang_mcfarlane/zm_conv_evap.F90 +++ b/zhang_mcfarlane/zm_conv_evap.F90 @@ -93,7 +93,6 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys) :: evpsnow(ncol) ! evaporation of snowfall (kg/kg/s) real(kind_phys) :: snowmlt(ncol) ! snow melt tendency in layer real(kind_phys) :: flxsntm(ncol) ! flux of snow into layer, after melting - real(kind_phys) allocatable :: prdsnow(:,:) ! snow production (kg/ks/s) real(kind_phys) :: kemask real(kind_phys) :: evplimit ! temp variable for evaporation limits @@ -107,14 +106,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & !----------------------------------------------------------------------- - ! If prdsnow is passed in and allocated, then use it in the calculation, otherwise - ! use the old snow calculation old_snow=.true. -! if (present(prdsnow)) then -! if (allocated(prdsnow)) then -! old_snow=.false. -! end if -! end if ! convert input precip to kg/m2/s prec(:ncol) = prec(:ncol)*1000._kind_phys @@ -232,10 +224,6 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & ntsnprd(i,k) = prdprec(i,k)*work2 - evpsnow(i) - snowmlt(i) tend_s_snwprd (i,k) = prdprec(i,k)*work2*latice tend_s_snwevmlt(i,k) = - ( evpsnow(i) + snowmlt(i) )*latice - else - ntsnprd(i,k) = prdsnow(i,k) - min(flxsnow(i,k)*gravit/pdel(i,k), evpsnow(i)+snowmlt(i)) - tend_s_snwprd (i,k) = prdsnow(i,k)*latice - tend_s_snwevmlt(i,k) = -min(flxsnow(i,k)*gravit/pdel(i,k), evpsnow(i)+snowmlt(i) )*latice end if ! precipitation fluxes From 70c0450ca89fdb599abaff0e6377801e73464d4f Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 14 Jun 2024 15:40:57 -0600 Subject: [PATCH 09/36] Add missing declaration for standard_name --- zhang_mcfarlane/zm_conv_convtran.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zhang_mcfarlane/zm_conv_convtran.F90 b/zhang_mcfarlane/zm_conv_convtran.F90 index efc3de73..b50d1b5a 100644 --- a/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/zhang_mcfarlane/zm_conv_convtran.F90 @@ -22,7 +22,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & doconvtran,q ,ncnst ,mu ,md , & du ,eu ,ed ,dp ,dsubcld , & jt ,mx ,ideep ,il1g ,il2g , & - nstep ,fracis ,dqdt ,dpdry ,dt, const_metadata ) + nstep ,fracis ,dqdt ,dpdry ,dt, const_metadata) ! ccpp_constituent_properties - standard name -- see chat !----------------------------------------------------------------------- @@ -118,6 +118,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & real(kind_phys) total(ncol) real(kind_phys) negadt,qtmp + character(len=256) :: standard_name !----------------------------------------------------------------------- ! @@ -137,7 +138,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & !CACNOTE - This should probably loop 1, ncnst - figure out what was being done for 1 do m = 1, ncnst - call const_metadata(m)%standard_name(standard_name, errcode, errmsg) + call const_metadata(m)%standard_name(standard_name) if (standard_name == 'water_vapor_wrt_moist_air_and_condensed_water') then cycle end if @@ -145,7 +146,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & if (doconvtran(m)) then ! if (cnst_get_type_byind(m).eq.'dry') then - call const_metadata(m)%is_dry(is_dry, errcode, errmsg) + call const_metadata(m)%is_dry(is_dry) if (is_dry) then do k = 1,pver do i =il1g,il2g From 2252688216e5bc738a6ef45aab5f799a048f10e8 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 18 Jun 2024 12:57:32 -0600 Subject: [PATCH 10/36] hook up constituents --- zhang_mcfarlane/zm_conv_convtran.F90 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/zhang_mcfarlane/zm_conv_convtran.F90 b/zhang_mcfarlane/zm_conv_convtran.F90 index b50d1b5a..a90371be 100644 --- a/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/zhang_mcfarlane/zm_conv_convtran.F90 @@ -22,7 +22,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & doconvtran,q ,ncnst ,mu ,md , & du ,eu ,ed ,dp ,dsubcld , & jt ,mx ,ideep ,il1g ,il2g , & - nstep ,fracis ,dqdt ,dpdry ,dt, const_metadata) + nstep ,fracis ,dqdt ,dpdry ,dt) ! ccpp_constituent_properties - standard name -- see chat !----------------------------------------------------------------------- @@ -39,8 +39,8 @@ subroutine zm_conv_convtran_run(ncol, pver, & ! Author: P. Rasch ! !----------------------------------------------------------------------- -!!!! use constituents, only: cnst_get_type_byind - use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t + use constituents, only: cnst_get_type_byind + use ccpp_constituent_prop_mod, only: ccpp_const_props implicit none !----------------------------------------------------------------------- @@ -72,7 +72,6 @@ subroutine zm_conv_convtran_run(ncol, pver, & real(kind_phys), intent(in) :: dt ! 2 delta t (model time increment) - type(ccpp_constituent_prop_ptr_t), intent(in) :: const_metadata(:) ! input/output @@ -138,7 +137,8 @@ subroutine zm_conv_convtran_run(ncol, pver, & !CACNOTE - This should probably loop 1, ncnst - figure out what was being done for 1 do m = 1, ncnst - call const_metadata(m)%standard_name(standard_name) + call ccpp_const_props(m)%standard_name(standard_name) + write(0,*) ' standard_name=',standard_name if (standard_name == 'water_vapor_wrt_moist_air_and_condensed_water') then cycle end if @@ -146,7 +146,9 @@ subroutine zm_conv_convtran_run(ncol, pver, & if (doconvtran(m)) then ! if (cnst_get_type_byind(m).eq.'dry') then - call const_metadata(m)%is_dry(is_dry) + call ccpp_const_props(m)%is_dry(is_dry) + write(0,*) ' is_dry=', is_dry + write(0,*) ' cnst_get_type_byind(m)=',cnst_get_type_byind(m) if (is_dry) then do k = 1,pver do i =il1g,il2g From c8076de89add934bc5a68a51fd06248a0a7294db Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 15 Jul 2024 11:41:06 -0600 Subject: [PATCH 11/36] Updates to get ZM to compile in CAM-SIMA --- cloud_fraction/cloud_fraction_fice.F90 | 86 ++ cloud_fraction/cloud_fraction_fice.meta | 37 + suite_zhang_mcfarlane.xml | 1 + to_be_ccppized/error_messages.F90 | 151 +++ to_be_ccppized/namelist_utils.F90 | 6 + to_be_ccppized/units.F90 | 36 + to_be_ccppized/wv_sat_methods.F90 | 759 ++++++++++++ to_be_ccppized/wv_saturation.F90 | 1485 +++++++++++++++++++++++ zhang_mcfarlane/zm_conv_convtran.F90 | 17 +- zhang_mcfarlane/zm_conv_convtran.meta | 14 + zhang_mcfarlane/zm_conv_evap.F90 | 16 +- zhang_mcfarlane/zm_conv_evap.meta | 2 + zhang_mcfarlane/zm_convr.F90 | 4 +- zhang_mcfarlane/zm_convr.meta | 9 +- 14 files changed, 2603 insertions(+), 20 deletions(-) create mode 100644 cloud_fraction/cloud_fraction_fice.F90 create mode 100644 cloud_fraction/cloud_fraction_fice.meta create mode 100644 to_be_ccppized/error_messages.F90 create mode 100644 to_be_ccppized/namelist_utils.F90 create mode 100644 to_be_ccppized/units.F90 create mode 100644 to_be_ccppized/wv_sat_methods.F90 create mode 100644 to_be_ccppized/wv_saturation.F90 diff --git a/cloud_fraction/cloud_fraction_fice.F90 b/cloud_fraction/cloud_fraction_fice.F90 new file mode 100644 index 00000000..a70ea1f3 --- /dev/null +++ b/cloud_fraction/cloud_fraction_fice.F90 @@ -0,0 +1,86 @@ +module cloud_fraction_fice + + use ccpp_kinds, only: kind_phys + +contains + +!================================================================================================ + +!=============================================================================== +!> \section arg_table_cloud_fraction_fice_run Argument Table +!! \htmlinclude cloud_fraction_fice_run.html +!! + subroutine cloud_fraction_fice_run(ncol, t, tmelt, fice, fsnow) +! +! Compute the fraction of the total cloud water which is in ice phase. +! The fraction depends on temperature only. +! This is the form that was used for radiation, the code came from cldefr originally +! +! Author: B. A. Boville Sept 10, 2002 +! modified: PJR 3/13/03 (added fsnow to ascribe snow production for convection ) +!----------------------------------------------------------------------- + +! Arguments + integer, intent(in) :: ncol ! number of active columns + real(kind_phys), intent(in) :: t(:,:) ! temperature + real(kind_phys), intent(in) :: tmelt ! freezing point of water + + real(kind_phys), intent(out) :: fice(:,:) ! Fractional ice content within cloud + real(kind_phys), intent(out) :: fsnow(:,:) ! Fractional snow content for convection + +! Local variables + real(kind_phys) :: tmax_fice ! max temperature for cloud ice formation + real(kind_phys) :: tmin_fice ! min temperature for cloud ice formation + real(kind_phys) :: tmax_fsnow ! max temperature for transition to convective snow + real(kind_phys) :: tmin_fsnow ! min temperature for transition to convective snow + + integer :: i,k ! loop indexes + +!----------------------------------------------------------------------- + + tmax_fice = tmelt - 10._kind_phys ! max temperature for cloud ice formation + tmin_fice = tmax_fice - 30._kind_phys ! min temperature for cloud ice formation + tmax_fsnow = tmelt ! max temperature for transition to convective snow + tmin_fsnow = tmelt - 5._kind_phys ! min temperature for transition to convective snow + + fice(:,:top_lev-1) = 0._kind_phys + fsnow(:,:top_lev-1) = 0._kind_phys + +! Define fractional amount of cloud that is ice + do k=top_lev,pver + do i=1,ncol + +! If warmer than tmax then water phase + if (t(i,k) > tmax_fice) then + fice(i,k) = 0.0_kind_phys + +! If colder than tmin then ice phase + else if (t(i,k) < tmin_fice) then + fice(i,k) = 1.0_kind_phys + +! Otherwise mixed phase, with ice fraction decreasing linearly from tmin to tmax + else + fice(i,k) =(tmax_fice - t(i,k)) / (tmax_fice - tmin_fice) + end if + +! snow fraction partitioning + +! If warmer than tmax then water phase + if (t(i,k) > tmax_fsnow) then + fsnow(i,k) = 0.0_kind_phys + +! If colder than tmin then ice phase + else if (t(i,k) < tmin_fsnow) then + fsnow(i,k) = 1.0_kind_phys + +! Otherwise mixed phase, with ice fraction decreasing linearly from tmin to tmax + else + fsnow(i,k) =(tmax_fsnow - t(i,k)) / (tmax_fsnow - tmin_fsnow) + end if + + end do + end do + + end subroutine cloud_fraction_fice_run + +end module cloud_fraction_fice diff --git a/cloud_fraction/cloud_fraction_fice.meta b/cloud_fraction/cloud_fraction_fice.meta new file mode 100644 index 00000000..d268c141 --- /dev/null +++ b/cloud_fraction/cloud_fraction_fice.meta @@ -0,0 +1,37 @@ +[ccpp-table-properties] + name = cloud_fraction_fice + type = scheme + +[ccpp-arg-table] + name = cloud_fraction_fice_run + type = scheme +[ ncol ] + standard_name = horizontal_loop_extent + units = count + type = integer + dimensions = () + intent = in +[ t ] + standard_name = air_temperature + units = K + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ tmelt ] + standard_name = freezing_point_of_water + units = K + type = real | kind = kind_phys + dimensions = () + intent = in +[ fice ] + standard_name = mass_fraction_of_ice_content_within_stratiform_cloud + units = fraction + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ fsnow ] + standard_name = mass_fraction_of_snow_content_within_stratiform_cloud + units = fraction + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out diff --git a/suite_zhang_mcfarlane.xml b/suite_zhang_mcfarlane.xml index 7b55021c..9fe83025 100644 --- a/suite_zhang_mcfarlane.xml +++ b/suite_zhang_mcfarlane.xml @@ -3,6 +3,7 @@ zm_convr + cloud_fraction_fice zm_conv_evap zm_conv_momtran zm_conv_convtran diff --git a/to_be_ccppized/error_messages.F90 b/to_be_ccppized/error_messages.F90 new file mode 100644 index 00000000..a2a64bca --- /dev/null +++ b/to_be_ccppized/error_messages.F90 @@ -0,0 +1,151 @@ +module error_messages + + !----------------------------------------------------------------------- + ! + ! Purpose: + ! General purpose routines for issuing error messages. + ! + ! Author: B. Eaton + ! + !----------------------------------------------------------------------- + use cam_abortutils, only: endrun + use cam_logfile, only: iulog + + implicit none + save + private + public :: & + alloc_err, &! Issue error message after non-zero return from an allocate statement. + handle_err, &! Issue error message after non-zero return from anything + handle_ncerr ! Handle error returns from netCDF library procedures. + + ! If an error message string is not empty, abort with that string as the + ! error message. + public :: handle_errmsg + +!############################################################################## +contains +!############################################################################## + + subroutine alloc_err( istat, routine, name, nelem ) + + !----------------------------------------------------------------------- + ! Purpose: + ! Issue error message after non-zero return from an allocate statement. + ! + ! Author: B. Eaton + !----------------------------------------------------------------------- + + integer, intent(in) ::& + istat ! status from allocate statement + character(len=*), intent(in) ::& + routine, &! routine that called allocate + name ! name of array + integer, intent(in) ::& + nelem ! number of elements attempted to allocate + !----------------------------------------------------------------------- + + if ( istat .ne. 0 ) then + write(iulog,*)'ERROR trying to allocate memory in routine: ' & + //trim(routine) + write(iulog,*)' Variable name: '//trim(name) + write(iulog,*)' Number of elements: ',nelem + call endrun ('ALLOC_ERR') + end if + + return + + end subroutine alloc_err + +!############################################################################## + + subroutine handle_err( istat, msg ) + + !----------------------------------------------------------------------- + ! Purpose: + ! Issue error message after non-zero return from anything. + ! + ! Author: T. Henderson + !----------------------------------------------------------------------- + + integer, intent(in) :: istat ! status, zero = "no error" + character(len=*), intent(in) :: msg ! error message to print + !----------------------------------------------------------------------- + + if ( istat .ne. 0 ) then + call endrun (trim(msg)) + end if + + return + + end subroutine handle_err + +!############################################################################## + + subroutine handle_ncerr( ret, mes, line ) + + !----------------------------------------------------------------------- + ! Purpose: + ! Check netCDF library function return code. If error detected + ! issue error message then abort. + ! + ! Author: B. Eaton + !----------------------------------------------------------------------- + +!----------------------------------------------------------------------- + use netcdf +!----------------------------------------------------------------------- + + integer, intent(in) ::& + ret ! return code from netCDF library routine + character(len=*), intent(in) ::& + mes ! message to be printed if error detected + integer, intent(in), optional :: line + !----------------------------------------------------------------------- + + if ( ret .ne. NF90_NOERR ) then + if(present(line)) then + write(iulog,*) mes, line + else + write(iulog,*) mes + end if + write(iulog,*) nf90_strerror( ret ) + call endrun ('HANDLE_NCERR') + endif + + return + + end subroutine handle_ncerr + +!############################################################################## + + subroutine handle_errmsg(errmsg, subname, extra_msg) + + ! String that is asserted to be null. + character(len=*), intent(in) :: errmsg + ! Name of procedure generating the message. + character(len=*), intent(in), optional :: subname + ! Additional message from the procedure calling this one. + character(len=*), intent(in), optional :: extra_msg + + if (trim(errmsg) /= "") then + + if (present(extra_msg)) & + write(iulog,*) "handle_errmsg: & + &Message from caller: ",trim(extra_msg) + + if (present(subname)) then + call endrun("ERROR: handle_errmsg: "// & + trim(subname)//": "//trim(errmsg)) + else + call endrun("ERROR: handle_errmsg: "// & + "Error message received from routine: "//trim(errmsg)) + end if + + end if + + end subroutine handle_errmsg + +!############################################################################## + +end module error_messages diff --git a/to_be_ccppized/namelist_utils.F90 b/to_be_ccppized/namelist_utils.F90 new file mode 100644 index 00000000..c12dfad2 --- /dev/null +++ b/to_be_ccppized/namelist_utils.F90 @@ -0,0 +1,6 @@ +module namelist_utils + +use shr_nl_mod, only: & + find_group_name => shr_nl_find_group_name + +end module namelist_utils diff --git a/to_be_ccppized/units.F90 b/to_be_ccppized/units.F90 new file mode 100644 index 00000000..8497cbf6 --- /dev/null +++ b/to_be_ccppized/units.F90 @@ -0,0 +1,36 @@ +module units + +use shr_file_mod, only: shr_file_getUnit, shr_file_freeUnit + +implicit none +private + +public :: getunit, freeunit + +!------------------------------------------------------------------------------- +contains +!------------------------------------------------------------------------------- + +integer function getunit(iu) + + ! return an available unit number for i/o + + integer, intent(in), optional :: iu ! desired unit number + + getunit = shr_file_getUnit(iu) + +end function getunit + +!------------------------------------------------------------------------------- + +subroutine freeunit(iu) + + ! release the unit + + integer, intent(in) :: iu ! unit number to be freed + + call shr_file_freeUnit(iu) + +end subroutine freeunit + +end module units diff --git a/to_be_ccppized/wv_sat_methods.F90 b/to_be_ccppized/wv_sat_methods.F90 new file mode 100644 index 00000000..bb2ffeb4 --- /dev/null +++ b/to_be_ccppized/wv_sat_methods.F90 @@ -0,0 +1,759 @@ +module wv_sat_methods + +! This portable module contains all CAM methods for estimating +! the saturation vapor pressure of water. +! +! wv_saturation provides CAM-specific interfaces and utilities +! based on these formulae. +! +! Typical usage of this module: +! +! Init: +! call wv_sat_methods_init(r8, , errstring) +! +! Get scheme index from a name string: +! scheme_idx = wv_sat_get_scheme_idx(scheme_name) +! if (.not. wv_sat_valid_idx(scheme_idx)) +! +! Get pressures: +! es = wv_sat_svp_water(t, scheme_idx) +! es = wv_sat_svp_ice(t, scheme_idx) +! +! Use ice/water transition range: +! es = wv_sat_svp_trice(t, ttrice, scheme_idx) +! +! Note that elemental functions cannot be pointed to, nor passed +! as arguments. If you need to do either, it is recommended to +! wrap the function so that it can be given an explicit (non- +! elemental) interface. + +implicit none +private +save + +integer, parameter :: r8 = selected_real_kind(12) ! 8 byte real + +integer, parameter :: VLENS = 128 ! vector length for a GPU kernel + +real(r8) :: tmelt ! Melting point of water at 1 atm (K) +real(r8) :: h2otrip ! Triple point temperature of water (K) +real(r8) :: tboil ! Boiling point of water at 1 atm (K) + +real(r8) :: ttrice ! Ice-water transition range + +real(r8) :: epsilo ! Ice-water transition range +real(r8) :: omeps ! 1._r8 - epsilo + +! Indices representing individual schemes +integer, parameter :: Invalid_idx = -1 +integer, parameter :: GoffGratch_idx = 1 +integer, parameter :: MurphyKoop_idx = 2 +integer, parameter :: Bolton_idx = 3 + +! Index representing the current default scheme. +integer, parameter :: initial_default_idx = GoffGratch_idx +integer :: default_idx = initial_default_idx + +!$acc declare create (epsilo, tmelt, tboil, omeps, h2otrip, ttrice) + +public wv_sat_methods_init +public wv_sat_get_scheme_idx +public wv_sat_valid_idx + +public wv_sat_set_default +public wv_sat_reset_default + +public wv_sat_qsat_water, wv_sat_qsat_water_vect +public wv_sat_qsat_ice, wv_sat_qsat_ice_vect + +public wv_sat_svp_trans, wv_sat_svp_trans_vect + +! pressure -> humidity conversion +public wv_sat_svp_to_qsat, wv_sat_svp_to_qsat_vect + +! Combined qsat operations +public wv_sat_qsat_trans + +public wv_sat_svp_water, wv_sat_svp_water_vect +public wv_sat_svp_ice, wv_sat_svp_ice_vect + +contains + +!--------------------------------------------------------------------- +! ADMINISTRATIVE FUNCTIONS +!--------------------------------------------------------------------- + +! Get physical constants +subroutine wv_sat_methods_init(kind, tmelt_in, h2otrip_in, tboil_in, & + ttrice_in, epsilo_in, errstring) + integer, intent(in) :: kind + real(r8), intent(in) :: tmelt_in + real(r8), intent(in) :: h2otrip_in + real(r8), intent(in) :: tboil_in + real(r8), intent(in) :: ttrice_in + real(r8), intent(in) :: epsilo_in + character(len=*), intent(out) :: errstring + + errstring = ' ' + + if (kind /= r8) then + write(errstring,*) 'wv_sat_methods_init: ERROR: ', & + kind,' was input kind but ',r8,' is internal kind.' + return + end if + + if (ttrice_in < 0._r8) then + write(errstring,*) 'wv_sat_methods_init: ERROR: ', & + ttrice_in,' was input for ttrice, but negative range is invalid.' + return + end if + + tmelt = tmelt_in + h2otrip = h2otrip_in + tboil = tboil_in + ttrice = ttrice_in + epsilo = epsilo_in + + omeps = 1._r8 - epsilo + + !$acc update device (tmelt,h2otrip,tboil,ttrice,epsilo,omeps) + +end subroutine wv_sat_methods_init + +! Look up index by name. +pure function wv_sat_get_scheme_idx(name) result(idx) + character(len=*), intent(in) :: name + integer :: idx + + select case (name) + case("GoffGratch") + idx = GoffGratch_idx + case("MurphyKoop") + idx = MurphyKoop_idx + case("Bolton") + idx = Bolton_idx + case default + idx = Invalid_idx + end select + +end function wv_sat_get_scheme_idx + +! Check validity of an index from the above routine. +pure function wv_sat_valid_idx(idx) result(status) + integer, intent(in) :: idx + logical :: status + + status = (idx /= Invalid_idx) + +end function wv_sat_valid_idx + +! Set default scheme (otherwise, Goff & Gratch is default) +! Returns a logical representing success (.true.) or +! failure (.false.). +function wv_sat_set_default(name) result(status) + character(len=*), intent(in) :: name + logical :: status + + ! Don't want to overwrite valid default with invalid, + ! so assign to temporary and check it first. + integer :: tmp_idx + + tmp_idx = wv_sat_get_scheme_idx(name) + + status = wv_sat_valid_idx(tmp_idx) + + if (status) default_idx = tmp_idx + +end function wv_sat_set_default + +! Reset default scheme to initial value. +! The same thing can be accomplished with wv_sat_set_default; +! the real reason to provide this routine is to reset the +! module for testing purposes. +subroutine wv_sat_reset_default() + + default_idx = initial_default_idx + +end subroutine wv_sat_reset_default + +!--------------------------------------------------------------------- +! UTILITIES +!--------------------------------------------------------------------- + +! Get saturation specific humidity given pressure and SVP. +! Specific humidity is limited to range 0-1. +function wv_sat_svp_to_qsat(es, p) result(qs) + real(r8), intent(in) :: es ! SVP + real(r8), intent(in) :: p ! Current pressure. + real(r8) :: qs + + ! If pressure is less than SVP, set qs to maximum of 1. + if ( (p - es) <= 0._r8 ) then + qs = 1.0_r8 + else + qs = epsilo*es / (p - omeps*es) + end if + +end function wv_sat_svp_to_qsat + +! Get saturation specific humidity given pressure and SVP. +! Specific humidity is limited to range 0-1. +subroutine wv_sat_svp_to_qsat_vect(es, p, qs, vlen) + + integer, intent(in) :: vlen + real(r8), intent(in) :: es(vlen) ! SVP + real(r8), intent(in) :: p(vlen) ! Current pressure. + real(r8), intent(out) :: qs(vlen) + integer :: i + + ! If pressure is less than SVP, set qs to maximum of 1. + + !$acc data present (es,p,qs) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i=1,vlen + if ( (p(i) - es(i)) <= 0._r8 ) then + qs(i) = 1.0_r8 + else + qs(i) = epsilo*es(i) / (p(i) - omeps*es(i)) + end if + end do + !$acc end parallel + + !$acc end data +end subroutine wv_sat_svp_to_qsat_vect + +subroutine wv_sat_qsat_water(t, p, es, qs, idx) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over water at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + !------------------------------------------------------------------! + + ! Inputs + real(r8), intent(in) :: t ! Temperature + real(r8), intent(in) :: p ! Pressure + ! Outputs + real(r8), intent(out) :: es ! Saturation vapor pressure + real(r8), intent(out) :: qs ! Saturation specific humidity + + integer, intent(in), optional :: idx ! Scheme index + + es = wv_sat_svp_water(t, idx) + + qs = wv_sat_svp_to_qsat(es, p) + + ! Ensures returned es is consistent with limiters on qs. + es = min(es, p) + +end subroutine wv_sat_qsat_water + +subroutine wv_sat_qsat_water_vect(t, p, es, qs, vlen, idx) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over water at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + !------------------------------------------------------------------! + ! Inputs + + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature + real(r8), intent(in) :: p(vlen) ! Pressure + ! Outputs + real(r8), intent(out) :: es(vlen) ! Saturation vapor pressure + real(r8), intent(out) :: qs(vlen) ! Saturation specific humidity + + integer, intent(in), optional :: idx ! Scheme index + integer :: i + + !$acc data present (t,p,es,qs) + + call wv_sat_svp_water_vect(t, es, vlen, idx) + call wv_sat_svp_to_qsat_vect(es, p, qs, vlen) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i=1,vlen + ! Ensures returned es is consistent with limiters on qs. + es(i) = min(es(i), p(i)) + enddo + !$acc end parallel + + !$acc end data +end subroutine wv_sat_qsat_water_vect + +subroutine wv_sat_qsat_ice(t, p, es, qs, idx) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over ice at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + !------------------------------------------------------------------! + + ! Inputs + real(r8), intent(in) :: t ! Temperature + real(r8), intent(in) :: p ! Pressure + ! Outputs + real(r8), intent(out) :: es ! Saturation vapor pressure + real(r8), intent(out) :: qs ! Saturation specific humidity + + integer, intent(in), optional :: idx ! Scheme index + + es = wv_sat_svp_ice(t, idx) + + qs = wv_sat_svp_to_qsat(es, p) + + ! Ensures returned es is consistent with limiters on qs. + es = min(es, p) + +end subroutine wv_sat_qsat_ice + +subroutine wv_sat_qsat_ice_vect(t, p, es, qs, vlen, idx) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over ice at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + !------------------------------------------------------------------! + ! Inputs + + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature + real(r8), intent(in) :: p(vlen) ! Pressure + ! Outputs + real(r8), intent(out) :: es(vlen) ! Saturation vapor pressure + real(r8), intent(out) :: qs(vlen) ! Saturation specific humidity + + integer, intent(in), optional :: idx ! Scheme index + integer :: i + + !$acc data present (t,p,es,qs) + + call wv_sat_svp_ice_vect(t, es, vlen, idx) + call wv_sat_svp_to_qsat_vect(es, p, qs, vlen) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i=1,vlen + ! Ensures returned es is consistent with limiters on qs. + es(i) = min(es(i), p(i)) + enddo + !$acc end parallel + + !$acc end data +end subroutine wv_sat_qsat_ice_vect + +subroutine wv_sat_qsat_trans(t, p, es, qs, idx) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over ice at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + !------------------------------------------------------------------! + + ! Inputs + real(r8), intent(in) :: t ! Temperature + real(r8), intent(in) :: p ! Pressure + ! Outputs + real(r8), intent(out) :: es ! Saturation vapor pressure + real(r8), intent(out) :: qs ! Saturation specific humidity + + integer, intent(in), optional :: idx ! Scheme index + + es = wv_sat_svp_trans(t, idx) + + qs = wv_sat_svp_to_qsat(es, p) + + ! Ensures returned es is consistent with limiters on qs. + es = min(es, p) + +end subroutine wv_sat_qsat_trans + +!--------------------------------------------------------------------- +! SVP INTERFACE FUNCTIONS +!--------------------------------------------------------------------- + +function wv_sat_svp_water(t, idx) result(es) + real(r8), intent(in) :: t + integer, intent(in), optional :: idx + real(r8) :: es + + integer :: use_idx + + if (present(idx)) then + use_idx = idx + else + use_idx = default_idx + end if + + select case (use_idx) + case(GoffGratch_idx) + es = GoffGratch_svp_water(t) + case(MurphyKoop_idx) + es = MurphyKoop_svp_water(t) + case(Bolton_idx) + es = Bolton_svp_water(t) + end select + +end function wv_sat_svp_water + +subroutine wv_sat_svp_water_vect(t, es, vlen, idx) + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) + integer, intent(in), optional :: idx + real(r8), intent(out) :: es(vlen) + integer :: i + integer :: use_idx + + !$acc data present (t,es) + + if (present(idx)) then + use_idx = idx + else + use_idx = default_idx + end if + + select case (use_idx) + case(GoffGratch_idx) + call GoffGratch_svp_water_vect(t,es,vlen) + case(MurphyKoop_idx) + call MurphyKoop_svp_water_vect(t,es,vlen) + case(Bolton_idx) + call Bolton_svp_water_vect(t,es,vlen) + end select + + !$acc end data +end subroutine wv_sat_svp_water_vect + +function wv_sat_svp_ice(t, idx) result(es) + real(r8), intent(in) :: t + integer, intent(in), optional :: idx + real(r8) :: es + + integer :: use_idx + + if (present(idx)) then + use_idx = idx + else + use_idx = default_idx + end if + + select case (use_idx) + case(GoffGratch_idx) + es = GoffGratch_svp_ice(t) + case(MurphyKoop_idx) + es = MurphyKoop_svp_ice(t) + case(Bolton_idx) + es = Bolton_svp_water(t) + end select + +end function wv_sat_svp_ice + +subroutine wv_sat_svp_ice_vect(t, es, vlen, idx) + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) + integer, intent(in), optional :: idx + real(r8), intent(out) :: es(vlen) + integer :: i + + integer :: use_idx + + !$acc data present (t,es) + + if (present(idx)) then + use_idx = idx + else + use_idx = default_idx + end if + + select case (use_idx) + case(GoffGratch_idx) + call GoffGratch_svp_ice_vect(t,es,vlen) + case(MurphyKoop_idx) + call MurphyKoop_svp_ice_vect(t,es,vlen) + case(Bolton_idx) + call Bolton_svp_water_vect(t,es,vlen) + end select + + !$acc end data +end subroutine wv_sat_svp_ice_vect + +function wv_sat_svp_trans(t, idx) result(es) + + real(r8), intent(in) :: t + integer, intent(in), optional :: idx + real(r8) :: es + + real(r8) :: esice ! Saturation vapor pressure over ice + real(r8) :: weight ! Intermediate scratch variable for es transition + +! +! Water +! + if (t >= (tmelt - ttrice)) then + es = wv_sat_svp_water(t,idx) + else + es = 0.0_r8 + end if + +! +! Ice +! + if (t < tmelt) then + + esice = wv_sat_svp_ice(t,idx) + + if ( (tmelt - t) > ttrice ) then + weight = 1.0_r8 + else + weight = (tmelt - t)/ttrice + end if + + es = weight*esice + (1.0_r8 - weight)*es + end if + +end function wv_sat_svp_trans + +subroutine wv_sat_svp_trans_vect(t, es, vlen, idx) + + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) + integer, intent(in), optional :: idx + real(r8), intent(out) :: es(vlen) + + real(r8) :: esice(vlen) ! Saturation vapor pressure over ice + real(r8) :: weight ! Intermediate scratch variable for es transition + integer :: i + + !$acc data present (t,es) & + !$acc create (esice) + +! +! Water +! + call wv_sat_svp_water_vect(t,es,vlen,idx) + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + if (t(i) < (tmelt - ttrice)) then + es(i) = 0.0_r8 + end if + end do + !$acc end parallel +! +! Ice +! + call wv_sat_svp_ice_vect(t,esice,vlen,idx) + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + if (t(i) < tmelt) then + if ( (tmelt - t(i)) > ttrice ) then + weight = 1.0_r8 + else + weight = (tmelt - t(i))/ttrice + end if + + es(i) = weight*esice(i) + (1.0_r8 - weight)*es(i) + end if + end do + !$acc end parallel + + !$acc end data +end subroutine wv_sat_svp_trans_vect + +!--------------------------------------------------------------------- +! SVP METHODS +!--------------------------------------------------------------------- + +! Goff & Gratch (1946) + +function GoffGratch_svp_water(t) result(es) + real(r8), intent(in) :: t ! Temperature in Kelvin + real(r8) :: es ! SVP in Pa + + ! uncertain below -70 C + es = 10._r8**(-7.90298_r8*(tboil/t-1._r8)+ & + 5.02808_r8*log10(tboil/t)- & + 1.3816e-7_r8*(10._r8**(11.344_r8*(1._r8-t/tboil))-1._r8)+ & + 8.1328e-3_r8*(10._r8**(-3.49149_r8*(tboil/t-1._r8))-1._r8)+ & + log10(1013.246_r8))*100._r8 + +end function GoffGratch_svp_water + +subroutine GoffGratch_svp_water_vect(t, es, vlen) + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature in Kelvin + real(r8), intent(out) :: es(vlen) ! SVP in Pa + real(r8) :: log_tboil + integer :: i + + !$acc data present (t,es) + + ! Goff, J. A., and S. Gratch. “Low-Pressure Properties of Water from -160F + ! to 212F.” Trans. Am. Soc. Heat. Vent. Eng. 52 (1946): 95–121. + ! uncertain below -70 C + + log_tboil = log10(tboil) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i=1,vlen + es(i) = 10._r8**(-7.90298_r8*(tboil/t(i)-1._r8)+ & + 5.02808_r8*(log_tboil-log10(t(i)))- & + 1.3816e-7_r8*(10._r8**(11.344_r8*(1._r8-t(i)/tboil))-1._r8)+ & + 8.1328e-3_r8*(10._r8**(-3.49149_r8*(tboil/t(i)-1._r8))-1._r8)+ & + log10(1013.246_r8))*100._r8 + enddo + !$acc end parallel + + !$acc end data +end subroutine GoffGratch_svp_water_vect + +function GoffGratch_svp_ice(t) result(es) + real(r8), intent(in) :: t ! Temperature in Kelvin + real(r8) :: es ! SVP in Pa + + ! good down to -100 C + es = 10._r8**(-9.09718_r8*(h2otrip/t-1._r8)-3.56654_r8* & + log10(h2otrip/t)+0.876793_r8*(1._r8-t/h2otrip)+ & + log10(6.1071_r8))*100._r8 + +end function GoffGratch_svp_ice + +subroutine GoffGratch_svp_ice_vect(t, es, vlen) + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature in Kelvin + real(r8), intent(out) :: es(vlen) ! SVP in Pa + real(r8), parameter :: log_param = log10(6.1071_r8) + integer :: i + ! good down to -100 C + + !$acc data present (t,es) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i=1,vlen + es(i) = 10._r8**(-9.09718_r8*(h2otrip/t(i)-1._r8)-3.56654_r8* & + log10(h2otrip/t(i))+0.876793_r8*(1._r8-t(i)/h2otrip)+ & + log_param)*100._r8 + enddo + !$acc end parallel + + !$acc end data +end subroutine GoffGratch_svp_ice_vect + +! Murphy & Koop (2005) + +function MurphyKoop_svp_water(t) result(es) + real(r8), intent(in) :: t ! Temperature in Kelvin + real(r8) :: es ! SVP in Pa + + ! (good for 123 < T < 332 K) + es = exp(54.842763_r8 - (6763.22_r8 / t) - (4.210_r8 * log(t)) + & + (0.000367_r8 * t) + (tanh(0.0415_r8 * (t - 218.8_r8)) * & + (53.878_r8 - (1331.22_r8 / t) - (9.44523_r8 * log(t)) + & + 0.014025_r8 * t))) + +end function MurphyKoop_svp_water + +subroutine MurphyKoop_svp_water_vect(t, es, vlen) + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature in Kelvin + real(r8), intent(out) :: es(vlen) ! SVP in Pa + + integer :: i + ! Murphy, D. M., and T. Koop. “Review of the Vapour Pressure of Ice and + ! Supercooled Water for Atmospheric Applications.” Q. J. R. Meteorol. + ! Soc. 131, no. 608 (2005): 1539–65. 10.1256/qj.04.94 + ! (good for 123 < T < 332 K) + + !$acc data present (t,es) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + es(i) = exp(54.842763_r8 - (6763.22_r8 / t(i)) - (4.210_r8 * log(t(i))) + & + (0.000367_r8 * t(i)) + (tanh(0.0415_r8 * (t(i) - 218.8_r8)) * & + (53.878_r8 - (1331.22_r8 / t(i)) - (9.44523_r8 * log(t(i))) + & + 0.014025_r8 * t(i)))) + end do + !$acc end parallel + + !$acc end data +end subroutine MurphyKoop_svp_water_vect + +function MurphyKoop_svp_ice(t) result(es) + real(r8), intent(in) :: t ! Temperature in Kelvin + real(r8) :: es ! SVP in Pa + + ! (good down to 110 K) + es = exp(9.550426_r8 - (5723.265_r8 / t) + (3.53068_r8 * log(t)) & + - (0.00728332_r8 * t)) + +end function MurphyKoop_svp_ice + +subroutine MurphyKoop_svp_ice_vect(t, es, vlen) + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature in Kelvin + real(r8), intent(out) :: es(vlen) ! SVP in Pa + + integer :: i + ! (good down to 110 K) + + !$acc data present (t,es) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + es(i) = exp(9.550426_r8 - (5723.265_r8 / t(i)) + (3.53068_r8 * log(t(i))) & + - (0.00728332_r8 * t(i))) + end do + !$acc end parallel + + !$acc end data +end subroutine MurphyKoop_svp_ice_vect + +! Bolton (1980) +! zm_conv deep convection scheme contained this SVP calculation. +! It appears to be from D. Bolton, 1980, Monthly Weather Review. +! Unlike the other schemes, no distinct ice formula is associated +! with it. (However, a Bolton ice formula exists in CLUBB.) + +! The original formula used degrees C, but this function +! takes Kelvin and internally converts. + +function Bolton_svp_water(t) result(es) + real(r8),parameter :: c1 = 611.2_r8 + real(r8),parameter :: c2 = 17.67_r8 + real(r8),parameter :: c3 = 243.5_r8 + + real(r8), intent(in) :: t ! Temperature in Kelvin + real(r8) :: es ! SVP in Pa + + es = c1*exp( (c2*(t - tmelt))/((t - tmelt)+c3) ) + +end function Bolton_svp_water + +subroutine Bolton_svp_water_vect(t, es,vlen) + real(r8),parameter :: c1 = 611.2_r8 + real(r8),parameter :: c2 = 17.67_r8 + real(r8),parameter :: c3 = 243.5_r8 + + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature in Kelvin + real(r8), intent(out) :: es(vlen) ! SVP in Pa + + integer :: i + + !$acc data present (t,es) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + es(i) = c1*exp( (c2*(t(i) - tmelt))/((t(i) - tmelt)+c3) ) + end do + !$acc end parallel + + !$acc end data +end subroutine Bolton_svp_water_vect + +end module wv_sat_methods diff --git a/to_be_ccppized/wv_saturation.F90 b/to_be_ccppized/wv_saturation.F90 new file mode 100644 index 00000000..dcd1053e --- /dev/null +++ b/to_be_ccppized/wv_saturation.F90 @@ -0,0 +1,1485 @@ +module wv_saturation + +!--------------------------------------------------------------------! +! Module Overview: ! +! ! +! This module provides an interface to wv_sat_methods, providing ! +! saturation vapor pressure and related calculations to CAM. ! +! ! +! The original wv_saturation codes were introduced by J. J. Hack, ! +! February 1990. The code has been extensively rewritten since then, ! +! including a total refactoring in Summer 2012. ! +! ! +!--------------------------------------------------------------------! +! Methods: ! +! ! +! Pure water/ice saturation vapor pressures are calculated on the ! +! fly, with the specific method determined by a runtime option. ! +! Mixed phase SVP is interpolated from the internal table, estbl, ! +! which is created during initialization. ! +! ! +! The default method for calculating SVP is determined by a namelist ! +! option, and used whenever svp_water/ice or qsat are called. ! +! ! +!--------------------------------------------------------------------! + +use shr_kind_mod, only: r8 => shr_kind_r8 +use physconst, only: epsilo, & + latvap, & + latice, & + rh2o, & + cpair, & + tmelt, & + h2otrip + +use wv_sat_methods, only: & + svp_to_qsat => wv_sat_svp_to_qsat, & + svp_to_qsat_vect => wv_sat_svp_to_qsat_vect + +implicit none +private +save + +! Public interfaces +! Namelist, initialization, finalization +public wv_sat_readnl +public wv_sat_init +public wv_sat_final + +! Saturation vapor pressure calculations +public svp_water, svp_water_vect +public svp_ice, svp_ice_vect + +! Mixed phase (water + ice) saturation vapor pressure table lookup +public estblf + +public svp_to_qsat + +! Subroutines that return both SVP and humidity +! Optional arguments do temperature derivatives +interface qsat + module procedure qsat_line + module procedure qsat_vect + module procedure qsat_2D +end interface +public qsat ! Mixed phase +interface qsat_water + module procedure qsat_water_line + module procedure qsat_water_vect + module procedure qsat_water_2D +end interface +public qsat_water ! SVP over water only +interface qsat_ice + module procedure qsat_ice_line + module procedure qsat_ice_vect + module procedure qsat_ice_2D +end interface +public qsat_ice ! SVP over ice only + +! Wet bulb temperature solver +public :: findsp_vc, findsp + +! Data + +! This value is slightly high, but it seems to be the value for the +! steam point of water originally (and most frequently) used in the +! Goff & Gratch scheme. +real(r8), parameter :: tboil = 373.16_r8 + +! Table of saturation vapor pressure values (estbl) from tmin to +! tmax+1 Kelvin, in one degree increments. ttrice defines the +! transition region, estbl contains a combination of ice & water +! values. +! Make these public parameters in case another module wants to see the +! extent of the table. + real(r8), public, parameter :: tmin = 127.16_r8 + real(r8), public, parameter :: tmax = 375.16_r8 + + real(r8), parameter :: ttrice = 20.00_r8 ! transition range from es over H2O to es over ice + + integer :: plenest ! length of estbl + real(r8), allocatable :: estbl(:) ! table values of saturation vapor pressure + + real(r8) :: omeps ! 1.0_r8 - epsilo + + real(r8) :: c3 ! parameter used by findsp + + ! Set coefficients for polynomial approximation of difference + ! between saturation vapor press over water and saturation pressure + ! over ice for -ttrice < t < 0 (degrees C). NOTE: polynomial is + ! valid in the range -40 < t < 0 (degrees C). + real(r8) :: pcf(5) = (/ & + 5.04469588506e-01_r8, & + -5.47288442819e+00_r8, & + -3.67471858735e-01_r8, & + -8.95963532403e-03_r8, & + -7.78053686625e-05_r8 /) + +! --- Degree 6 approximation --- +! real(r8) :: pcf(6) = (/ & +! 7.63285250063e-02, & +! 5.86048427932e+00, & +! 4.38660831780e-01, & +! 1.37898276415e-02, & +! 2.14444472424e-04, & +! 1.36639103771e-06 /) + + integer, parameter :: VLENS = 128 ! vector length for a GPU kernel + + !$acc declare create (plenest,estbl,omeps,c3,pcf) + +contains + +!--------------------------------------------------------------------- +! ADMINISTRATIVE FUNCTIONS +!--------------------------------------------------------------------- + +subroutine wv_sat_readnl(nlfile) + !------------------------------------------------------------------! + ! Purpose: ! + ! Get runtime options for wv_saturation. ! + !------------------------------------------------------------------! + + use wv_sat_methods, only: wv_sat_get_scheme_idx, & + wv_sat_valid_idx, & + wv_sat_set_default + + use spmd_utils, only: masterproc + use namelist_utils, only: find_group_name + use units, only: getunit, freeunit +!CACNOTE - Bring this back in along with the mpibcast call below +! use mpishorthand + use cam_abortutils, only: endrun + + character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input + + ! Local variables + integer :: unitn, ierr + + character(len=32) :: wv_sat_scheme = "GoffGratch" + + character(len=*), parameter :: subname = 'wv_sat_readnl' + + namelist /wv_sat_nl/ wv_sat_scheme + !----------------------------------------------------------------------------- + + if (masterproc) then + unitn = getunit() + open( unitn, file=trim(nlfile), status='old' ) + call find_group_name(unitn, 'wv_sat_nl', status=ierr) + if (ierr == 0) then + read(unitn, wv_sat_nl, iostat=ierr) + if (ierr /= 0) then + call endrun(subname // ':: ERROR reading namelist') + return + end if + end if + close(unitn) + call freeunit(unitn) + + end if + +#ifdef SPMD +! call mpibcast(wv_sat_scheme, len(wv_sat_scheme) , mpichar, 0, mpicom) +#endif + + if (.not. wv_sat_set_default(wv_sat_scheme)) then + call endrun('wv_sat_readnl :: Invalid wv_sat_scheme.') + return + end if + +end subroutine wv_sat_readnl + +subroutine wv_sat_init + !------------------------------------------------------------------! + ! Purpose: ! + ! Initialize module (e.g. setting parameters, initializing the ! + ! SVP lookup table). ! + !------------------------------------------------------------------! + + use wv_sat_methods, only: wv_sat_methods_init, & + wv_sat_get_scheme_idx, & + wv_sat_valid_idx + use spmd_utils, only: masterproc + use cam_logfile, only: iulog + use cam_abortutils, only: endrun + use shr_assert_mod, only: shr_assert_in_domain + use error_messages, only: handle_errmsg + + integer :: status + + ! For wv_sat_methods error reporting. + character(len=256) :: errstring + + ! For generating internal SVP table. + real(r8) :: t ! Temperature + integer :: i ! Increment counter + + ! Precalculated because so frequently used. + omeps = 1.0_r8 - epsilo + + ! Transition range method is only valid for transition temperatures at: + ! -40 deg C < T < 0 deg C + call shr_assert_in_domain(ttrice, ge=0._r8, le=40._r8, varname="ttrice",& + msg="wv_sat_init: Invalid transition temperature range.") + +! This parameter uses a hardcoded 287.04_r8? + c3 = 287.04_r8*(7.5_r8*log(10._r8))/cpair + +! Init "methods" module containing actual SVP formulae. + + call wv_sat_methods_init(r8, tmelt, h2otrip, tboil, ttrice, & + epsilo, errstring) + + call handle_errmsg(errstring, subname="wv_sat_methods_init") + + ! Add two to make the table slightly too big, just in case. + plenest = ceiling(tmax-tmin) + 2 + + ! Allocate SVP table. + allocate(estbl(plenest), stat=status) + if (status /= 0) then + call endrun('wv_sat_init :: ERROR allocating saturation vapor pressure table') + return + end if + + do i = 1, plenest + estbl(i) = svp_trans(tmin + real(i-1,r8)) + end do + + !$acc update device (plenest,estbl,omeps,c3,pcf) + + if (masterproc) then + write(iulog,*)' *** SATURATION VAPOR PRESSURE TABLE COMPLETED ***' + end if + +end subroutine wv_sat_init + +subroutine wv_sat_final + !------------------------------------------------------------------! + ! Purpose: ! + ! Deallocate global variables in module. ! + !------------------------------------------------------------------! + use cam_abortutils, only: endrun + + integer :: status + + if (allocated(estbl)) then + + deallocate(estbl, stat=status) + + if (status /= 0) then + call endrun('wv_sat_final :: ERROR deallocating table') + return + end if + + end if + +end subroutine wv_sat_final + +!--------------------------------------------------------------------- +! DEFAULT SVP FUNCTIONS +!--------------------------------------------------------------------- + +! Compute saturation vapor pressure over water +function svp_water(t) result(es) + + use wv_sat_methods, only: & + wv_sat_svp_water + + real(r8), intent(in) :: t ! Temperature (K) + real(r8) :: es ! SVP (Pa) + + es = wv_sat_svp_water(t) + +end function svp_water + +! Compute saturation vapor pressure over water +subroutine svp_water_vect(t, es, vlen) + + use wv_sat_methods, only: & + wv_sat_svp_water_vect + + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature (K) + real(r8), intent(out) :: es(vlen) ! SVP (Pa) + + !$acc data copyin (t) copyout (es) + + call wv_sat_svp_water_vect(t, es, vlen) + + !$acc end data +end subroutine svp_water_vect + +! Compute saturation vapor pressure over ice +function svp_ice(t) result(es) + + use wv_sat_methods, only: & + wv_sat_svp_ice + + real(r8), intent(in) :: t ! Temperature (K) + real(r8) :: es ! SVP (Pa) + + es = wv_sat_svp_ice(t) + +end function svp_ice + +! Compute saturation vapor pressure over ice +subroutine svp_ice_vect(t, es, vlen) + + use wv_sat_methods, only: & + wv_sat_svp_ice_vect + + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature (K) + real(r8), intent(out) :: es(vlen) ! SVP (Pa) + + !$acc data copyin(t) copyout(es) + + call wv_sat_svp_ice_vect(t, es, vlen) + + !$acc end data +end subroutine svp_ice_vect + +! Compute saturation vapor pressure with an ice-water transition +function svp_trans(t) result(es) + + use wv_sat_methods, only: & + wv_sat_svp_trans + + real(r8), intent(in) :: t ! Temperature (K) + real(r8) :: es ! SVP (Pa) + + es = wv_sat_svp_trans(t) + +end function svp_trans + +! Compute saturation vapor pressure with an ice-water transition +subroutine svp_trans_vect(t, es, vlen) + + use wv_sat_methods, only: & + wv_sat_svp_trans_vect + + integer, intent(in) :: vlen + real(r8), intent(in) :: t(vlen) ! Temperature (K) + real(r8), intent(out) :: es(vlen) ! SVP (Pa) + + !$acc data copyin(t) copyout(es) + + call wv_sat_svp_trans_vect(t, es, vlen) + + !$acc end data +end subroutine svp_trans_vect + +!--------------------------------------------------------------------- +! UTILITIES +!--------------------------------------------------------------------- + +! Does linear interpolation from nearest values found +! in the table (estbl). +elemental function estblf(t) result(es) + + real(r8), intent(in) :: t ! Temperature + real(r8) :: es ! SVP (Pa) + + integer :: i ! Index for t in the table + real(r8) :: t_tmp ! intermediate temperature for es look-up + + real(r8) :: weight ! Weight for interpolation + + t_tmp = max(min(t,tmax)-tmin, 0._r8) ! Number of table entries above tmin + i = int(t_tmp) + 1 ! Corresponding index. + weight = t_tmp - aint(t_tmp, r8) ! Fractional part of t_tmp (for interpolation). + es = (1._r8 - weight)*estbl(i) + weight*estbl(i+1) + +end function estblf + +! Does linear interpolation from nearest values found +! in the table (estbl). +subroutine estblf_vect(t, es, vlen) + + integer, intent(in) :: vlen + real(r8), dimension(vlen), intent(in) :: t ! Temperature + real(r8), dimension(vlen), intent(out) :: es ! SVP (Pa) + + integer :: i ! Index for t in the table + integer :: j + real(r8) :: t_tmp ! intermediate temperature for es look-up + + real(r8) :: weight ! Weight for interpolation + + !$acc data present (t,es) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector private(t_tmp,weight,i) + do j = 1, vlen + t_tmp = max(min(t(j),tmax)-tmin, 0._r8) ! Number of table entries above tmin + i = int(t_tmp) + 1 ! Corresponding index. + weight = t_tmp - aint(t_tmp, r8) ! Fractional part of t_tmp (for interpolation). + es(j) = (1._r8 - weight)*estbl(i) + weight*estbl(i+1) + end do + !$acc end parallel + + !$acc end data +end subroutine estblf_vect + +! Get enthalpy based only on temperature +! and specific humidity. +elemental function tq_enthalpy(t, q, hltalt) result(enthalpy) + + real(r8), intent(in) :: t ! Temperature + real(r8), intent(in) :: q ! Specific humidity + real(r8), intent(in) :: hltalt ! Modified hlat for T derivatives + + real(r8) :: enthalpy + + enthalpy = cpair * t + hltalt * q + +end function tq_enthalpy + +! Get enthalpy based only on temperature +! and specific humidity. +subroutine tq_enthalpy_vect(t, q, hltalt, enthalpy, vlen) + + integer, intent(in) :: vlen + real(r8), dimension(vlen), intent(in) :: t ! Temperature + real(r8), dimension(vlen), intent(in) :: q ! Specific humidity + real(r8), dimension(vlen), intent(in) :: hltalt ! Modified hlat for T derivatives + + real(r8), dimension(vlen), intent(out) :: enthalpy + + integer :: i + + !$acc data present(t,q,hltalt,enthalpy) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + enthalpy(i) = cpair * t(i) + hltalt(i) * q(i) + end do + !$acc end parallel + + !$acc end data +end subroutine tq_enthalpy_vect + +!--------------------------------------------------------------------- +! LATENT HEAT OF VAPORIZATION CORRECTIONS +!--------------------------------------------------------------------- + +elemental subroutine no_ip_hltalt(t, hltalt) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate latent heat of vaporization of pure liquid water at ! + ! a given temperature. ! + !------------------------------------------------------------------! + + ! Inputs + real(r8), intent(in) :: t ! Temperature + ! Outputs + real(r8), intent(out) :: hltalt ! Appropriately modified hlat + + hltalt = latvap + + ! Account for change of latvap with t above freezing where + ! constant slope is given by -2369 j/(kg c) = cpv - cw + if (t >= tmelt) then + hltalt = hltalt - 2369.0_r8*(t-tmelt) + end if + +end subroutine no_ip_hltalt + +subroutine no_ip_hltalt_vect(t, hltalt, vlen) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate latent heat of vaporization of pure liquid water at ! + ! a given temperature. ! + !------------------------------------------------------------------! + + ! Inputs + integer, intent(in) :: vlen + real(r8), dimension(vlen), intent(in) :: t ! Temperature + ! Outputs + real(r8), dimension(vlen), intent(out) :: hltalt ! Appropriately modified hlat + + integer :: i + + !$acc data present(t,hltalt) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + hltalt(i) = latvap + ! Account for change of latvap with t above freezing where + ! constant slope is given by -2369 j/(kg c) = cpv - cw + if (t(i) >= tmelt) then + hltalt(i) = hltalt(i) - 2369.0_r8*(t(i)-tmelt) + end if + end do + !$acc end parallel + + !$acc end data +end subroutine no_ip_hltalt_vect + +elemental subroutine calc_hltalt(t, hltalt, tterm) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate latent heat of vaporization of water at a given ! + ! temperature, taking into account the ice phase if temperature ! + ! is below freezing. ! + ! Optional argument also calculates a term used to calculate ! + ! d(es)/dT within the water-ice transition range. ! + !------------------------------------------------------------------! + + ! Inputs + real(r8), intent(in) :: t ! Temperature + ! Outputs + real(r8), intent(out) :: hltalt ! Appropriately modified hlat + ! Term to account for d(es)/dT in transition region. + real(r8), intent(out), optional :: tterm + + ! Local variables + real(r8) :: tc ! Temperature in degrees C + real(r8) :: weight ! Weight for es transition from water to ice + ! Loop iterator + integer :: i + + if (present(tterm)) tterm = 0.0_r8 + + call no_ip_hltalt(t,hltalt) + if (t < tmelt) then + ! Weighting of hlat accounts for transition from water to ice. + tc = t - tmelt + + if (tc >= -ttrice) then + weight = -tc/ttrice + + ! polynomial expression approximates difference between es + ! over water and es over ice from 0 to -ttrice (C) (max of + ! ttrice is 40): required for accurate estimate of es + ! derivative in transition range from ice to water + if (present(tterm)) then + do i = size(pcf), 1, -1 + tterm = pcf(i) + tc*tterm + end do + tterm = tterm/ttrice + end if + + else + weight = 1.0_r8 + end if + + hltalt = hltalt + weight*latice + + end if + +end subroutine calc_hltalt + +subroutine calc_hltalt_vect(t, hltalt, vlen, tterm) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate latent heat of vaporization of water at a given ! + ! temperature, taking into account the ice phase if temperature ! + ! is below freezing. ! + ! Optional argument also calculates a term used to calculate ! + ! d(es)/dT within the water-ice transition range. ! + !------------------------------------------------------------------! + + ! Inputs + integer, intent(in) :: vlen + real(r8), dimension(vlen), intent(in) :: t ! Temperature + ! Outputs + real(r8), dimension(vlen), intent(out) :: hltalt ! Appropriately modified hlat + ! Term to account for d(es)/dT in transition region. + real(r8), dimension(vlen), intent(out), optional :: tterm + + ! Local variables + real(r8) :: tc ! Temperature in degrees C + real(r8) :: weight ! Weight for es transition from water to ice + logical :: present_tterm + ! Loop iterator + integer :: i, j, size_pcf + + present_tterm = present(tterm) + size_pcf = size(pcf) + + !$acc data present(t,hltalt,tterm) + + if (present_tterm) then + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + tterm(i) = 0.0_r8 + end do + !$acc end parallel + end if + + call no_ip_hltalt_vect(t,hltalt,vlen) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector private(tc,weight) + do j = 1, vlen + if (t(j) < tmelt) then + ! Weighting of hlat accounts for transition from water to ice. + tc = t(j) - tmelt + + if (tc >= -ttrice) then + weight = -tc/ttrice + + ! polynomial expression approximates difference between es + ! over water and es over ice from 0 to -ttrice (C) (max of + ! ttrice is 40): required for accurate estimate of es + ! derivative in transition range from ice to water + if (present_tterm) then + !$acc loop seq + do i = size_pcf, 1, -1 + tterm(j) = pcf(i) + tc*tterm(j) + end do + tterm(j) = tterm(j)/ttrice + end if + + else + weight = 1.0_r8 + end if + + hltalt(j) = hltalt(j) + weight*latice + + end if + end do + !$acc end parallel + + !$acc end data +end subroutine calc_hltalt_vect + +!--------------------------------------------------------------------- +! OPTIONAL OUTPUTS +!--------------------------------------------------------------------- + +! Temperature derivative outputs, for qsat_* +subroutine deriv_outputs_line(t, p, es, qs, hltalt, tterm, & + gam, dqsdt) + + ! Inputs + real(r8), intent(in) :: t ! Temperature + real(r8), intent(in) :: p ! Pressure + real(r8), intent(in) :: es ! Saturation vapor pressure + real(r8), intent(in) :: qs ! Saturation specific humidity + real(r8), intent(in) :: hltalt ! Modified latent heat + real(r8), intent(in) :: tterm ! Extra term for d(es)/dT in + ! transition region. + + ! Outputs + real(r8), intent(out), optional :: gam ! (hltalt/cpair)*(d(qs)/dt) + real(r8), intent(out), optional :: dqsdt ! (d(qs)/dt) + + ! Local variables + real(r8) :: desdt ! d(es)/dt + real(r8) :: dqsdt_loc ! local copy of dqsdt + + if (qs == 1.0_r8) then + dqsdt_loc = 0._r8 + else + desdt = hltalt*es/(rh2o*t*t) + tterm + dqsdt_loc = qs*p*desdt/(es*(p-omeps*es)) + end if + + if (present(dqsdt)) dqsdt = dqsdt_loc + if (present(gam)) gam = dqsdt_loc * (hltalt/cpair) + +end subroutine deriv_outputs_line + +! Temperature derivative outputs, for qsat_* +subroutine deriv_outputs_vect(t, p, es, qs, hltalt, tterm, vlen, & + gam, dqsdt) + + ! Inputs + integer, intent(in) :: vlen + real(r8), dimension(vlen), intent(in) :: t ! Temperature + real(r8), dimension(vlen), intent(in) :: p ! Pressure + real(r8), dimension(vlen), intent(in) :: es ! Saturation vapor pressure + real(r8), dimension(vlen), intent(in) :: qs ! Saturation specific humidity + real(r8), dimension(vlen), intent(in) :: hltalt ! Modified latent heat + real(r8), dimension(vlen), intent(in) :: tterm ! Extra term for d(es)/dT in + ! transition region. + + ! Outputs + real(r8), dimension(vlen), intent(out), optional :: gam ! (hltalt/cpair)*(d(qs)/dt) + real(r8), dimension(vlen), intent(out), optional :: dqsdt ! (d(qs)/dt) + + ! Local variables + real(r8) :: desdt ! d(es)/dt + real(r8) :: dqsdt_loc ! local copy of dqsdt + logical :: present_dqsdt, present_gam + integer :: i + + present_dqsdt = present(dqsdt) + present_gam = present(gam) + + !$acc data present(t,p,es,qs,hltalt,tterm,gam,dqsdt) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector private(dqsdt_loc,desdt) + do i = 1, vlen + if (qs(i) == 1.0_r8) then + dqsdt_loc = 0._r8 + else + desdt = hltalt(i)*es(i)/(rh2o*t(i)*t(i)) + tterm(i) + dqsdt_loc = qs(i)*p(i)*desdt/(es(i)*(p(i)-omeps*es(i))) + end if + + if (present_dqsdt) dqsdt(i) = dqsdt_loc + if (present_gam) gam(i) = dqsdt_loc * (hltalt(i)/cpair) + end do + !$acc end parallel + + !$acc end data +end subroutine deriv_outputs_vect + +!--------------------------------------------------------------------- +! QSAT (SPECIFIC HUMIDITY) PROCEDURES +!--------------------------------------------------------------------- + +subroutine qsat_line(t, p, es, qs, gam, dqsdt, enthalpy) + !------------------------------------------------------------------! + ! Purpose: ! + ! Look up and return saturation vapor pressure from precomputed ! + ! table, then calculate and return saturation specific humidity. ! + ! Optionally return various temperature derivatives or enthalpy ! + ! at saturation. ! + !------------------------------------------------------------------! + + ! Inputs + real(r8), intent(in) :: t ! Temperature + real(r8), intent(in) :: p ! Pressure + ! Outputs + real(r8), intent(out) :: es ! Saturation vapor pressure + real(r8), intent(out) :: qs ! Saturation specific humidity + + real(r8), intent(out), optional :: gam ! (l/cpair)*(d(qs)/dt) + real(r8), intent(out), optional :: dqsdt ! (d(qs)/dt) + real(r8), intent(out), optional :: enthalpy ! cpair*t + hltalt*q + + ! Local variables + real(r8) :: hltalt ! Modified latent heat for T derivatives + real(r8) :: tterm ! Account for d(es)/dT in transition region + + es = estblf(t) + + qs = svp_to_qsat(es, p) + + ! Ensures returned es is consistent with limiters on qs. + es = min(es, p) + + ! Calculate optional arguments. + if (present(gam) .or. present(dqsdt) .or. present(enthalpy)) then + + ! "generalized" analytic expression for t derivative of es + ! accurate to within 1 percent for 173.16 < t < 373.16 + call calc_hltalt(t, hltalt, tterm) + + if (present(enthalpy)) enthalpy = tq_enthalpy(t, qs, hltalt) + + call deriv_outputs_line(t, p, es, qs, hltalt, tterm, & + gam=gam, dqsdt=dqsdt) + + end if + +end subroutine qsat_line + +subroutine qsat_vect(t, p, es, qs, vlen, gam, dqsdt, enthalpy) + !------------------------------------------------------------------! + ! Purpose: ! + ! Look up and return saturation vapor pressure from precomputed ! + ! table, then calculate and return saturation specific humidity. ! + ! Optionally return various temperature derivatives or enthalpy ! + ! at saturation. ! + !------------------------------------------------------------------! + + ! Inputs + integer, intent(in) :: vlen + real(r8), dimension(vlen), intent(in) :: t ! Temperature + real(r8), dimension(vlen), intent(in) :: p ! Pressure + ! Outputs + real(r8), dimension(vlen), intent(out) :: es ! Saturation vapor pressure + real(r8), dimension(vlen), intent(out) :: qs ! Saturation specific humidity + + real(r8), dimension(vlen), intent(out), optional :: gam ! (l/cpair)*(d(qs)/dt) + real(r8), dimension(vlen), intent(out), optional :: dqsdt ! (d(qs)/dt) + real(r8), dimension(vlen), intent(out), optional :: enthalpy ! cpair*t + hltalt*q + + ! Local variables + real(r8), dimension(vlen) :: hltalt ! Modified latent heat for T derivatives + real(r8), dimension(vlen) :: tterm ! Account for d(es)/dT in transition region + integer :: i + logical :: present_gam, present_dqsdt, present_enthalpy + + present_gam = present(gam) + present_dqsdt = present(dqsdt) + present_enthalpy = present(enthalpy) + + !$acc data copyin (t,p) & + !$acc copyout (es,qs,gam,dqsdt,enthalpy) & + !$acc create (hltalt,tterm) + + call estblf_vect(t, es, vlen) + + call svp_to_qsat_vect(es, p, qs, vlen) + + ! Ensures returned es is consistent with limiters on qs. + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + es(i) = min(es(i), p(i)) + end do + !$acc end parallel + + ! Calculate optional arguments. + if (present_gam .or. present_dqsdt .or. present_enthalpy) then + + ! "generalized" analytic expression for t derivative of es + ! accurate to within 1 percent for 173.16 < t < 373.16 + call calc_hltalt_vect(t, hltalt, vlen, tterm) + + if (present_enthalpy) call tq_enthalpy_vect(t, qs, hltalt, enthalpy, vlen) + + call deriv_outputs_vect(t, p, es, qs, hltalt, tterm, vlen, & + gam=gam, dqsdt=dqsdt) + + end if + + !$acc end data +end subroutine qsat_vect + +subroutine qsat_2D(t, p, es, qs, dim1, dim2, gam, dqsdt, enthalpy) + !------------------------------------------------------------------! + ! Purpose: ! + ! Look up and return saturation vapor pressure from precomputed ! + ! table, then calculate and return saturation specific humidity. ! + ! Optionally return various temperature derivatives or enthalpy ! + ! at saturation. ! + !------------------------------------------------------------------! + + ! Inputs + integer, intent(in) :: dim1, dim2 + real(r8), dimension(dim1,dim2), intent(in) :: t ! Temperature + real(r8), dimension(dim1,dim2), intent(in) :: p ! Pressure + ! Outputs + real(r8), dimension(dim1,dim2), intent(out) :: es ! Saturation vapor pressure + real(r8), dimension(dim1,dim2), intent(out) :: qs ! Saturation specific humidity + + real(r8), dimension(dim1,dim2), intent(out), optional :: gam ! (l/cpair)*(d(qs)/dt) + real(r8), dimension(dim1,dim2), intent(out), optional :: dqsdt ! (d(qs)/dt) + real(r8), dimension(dim1,dim2), intent(out), optional :: enthalpy ! cpair*t + hltalt*q + + ! Local variables + real(r8), dimension(dim1,dim2) :: hltalt ! Modified latent heat for T derivatives + real(r8), dimension(dim1,dim2) :: tterm ! Account for d(es)/dT in transition region + integer :: i, k, vlen + logical :: present_gam, present_dqsdt, present_enthalpy + + vlen = dim1 * dim2 + present_gam = present(gam) + present_dqsdt = present(dqsdt) + present_enthalpy = present(enthalpy) + + !$acc data copyin (t,p) & + !$acc copyout (es,qs,gam,dqsdt,enthalpy) & + !$acc create (hltalt,tterm) + + call estblf_vect(t, es, vlen) + + call svp_to_qsat_vect(es, p, qs, vlen) + + ! Ensures returned es is consistent with limiters on qs. + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector collapse(2) + do k = 1, dim2 + do i = 1, dim1 + es(i,k) = min(es(i,k), p(i,k)) + end do + end do + !$acc end parallel + + ! Calculate optional arguments. + if (present_gam .or. present_dqsdt .or. present_enthalpy) then + + ! "generalized" analytic expression for t derivative of es + ! accurate to within 1 percent for 173.16 < t < 373.16 + call calc_hltalt_vect(t, hltalt, vlen, tterm) + + if (present_enthalpy) call tq_enthalpy_vect(t, qs, hltalt, enthalpy, vlen) + + call deriv_outputs_vect(t, p, es, qs, hltalt, tterm, vlen, & + gam=gam, dqsdt=dqsdt) + + end if + + !$acc end data +end subroutine qsat_2D + +subroutine qsat_water_line(t, p, es, qs, gam, dqsdt, enthalpy) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over water at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + ! Optionally return various temperature derivatives or enthalpy ! + ! at saturation. ! + !------------------------------------------------------------------! + + use wv_sat_methods, only: wv_sat_qsat_water + + ! Inputs + real(r8), intent(in) :: t ! Temperature + real(r8), intent(in) :: p ! Pressure + ! Outputs + real(r8), intent(out) :: es ! Saturation vapor pressure + real(r8), intent(out) :: qs ! Saturation specific humidity + + real(r8), intent(out), optional :: gam ! (l/cpair)*(d(qs)/dt) + real(r8), intent(out), optional :: dqsdt ! (d(qs)/dt) + real(r8), intent(out), optional :: enthalpy ! cpair*t + hltalt*q + + ! Local variables + real(r8) :: hltalt ! Modified latent heat for T derivatives + + call wv_sat_qsat_water(t, p, es, qs) + + if (present(gam) .or. present(dqsdt) .or. present(enthalpy)) then + + ! "generalized" analytic expression for t derivative of es + ! accurate to within 1 percent for 173.16 < t < 373.16 + call no_ip_hltalt(t, hltalt) + + if (present(enthalpy)) enthalpy = tq_enthalpy(t, qs, hltalt) + + ! For pure water/ice transition term is 0. + call deriv_outputs_line(t, p, es, qs, hltalt, 0._r8, & + gam=gam, dqsdt=dqsdt) + + end if + +end subroutine qsat_water_line + +subroutine qsat_water_vect(t, p, es, qs, vlen, gam, dqsdt, enthalpy) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over water at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + ! Optionally return various temperature derivatives or enthalpy ! + ! at saturation. ! + !------------------------------------------------------------------! + + use wv_sat_methods, only: wv_sat_qsat_water_vect + + ! Inputs + integer, intent(in) :: vlen + real(r8), dimension(vlen), intent(in) :: t ! Temperature + real(r8), dimension(vlen), intent(in) :: p ! Pressure + ! Outputs + real(r8), dimension(vlen), intent(out) :: es ! Saturation vapor pressure + real(r8), dimension(vlen), intent(out) :: qs ! Saturation specific humidity + + real(r8), dimension(vlen), intent(out), optional :: gam ! (l/cpair)*(d(qs)/dt) + real(r8), dimension(vlen), intent(out), optional :: dqsdt ! (d(qs)/dt) + real(r8), dimension(vlen), intent(out), optional :: enthalpy ! cpair*t + hltalt*q + + ! Local variables + real(r8), dimension(vlen) :: hltalt ! Modified latent heat for T derivatives + real(r8), dimension(vlen) :: tterm + integer :: i + logical :: present_gam, present_dqsdt, present_enthalpy + + present_gam = present(gam) + present_dqsdt = present(dqsdt) + present_enthalpy = present(enthalpy) + + !$acc data copyin (t,p) & + !$acc copyout (es,qs,gam,dqsdt,enthalpy) & + !$acc create (tterm,hltalt) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + tterm(i) = 0._r8 + end do + !$acc end parallel + + call wv_sat_qsat_water_vect(t, p, es, qs, vlen) + + if (present_gam .or. present_dqsdt .or. present_enthalpy) then + + ! "generalized" analytic expression for t derivative of es + ! accurate to within 1 percent for 173.16 < t < 373.16 + call no_ip_hltalt_vect(t, hltalt, vlen) + + if (present_enthalpy) call tq_enthalpy_vect(t, qs, hltalt, enthalpy, vlen) + + ! For pure water/ice transition term is 0. + call deriv_outputs_vect(t, p, es, qs, hltalt, tterm, vlen, & + gam=gam, dqsdt=dqsdt) + + end if + + !$acc end data +end subroutine qsat_water_vect + +subroutine qsat_water_2D(t, p, es, qs, dim1, dim2, gam, dqsdt, enthalpy) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over water at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + ! Optionally return various temperature derivatives or enthalpy ! + ! at saturation. ! + !------------------------------------------------------------------! + + use wv_sat_methods, only: wv_sat_qsat_water_vect + + ! Inputs + integer, intent(in) :: dim1, dim2 + real(r8), dimension(dim1,dim2), intent(in) :: t ! Temperature + real(r8), dimension(dim1,dim2), intent(in) :: p ! Pressure + ! Outputs + real(r8), dimension(dim1,dim2), intent(out) :: es ! Saturation vapor pressure + real(r8), dimension(dim1,dim2), intent(out) :: qs ! Saturation specific humidity + + real(r8), dimension(dim1,dim2), intent(out), optional :: gam ! (l/cpair)*(d(qs)/dt) + real(r8), dimension(dim1,dim2), intent(out), optional :: dqsdt ! (d(qs)/dt) + real(r8), dimension(dim1,dim2), intent(out), optional :: enthalpy ! cpair*t + hltalt*q + + ! Local variables + real(r8), dimension(dim1,dim2) :: hltalt ! Modified latent heat for T derivatives + real(r8), dimension(dim1,dim2) :: tterm + integer :: i, k, vlen + logical :: present_gam, present_dqsdt, present_enthalpy + + vlen = dim1 * dim2 + present_gam = present(gam) + present_dqsdt = present(dqsdt) + present_enthalpy = present(enthalpy) + + !$acc data copyin (t,p) & + !$acc copyout (es,qs,gam,dqsdt,enthalpy) & + !$acc create (hltalt,tterm) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector collapse(2) + do k = 1, dim2 + do i = 1, dim1 + tterm(i,k) = 0._r8 + end do + end do + !$acc end parallel + + call wv_sat_qsat_water_vect(t, p, es, qs, vlen) + + if (present_gam .or. present_dqsdt .or. present_enthalpy) then + + ! "generalized" analytic expression for t derivative of es + ! accurate to within 1 percent for 173.16 < t < 373.16 + call no_ip_hltalt_vect(t, hltalt, vlen) + + if (present_enthalpy) call tq_enthalpy_vect(t, qs, hltalt, enthalpy, vlen) + + ! For pure water/ice transition term is 0. + call deriv_outputs_vect(t, p, es, qs, hltalt, tterm, vlen, & + gam=gam, dqsdt=dqsdt) + + end if + + !$acc end data +end subroutine qsat_water_2D + +subroutine qsat_ice_line(t, p, es, qs, gam, dqsdt, enthalpy) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over ice at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + ! Optionally return various temperature derivatives or enthalpy ! + ! at saturation. ! + !------------------------------------------------------------------! + + use wv_sat_methods, only: wv_sat_qsat_ice + + ! Inputs + real(r8), intent(in) :: t ! Temperature + real(r8), intent(in) :: p ! Pressure + ! Outputs + real(r8), intent(out) :: es ! Saturation vapor pressure + real(r8), intent(out) :: qs ! Saturation specific humidity + + real(r8), intent(out), optional :: gam ! (l/cpair)*(d(qs)/dt) + real(r8), intent(out), optional :: dqsdt ! (d(qs)/dt) + real(r8), intent(out), optional :: enthalpy ! cpair*t + hltalt*q + + ! Local variables + real(r8) :: hltalt ! Modified latent heat for T derivatives + + call wv_sat_qsat_ice(t, p, es, qs) + + if (present(gam) .or. present(dqsdt) .or. present(enthalpy)) then + + ! For pure ice, just add latent heats. + hltalt = latvap + latice + + if (present(enthalpy)) enthalpy = tq_enthalpy(t, qs, hltalt) + + ! For pure water/ice transition term is 0. + call deriv_outputs_line(t, p, es, qs, hltalt, 0._r8, & + gam=gam, dqsdt=dqsdt) + + end if + +end subroutine qsat_ice_line + +subroutine qsat_ice_vect(t, p, es, qs, vlen, gam, dqsdt, enthalpy) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over ice at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + ! Optionally return various temperature derivatives or enthalpy ! + ! at saturation. ! + !------------------------------------------------------------------! + + use wv_sat_methods, only: wv_sat_qsat_ice_vect + + ! Inputs + integer, intent(in) :: vlen + real(r8), dimension(vlen), intent(in) :: t ! Temperature + real(r8), dimension(vlen), intent(in) :: p ! Pressure + ! Outputs + real(r8), dimension(vlen), intent(out) :: es ! Saturation vapor pressure + real(r8), dimension(vlen), intent(out) :: qs ! Saturation specific humidity + + real(r8), dimension(vlen), intent(out), optional :: gam ! (l/cpair)*(d(qs)/dt) + real(r8), dimension(vlen), intent(out), optional :: dqsdt ! (d(qs)/dt) + real(r8), dimension(vlen), intent(out), optional :: enthalpy ! cpair*t + hltalt*q + + ! Local variables + real(r8), dimension(vlen) :: hltalt ! Modified latent heat for T derivatives + real(r8), dimension(vlen) :: tterm + integer :: i + logical :: present_gam, present_dqsdt, present_enthalpy + + present_gam = present(gam) + present_dqsdt = present(dqsdt) + present_enthalpy = present(enthalpy) + + !$acc data copyin (t,p) & + !$acc copyout (es,qs,gam,dqsdt,enthalpy) & + !$acc create (hltalt,tterm) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + tterm(i) = 0._r8 + end do + !$acc end parallel + + call wv_sat_qsat_ice_vect(t, p, es, qs, vlen) + + if (present_gam .or. present_dqsdt .or. present_enthalpy) then + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector + do i = 1, vlen + ! For pure ice, just add latent heats. + hltalt(i) = latvap + latice + end do + !$acc end parallel + + if (present_enthalpy) call tq_enthalpy_vect(t, qs, hltalt, enthalpy, vlen) + + ! For pure water/ice transition term is 0. + call deriv_outputs_vect(t, p, es, qs, hltalt, tterm, vlen, & + gam=gam, dqsdt=dqsdt) + + end if + + !$acc end data +end subroutine qsat_ice_vect + +subroutine qsat_ice_2D(t, p, es, qs, dim1, dim2, gam, dqsdt, enthalpy) + !------------------------------------------------------------------! + ! Purpose: ! + ! Calculate SVP over ice at a given temperature, and then ! + ! calculate and return saturation specific humidity. ! + ! Optionally return various temperature derivatives or enthalpy ! + ! at saturation. ! + !------------------------------------------------------------------! + + use wv_sat_methods, only: wv_sat_qsat_ice_vect + + ! Inputs + integer, intent(in) :: dim1, dim2 + real(r8), dimension(dim1,dim2), intent(in) :: t ! Temperature + real(r8), dimension(dim1,dim2), intent(in) :: p ! Pressure + ! Outputs + real(r8), dimension(dim1,dim2), intent(out) :: es ! Saturation vapor pressure + real(r8), dimension(dim1,dim2), intent(out) :: qs ! Saturation specific humidity + + real(r8), dimension(dim1,dim2), intent(out), optional :: gam ! (l/cpair)*(d(qs)/dt) + real(r8), dimension(dim1,dim2), intent(out), optional :: dqsdt ! (d(qs)/dt) + real(r8), dimension(dim1,dim2), intent(out), optional :: enthalpy ! cpair*t + hltalt*q + + ! Local variables + real(r8), dimension(dim1,dim2) :: hltalt ! Modified latent heat for T derivatives + real(r8), dimension(dim1,dim2) :: tterm + integer :: i, k, vlen + logical :: present_gam, present_dqsdt, present_enthalpy + + vlen = dim1 * dim2 + present_gam = present(gam) + present_dqsdt = present(dqsdt) + present_enthalpy = present(enthalpy) + + !$acc data copyin (t,p) & + !$acc copyout (es,qs,gam,dqsdt,enthalpy) & + !$acc create (hltalt,tterm) + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector collapse(2) + do k = 1, dim2 + do i = 1, dim1 + tterm(i,k) = 0._r8 + end do + end do + !$acc end parallel + + call wv_sat_qsat_ice_vect(t, p, es, qs, vlen) + + if (present_gam .or. present_dqsdt .or. present_enthalpy) then + + !$acc parallel vector_length(VLENS) default(present) + !$acc loop gang vector collapse(2) + do k = 1, dim2 + do i = 1, dim1 + ! For pure ice, just add latent heats. + hltalt(i,k) = latvap + latice + end do + end do + !$acc end parallel + + if (present_enthalpy) call tq_enthalpy_vect(t, qs, hltalt, enthalpy, vlen) + + ! For pure water/ice transition term is 0. + call deriv_outputs_vect(t, p, es, qs, hltalt, tterm, vlen, & + gam=gam, dqsdt=dqsdt) + + end if + + !$acc end data +end subroutine qsat_ice_2D + +!--------------------------------------------------------------------- +! FINDSP (WET BULB TEMPERATURE) PROCEDURES +!--------------------------------------------------------------------- + +subroutine findsp_vc(q, t, p, use_ice, tsp, qsp) + + use cam_logfile, only: iulog + use cam_abortutils, only: endrun + + ! Wrapper for findsp which is 1D and handles the output status. + ! Changing findsp to elemental restricted debugging output. + ! If that output is needed again, it's preferable *not* to copy findsp, + ! but to change the existing version. + + ! input arguments + real(r8), intent(in) :: q(:) ! water vapor (kg/kg) + real(r8), intent(in) :: t(:) ! temperature (K) + real(r8), intent(in) :: p(:) ! pressure (Pa) + logical, intent(in) :: use_ice ! flag to include ice phase in calculations + + ! output arguments + real(r8), intent(out) :: tsp(:) ! saturation temp (K) + real(r8), intent(out) :: qsp(:) ! saturation mixing ratio (kg/kg) + + integer :: status(size(q)) ! flag representing state of output + ! 0 => Successful convergence + ! 1 => No calculation done: pressure or specific + ! humidity not within usable range + ! 2 => Run failed to converge + ! 4 => Temperature fell below minimum + ! 8 => Enthalpy not conserved + + integer :: n, i + + n = size(q) + + ! Currently, only 2 and 8 seem to be treated as fatal errors. + do i = 1,n + call findsp(q(i), t(i), p(i), use_ice, tsp(i), qsp(i), status(i)) + if (status(i) == 2) then + write(iulog,*) ' findsp not converging at i = ', i + write(iulog,*) ' t, q, p ', t(i), q(i), p(i) + write(iulog,*) ' tsp, qsp ', tsp(i), qsp(i) + call endrun ('wv_saturation::FINDSP -- not converging') + else if (status(i) == 8) then + write(iulog,*) ' the enthalpy is not conserved at i = ', i + write(iulog,*) ' t, q, p ', t(i), q(i), p(i) + write(iulog,*) ' tsp, qsp ', tsp(i), qsp(i) + call endrun ('wv_saturation::FINDSP -- enthalpy is not conserved') + endif + end do + +end subroutine findsp_vc + +subroutine findsp (q, t, p, use_ice, tsp, qsp, status) +!----------------------------------------------------------------------- +! +! Purpose: +! find the wet bulb temperature for a given t and q +! in a longitude height section +! wet bulb temp is the temperature and spec humidity that is +! just saturated and has the same enthalpy +! if q > qs(t) then tsp > t and qsp = qs(tsp) < q +! if q < qs(t) then tsp < t and qsp = qs(tsp) > q +! +! Method: +! a Newton method is used +! first guess uses an algorithm provided by John Petch from the UKMO +! we exclude points where the physical situation is unrealistic +! e.g. where the temperature is outside the range of validity for the +! saturation vapor pressure, or where the water vapor pressure +! exceeds the ambient pressure, or the saturation specific humidity is +! unrealistic +! +! Author: P. Rasch +! +!----------------------------------------------------------------------- +! +! input arguments +! + + real(r8), intent(in) :: q ! water vapor (kg/kg) + real(r8), intent(in) :: t ! temperature (K) + real(r8), intent(in) :: p ! pressure (Pa) + logical, intent(in) :: use_ice ! flag to include ice phase in calculations +! +! output arguments +! + real(r8), intent(out) :: tsp ! saturation temp (K) + real(r8), intent(out) :: qsp ! saturation mixing ratio (kg/kg) + integer, intent(out) :: status ! flag representing state of output + ! 0 => Successful convergence + ! 1 => No calculation done: pressure or specific + ! humidity not within usable range + ! 2 => Run failed to converge + ! 4 => Temperature fell below minimum + ! 8 => Enthalpy not conserved +! +! local variables +! + integer, parameter :: iter = 8 ! max number of times to iterate the calculation + integer :: l ! iterator + + real(r8) es ! sat. vapor pressure + real(r8) gam ! change in sat spec. hum. wrt temperature (times hltalt/cpair) + real(r8) dgdt ! work variable + real(r8) g ! work variable + real(r8) hltalt ! lat. heat. of vap. + real(r8) qs ! spec. hum. of water vapor + +! work variables + real(r8) t1, q1, dt, dq + real(r8) qvd + real(r8) r1b, c1, c2 + real(r8), parameter :: dttol = 1.e-4_r8 ! the relative temp error tolerance required to quit the iteration + real(r8), parameter :: dqtol = 1.e-4_r8 ! the relative moisture error tolerance required to quit the iteration + real(r8) enin, enout + + ! Saturation specific humidity at this temperature + if (use_ice) then + call qsat(t, p, es, qs) + else + call qsat_water(t, p, es, qs) + end if + + ! make sure a meaningful calculation is possible + if (p <= 5._r8*es .or. qs <= 0._r8 .or. qs >= 0.5_r8 & + .or. t < tmin .or. t > tmax) then + status = 1 + ! Keep initial parameters when conditions aren't suitable + tsp = t + qsp = q + enin = 1._r8 + enout = 1._r8 + + return + end if + + ! Prepare to iterate + status = 2 + + ! Get initial enthalpy + if (use_ice) then + call calc_hltalt(t,hltalt) + else + call no_ip_hltalt(t,hltalt) + end if + enin = tq_enthalpy(t, q, hltalt) + + ! make a guess at the wet bulb temp using a UKMO algorithm (from J. Petch) + c1 = hltalt*c3 + c2 = (t + 36._r8)**2 + r1b = c2/(c2 + c1*qs) + qvd = r1b * (q - qs) + tsp = t + ((hltalt/cpair)*qvd) + + ! Generate qsp, gam, and enout from tsp. + if (use_ice) then + call qsat(tsp, p, es, qsp, gam=gam, enthalpy=enout) + else + call qsat_water(tsp, p, es, qsp, gam=gam, enthalpy=enout) + end if + + ! iterate on first guess + do l = 1, iter + + g = enin - enout + dgdt = -cpair * (1 + gam) + + ! New tsp + t1 = tsp - g/dgdt + dt = abs(t1 - tsp)/t1 + tsp = t1 + + ! bail out if past end of temperature range + if ( tsp < tmin ) then + tsp = tmin + ! Get latent heat and set qsp to a value + ! that preserves enthalpy. + if (use_ice) then + call calc_hltalt(tsp,hltalt) + else + call no_ip_hltalt(tsp,hltalt) + end if + qsp = (enin - cpair*tsp)/hltalt + enout = tq_enthalpy(tsp, qsp, hltalt) + status = 4 + exit + end if + + ! Re-generate qsp, gam, and enout from new tsp. + if (use_ice) then + call qsat(tsp, p, es, q1, gam=gam, enthalpy=enout) + else + call qsat_water(tsp, p, es, q1, gam=gam, enthalpy=enout) + end if + dq = abs(q1 - qsp)/max(q1,1.e-12_r8) + qsp = q1 + + ! if converged at this point, exclude it from more iterations + if (dt < dttol .and. dq < dqtol) then + status = 0 + exit + endif + end do + + ! Test for enthalpy conservation + if (abs((enin-enout)/(enin+enout)) > 1.e-4_r8) status = 8 + +end subroutine findsp + +end module wv_saturation diff --git a/zhang_mcfarlane/zm_conv_convtran.F90 b/zhang_mcfarlane/zm_conv_convtran.F90 index a90371be..df050fe5 100644 --- a/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/zhang_mcfarlane/zm_conv_convtran.F90 @@ -22,7 +22,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & doconvtran,q ,ncnst ,mu ,md , & du ,eu ,ed ,dp ,dsubcld , & jt ,mx ,ideep ,il1g ,il2g , & - nstep ,fracis ,dqdt ,dpdry ,dt) + nstep ,fracis ,dqdt ,dpdry ,dt, const_metadata, errflg, errmsg) ! ccpp_constituent_properties - standard name -- see chat !----------------------------------------------------------------------- @@ -39,8 +39,10 @@ subroutine zm_conv_convtran_run(ncol, pver, & ! Author: P. Rasch ! !----------------------------------------------------------------------- - use constituents, only: cnst_get_type_byind - use ccpp_constituent_prop_mod, only: ccpp_const_props +! use constituents, only: cnst_get_type_byind +! use ccpp_constituent_prop_mod, only: ccpp_const_props + use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t + implicit none !----------------------------------------------------------------------- @@ -72,7 +74,9 @@ subroutine zm_conv_convtran_run(ncol, pver, & real(kind_phys), intent(in) :: dt ! 2 delta t (model time increment) - + type(ccpp_constituent_prop_ptr_t), intent(in) :: const_metadata(:) + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg ! input/output @@ -137,7 +141,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & !CACNOTE - This should probably loop 1, ncnst - figure out what was being done for 1 do m = 1, ncnst - call ccpp_const_props(m)%standard_name(standard_name) + call const_metadata(m)%standard_name(standard_name) write(0,*) ' standard_name=',standard_name if (standard_name == 'water_vapor_wrt_moist_air_and_condensed_water') then cycle @@ -146,9 +150,8 @@ subroutine zm_conv_convtran_run(ncol, pver, & if (doconvtran(m)) then ! if (cnst_get_type_byind(m).eq.'dry') then - call ccpp_const_props(m)%is_dry(is_dry) + call const_metadata(m)%is_dry(is_dry, errflg, errmsg) write(0,*) ' is_dry=', is_dry - write(0,*) ' cnst_get_type_byind(m)=',cnst_get_type_byind(m) if (is_dry) then do k = 1,pver do i =il1g,il2g diff --git a/zhang_mcfarlane/zm_conv_convtran.meta b/zhang_mcfarlane/zm_conv_convtran.meta index 95e3650c..5497eda4 100644 --- a/zhang_mcfarlane/zm_conv_convtran.meta +++ b/zhang_mcfarlane/zm_conv_convtran.meta @@ -143,3 +143,17 @@ type = ccpp_constituent_prop_ptr_t dimensions = (number_of_ccpp_constituents) intent = in +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out diff --git a/zhang_mcfarlane/zm_conv_evap.F90 b/zhang_mcfarlane/zm_conv_evap.F90 index 890bf899..74dfa9f8 100644 --- a/zhang_mcfarlane/zm_conv_evap.F90 +++ b/zhang_mcfarlane/zm_conv_evap.F90 @@ -3,7 +3,7 @@ module zm_conv_evap use ccpp_kinds, only: kind_phys ! CACNOTE - Need to ccpp'ize cloud_fraction - use cloud_fraction, only: cldfrc_fice +! use cloud_fraction_fice, only: cldfrc_fice implicit none @@ -115,12 +115,14 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & do k = 1,pver call qsat(t(1:ncol,k), pmid(1:ncol,k), es(1:ncol,k), qs(1:ncol,k), ncol) end do -! determine ice fraction in rain production (use cloud water parameterization fraction at present) -!REMOVECAM - no longer need these when CAM is retired and pcols no longer exists - fice(:,:) = 0._kind_phys - fsnow_conv(:,:) = 0._kind_phys -!REMOVECAM_END - call cldfrc_fice(ncol, t(1:ncol,:), fice(1:ncol,:), fsnow_conv(1:ncol,:)) + +! CACNOTE Now it's own scheme +!!! determine ice fraction in rain production (use cloud water parameterization fraction at present) +!!!REMOVECAM - no longer need these when CAM is retired and pcols no longer exists +!! fice(:,:) = 0._kind_phys +!! fsnow_conv(:,:) = 0._kind_phys +!!!REMOVECAM_END +!!! call cldfrc_fice_run(ncol, t(1:ncol,:), tmelt, fice(1:ncol,:), fsnow_conv(1:ncol,:)) ! zero the flux integrals on the top boundary flxprec(:ncol,1) = 0._kind_phys diff --git a/zhang_mcfarlane/zm_conv_evap.meta b/zhang_mcfarlane/zm_conv_evap.meta index 4fb11721..d59b442e 100644 --- a/zhang_mcfarlane/zm_conv_evap.meta +++ b/zhang_mcfarlane/zm_conv_evap.meta @@ -1,6 +1,8 @@ [ccpp-table-properties] name = zm_conv_evap type = scheme + dependencies = ../to_be_ccppized/wv_saturation.F90 + dependencies = ../cloud_fraction/cloud_fraction_fice.F90 [ccpp-arg-table] name = zm_conv_evap_run diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index 98b2b4e8..222aab51 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -360,8 +360,8 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys) :: dif(ncol,pver) ! detrained convective cloud ice mixing ratio. !CACNOTE - Figure out real intent for jt and maxg - integer, intent(inout) :: jt(ncol) ! wg top level index of deep cumulus convection. - integer, intent(inout) :: maxg(ncol) ! wg gathered values of maxi. + integer, intent(out) :: jt(ncol) ! wg top level index of deep cumulus convection. + integer, intent(out) :: maxg(ncol) ! wg gathered values of maxi. integer lengath ! diagnostic field used by chem/wetdep codes diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index 6cf347d5..7dba4532 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -1,6 +1,7 @@ [ccpp-table-properties] name = zm_convr type = scheme + dependencies = ../to_be_ccppized/wv_saturation.F90 [ccpp-arg-table] name = zm_convr_init @@ -18,7 +19,7 @@ dimensions = () intent = in [ cpair ] - standard_name = composition_dependent_specific_heat_of_dry_air_at_constant_pressure + standard_name = specific_heat_of_dry_air_at_constant_pressure units = J kg-1 K-1 type = real | kind = kind_phys dimensions = () @@ -48,7 +49,7 @@ dimensions = () intent = in [ rair ] - standard_name = composition_dependent_gas_constant_of_dry_air + standard_name = gas_constant_of_dry_air units = J kg-1 K-1 type = real | kind = kind_phys dimensions = () @@ -389,13 +390,13 @@ units = index type = integer dimensions = (horizontal_loop_extent) - intent = inout + intent = out [ maxg ] standard_name = vertical_index_of_deep_convection_launch_level_for_convective_columns units = index type = integer dimensions = (horizontal_loop_extent) - intent = inout + intent = out [ ideep ] standard_name = horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns units = index From 755a07b3d75e4284237fa8c6778da0af36d8efea Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 5 Aug 2024 12:02:02 -0600 Subject: [PATCH 12/36] Fixes for cleanup3 --- cloud_fraction/cloud_fraction_fice.F90 | 5 ++++- zhang_mcfarlane/zm_conv_convtran.F90 | 2 +- zhang_mcfarlane/zm_conv_evap.F90 | 5 ++--- zhang_mcfarlane/zm_conv_evap.meta | 8 +++++++- zhang_mcfarlane/zm_convr.meta | 4 ++-- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/cloud_fraction/cloud_fraction_fice.F90 b/cloud_fraction/cloud_fraction_fice.F90 index a70ea1f3..7c102ece 100644 --- a/cloud_fraction/cloud_fraction_fice.F90 +++ b/cloud_fraction/cloud_fraction_fice.F90 @@ -1,6 +1,7 @@ module cloud_fraction_fice use ccpp_kinds, only: kind_phys + implicit none contains @@ -10,7 +11,7 @@ module cloud_fraction_fice !> \section arg_table_cloud_fraction_fice_run Argument Table !! \htmlinclude cloud_fraction_fice_run.html !! - subroutine cloud_fraction_fice_run(ncol, t, tmelt, fice, fsnow) + subroutine cloud_fraction_fice_run(ncol, t, tmelt, top_lev, pver, fice, fsnow) ! ! Compute the fraction of the total cloud water which is in ice phase. ! The fraction depends on temperature only. @@ -24,6 +25,8 @@ subroutine cloud_fraction_fice_run(ncol, t, tmelt, fice, fsnow) integer, intent(in) :: ncol ! number of active columns real(kind_phys), intent(in) :: t(:,:) ! temperature real(kind_phys), intent(in) :: tmelt ! freezing point of water + integer, intent(in) :: top_lev + integer, intent(in) :: pver real(kind_phys), intent(out) :: fice(:,:) ! Fractional ice content within cloud real(kind_phys), intent(out) :: fsnow(:,:) ! Fractional snow content for convection diff --git a/zhang_mcfarlane/zm_conv_convtran.F90 b/zhang_mcfarlane/zm_conv_convtran.F90 index df050fe5..f732fa37 100644 --- a/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/zhang_mcfarlane/zm_conv_convtran.F90 @@ -22,7 +22,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & doconvtran,q ,ncnst ,mu ,md , & du ,eu ,ed ,dp ,dsubcld , & jt ,mx ,ideep ,il1g ,il2g , & - nstep ,fracis ,dqdt ,dpdry ,dt, const_metadata, errflg, errmsg) + nstep ,fracis ,dqdt ,dpdry ,dt, const_metadata, errmsg, errflg) ! ccpp_constituent_properties - standard name -- see chat !----------------------------------------------------------------------- diff --git a/zhang_mcfarlane/zm_conv_evap.F90 b/zhang_mcfarlane/zm_conv_evap.F90 index 74dfa9f8..0edf1a58 100644 --- a/zhang_mcfarlane/zm_conv_evap.F90 +++ b/zhang_mcfarlane/zm_conv_evap.F90 @@ -28,8 +28,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & landfrac, & tend_s, tend_s_snwprd, tend_s_snwevmlt, tend_q, & prdprec, cldfrc, deltat, & - prec, snow, ntprprd, ntsnprd, flxprec, flxsnow) - + prec, snow, ntprprd, ntsnprd, fsnow_conv, flxprec, flxsnow) !----------------------------------------------------------------------- ! Compute tendencies due to evaporation of rain from ZM scheme @@ -69,6 +68,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys), intent(in ) :: prdprec(:,:)! precipitation production (kg/ks/s) (ncol,pver) real(kind_phys), intent(in ) :: cldfrc(:,:) ! cloud fraction (ncol,pver) real(kind_phys), intent(in ) :: deltat ! time step + real(kind_phys), intent(in ) :: fsnow_conv(:,:) ! snow fraction in precip production real(kind_phys), intent(inout) :: prec(:) ! Convective-scale preciptn rate (ncol) real(kind_phys), intent(out) :: snow(:) ! Convective-scale snowfall rate (ncol) @@ -79,7 +79,6 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys) :: es (ncol,pver) ! Saturation vapor pressure real(kind_phys) :: fice (ncol,pver) ! ice fraction in precip production - real(kind_phys) :: fsnow_conv(ncol,pver) ! snow fraction in precip production real(kind_phys) :: qs (ncol,pver) ! saturation specific humidity real(kind_phys),intent(out) :: flxprec(:,:) ! Convective-scale flux of precip at interfaces (kg/m2/s) ! (ncol,pverp) real(kind_phys),intent(out) :: flxsnow(:,:) ! Convective-scale flux of snow at interfaces (kg/m2/s) ! (ncol,pverp) diff --git a/zhang_mcfarlane/zm_conv_evap.meta b/zhang_mcfarlane/zm_conv_evap.meta index 11b8c22f..08f0cf8a 100644 --- a/zhang_mcfarlane/zm_conv_evap.meta +++ b/zhang_mcfarlane/zm_conv_evap.meta @@ -26,7 +26,7 @@ dimensions = () intent = in [ gravit ] - standard_name = standard_gravitational_acceleration + standard_name = gravitational_acceleration units = m s-2 type = real | kind = kind_phys dimensions = () @@ -181,3 +181,9 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out +[ fsnow_conv ] + standard_name = mass_fraction_of_snow_content_within_stratiform_cloud + units = fraction + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index f1b4fd51..7dba4532 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -31,7 +31,7 @@ dimensions = () intent = in [ gravit ] - standard_name = standard_gravitational_acceleration + standard_name = gravitational_acceleration units = m s-2 type = real | kind = kind_phys dimensions = () @@ -193,7 +193,7 @@ dimensions = () intent = in [ gravit ] - standard_name = standard_gravitational_acceleration + standard_name = gravitational_acceleration units = m s-2 type = real | kind = kind_phys dimensions = () From e8dc85f6fb1d3a601d5ca878f860062cc2ea6c25 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 7 Aug 2024 15:05:37 -0600 Subject: [PATCH 13/36] additional changes to get ZM running in CAM-SIMA --- cloud_fraction/cloud_fraction_fice.meta | 12 ++++++++++++ suite_zhang_mcfarlane.xml | 3 ++- zhang_mcfarlane/zm_conv_convtran.meta | 14 +++++++------- zhang_mcfarlane/zm_conv_evap.meta | 14 +++++++------- zhang_mcfarlane/zm_convr.meta | 4 ++-- 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/cloud_fraction/cloud_fraction_fice.meta b/cloud_fraction/cloud_fraction_fice.meta index d268c141..25e97945 100644 --- a/cloud_fraction/cloud_fraction_fice.meta +++ b/cloud_fraction/cloud_fraction_fice.meta @@ -23,6 +23,18 @@ type = real | kind = kind_phys dimensions = () intent = in +[ top_lev ] + standard_name = index_of_pressure_at_troposphere_cloud_top + units = index + type = integer + dimensions = () + intent = in +[ pver ] + standard_name = vertical_layer_dimension + units = count + type = integer + dimensions = () + intent = in [ fice ] standard_name = mass_fraction_of_ice_content_within_stratiform_cloud units = fraction diff --git a/suite_zhang_mcfarlane.xml b/suite_zhang_mcfarlane.xml index 9fe83025..391a2444 100644 --- a/suite_zhang_mcfarlane.xml +++ b/suite_zhang_mcfarlane.xml @@ -1,12 +1,13 @@ - + zm_convr cloud_fraction_fice zm_conv_evap zm_conv_momtran zm_conv_convtran + zm_diagnostics diff --git a/zhang_mcfarlane/zm_conv_convtran.meta b/zhang_mcfarlane/zm_conv_convtran.meta index 5497eda4..74cc6e63 100644 --- a/zhang_mcfarlane/zm_conv_convtran.meta +++ b/zhang_mcfarlane/zm_conv_convtran.meta @@ -143,13 +143,6 @@ type = ccpp_constituent_prop_ptr_t dimensions = (number_of_ccpp_constituents) intent = in -[ errflg ] - standard_name = ccpp_error_code - long_name = Error flag for error handling in CCPP - units = 1 - type = integer - dimensions = () - intent = out [ errmsg ] standard_name = ccpp_error_message long_name = Error message for error handling in CCPP @@ -157,3 +150,10 @@ type = character | kind = len=512 dimensions = () intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out diff --git a/zhang_mcfarlane/zm_conv_evap.meta b/zhang_mcfarlane/zm_conv_evap.meta index 08f0cf8a..7d93fb6e 100644 --- a/zhang_mcfarlane/zm_conv_evap.meta +++ b/zhang_mcfarlane/zm_conv_evap.meta @@ -26,7 +26,7 @@ dimensions = () intent = in [ gravit ] - standard_name = gravitational_acceleration + standard_name = standard_gravitational_acceleration units = m s-2 type = real | kind = kind_phys dimensions = () @@ -169,6 +169,12 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out +[ fsnow_conv ] + standard_name = mass_fraction_of_snow_content_within_stratiform_cloud + units = fraction + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in [ flxprec ] standard_name = precipitation_flux_at_interface_due_to_deep_convection units = kg m-2 s-1 @@ -181,9 +187,3 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out -[ fsnow_conv ] - standard_name = mass_fraction_of_snow_content_within_stratiform_cloud - units = fraction - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index 7dba4532..f1b4fd51 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -31,7 +31,7 @@ dimensions = () intent = in [ gravit ] - standard_name = gravitational_acceleration + standard_name = standard_gravitational_acceleration units = m s-2 type = real | kind = kind_phys dimensions = () @@ -193,7 +193,7 @@ dimensions = () intent = in [ gravit ] - standard_name = gravitational_acceleration + standard_name = standard_gravitational_acceleration units = m s-2 type = real | kind = kind_phys dimensions = () From c790696bc659f75c726bcb327750021c2e94d6fe Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 7 Aug 2024 16:53:07 -0600 Subject: [PATCH 14/36] Preliminary zm_diagnostics --- cam_diagnostics/zm_diagnostics.F90 | 84 +++++++++++++++++++++++++++++ cam_diagnostics/zm_diagnostics.meta | 69 ++++++++++++++++++++++++ 2 files changed, 153 insertions(+) create mode 100644 cam_diagnostics/zm_diagnostics.F90 create mode 100644 cam_diagnostics/zm_diagnostics.meta diff --git a/cam_diagnostics/zm_diagnostics.F90 b/cam_diagnostics/zm_diagnostics.F90 new file mode 100644 index 00000000..e2c1d5b3 --- /dev/null +++ b/cam_diagnostics/zm_diagnostics.F90 @@ -0,0 +1,84 @@ +module zm_diagnostics +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! THIS IS A TEMPLATE +! 1. copy this file to a new file with the correct name +! (SCHEME_diagnostics.F90) +! 2. do a search and replace for "SCHEME" in this file and +! replace with your scheme name +! 3. Add desired history_add_field calls to the init phase +! 4. Add all fields that are being output as inputs to the run phase +! 5. Add desired history_out_field calls to the run phase +! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 +! file to generate the metadata +! 7. Complete the metadata (fill out standard names, units, dimensions) +! 8. Add this scheme to the SDF file for your suite (likely will be at end) +! 9. Delete this header section +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + use ccpp_kinds, only: kind_phys + + implicit none + private + save + + public :: zm_diagnostics_init ! init routine + public :: zm_diagnostics_run ! main routine + +CONTAINS + + !> \section arg_table_zm_diagnostics_init Argument Table + !! \htmlinclude zm_diagnostics_init.html + subroutine zm_diagnostics_init(errmsg, errflg) + use cam_history, only: history_add_field + use cam_history_support, only: horiz_only + + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables: + + errmsg = '' + errflg = 0 + + call history_add_field ('PRECZ', 'total precipitation from ZM convection', horiz_only, 'avg', 'm s-1') + call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') + + end subroutine zm_diagnostics_init + + !> \section arg_table_zm_diagnostics_run Argument Table + !! \htmlinclude zm_diagnostics_run.html + subroutine zm_diagnostics_run(ncol, pver, cpair, heat, prec, errmsg, errflg) + + use cam_history, only: history_out_field + !------------------------------------------------ + ! Input / output parameters + !------------------------------------------------ + integer, intent(in) :: ncol + integer, intent(in) :: pver + + real(kind_phys), intent(in) :: cpair + real(kind_phys), intent(in) :: heat(:,:) + real(kind_phys), intent(in) :: prec(:) + + ! CCPP error handling variables + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + real(kind_phys) :: ftem(ncol,pver) + + errmsg = '' + errflg = 0 + + call history_out_field('PRECZ', prec) + + ftem(:,:) = 0._kind_phys + ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair + call history_out_field('ZMDT', ftem) + + end subroutine zm_diagnostics_run + + !======================================================================= + +end module zm_diagnostics diff --git a/cam_diagnostics/zm_diagnostics.meta b/cam_diagnostics/zm_diagnostics.meta new file mode 100644 index 00000000..560832f8 --- /dev/null +++ b/cam_diagnostics/zm_diagnostics.meta @@ -0,0 +1,69 @@ +[ccpp-table-properties] + name = zm_diagnostics + type = scheme + +[ccpp-arg-table] + name = zm_diagnostics_init + type = scheme +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out + +[ccpp-arg-table] + name = zm_diagnostics_run + type = scheme +[ 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 +[ cpair ] + standard_name = specific_heat_of_dry_air_at_constant_pressure + units = J kg-1 K-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ heat ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure + units = J kg-1 s-1 + type = real | kind = kind_phys + dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + intent = in +[ prec ] + standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection + units = m s-1 + type = real | kind = kind_phys + dimensions = (1:horizontal_loop_extent) + intent = in +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out From 00c566dd5a9f9642f594c53330c526dec04f9122 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 14 Aug 2024 13:19:09 -0600 Subject: [PATCH 15/36] preliminary diagnostics for ZM --- cam_diagnostics/zm_diagnostics.F90 | 74 +++++++++++++++++++++------ zhang_mcfarlane/zm_conv_convtran.meta | 2 +- 2 files changed, 60 insertions(+), 16 deletions(-) diff --git a/cam_diagnostics/zm_diagnostics.F90 b/cam_diagnostics/zm_diagnostics.F90 index e2c1d5b3..081461ab 100644 --- a/cam_diagnostics/zm_diagnostics.F90 +++ b/cam_diagnostics/zm_diagnostics.F90 @@ -28,22 +28,66 @@ module zm_diagnostics CONTAINS - !> \section arg_table_zm_diagnostics_init Argument Table - !! \htmlinclude zm_diagnostics_init.html - subroutine zm_diagnostics_init(errmsg, errflg) - use cam_history, only: history_add_field - use cam_history_support, only: horiz_only + !> \section arg_table_zm_diagnostics_init Argument Table + !! \htmlinclude zm_diagnostics_init.html + subroutine zm_diagnostics_init(errmsg, errflg) + use cam_history, only: history_add_field + use cam_history_support, only: horiz_only + + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables: + + errmsg = '' + errflg = 0 + + call history_add_field ('ZM_ORG ', 'Organization parameter', 'lev', 'avg', '1') + call history_add_field ('ZM_ORG2D ', 'Organization parameter 2D', 'lev', 'avg', '1') + + call history_add_field ('PRECZ', 'total precipitation from ZM convection', horiz_only, 'avg', 'm s-1') + call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') + call history_add_field ('ZMDQ', 'Q tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('ZMDICE', 'Cloud ice tendency - Zhang-McFarlane convection', 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('ZMDLIQ', 'Cloud liq tendency - Zhang-McFarlane convection', 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('EVAPTZM', 'T tendency - Evaporation/snow prod from Zhang convection', 'lev', 'avg', 'K s-1') + call history_add_field ('FZSNTZM', 'T tendency - Rain to snow conversion from Zhang convection', 'lev', 'avg', 'K s-1') + call history_add_field ('EVSNTZM', 'T tendency - Snow to rain prod from Zhang convection', 'lev', 'avg', 'K s-1') + call history_add_field ('EVAPQZM', 'Q tendency - Evaporation from Zhang-McFarlane moist convection', 'lev', 'avg', & + 'kg kg-1 s-1') + call history_add_field ('ZMFLXPRC', 'Flux of precipitation from ZM convection', 'ilev', 'avg', 'kg m-2 s-1') + call history_add_field ('ZMFLXSNW', 'Flux of snow from ZM convection', 'ilev', 'avg', 'kg m-2 s-1') + call history_add_field ('ZMNTPRPD', 'Net precipitation production from ZM convection', 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('ZMNTSNPD', 'Net snow production from ZM convection', 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('ZMEIHEAT', 'Heating by ice and evaporation in ZM convection', 'lev', 'avg', 'W kg-1') + + call history_add_field ('CMFMC_DP', 'Convection mass flux from ZM deep ', 'ilev', 'avg', 'kg m-2 s-1') + call history_add_field ('PRECCDZM', 'Convective precipitation rate from ZM deep', horiz_only, 'avg', 'm s-1') + + call history_add_field ('PCONVB', 'convection base pressure', horiz_only , 'avg', 'Pa' ) + call history_add_field ('PCONVT', 'convection top pressure', horiz_only , 'avg', 'Pa' ) + + call history_add_field ('CAPE', 'Convectively available potential energy', horiz_only, 'avg', 'J kg-1') + call history_add_field ('FREQZM', 'Fractional occurance of ZM convection', horiz_only , 'avg', 'fraction') + call history_add_field ('ZMMTT', 'T tendency - ZM convective momentum transport', 'lev', 'avg', 'K s-1') + call history_add_field ('ZMMTU', 'U tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') + call history_add_field ('ZMMTV', 'V tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') + + call history_add_field ('ZMMU', 'ZM convection updraft mass flux', 'lev', 'avg', 'kg m-2 s-1') + call history_add_field ('ZMMD', 'ZM convection downdraft mass flux', 'lev', 'avg', 'kg m-2 s-1') + + call history_add_field ('ZMUPGU', 'zonal force from ZM updraft pressure gradient term', 'lev', 'avg', 'm s-2') + call history_add_field ('ZMUPGD', 'zonal force from ZM downdraft pressure gradient term', 'lev', 'avg', 'm s-2') + call history_add_field ('ZMVPGU', 'meridional force from ZM updraft pressure gradient term', 'lev', 'avg', 'm s-2') + call history_add_field ('ZMVPGD', 'merdional force from ZM downdraft pressure gradient term', 'lev', 'avg', 'm s-2') + + call history_add_field ('ZMICUU', 'ZM in-cloud U updrafts', 'lev', 'avg', 'm/s') + call history_add_field ('ZMICUD', 'ZM in-cloud U downdrafts', 'lev', 'avg', 'm/s') + call history_add_field ('ZMICVU', 'ZM in-cloud V updrafts', 'lev', 'avg', 'm/s') + call history_add_field ('ZMICVD', 'ZM in-cloud V downdrafts', 'lev', 'avg', 'm/s') + + call history_add_field ('DLFZM', 'Detrained liquid water from ZM convection', 'lev', 'avg','kg kg-1 s-1 ') - character(len=512), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Local variables: - - errmsg = '' - errflg = 0 - - call history_add_field ('PRECZ', 'total precipitation from ZM convection', horiz_only, 'avg', 'm s-1') - call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') end subroutine zm_diagnostics_init diff --git a/zhang_mcfarlane/zm_conv_convtran.meta b/zhang_mcfarlane/zm_conv_convtran.meta index 74cc6e63..27295261 100644 --- a/zhang_mcfarlane/zm_conv_convtran.meta +++ b/zhang_mcfarlane/zm_conv_convtran.meta @@ -126,7 +126,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_ccpp_constituents) intent = out [ dpdry ] - standard_name = air_pressure_thickness_of_dry_air_for_deep_convection_for_gathered_convective_columns + standard_name = air_pressure_thickness_of_dry_air units = hPa type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) From 34e609b1725a6bd08cfbf546520926b069d73010 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 23 Aug 2024 13:26:49 -0600 Subject: [PATCH 16/36] Remove zm_org logic per Rich Neale's advice --- zhang_mcfarlane/zm_conv_evap.F90 | 9 +--- zhang_mcfarlane/zm_conv_evap.meta | 6 --- zhang_mcfarlane/zm_convr.F90 | 77 +++------------------------ zhang_mcfarlane/zm_convr.meta | 24 --------- zhang_mcfarlane/zm_convr_namelist.xml | 16 ------ 5 files changed, 10 insertions(+), 122 deletions(-) diff --git a/zhang_mcfarlane/zm_conv_evap.F90 b/zhang_mcfarlane/zm_conv_evap.F90 index 0edf1a58..b7b3e2cf 100644 --- a/zhang_mcfarlane/zm_conv_evap.F90 +++ b/zhang_mcfarlane/zm_conv_evap.F90 @@ -23,7 +23,7 @@ module zm_conv_evap !! subroutine zm_conv_evap_run(ncol, pver, pverp, & gravit, latice, latvap, tmelt, & - cpres, ke, ke_lnd, zm_org, & + cpres, ke, ke_lnd, & t,pmid,pdel,q, & landfrac, & tend_s, tend_s_snwprd, tend_s_snwevmlt, tend_q, & @@ -52,7 +52,6 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys), intent(in) :: cpres ! specific heat at constant pressure in j/kg-degk. real(kind_phys), intent(in) :: ke ! Tunable evaporation efficiency set from namelist input zmconv_ke real(kind_phys), intent(in) :: ke_lnd - logical, intent(in) :: zm_org real(kind_phys),intent(in), dimension(:,:) :: t ! temperature (K) (ncol,pver) real(kind_phys),intent(in), dimension(:,:) :: pmid ! midpoint pressure (Pa) (ncol,pver) real(kind_phys),intent(in), dimension(:,:) :: pdel ! layer thickness (Pa) (ncol,pver) @@ -165,11 +164,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & ! relative humidity depression must be > 0 for evaporation evplimit = max(1._kind_phys - q(i,k)/qs(i,k), 0._kind_phys) - if (zm_org) then - kemask = ke * (1._kind_phys - landfrac(i)) + ke_lnd * landfrac(i) - else - kemask = ke - endif + kemask = ke ! total evaporation depends on flux in the top of the layer ! flux prec is the net production above layer minus evaporation into environmet diff --git a/zhang_mcfarlane/zm_conv_evap.meta b/zhang_mcfarlane/zm_conv_evap.meta index 7d93fb6e..a98f2115 100644 --- a/zhang_mcfarlane/zm_conv_evap.meta +++ b/zhang_mcfarlane/zm_conv_evap.meta @@ -67,12 +67,6 @@ type = real | kind = kind_phys dimensions = () intent = in -[ zm_org ] - standard_name = flag_for_convective_organization_parameterization_for_zhang_mcfarlane_deep_convection_scheme - units = flag - type = logical - dimensions = () - intent = in [ t ] standard_name = air_temperature units = K diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index 3b1d392c..3f543834 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -23,7 +23,6 @@ module zm_convr integer :: num_cin ! set from namelist input zmconv_num_cin ! The number of negative buoyancy regions that are allowed ! before the convection top and CAPE calculations are completed. - logical :: zm_org real(kind_phys) tau ! convective time scale real(kind_phys) :: tfreez real(kind_phys) :: eps1 @@ -57,7 +56,7 @@ module zm_convr !! subroutine zm_convr_init(plev, plevp, cpair, epsilo, gravit, latvap, tmelt, rair, & pref_edge, zmconv_c0_lnd, zmconv_c0_ocn, zmconv_ke, zmconv_ke_lnd, & - zmconv_momcu, zmconv_momcd, zmconv_num_cin, zmconv_org, & + zmconv_momcu, zmconv_momcd, zmconv_num_cin, & no_deep_pbl_in, zmconv_tiedke_add, & zmconv_capelmt, zmconv_dmpdz, zmconv_parcel_pbl, zmconv_tau, & masterproc, iulog, errmsg, errflg) @@ -80,7 +79,6 @@ subroutine zm_convr_init(plev, plevp, cpair, epsilo, gravit, latvap, tmelt, rair real(kind_phys),intent(in) :: zmconv_ke_lnd real(kind_phys),intent(in) :: zmconv_momcu real(kind_phys),intent(in) :: zmconv_momcd - logical, intent(in) :: zmconv_org logical, intent(in) :: no_deep_pbl_in ! no_deep_pbl = .true. eliminates ZM convection entirely within PBL real(kind_phys),intent(in) :: zmconv_tiedke_add real(kind_phys),intent(in) :: zmconv_capelmt @@ -112,7 +110,6 @@ subroutine zm_convr_init(plev, plevp, cpair, epsilo, gravit, latvap, tmelt, rair num_cin = zmconv_num_cin ke = zmconv_ke ke_lnd = zmconv_ke_lnd - zm_org = zmconv_org momcu = zmconv_momcu momcd = zmconv_momcd @@ -174,7 +171,6 @@ subroutine zm_convr_run( ncol ,pver , & mu ,md ,du ,eu ,ed , & dp ,dsubcld ,jt ,maxg ,ideep , & ql ,rliq ,landfrac, & - org ,orgt ,org2d , & rice ,errmsg ,errflg) !----------------------------------------------------------------------- ! @@ -340,10 +336,6 @@ subroutine zm_convr_run( ncol ,pver , & integer, intent(out) :: errflg - real(kind_phys), intent(in) :: org(:,:) ! Only used if zm_org is true ! in - real(kind_phys), intent(out) :: orgt(:,:) ! Only used if zm_org is true ! out - real(kind_phys), intent(out) :: org2d(:,:) ! Only used if zm_org is true ! out - ! Local variables @@ -352,7 +344,6 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys) cug(ncol,pver) ! gathered condensation rate real(kind_phys) evpg(ncol,pver) ! gathered evap rate of rain in downdraft - real(kind_phys) orgavg(ncol) real(kind_phys) dptot(ncol) real(kind_phys) mumax(ncol) @@ -474,10 +465,6 @@ subroutine zm_convr_run( ncol ,pver , & ! zero out variables not used in cam ! - if (zm_org) then - orgt(:,:) = 0._kind_phys - end if - qtnd(:,:) = 0._kind_phys heat(:,:) = 0._kind_phys mcon(:,:) = 0._kind_phys @@ -514,34 +501,6 @@ subroutine zm_convr_run( ncol ,pver , & end do - if (zm_org) then -! compute vertical average here - orgavg(:) = 0._kind_phys - dptot(:) = 0._kind_phys - - do k = 1, pver - do i = 1,ncol - if (org(i,k) .gt. 0) then - orgavg(i) = orgavg(i)+dpp(i,k)*org(i,k) - dptot(i) = dptot(i)+dpp(i,k) - endif - enddo - enddo - - do i = 1,ncol - if (dptot(i) .gt. 0) then - orgavg(i) = orgavg(i)/dptot(i) - endif - enddo - - do k = 1, pver - do i = 1, ncol - org2d(i,k) = orgavg(i) - enddo - enddo - - endif - ! ! calculate local pressure (mbs) and height (m) for both interface ! and mid-layer locations. @@ -599,7 +558,7 @@ subroutine zm_convr_run( ncol ,pver , & tp ,qstp ,tl ,rl ,cape , & pblt ,lcl ,lel ,lon ,maxi , & rgas ,grav ,cpres ,msg , & - zi ,zs ,tpert , org2d , landfrac,& + zi ,zs ,tpert , landfrac,& errmsg ,errflg) ! @@ -839,7 +798,7 @@ subroutine buoyan_dilute( ncol ,pver , & tp ,qstp ,tl ,rl ,cape , & pblt ,lcl ,lel ,lon ,mx , & rd ,grav ,cp ,msg , & - zi ,zs ,tpert ,org , landfrac,& + zi ,zs ,tpert , landfrac,& errmsg ,errflg) !----------------------------------------------------------------------- ! @@ -903,7 +862,6 @@ subroutine buoyan_dilute( ncol ,pver , & integer lon(ncol) ! level of onset of deep convection integer mx(ncol) ! level of max moist static energy - real(kind_phys) :: org(:,:) ! organization parameter real(kind_phys), intent(in) :: landfrac(ncol) character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg @@ -1114,7 +1072,7 @@ subroutine buoyan_dilute( ncol ,pver , & call parcel_dilute(ncol, pver, cpliq, cpwv, rh2o, latice, msg, mx, p, t, q, & tpert, tp, tpv, qstp, pl, tl, ql, lcl, & - org, landfrac, errmsg, errflg) + landfrac, errmsg, errflg) ! If lcl is above the nominal level of non-divergence (600 mbs), @@ -1197,7 +1155,7 @@ end subroutine buoyan_dilute subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p, t, q, & tpert, tp, tpv, qstp, pl, tl, ql, lcl, & - org, landfrac,errmsg,errflg) + landfrac,errmsg,errflg) ! Routine to determine ! 1. Tp - Parcel temperature @@ -1237,7 +1195,6 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p -real(kind_phys), dimension(:,:) :: org real(kind_phys), intent(in), dimension(ncol) :: landfrac !-------------------- @@ -1282,7 +1239,6 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p real(kind_phys) qxsk, qxskp1 ! LCL excess water (k, k+1) real(kind_phys) dsdp, dqtdp, dqxsdp ! LCL s, qt, p gradients (k, k+1) real(kind_phys) slcl,qtlcl,qslcl ! LCL s, qt, qs values. -real(kind_phys) org2rkm, org2Tpert real(kind_phys) dmpdz_lnd, dmpdz_mask integer rcall ! Number of ientropy call for errors recording @@ -1302,10 +1258,6 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p ! Set some values that may be changed frequently. ! -if (zm_org) then - org2rkm = 10._kind_phys - org2Tpert = 0._kind_phys -endif nit_lheat = 2 ! iterations for ds,dq changes from condensation freezing. dmpdz=dmpdz_param ! Entrainment rate. (-ve for /m) dmpdz_lnd=-1.e-3_kind_phys @@ -1377,12 +1329,7 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p dpdz = -(penv*grav)/(rgas*tenv) ! in mb/m since p in mb. dzdp = 1._kind_phys/dpdz ! in m/mb - if (zm_org) then - dmpdz_mask = landfrac(i) * dmpdz_lnd + (1._kind_phys - landfrac(i)) * dmpdz - dmpdp = (dmpdz_mask/(1._kind_phys+org(i,k)*org2rkm))*dzdp ! /mb Fractional entrainment - else - dmpdp = dmpdz*dzdp - endif + dmpdp = dmpdz*dzdp ! Sum entrainment to current level ! entrains q,s out of intervening dp layers, in which linear variation is assumed @@ -1474,11 +1421,7 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p tp(i,k) = tmix(i,k) qstp(i,k) = q(i,k) - if (zm_org) then - tpv(i,k) = (tp(i,k) + (org2Tpert*org(i,k)+tpert(i))) * (1._kind_phys+1.608_kind_phys*qstp(i,k)) / (1._kind_phys+qstp(i,k)) - else - tpv(i,k) = (tp(i,k) + tpert(i)) * (1._kind_phys+1.608_kind_phys*qstp(i,k)) / (1._kind_phys+qstp(i,k)) - endif + tpv(i,k) = (tp(i,k) + tpert(i)) * (1._kind_phys+1.608_kind_phys*qstp(i,k)) / (1._kind_phys+qstp(i,k)) end if @@ -1538,11 +1481,7 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p qstp(i,k) = new_q end if - if (zm_org) then - tpv(i,k) = (tp(i,k)+(org2Tpert*org(i,k)+tpert(i)))* (1._kind_phys+1.608_kind_phys*qstp(i,k)) / (1._kind_phys+ new_q) - else - tpv(i,k) = (tp(i,k)+tpert(i))* (1._kind_phys+1.608_kind_phys*qstp(i,k)) / (1._kind_phys+ new_q) - endif + tpv(i,k) = (tp(i,k)+tpert(i))* (1._kind_phys+1.608_kind_phys*qstp(i,k)) / (1._kind_phys+ new_q) end if ! k < klaunch diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index f1b4fd51..faa3863f 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -102,12 +102,6 @@ type = integer dimensions = () intent = in -[ zmconv_org ] - standard_name = flag_for_convective_organization_parameterization_for_zhang_mcfarlane_deep_convection_scheme - units = flag - type = logical - dimensions = () - intent = in [ no_deep_pbl_in ] standard_name = flag_for_no_deep_convection_in_pbl units = flag @@ -421,24 +415,6 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent) intent = in -[ org ] - standard_name = zhang_mcfarlane_organization_parameter_of_deep_convection - units = 1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = in -[ orgt ] - standard_name = tendency_of_zhang_mcfarlane_organization_parameter_of_deep_convection - units = s-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ org2d ] - standard_name = zhang_mcfarlane_organization_parameter_of_deep_convection_copied_to_whole_column - units = 1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out [ rice ] standard_name = vertically_integrated_cloud_ice_tendency_due_to_all_convection_to_be_applied_later_in_time_loop units = m s-1 diff --git a/zhang_mcfarlane/zm_convr_namelist.xml b/zhang_mcfarlane/zm_convr_namelist.xml index 88a65b8d..d370a52e 100644 --- a/zhang_mcfarlane/zm_convr_namelist.xml +++ b/zhang_mcfarlane/zm_convr_namelist.xml @@ -70,22 +70,6 @@ - - conv - zmconv_nl - flag_for_convective_organization_parameterization_for_zhang_mcfarlane_deep_convection_scheme - flag - logical - Include organization parameterization in ZM. This value is set to true automatically - if -zmconv_org is set in configure. - Default: .false., unless -zmconv_org set in configure - - - .false. - .true. - - - conv zmconv_nl From aba6bee3a905939f55d6b4db1b17a0b065c5ed03 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 28 Aug 2024 13:23:40 -0600 Subject: [PATCH 17/36] Changes to get ZM to run in CAM-SIMA --- suite_zhang_mcfarlane.xml | 1 + to_be_ccppized/to_be_ccppized_temporary.F90 | 29 ++++++++++++++++++++ to_be_ccppized/to_be_ccppized_temporary.meta | 22 +++++++++++++++ zhang_mcfarlane/zm_conv_convtran.F90 | 2 +- zhang_mcfarlane/zm_conv_evap.F90 | 2 +- zhang_mcfarlane/zm_conv_evap.meta | 5 ++-- zhang_mcfarlane/zm_conv_momtran.F90 | 2 +- zhang_mcfarlane/zm_convr.F90 | 13 +++++---- zhang_mcfarlane/zm_convr.meta | 8 +++++- 9 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 to_be_ccppized/to_be_ccppized_temporary.F90 create mode 100644 to_be_ccppized/to_be_ccppized_temporary.meta diff --git a/suite_zhang_mcfarlane.xml b/suite_zhang_mcfarlane.xml index 391a2444..7c5d85f6 100644 --- a/suite_zhang_mcfarlane.xml +++ b/suite_zhang_mcfarlane.xml @@ -2,6 +2,7 @@ + to_be_ccppized_temporary zm_convr cloud_fraction_fice zm_conv_evap diff --git a/to_be_ccppized/to_be_ccppized_temporary.F90 b/to_be_ccppized/to_be_ccppized_temporary.F90 new file mode 100644 index 00000000..e87d221e --- /dev/null +++ b/to_be_ccppized/to_be_ccppized_temporary.F90 @@ -0,0 +1,29 @@ +module to_be_ccppized_temporary +! This module is a TEMPORARY place to put calls to initialization routines which have not yet +! been CCPP'ized, and the run methods are being called directly in CCPP'ized routines. + +! Once a module has been CCPP'ized, then the call in this routine needs to be removed + +implicit none + +contains + +!> \section arg_table_to_be_ccppized_temporary_init Argument Table +!! \htmlinclude to_be_ccppized_temporary_init.html +!! +subroutine to_be_ccppized_temporary_init(errmsg, errflg) + + use wv_saturation, only: wv_sat_init + + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + errmsg = ' ' + errflg = 0 + + call wv_sat_init() + +end subroutine to_be_ccppized_temporary_init + +end module to_be_ccppized_temporary + diff --git a/to_be_ccppized/to_be_ccppized_temporary.meta b/to_be_ccppized/to_be_ccppized_temporary.meta new file mode 100644 index 00000000..87325229 --- /dev/null +++ b/to_be_ccppized/to_be_ccppized_temporary.meta @@ -0,0 +1,22 @@ +[ccpp-table-properties] + name = to_be_ccppized_temporary + type = scheme + +[ccpp-arg-table] + name = to_be_ccppized_temporary_init + type = scheme +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out + diff --git a/zhang_mcfarlane/zm_conv_convtran.F90 b/zhang_mcfarlane/zm_conv_convtran.F90 index 59a8ea7b..63629dff 100644 --- a/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/zhang_mcfarlane/zm_conv_convtran.F90 @@ -22,7 +22,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & doconvtran,q ,ncnst ,mu ,md , & du ,eu ,ed ,dp ,dsubcld , & jt ,mx ,ideep ,il1g ,il2g , & - nstep ,fracis ,dqdt ,dpdry , const_metadata, errmsg, errflg) + nstep ,fracis ,dqdt ,dpdry ,const_metadata, errmsg, errflg) ! ccpp_constituent_properties - standard name -- see chat !----------------------------------------------------------------------- diff --git a/zhang_mcfarlane/zm_conv_evap.F90 b/zhang_mcfarlane/zm_conv_evap.F90 index b7b3e2cf..b2ea4d25 100644 --- a/zhang_mcfarlane/zm_conv_evap.F90 +++ b/zhang_mcfarlane/zm_conv_evap.F90 @@ -77,7 +77,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & !---------------------------Local storage------------------------------- real(kind_phys) :: es (ncol,pver) ! Saturation vapor pressure - real(kind_phys) :: fice (ncol,pver) ! ice fraction in precip production +!! real(kind_phys) :: fice (ncol,pver) ! ice fraction in precip production real(kind_phys) :: qs (ncol,pver) ! saturation specific humidity real(kind_phys),intent(out) :: flxprec(:,:) ! Convective-scale flux of precip at interfaces (kg/m2/s) ! (ncol,pverp) real(kind_phys),intent(out) :: flxsnow(:,:) ! Convective-scale flux of snow at interfaces (kg/m2/s) ! (ncol,pverp) diff --git a/zhang_mcfarlane/zm_conv_evap.meta b/zhang_mcfarlane/zm_conv_evap.meta index a98f2115..4372e564 100644 --- a/zhang_mcfarlane/zm_conv_evap.meta +++ b/zhang_mcfarlane/zm_conv_evap.meta @@ -2,7 +2,6 @@ name = zm_conv_evap type = scheme dependencies = ../to_be_ccppized/wv_saturation.F90 - dependencies = ../cloud_fraction/cloud_fraction_fice.F90 [ccpp-arg-table] name = zm_conv_evap_run @@ -173,11 +172,11 @@ standard_name = precipitation_flux_at_interface_due_to_deep_convection units = kg m-2 s-1 type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_interface_dimension) intent = out [ flxsnow ] standard_name = frozen_precipitation_flux_at_interface_due_to_deep_convection units = kg m-2 s-1 type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_interface_dimension) intent = out diff --git a/zhang_mcfarlane/zm_conv_momtran.F90 b/zhang_mcfarlane/zm_conv_momtran.F90 index 0db7faf7..ef366b98 100644 --- a/zhang_mcfarlane/zm_conv_momtran.F90 +++ b/zhang_mcfarlane/zm_conv_momtran.F90 @@ -57,7 +57,7 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, & real(kind_phys), intent(in) :: ed(:,:) ! Mass entraining from downdraft (ncol,pver) real(kind_phys), intent(in) :: dp(:,:) ! Delta pressure between interfaces (ncol,pver) real(kind_phys), intent(in) :: dsubcld(:) ! Delta pressure from cloud base to sfc (ncol) - real(kind_phys), intent(in) :: dt ! time step in seconds + real(kind_phys), intent(in) :: dt ! time step in seconds integer, intent(in) :: jt(:) ! Index of cloud top for each column (ncol) integer, intent(in) :: mx(:) ! Index of cloud top for each column (ncol) diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index 3f543834..c962f6d7 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -171,7 +171,7 @@ subroutine zm_convr_run( ncol ,pver , & mu ,md ,du ,eu ,ed , & dp ,dsubcld ,jt ,maxg ,ideep , & ql ,rliq ,landfrac, & - rice ,errmsg ,errflg) + rice ,lengath ,errmsg ,errflg) !----------------------------------------------------------------------- ! ! Purpose: @@ -354,8 +354,7 @@ subroutine zm_convr_run( ncol ,pver , & integer, intent(out) :: jt(ncol) ! wg top level index of deep cumulus convection. integer, intent(out) :: maxg(ncol) ! wg gathered values of maxi. - integer lengath -! diagnostic field used by chem/wetdep codes + integer, intent(out) :: lengath !CACNOTE - Figure out real intent for ql real(kind_phys),intent(inout):: ql(ncol,pver) ! wg grid slice of cloud liquid water. @@ -465,6 +464,7 @@ subroutine zm_convr_run( ncol ,pver , & ! zero out variables not used in cam ! + qtnd(:,:) = 0._kind_phys heat(:,:) = 0._kind_phys mcon(:,:) = 0._kind_phys @@ -501,6 +501,7 @@ subroutine zm_convr_run( ncol ,pver , & end do + ! ! calculate local pressure (mbs) and height (m) for both interface ! and mid-layer locations. @@ -558,7 +559,7 @@ subroutine zm_convr_run( ncol ,pver , & tp ,qstp ,tl ,rl ,cape , & pblt ,lcl ,lel ,lon ,maxi , & rgas ,grav ,cpres ,msg , & - zi ,zs ,tpert , landfrac,& + zi ,zs ,tpert , landfrac,& errmsg ,errflg) ! @@ -1788,7 +1789,7 @@ subroutine cldprp(ncol ,pver ,pverp ,cpliq , & real(kind_phys) small real(kind_phys) mdt - real(kind_phys) fice(ncol,pver) ! ice fraction in precip production +!! real(kind_phys) fice(ncol,pver) ! ice fraction in precip production real(kind_phys) tug(ncol,pver) real(kind_phys) tvuo(ncol,pver) ! updraft virtual T w/o freezing heating @@ -1866,7 +1867,7 @@ subroutine cldprp(ncol ,pver ,pverp ,cpliq , & hd(i,k) = hmn(i,k) rprd(i,k) = 0._kind_phys - fice(i,k) = 0._kind_phys +!! fice(i,k) = 0._kind_phys tug(i,k) = 0._kind_phys qcde(i,k) = 0._kind_phys tvuo(i,k) = (shat(i,k) - grav/cp*zf(i,k))*(1._kind_phys + 0.608_kind_phys*qhat(i,k)) diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index faa3863f..ed94ba47 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -290,7 +290,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ delt ] - standard_name = half_timestep_for_physics + standard_name = timestep_for_physics units = s type = real | kind = kind_phys dimensions = () @@ -421,6 +421,12 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent) intent = out +[ lengath ] + standard_name = index_of_last_column_of_gathered_deep_convection_arrays + units = index + type = integer + dimensions = () + intent = out [ errmsg ] standard_name = ccpp_error_message long_name = Error message for error handling in CCPP From 094d677ff6406ddc433214d62b5ec3a617bf257c Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 19 Sep 2024 15:21:39 -0600 Subject: [PATCH 18/36] Changes to fix answers - now roundoff --- suite_zhang_mcfarlane.xml | 14 ++++++++++++++ zhang_mcfarlane/zm_conv_convtran.F90 | 8 +++++++- zhang_mcfarlane/zm_conv_convtran.meta | 7 +++++++ zhang_mcfarlane/zm_conv_evap.F90 | 10 +++++++++- zhang_mcfarlane/zm_conv_evap.meta | 21 +++++++++++++++++++++ zhang_mcfarlane/zm_conv_momtran.F90 | 11 +++++++++-- zhang_mcfarlane/zm_conv_momtran.meta | 21 +++++++++++++++++++++ zhang_mcfarlane/zm_convr.F90 | 4 +++- zhang_mcfarlane/zm_convr.meta | 9 ++++++++- 9 files changed, 99 insertions(+), 6 deletions(-) diff --git a/suite_zhang_mcfarlane.xml b/suite_zhang_mcfarlane.xml index 7c5d85f6..d1978f42 100644 --- a/suite_zhang_mcfarlane.xml +++ b/suite_zhang_mcfarlane.xml @@ -4,9 +4,23 @@ to_be_ccppized_temporary zm_convr + apply_heating_rate + dadadj_apply_qv_tendency + qneg + geopotential_temp cloud_fraction_fice zm_conv_evap + apply_heating_rate + dadadj_apply_qv_tendency + qneg + geopotential_temp + cloud_fraction_fice zm_conv_momtran + apply_heating_rate + apply_tendency_of_eastward_wind + apply_tendency_of_northward_wind + qneg + geopotential_temp zm_conv_convtran zm_diagnostics diff --git a/zhang_mcfarlane/zm_conv_convtran.F90 b/zhang_mcfarlane/zm_conv_convtran.F90 index 63629dff..6c2a666b 100644 --- a/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/zhang_mcfarlane/zm_conv_convtran.F90 @@ -22,7 +22,8 @@ subroutine zm_conv_convtran_run(ncol, pver, & doconvtran,q ,ncnst ,mu ,md , & du ,eu ,ed ,dp ,dsubcld , & jt ,mx ,ideep ,il1g ,il2g , & - nstep ,fracis ,dqdt ,dpdry ,const_metadata, errmsg, errflg) + nstep ,fracis ,dqdt ,dpdry ,const_metadata, & + scheme_name, errmsg, errflg) ! ccpp_constituent_properties - standard name -- see chat !----------------------------------------------------------------------- @@ -74,6 +75,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & type(ccpp_constituent_prop_ptr_t), intent(in) :: const_metadata(:) + character(len=40), intent(out) :: scheme_name character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg @@ -124,6 +126,10 @@ subroutine zm_conv_convtran_run(ncol, pver, & !----------------------------------------------------------------------- ! + scheme_name = "zm_conv_convtran_run" + errmsg = '' + errflg = 0 + small = 1.e-36_kind_phys ! mbsth is the threshold below which we treat the mass fluxes as zero (in mb/s) mbsth = 1.e-15_kind_phys diff --git a/zhang_mcfarlane/zm_conv_convtran.meta b/zhang_mcfarlane/zm_conv_convtran.meta index 5b1d357c..f0000d1a 100644 --- a/zhang_mcfarlane/zm_conv_convtran.meta +++ b/zhang_mcfarlane/zm_conv_convtran.meta @@ -137,6 +137,13 @@ type = ccpp_constituent_prop_ptr_t dimensions = (number_of_ccpp_constituents) intent = in +[ scheme_name ] + standard_name = scheme_name + long_name = scheme name + units = none + type = character | kind = len=40 + dimensions = () + intent = out [ errmsg ] standard_name = ccpp_error_message long_name = Error message for error handling in CCPP diff --git a/zhang_mcfarlane/zm_conv_evap.F90 b/zhang_mcfarlane/zm_conv_evap.F90 index b2ea4d25..290e19c6 100644 --- a/zhang_mcfarlane/zm_conv_evap.F90 +++ b/zhang_mcfarlane/zm_conv_evap.F90 @@ -28,7 +28,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & landfrac, & tend_s, tend_s_snwprd, tend_s_snwevmlt, tend_q, & prdprec, cldfrc, deltat, & - prec, snow, ntprprd, ntsnprd, fsnow_conv, flxprec, flxsnow) + prec, snow, ntprprd, ntsnprd, fsnow_conv, flxprec, flxsnow, scheme_name, errmsg, errflg) !----------------------------------------------------------------------- ! Compute tendencies due to evaporation of rain from ZM scheme @@ -83,6 +83,11 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys),intent(out) :: flxsnow(:,:) ! Convective-scale flux of snow at interfaces (kg/m2/s) ! (ncol,pverp) real(kind_phys),intent(out) :: ntprprd(:,:) ! net precip production in layer ! (ncol,pver) real(kind_phys),intent(out) :: ntsnprd(:,:) ! net snow production in layer ! (ncol,pver) + + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + character(len=40), intent(out) :: scheme_name + real(kind_phys) :: work1 ! temp variable (pjr) real(kind_phys) :: work2 ! temp variable (pjr) @@ -103,6 +108,9 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & !----------------------------------------------------------------------- + scheme_name = "zm_conv_evap_run" + errmsg = '' + errflg = 0 old_snow=.true. diff --git a/zhang_mcfarlane/zm_conv_evap.meta b/zhang_mcfarlane/zm_conv_evap.meta index 4372e564..d32a88e5 100644 --- a/zhang_mcfarlane/zm_conv_evap.meta +++ b/zhang_mcfarlane/zm_conv_evap.meta @@ -180,3 +180,24 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_interface_dimension) intent = out +[ scheme_name ] + standard_name = scheme_name + long_name = scheme name + units = none + type = character | kind = len=40 + dimensions = () + intent = out +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out diff --git a/zhang_mcfarlane/zm_conv_momtran.F90 b/zhang_mcfarlane/zm_conv_momtran.F90 index ef366b98..fc1c859a 100644 --- a/zhang_mcfarlane/zm_conv_momtran.F90 +++ b/zhang_mcfarlane/zm_conv_momtran.F90 @@ -22,7 +22,7 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, & du, eu, ed, dp, dsubcld , & jt, mx, ideep , il1g, il2g, & nstep, windu_tend, windv_tend, pguallu, pguallv, pgdallu, pgdallv, & - icwuu, icwuv, icwdu, icwdv, dt, seten) + icwuu, icwuv, icwdu, icwdv, dt, seten, scheme_name, errmsg, errflg) !----------------------------------------------------------------------- ! ! Purpose: @@ -73,6 +73,10 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, & real(kind_phys), intent(out) :: windu_tend(:,:) ! U wind tendency real(kind_phys), intent(out) :: windv_tend(:,:) ! V wind tendency + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + character(len=40), intent(out) :: scheme_name + !--------------------------Local Variables------------------------------ integer i ! Work index @@ -141,7 +145,10 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, & !----------------------------------------------------------------------- -! + scheme_name = "zm_conv_momtran_run" + errmsg = '' + errflg = 0 + ! Combine winds in single array winds(:,:,1) = windu(:,:) winds(:,:,2) = windv(:,:) diff --git a/zhang_mcfarlane/zm_conv_momtran.meta b/zhang_mcfarlane/zm_conv_momtran.meta index eea65895..4f289f9d 100644 --- a/zhang_mcfarlane/zm_conv_momtran.meta +++ b/zhang_mcfarlane/zm_conv_momtran.meta @@ -203,3 +203,24 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out +[ scheme_name ] + standard_name = scheme_name + long_name = scheme name + units = none + type = character | kind = len=40 + dimensions = () + intent = out +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index c962f6d7..4d3ef5e9 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -171,7 +171,7 @@ subroutine zm_convr_run( ncol ,pver , & mu ,md ,du ,eu ,ed , & dp ,dsubcld ,jt ,maxg ,ideep , & ql ,rliq ,landfrac, & - rice ,lengath ,errmsg ,errflg) + rice ,lengath ,scheme_name, errmsg ,errflg) !----------------------------------------------------------------------- ! ! Purpose: @@ -332,6 +332,7 @@ subroutine zm_convr_run( ncol ,pver , & integer, intent(out) :: ideep(:) ! column indices of gathered points (ncol) + character(len=40), intent(out) :: scheme_name character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg @@ -453,6 +454,7 @@ subroutine zm_convr_run( ncol ,pver , & ! !--------------------------Data statements------------------------------ + scheme_name = "zm_convr_run" errmsg = '' errflg = 0 ! diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index ed94ba47..9cbda9f3 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -266,7 +266,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ heat ] - standard_name = dry_static_energy + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure units = J kg-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) @@ -427,6 +427,13 @@ type = integer dimensions = () intent = out +[ scheme_name ] + standard_name = scheme_name + long_name = scheme name + units = none + type = character | kind = len=40 + dimensions = () + intent = out [ errmsg ] standard_name = ccpp_error_message long_name = Error message for error handling in CCPP From fd27d140fbd2a0c1365454ba18059d346eca575b Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Tue, 24 Sep 2024 10:45:28 -0600 Subject: [PATCH 19/36] Change Liceense to Apache 2.0 Replace original, locally-developed license with Apache 2.0 license. --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 592fe830a0bf248456196555312320014c5f3b5f Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Tue, 24 Sep 2024 10:49:21 -0600 Subject: [PATCH 20/36] Remove old license file. --- LICENSE.txt | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 8c3b9387..00000000 --- a/LICENSE.txt +++ /dev/null @@ -1,34 +0,0 @@ -Copyright (c) 2017, University Corporation for Atmospheric Research (UCAR) -All rights reserved. - -Developed by: - University Corporation for Atmospheric Research - National Center for Atmospheric Research - https://www.cesm.ucar.edu/working_groups/Atmosphere - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the "Software"), -to deal with the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the documentation - and/or other materials provided with the distribution. - - Neither the names of [Name of Development Group, UCAR], - nor the names of its contributors may be used to endorse or promote - products derived from this Software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. From bff9925ba34f8059f341d58fed8c844df2dd3d80 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 27 Sep 2024 14:31:36 -0600 Subject: [PATCH 21/36] cleanup and fix a couple of bugs --- suite_zhang_mcfarlane.xml | 2 ++ zhang_mcfarlane/zm_conv_convtran.F90 | 5 ++--- zhang_mcfarlane/zm_conv_convtran.meta | 2 +- zhang_mcfarlane/zm_conv_evap.F90 | 12 ------------ zhang_mcfarlane/zm_convr.F90 | 1 - 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/suite_zhang_mcfarlane.xml b/suite_zhang_mcfarlane.xml index d1978f42..e520e413 100644 --- a/suite_zhang_mcfarlane.xml +++ b/suite_zhang_mcfarlane.xml @@ -2,6 +2,7 @@ + initialize_constituents to_be_ccppized_temporary zm_convr apply_heating_rate @@ -22,6 +23,7 @@ qneg geopotential_temp zm_conv_convtran + apply_constituent_tendencies zm_diagnostics diff --git a/zhang_mcfarlane/zm_conv_convtran.F90 b/zhang_mcfarlane/zm_conv_convtran.F90 index 6c2a666b..9baedcd5 100644 --- a/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/zhang_mcfarlane/zm_conv_convtran.F90 @@ -144,17 +144,17 @@ subroutine zm_conv_convtran_run(ncol, pver, & ! Loop ever each constituent !CACNOTE - This should probably loop 1, ncnst - figure out what was being done for 1 + dqdt(:,:,:) = 0._kind_phys do m = 1, ncnst call const_metadata(m)%standard_name(standard_name) write(0,*) ' standard_name=',standard_name - if (standard_name == 'water_vapor_wrt_moist_air_and_condensed_water') then + if (standard_name == 'water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water') then cycle end if if (doconvtran(m)) then -! if (cnst_get_type_byind(m).eq.'dry') then call const_metadata(m)%is_dry(is_dry, errflg, errmsg) write(0,*) ' is_dry=', is_dry if (is_dry) then @@ -301,7 +301,6 @@ subroutine zm_conv_convtran_run(ncol, pver, & end do ! Initialize to zero everywhere, then scatter tendency back to full array - dqdt(:,:,m) = 0._kind_phys do k = 1,pver kp1 = min(pver,k+1) do i = il1g,il2g diff --git a/zhang_mcfarlane/zm_conv_convtran.meta b/zhang_mcfarlane/zm_conv_convtran.meta index f0000d1a..222fe9d4 100644 --- a/zhang_mcfarlane/zm_conv_convtran.meta +++ b/zhang_mcfarlane/zm_conv_convtran.meta @@ -120,7 +120,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_ccpp_constituents) intent = in [ dqdt ] - standard_name = tendency_of_ccpp_constituents + standard_name = ccpp_constituent_tendencies units = none type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_ccpp_constituents) diff --git a/zhang_mcfarlane/zm_conv_evap.F90 b/zhang_mcfarlane/zm_conv_evap.F90 index 290e19c6..5786b337 100644 --- a/zhang_mcfarlane/zm_conv_evap.F90 +++ b/zhang_mcfarlane/zm_conv_evap.F90 @@ -2,9 +2,6 @@ module zm_conv_evap use ccpp_kinds, only: kind_phys -! CACNOTE - Need to ccpp'ize cloud_fraction -! use cloud_fraction_fice, only: cldfrc_fice - implicit none save @@ -39,7 +36,6 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & ! Evaporate some of the precip directly into the environment using a Sundqvist type algorithm !----------------------------------------------------------------------- -!CACNOTE - Not sure what to do about qsat_water use wv_saturation, only: qsat !------------------------------Arguments-------------------------------- @@ -122,14 +118,6 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & call qsat(t(1:ncol,k), pmid(1:ncol,k), es(1:ncol,k), qs(1:ncol,k), ncol) end do -! CACNOTE Now it's own scheme -!!! determine ice fraction in rain production (use cloud water parameterization fraction at present) -!!!REMOVECAM - no longer need these when CAM is retired and pcols no longer exists -!! fice(:,:) = 0._kind_phys -!! fsnow_conv(:,:) = 0._kind_phys -!!!REMOVECAM_END -!!! call cldfrc_fice_run(ncol, t(1:ncol,:), tmelt, fice(1:ncol,:), fsnow_conv(1:ncol,:)) - ! zero the flux integrals on the top boundary flxprec(:ncol,1) = 0._kind_phys flxsnow(:ncol,1) = 0._kind_phys diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index 4d3ef5e9..a03a7096 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -2704,7 +2704,6 @@ end subroutine q1q2_pjr ! qsat_water uses Pa internally, so get it right, need to pass in Pa. ! Afterward, set es back to hPa. subroutine qsat_hPa(t, p, es, qm) -!CACNOTE - Need to figure out how to handle this use wv_saturation, only: qsat_water ! Inputs From 752c550e45ac7e2452e2d8699645cc200c6dc03d Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 30 Sep 2024 09:06:42 -0600 Subject: [PATCH 22/36] add some ZM diagnostics --- cam_diagnostics/zm_diagnostics.F90 | 35 ++++++++++++++++++++++++----- cam_diagnostics/zm_diagnostics.meta | 18 +++++++++++++++ 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/cam_diagnostics/zm_diagnostics.F90 b/cam_diagnostics/zm_diagnostics.F90 index 081461ab..c8133cf4 100644 --- a/cam_diagnostics/zm_diagnostics.F90 +++ b/cam_diagnostics/zm_diagnostics.F90 @@ -42,10 +42,12 @@ subroutine zm_diagnostics_init(errmsg, errflg) errmsg = '' errflg = 0 - call history_add_field ('ZM_ORG ', 'Organization parameter', 'lev', 'avg', '1') - call history_add_field ('ZM_ORG2D ', 'Organization parameter 2D', 'lev', 'avg', '1') + call history_add_field ('ZM_ORG ', 'zhang_mcfarlane_organization_parameter_of_deep_convection', 'lev', 'avg', '1') + call history_add_field ('ZM_ORG2D ', 'zhang_mcfarlane_organization_parameter_of_deep_convection_copied_to_whole_column',& + 'lev', 'avg', '1') - call history_add_field ('PRECZ', 'total precipitation from ZM convection', horiz_only, 'avg', 'm s-1') + call history_add_field ('PRECZ', 'lwe_precipitation_rate_at_surface_due_to_deep_convection_due_to_Zhang-McFarlane', & + horiz_only, 'avg', 'm s-1') call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') call history_add_field ('ZMDQ', 'Q tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'kg kg-1 s-1') call history_add_field ('ZMDICE', 'Cloud ice tendency - Zhang-McFarlane convection', 'lev', 'avg', 'kg kg-1 s-1') @@ -67,7 +69,7 @@ subroutine zm_diagnostics_init(errmsg, errflg) call history_add_field ('PCONVB', 'convection base pressure', horiz_only , 'avg', 'Pa' ) call history_add_field ('PCONVT', 'convection top pressure', horiz_only , 'avg', 'Pa' ) - call history_add_field ('CAPE', 'Convectively available potential energy', horiz_only, 'avg', 'J kg-1') + call history_add_field ('CAPE', 'zhang_mcfarlane_convective_available_potential_energycap', horiz_only, 'avg', 'J kg-1') call history_add_field ('FREQZM', 'Fractional occurance of ZM convection', horiz_only , 'avg', 'fraction') call history_add_field ('ZMMTT', 'T tendency - ZM convective momentum transport', 'lev', 'avg', 'K s-1') call history_add_field ('ZMMTU', 'U tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') @@ -93,7 +95,7 @@ end subroutine zm_diagnostics_init !> \section arg_table_zm_diagnostics_run Argument Table !! \htmlinclude zm_diagnostics_run.html - subroutine zm_diagnostics_run(ncol, pver, cpair, heat, prec, errmsg, errflg) + subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, errmsg, errflg) use cam_history, only: history_out_field !------------------------------------------------ @@ -101,26 +103,49 @@ subroutine zm_diagnostics_run(ncol, pver, cpair, heat, prec, errmsg, errflg) !------------------------------------------------ integer, intent(in) :: ncol integer, intent(in) :: pver + integer, intent(in) :: pverp + integer, intent(in) :: ideep(:) real(kind_phys), intent(in) :: cpair real(kind_phys), intent(in) :: heat(:,:) real(kind_phys), intent(in) :: prec(:) + real(kind_phys), intent(in) :: cape(:) ! CCPP error handling variables character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg + integer :: lengath ! number of columns with deep convection + real(kind_phys) :: ftem(ncol,pver) + real(kind_phys) :: mcon(ncol,pverp) + real(kind_phys) :: mconzm(ncol,pverp) errmsg = '' errflg = 0 + lengath = count(ideep > 0) + if (lengath > ncol) lengath = ncol ! should not happen, but force it to not be larger than ncol for safety sake + call history_out_field('PRECZ', prec) ftem(:,:) = 0._kind_phys ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair call history_out_field('ZMDT', ftem) + call history_out_field('CAPE', cape) + + freqzm(:) = 0._r8 + do i = 1,lengath + freqzm(ideep(i)) = 1.0_r8 + end do + call history_out_field('FREQZM ',freqzm) +` + mcon(:ncol,:pverp) = mcon(:ncol,:pverp) * 100._r8/gravit + mconzm(:ncol,:pverp) = mcon(:ncol,:pverp) + + call outfld('CMFMC_DP', mconzm) + end subroutine zm_diagnostics_run !======================================================================= diff --git a/cam_diagnostics/zm_diagnostics.meta b/cam_diagnostics/zm_diagnostics.meta index 560832f8..da0dcf04 100644 --- a/cam_diagnostics/zm_diagnostics.meta +++ b/cam_diagnostics/zm_diagnostics.meta @@ -35,6 +35,18 @@ type = integer dimensions = () intent = in +[ pverp ] + standard_name = vertical_interface_dimension + units = count + type = integer + dimensions = () + intent = in +[ ideep ] + standard_name = horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns + units = index + type = integer + dimensions = (horizontal_loop_extent) + intent = in [ cpair ] standard_name = specific_heat_of_dry_air_at_constant_pressure units = J kg-1 K-1 @@ -53,6 +65,12 @@ type = real | kind = kind_phys dimensions = (1:horizontal_loop_extent) intent = in +[ cape ] + standard_name = zhang_mcfarlane_convective_available_potential_energy + units = J kg-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in [ errmsg ] standard_name = ccpp_error_message long_name = Error message for error handling in CCPP From d17b4ed886a1bea3685717ee0262287ba96f385c Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Fri, 11 Oct 2024 16:51:02 -0600 Subject: [PATCH 23/36] Next phase of updates to ZM, including introducing zm_tendency_diagnostics --- cam_diagnostics/zm_diagnostics.F90 | 43 ++++---- cam_diagnostics/zm_tendency_diagnostics.F90 | 108 +++++++++++++++++++ cam_diagnostics/zm_tendency_diagnostics.meta | 69 ++++++++++++ suite_zhang_mcfarlane.xml | 2 + utilities/physics_tendency_updaters.F90 | 26 +++++ utilities/physics_tendency_updaters.meta | 49 +++++++++ zhang_mcfarlane/zm_conv_convtran.F90 | 30 ++++++ zhang_mcfarlane/zm_conv_convtran.meta | 35 ++++++ 8 files changed, 337 insertions(+), 25 deletions(-) create mode 100644 cam_diagnostics/zm_tendency_diagnostics.F90 create mode 100644 cam_diagnostics/zm_tendency_diagnostics.meta diff --git a/cam_diagnostics/zm_diagnostics.F90 b/cam_diagnostics/zm_diagnostics.F90 index c8133cf4..6c744be1 100644 --- a/cam_diagnostics/zm_diagnostics.F90 +++ b/cam_diagnostics/zm_diagnostics.F90 @@ -48,15 +48,6 @@ subroutine zm_diagnostics_init(errmsg, errflg) call history_add_field ('PRECZ', 'lwe_precipitation_rate_at_surface_due_to_deep_convection_due_to_Zhang-McFarlane', & horiz_only, 'avg', 'm s-1') - call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') - call history_add_field ('ZMDQ', 'Q tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'kg kg-1 s-1') - call history_add_field ('ZMDICE', 'Cloud ice tendency - Zhang-McFarlane convection', 'lev', 'avg', 'kg kg-1 s-1') - call history_add_field ('ZMDLIQ', 'Cloud liq tendency - Zhang-McFarlane convection', 'lev', 'avg', 'kg kg-1 s-1') - call history_add_field ('EVAPTZM', 'T tendency - Evaporation/snow prod from Zhang convection', 'lev', 'avg', 'K s-1') - call history_add_field ('FZSNTZM', 'T tendency - Rain to snow conversion from Zhang convection', 'lev', 'avg', 'K s-1') - call history_add_field ('EVSNTZM', 'T tendency - Snow to rain prod from Zhang convection', 'lev', 'avg', 'K s-1') - call history_add_field ('EVAPQZM', 'Q tendency - Evaporation from Zhang-McFarlane moist convection', 'lev', 'avg', & - 'kg kg-1 s-1') call history_add_field ('ZMFLXPRC', 'Flux of precipitation from ZM convection', 'ilev', 'avg', 'kg m-2 s-1') call history_add_field ('ZMFLXSNW', 'Flux of snow from ZM convection', 'ilev', 'avg', 'kg m-2 s-1') call history_add_field ('ZMNTPRPD', 'Net precipitation production from ZM convection', 'lev', 'avg', 'kg kg-1 s-1') @@ -71,9 +62,6 @@ subroutine zm_diagnostics_init(errmsg, errflg) call history_add_field ('CAPE', 'zhang_mcfarlane_convective_available_potential_energycap', horiz_only, 'avg', 'J kg-1') call history_add_field ('FREQZM', 'Fractional occurance of ZM convection', horiz_only , 'avg', 'fraction') - call history_add_field ('ZMMTT', 'T tendency - ZM convective momentum transport', 'lev', 'avg', 'K s-1') - call history_add_field ('ZMMTU', 'U tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') - call history_add_field ('ZMMTV', 'V tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') call history_add_field ('ZMMU', 'ZM convection updraft mass flux', 'lev', 'avg', 'kg m-2 s-1') call history_add_field ('ZMMD', 'ZM convection downdraft mass flux', 'lev', 'avg', 'kg m-2 s-1') @@ -98,12 +86,14 @@ end subroutine zm_diagnostics_init subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, errmsg, errflg) use cam_history, only: history_out_field + !------------------------------------------------ ! Input / output parameters !------------------------------------------------ integer, intent(in) :: ncol integer, intent(in) :: pver integer, intent(in) :: pverp +! real(kind_phys), intent(in) :: const_array(:,:,:) integer, intent(in) :: ideep(:) real(kind_phys), intent(in) :: cpair @@ -121,6 +111,8 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, real(kind_phys) :: mcon(ncol,pverp) real(kind_phys) :: mconzm(ncol,pverp) + integer :: index_cldliq + errmsg = '' errflg = 0 @@ -129,22 +121,23 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, call history_out_field('PRECZ', prec) - ftem(:,:) = 0._kind_phys - ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair - call history_out_field('ZMDT', ftem) +! ftem(:,:) = 0._kind_phys +! ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair +! call history_out_field('ZMDT', ftem) + +! call history_out_field('CAPE', cape) + +! freqzm(:) = 0._r8 +! do i = 1,lengath +! freqzm(ideep(i)) = 1.0_r8 +! end do +! call history_out_field('FREQZM ',freqzm) - call history_out_field('CAPE', cape) +! mcon(:ncol,:pverp) = mcon(:ncol,:pverp) * 100._r8/gravit +! mconzm(:ncol,:pverp) = mcon(:ncol,:pverp) - freqzm(:) = 0._r8 - do i = 1,lengath - freqzm(ideep(i)) = 1.0_r8 - end do - call history_out_field('FREQZM ',freqzm) -` - mcon(:ncol,:pverp) = mcon(:ncol,:pverp) * 100._r8/gravit - mconzm(:ncol,:pverp) = mcon(:ncol,:pverp) +! call outfld('CMFMC_DP', mconzm) - call outfld('CMFMC_DP', mconzm) end subroutine zm_diagnostics_run diff --git a/cam_diagnostics/zm_tendency_diagnostics.F90 b/cam_diagnostics/zm_tendency_diagnostics.F90 new file mode 100644 index 00000000..d7a4c9b3 --- /dev/null +++ b/cam_diagnostics/zm_tendency_diagnostics.F90 @@ -0,0 +1,108 @@ +module zm_tendency_diagnostics +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! THIS IS A TEMPLATE +! 1. copy this file to a new file with the correct name +! (SCHEME_diagnostics.F90) +! 2. do a search and replace for "SCHEME" in this file and +! replace with your scheme name +! 3. Add desired history_add_field calls to the init phase +! 4. Add all fields that are being output as inputs to the run phase +! 5. Add desired history_out_field calls to the run phase +! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 +! file to generate the metadata +! 7. Complete the metadata (fill out standard names, units, dimensions) +! 8. Add this scheme to the SDF file for your suite (likely will be at end) +! 9. Delete this header section +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + use ccpp_kinds, only: kind_phys + + implicit none + private + save + + public :: zm_tendency_diagnostics_init ! init routine + public :: zm_tendency_diagnostics_run ! main routine + +CONTAINS + + !> \section arg_table_zm_tendency_diagnostics_init Argument Table + !! \htmlinclude zm_tendency_diagnostics_init.html + subroutine zm_tendency_diagnostics_init(errmsg, errflg) + use cam_history, only: history_add_field + use cam_history_support, only: horiz_only + + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables: + + errmsg = '' + errflg = 0 + + call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') + call history_add_field ('ZMDQ', 'Q tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('ZMDICE', 'Cloud ice tendency - Zhang-McFarlane convection', 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('ZMDLIQ', 'Cloud liq tendency - Zhang-McFarlane convection', 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('EVAPTZM', 'T tendency - Evaporation/snow prod from Zhang convection', 'lev', 'avg', 'K s-1') + call history_add_field ('FZSNTZM', 'T tendency - Rain to snow conversion from Zhang convection', 'lev', 'avg', 'K s-1') + call history_add_field ('EVSNTZM', 'T tendency - Snow to rain prod from Zhang convection', 'lev', 'avg', 'K s-1') + call history_add_field ('EVAPQZM', 'Q tendency - Evaporation from Zhang-McFarlane moist convection', 'lev', 'avg', & + 'kg kg-1 s-1') + call history_add_field ('ZMMTT', 'T tendency - ZM convective momentum transport', 'lev', 'avg', 'K s-1') + call history_add_field ('ZMMTU', 'U tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') + call history_add_field ('ZMMTV', 'V tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') + + end subroutine zm_tendency_diagnostics_init + + !> \section arg_table_zm_tendency_diagnostics_run Argument Table + !! \htmlinclude zm_tendency_diagnostics_run.html + subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, errmsg, errflg) + + use cam_history, only: history_out_field + use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t + !------------------------------------------------ + ! Input / output parameters + !------------------------------------------------ + integer, intent(in) :: ncol + integer, intent(in) :: pver + integer, intent(in) :: pverp + type(ccpp_constituent_prop_ptr_t), intent(in) :: const_props(:) + real(kind_phys), intent(in) :: dqdt(:,:,:) ! Tracer tendency array (ncol,pver,ncnst) + + ! CCPP error handling variables + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + integer :: lengath ! number of columns with deep convection + integer :: const_idx + character(len=256) :: standard_name + + real(kind_phys) :: ftem(ncol,pver) + real(kind_phys) :: mcon(ncol,pverp) + real(kind_phys) :: mconzm(ncol,pverp) + + errmsg = '' + errflg = 0 + + do const_idx = 1, size(const_props) + call const_props(const_idx)%standard_name(standard_name, errflg, errmsg) + + ! Use the regular constituent names, as the location in the dqdt array match the constituent ordering in the + ! constituent properties + + select case (trim(standard_name)) + + case('cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water') + call history_out_field('ZMDLIQ', dqdt(:,:,const_idx)) + end select + + end do + + end subroutine zm_tendency_diagnostics_run + + !======================================================================= + +end module zm_tendency_diagnostics diff --git a/cam_diagnostics/zm_tendency_diagnostics.meta b/cam_diagnostics/zm_tendency_diagnostics.meta new file mode 100644 index 00000000..cca5cd56 --- /dev/null +++ b/cam_diagnostics/zm_tendency_diagnostics.meta @@ -0,0 +1,69 @@ +[ccpp-table-properties] + name = zm_tendency_diagnostics + type = scheme + +[ccpp-arg-table] + name = zm_tendency_diagnostics_init + type = scheme +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out + +[ccpp-arg-table] + name = zm_tendency_diagnostics_run + type = scheme +[ 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 +[ pverp ] + standard_name = vertical_interface_dimension + units = count + type = integer + dimensions = () + intent = in +[ const_props ] + standard_name = ccpp_constituent_properties + units = None + type = ccpp_constituent_prop_ptr_t + dimensions = (number_of_ccpp_constituents) + intent = in +[ dqdt ] + standard_name = ccpp_constituent_tendencies + units = none + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_ccpp_constituents) + intent = in +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out diff --git a/suite_zhang_mcfarlane.xml b/suite_zhang_mcfarlane.xml index e520e413..bf604f3e 100644 --- a/suite_zhang_mcfarlane.xml +++ b/suite_zhang_mcfarlane.xml @@ -23,7 +23,9 @@ qneg geopotential_temp zm_conv_convtran + zm_tendency_diagnostics apply_constituent_tendencies + geopotential_temp zm_diagnostics diff --git a/utilities/physics_tendency_updaters.F90 b/utilities/physics_tendency_updaters.F90 index 936e7bc8..271259ab 100644 --- a/utilities/physics_tendency_updaters.F90 +++ b/utilities/physics_tendency_updaters.F90 @@ -9,6 +9,7 @@ module physics_tendency_updaters public :: apply_tendency_of_northward_wind_run public :: apply_heating_rate_run public :: apply_tendency_of_air_temperature_run + public :: apply_constituent_tendencies_run CONTAINS @@ -117,4 +118,29 @@ subroutine apply_tendency_of_air_temperature_run(nz, t_tend, temp, dtdT_total, end subroutine apply_tendency_of_air_temperature_run + !> \section arg_table_apply_constituent_tendencies_run Argument Table + !!! \htmlinclude apply_constituent_tendencies_run.html + subroutine apply_constituent_tendencies_run(nz, const_tend, const, dt, errcode, errmsg) + ! Dummy arguments + integer, intent(in) :: nz ! Num vertical layers + real(kind_phys), intent(inout) :: const_tend(:,:,:) ! constituent tendency array + real(kind_phys), intent(inout) :: const(:,:,:) ! constituent state array + real(kind_phys), intent(in) :: dt ! physics time step + integer, intent(out) :: errcode + character(len=512), intent(out) :: errmsg + + ! Local variables + integer :: klev + + errcode = 0 + errmsg = '' + + do klev = 1, nz + const(:, klev, :) = const(:, klev, :) + (const_tend(:, klev, :) * dt) + end do + + const_tend = 0._kind_phys + + end subroutine apply_constituent_tendencies_run + end module physics_tendency_updaters diff --git a/utilities/physics_tendency_updaters.meta b/utilities/physics_tendency_updaters.meta index 8bbe77ef..e0e5bfa8 100644 --- a/utilities/physics_tendency_updaters.meta +++ b/utilities/physics_tendency_updaters.meta @@ -215,4 +215,53 @@ type = character | kind = len=512 dimensions = () intent = out +##################################################################### +[ccpp-table-properties] + name = apply_constituent_tendencies + type = scheme +[ccpp-arg-table] + name = apply_constituent_tendencies_run + type = scheme +[ nz ] + standard_name = vertical_layer_dimension + long_name = Number of vertical layers + units = count + type = integer + dimensions = () + intent = in +[ const_tend ] + standard_name = ccpp_constituent_tendencies + long_name = ccpp constituent tendencies + units = none + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent, vertical_layer_dimension, number_of_ccpp_constituents) + intent = inout +[ const ] + standard_name = ccpp_constituents + long_name = ccpp constituents + units = none + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent, vertical_layer_dimension, number_of_ccpp_constituents) + intent = inout +[ dt ] + standard_name = timestep_for_physics + long_name = time step + units = s + dimensions = () + type = real | kind = kind_phys + intent = in +[ errcode ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out ######################################################### diff --git a/zhang_mcfarlane/zm_conv_convtran.F90 b/zhang_mcfarlane/zm_conv_convtran.F90 index 9baedcd5..8b8e0794 100644 --- a/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/zhang_mcfarlane/zm_conv_convtran.F90 @@ -9,11 +9,41 @@ module zm_conv_convtran ! ! PUBLIC: interfaces ! + public zm_conv_convtran_init public zm_conv_convtran_run ! convective transport contains +!=============================================================================== +!> \section arg_table_zm_conv_convtran_init Argument Table +!! \htmlinclude zm_conv_convtran_init.html +!! +subroutine zm_conv_convtran_init(qprops, ncnst, doconvtran, errmsg, errflg) + +use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t + + implicit none + + type(ccpp_constituent_prop_ptr_t), intent(in) :: qprops(:) + integer, intent(in) :: ncnst ! number of tracers to transport + + logical, intent(out) :: doconvtran(:) ! flag for doing convective transport (ncnst) + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + + integer :: q_index + + errmsg = '' + errflg = 0 + + do q_index=1,ncnst + call qprops(q_index)%is_water_species(doconvtran(q_index), errflg, errmsg) + if (errflg /= 0) return + end do + +end subroutine zm_conv_convtran_init !=============================================================================== !> \section arg_table_zm_conv_convtran_run Argument Table !! \htmlinclude zm_conv_convtran_run.html diff --git a/zhang_mcfarlane/zm_conv_convtran.meta b/zhang_mcfarlane/zm_conv_convtran.meta index 222fe9d4..400d0e25 100644 --- a/zhang_mcfarlane/zm_conv_convtran.meta +++ b/zhang_mcfarlane/zm_conv_convtran.meta @@ -2,6 +2,41 @@ name = zm_conv_convtran type = scheme +[ccpp-arg-table] + name = zm_conv_convtran_init + type = scheme +[ qprops ] + standard_name = ccpp_constituent_properties + units = None + type = ccpp_constituent_prop_ptr_t + dimensions = (number_of_ccpp_constituents) + intent = in +[ ncnst ] + standard_name = number_of_ccpp_constituents + units = count + type = integer + dimensions = () + intent = in +[ doconvtran ] + standard_name = flag_for_tracer_transport_by_zhang_mcfarlane_deep_scheme + units = flag + type = logical + dimensions = (number_of_ccpp_constituents) + intent = out +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out [ccpp-arg-table] name = zm_conv_convtran_run type = scheme From 307d8bc9ee4d399fc590e862c2bdaef567b7bc26 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 22 Oct 2024 16:08:56 -0600 Subject: [PATCH 24/36] preliminary diagnostics --- .../zm_convr_tendency_diagnostics.F90 | 99 ++++ cam_diagnostics/zm_diagnostics.F90 | 134 ++++-- cam_diagnostics/zm_diagnostics.meta | 453 ++++++++++++++++++ .../zm_evap_tendency_diagnostics.F90 | 95 ++++ .../zm_momtran_tendency_diagnostics.F90 | 91 ++++ cam_diagnostics/zm_tendency_diagnostics.F90 | 16 +- suite_zhang_mcfarlane.xml | 1 + 7 files changed, 840 insertions(+), 49 deletions(-) create mode 100644 cam_diagnostics/zm_convr_tendency_diagnostics.F90 create mode 100644 cam_diagnostics/zm_evap_tendency_diagnostics.F90 create mode 100644 cam_diagnostics/zm_momtran_tendency_diagnostics.F90 diff --git a/cam_diagnostics/zm_convr_tendency_diagnostics.F90 b/cam_diagnostics/zm_convr_tendency_diagnostics.F90 new file mode 100644 index 00000000..d3363b11 --- /dev/null +++ b/cam_diagnostics/zm_convr_tendency_diagnostics.F90 @@ -0,0 +1,99 @@ +module zm_convr_diagnostics +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! THIS IS A TEMPLATE +! 1. copy this file to a new file with the correct name +! (SCHEME_diagnostics.F90) +! 2. do a search and replace for "SCHEME" in this file and +! replace with your scheme name +! 3. Add desired history_add_field calls to the init phase +! 4. Add all fields that are being output as inputs to the run phase +! 5. Add desired history_out_field calls to the run phase +! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 +! file to generate the metadata +! 7. Complete the metadata (fill out standard names, units, dimensions) +! 8. Add this scheme to the SDF file for your suite (likely will be at end) +! 9. Delete this header section +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + use ccpp_kinds, only: kind_phys + + implicit none + private + save + + public :: zm_convr_diagnostics_init ! init routine + public :: zm_convr_diagnostics_run ! main routine + +CONTAINS + + !> \section arg_table_zm_convr_diagnostics_init Argument Table + !! \htmlinclude zm_convr_diagnostics_init.html + subroutine zm_convr_diagnostics_init(errmsg, errflg) + use cam_history, only: history_add_field + use cam_history_support, only: horiz_only + + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables: + + errmsg = '' + errflg = 0 + + call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') + call history_add_field ('ZMDQ', 'Q tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'kg kg-1 s-1') + + end subroutine zm_convr_diagnostics_init + + !> \section arg_table_zm_convr_diagnostics_run Argument Table + !! \htmlinclude zm_convr_diagnostics_run.html + subroutine zm_convr_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, errmsg, errflg) + + use cam_history, only: history_out_field + + !------------------------------------------------ + ! Input / output parameters + !------------------------------------------------ + integer, intent(in) :: ncol + integer, intent(in) :: pver + integer, intent(in) :: pverp +! real(kind_phys), intent(in) :: const_array(:,:,:) + integer, intent(in) :: ideep(:) + + real(kind_phys), intent(in) :: cpair + real(kind_phys), intent(in) :: heat(:,:) + real(kind_phys), intent(in) :: prec(:) + real(kind_phys), intent(in) :: cape(:) + + ! CCPP error handling variables + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + integer :: lengath ! number of columns with deep convection + + real(kind_phys) :: freqzm(ncol) + real(kind_phys) :: ftem(ncol,pver) + real(kind_phys) :: mcon(ncol,pverp) + real(kind_phys) :: mconzm(ncol,pverp) + real(kind_phys) :: mu_out(ncol,pverp) + real(kind_phys) :: md_out(ncol,pverp) + + integer :: index_cldliq + + errmsg = '' + errflg = 0 + + lengath = count(ideep > 0) + if (lengath > ncol) lengath = ncol ! should not happen, but force it to not be larger than ncol for safety sake + + ftem(:ncol,:pver) = ptend_loc%s(:ncol,:pver)/cpair + call history_out_field('ZMDT ', ftem) + call history_out_field('ZMDQ ',ptend_loc%q(1,1,1)) + + end subroutine zm_convr_diagnostics_run + + !======================================================================= + +end module zm_convr_diagnostics diff --git a/cam_diagnostics/zm_diagnostics.F90 b/cam_diagnostics/zm_diagnostics.F90 index 6c744be1..1224590a 100644 --- a/cam_diagnostics/zm_diagnostics.F90 +++ b/cam_diagnostics/zm_diagnostics.F90 @@ -42,41 +42,49 @@ subroutine zm_diagnostics_init(errmsg, errflg) errmsg = '' errflg = 0 - call history_add_field ('ZM_ORG ', 'zhang_mcfarlane_organization_parameter_of_deep_convection', 'lev', 'avg', '1') - call history_add_field ('ZM_ORG2D ', 'zhang_mcfarlane_organization_parameter_of_deep_convection_copied_to_whole_column',& - 'lev', 'avg', '1') - call history_add_field ('PRECZ', 'lwe_precipitation_rate_at_surface_due_to_deep_convection_due_to_Zhang-McFarlane', & horiz_only, 'avg', 'm s-1') - call history_add_field ('ZMFLXPRC', 'Flux of precipitation from ZM convection', 'ilev', 'avg', 'kg m-2 s-1') - call history_add_field ('ZMFLXSNW', 'Flux of snow from ZM convection', 'ilev', 'avg', 'kg m-2 s-1') - call history_add_field ('ZMNTPRPD', 'Net precipitation production from ZM convection', 'lev', 'avg', 'kg kg-1 s-1') - call history_add_field ('ZMNTSNPD', 'Net snow production from ZM convection', 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('ZMFLXPRC', 'precipitation_flux_at_interface_due_to_deep_convection', 'ilev', 'avg', 'kg m-2 s-1') + call history_add_field ('ZMFLXSNW', 'frozen_precipitation_flux_at_interface_due_to_deep_convection', & + 'ilev', 'avg', 'kg m-2 s-1') + call history_add_field ('ZMNTPRPD', 'tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection', & + 'lev', 'avg', 'kg kg-1 s-1') + call history_add_field ('ZMNTSNPD', & + 'tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection', & + 'lev', 'avg', 'kg kg-1 s-1') call history_add_field ('ZMEIHEAT', 'Heating by ice and evaporation in ZM convection', 'lev', 'avg', 'W kg-1') call history_add_field ('CMFMC_DP', 'Convection mass flux from ZM deep ', 'ilev', 'avg', 'kg m-2 s-1') - call history_add_field ('PRECCDZM', 'Convective precipitation rate from ZM deep', horiz_only, 'avg', 'm s-1') + call history_add_field ('PRECCDZM', 'lwe_precipitation_rate_at_surface_due_to_deep_convection', horiz_only, 'avg', 'm s-1') call history_add_field ('PCONVB', 'convection base pressure', horiz_only , 'avg', 'Pa' ) call history_add_field ('PCONVT', 'convection top pressure', horiz_only , 'avg', 'Pa' ) - call history_add_field ('CAPE', 'zhang_mcfarlane_convective_available_potential_energycap', horiz_only, 'avg', 'J kg-1') + call history_add_field ('CAPE', 'zhang_mcfarlane_convective_available_potential_energy', horiz_only, 'avg', 'J kg-1') call history_add_field ('FREQZM', 'Fractional occurance of ZM convection', horiz_only , 'avg', 'fraction') call history_add_field ('ZMMU', 'ZM convection updraft mass flux', 'lev', 'avg', 'kg m-2 s-1') call history_add_field ('ZMMD', 'ZM convection downdraft mass flux', 'lev', 'avg', 'kg m-2 s-1') - call history_add_field ('ZMUPGU', 'zonal force from ZM updraft pressure gradient term', 'lev', 'avg', 'm s-2') - call history_add_field ('ZMUPGD', 'zonal force from ZM downdraft pressure gradient term', 'lev', 'avg', 'm s-2') - call history_add_field ('ZMVPGU', 'meridional force from ZM updraft pressure gradient term', 'lev', 'avg', 'm s-2') - call history_add_field ('ZMVPGD', 'merdional force from ZM downdraft pressure gradient term', 'lev', 'avg', 'm s-2') + call history_add_field ('ZMUPGU',& + 'tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term',& + 'lev', 'avg', 'm s-2') + call history_add_field ('ZMUPGD',& + 'tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term',& + 'lev', 'avg', 'm s-2') + call history_add_field ('ZMVPGU',& + 'tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term',& + 'lev', 'avg', 'm s-2') + call history_add_field ('ZMVPGD',& + 'tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term',& + 'lev', 'avg', 'm s-2') - call history_add_field ('ZMICUU', 'ZM in-cloud U updrafts', 'lev', 'avg', 'm/s') - call history_add_field ('ZMICUD', 'ZM in-cloud U downdrafts', 'lev', 'avg', 'm/s') - call history_add_field ('ZMICVU', 'ZM in-cloud V updrafts', 'lev', 'avg', 'm/s') - call history_add_field ('ZMICVD', 'ZM in-cloud V downdrafts', 'lev', 'avg', 'm/s') + call history_add_field ('ZMICUU', 'in_cloud_eastward_wind_in_updraft_due_to_deep_convection', 'lev', 'avg', 'm/s') + call history_add_field ('ZMICUD', 'in_cloud_eastward_wind_in_downdraft_due_to_deep_convection', 'lev', 'avg', 'm/s') + call history_add_field ('ZMICVU', 'in_cloud_northward_wind_in_updraft_due_to_deep_convection', 'lev', 'avg', 'm/s') + call history_add_field ('ZMICVD', 'in_cloud_northward_wind_in_downdraft_due_to_deep_convection', 'lev', 'avg', 'm/s') - call history_add_field ('DLFZM', 'Detrained liquid water from ZM convection', 'lev', 'avg','kg kg-1 s-1 ') + call history_add_field ('DLFZM', 'detrainment_of_cloud_liquid_due_to_deep_convection', 'lev', 'avg','kg kg-1 s-1 ') end subroutine zm_diagnostics_init @@ -107,9 +115,12 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, integer :: lengath ! number of columns with deep convection + real(kind_phys) :: freqzm(ncol) real(kind_phys) :: ftem(ncol,pver) real(kind_phys) :: mcon(ncol,pverp) real(kind_phys) :: mconzm(ncol,pverp) + real(kind_phys) :: mu_out(ncol,pverp) + real(kind_phys) :: md_out(ncol,pverp) integer :: index_cldliq @@ -119,26 +130,71 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, lengath = count(ideep > 0) if (lengath > ncol) lengath = ncol ! should not happen, but force it to not be larger than ncol for safety sake - call history_out_field('PRECZ', prec) - -! ftem(:,:) = 0._kind_phys -! ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair -! call history_out_field('ZMDT', ftem) - -! call history_out_field('CAPE', cape) - -! freqzm(:) = 0._r8 -! do i = 1,lengath -! freqzm(ideep(i)) = 1.0_r8 -! end do -! call history_out_field('FREQZM ',freqzm) - -! mcon(:ncol,:pverp) = mcon(:ncol,:pverp) * 100._r8/gravit -! mconzm(:ncol,:pverp) = mcon(:ncol,:pverp) - -! call outfld('CMFMC_DP', mconzm) - - + call history_out_field('CAPE', cape) + + freqzm(:) = 0._r8 + do i = 1,lengath + freqzm(ideep(i)) = 1.0_r8 + end do + call history_out_field('FREQZM ',freqzm) + + mcon(:ncol,:pverp) = mcon(:ncol,:pverp) * 100._r8/gravit + mconzm(:ncol,:pverp) = mcon(:ncol,:pverp) + + call history_out_field('CMFMC_DP', mconzm) + + + ! Store upward and downward mass fluxes in un-gathered arrays + ! + convert from mb/s to kg/m^2/s + do i=1,lengath + do k=1,pver + ii = ideep(i) + mu_out(ii,k) = mu(i,k) * 100._r8/gravit + md_out(ii,k) = md(i,k) * 100._r8/gravit + end do + end do + + call history_out_field('ZMMU', mu_out) + call history_out_field('ZMMD', md_out) + + call history_out_field('DIFZM' ,dif) + call history_out_field('DLFZM' ,dlf) + + pcont(:ncol) = pref_edge(:ncol) + pconb(:ncol) = pref_edge(:ncol) + do i = 1,lengath + if (maxg(i).gt.jt(i)) then + pcont(ideep(i)) = pref_mid(ideep(i),jt(i)) ! gathered array (or jctop ungathered) + pconb(ideep(i)) = pref_mid(ideep(i),maxg(i))! gathered array + endif + ! write(iulog,*) ' pcont, pconb ', pcont(i), pconb(i), cnt(i), cnb(i) + end do + call history_out_field('PCONVT ',pcont) + call history_out_field('PCONVB ',pconb) + + call history_out_field('ZMFLXPRC', flxprec) + call history_out_field('ZMFLXSNW', flxsnow) + call history_out_field('ZMNTPRPD', ntprprd) + call history_out_field('ZMNTSNPD', ntsnprd) + call history_out_field('ZMEIHEAT', heat) + +!CACNOTE - CAM is outputting the exact same quantity to both fields + call history_out_field('PRECCDZM ',prec) + call history_out_field('PRECZ ', prec) + + ! Output apparent force from pressure gradient + call history_out_field('ZMUPGU', pguallu) + call history_out_field('ZMUPGD', pgdallu) + call history_out_field('ZMVPGU', pguallv) + call history_out_field('ZMVPGD', pgdallv) + + ! Output in-cloud winds + call history_out_field('ZMICUU', icwuu, pcols, lchnk) + call history_out_field('ZMICUD', icwdu, pcols, lchnk) + call history_out_field('ZMICVU', icwuv, pcols, lchnk) + call history_out_field('ZMICVD', icwdv, pcols, lchnk) + + end if end subroutine zm_diagnostics_run !======================================================================= diff --git a/cam_diagnostics/zm_diagnostics.meta b/cam_diagnostics/zm_diagnostics.meta index da0dcf04..dacaccd9 100644 --- a/cam_diagnostics/zm_diagnostics.meta +++ b/cam_diagnostics/zm_diagnostics.meta @@ -85,3 +85,456 @@ type = integer dimensions = () intent = out + + + +[ccpp-table-properties] + name = zm_convr + type = scheme + dependencies = ../to_be_ccppized/wv_saturation.F90 + +[ccpp-arg-table] + name = zm_convr_init + type = scheme +[ plev ] + standard_name = vertical_layer_dimension + units = count + type = integer + dimensions = () + intent = in +[ plevp ] + standard_name = vertical_interface_dimension + units = count + type = integer + dimensions = () + intent = in +[ cpair ] + standard_name = specific_heat_of_dry_air_at_constant_pressure + units = J kg-1 K-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ epsilo ] + standard_name = ratio_of_water_vapor_to_dry_air_molecular_weights + units = 1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ gravit ] + standard_name = standard_gravitational_acceleration + units = m s-2 + type = real | kind = kind_phys + dimensions = () + intent = in +[ latvap ] + standard_name = latent_heat_of_vaporization_of_water_at_0c + units = J kg-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ tmelt ] + standard_name = freezing_point_of_water + units = K + type = real | kind = kind_phys + dimensions = () + intent = in +[ rair ] + standard_name = gas_constant_of_dry_air + units = J kg-1 K-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ pref_edge ] + standard_name = reference_pressure_at_interface + units = Pa + type = real | kind = kind_phys + dimensions = (vertical_interface_dimension) + intent = in +[ zmconv_c0_lnd ] + standard_name = cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme + units = m-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ zmconv_c0_ocn ] + standard_name = cloud_condensate_to_precipitation_autoconversion_coefficient_over_ocean_for_zhang_mcfarlane_deep_convection_scheme + units = m-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ zmconv_ke ] + standard_name = tunable_evaporation_efficiency_over_ocean_for_zhang_mcfarlane_deep_convection_scheme + units = 1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ zmconv_ke_lnd ] + standard_name = tunable_evaporation_efficiency_over_land_for_zhang_mcfarlane_deep_convection_scheme + units = 1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ zmconv_momcu ] + standard_name = momentum_transport_parameter_for_vertical_pressure_gradient_force_for_updraft_for_zhang_mcfarlane_deep_convection_scheme + units = 1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ zmconv_momcd ] + standard_name = momentum_transport_parameter_for_vertical_pressure_gradient_force_for_downdraft_for_zhang_mcfarlane_deep_convection_scheme + units = 1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ zmconv_num_cin ] + standard_name = number_of_negative_buoyancy_layers_allowed_before_convection_top_for_zhang_mcfarlane_deep_convection_scheme + units = count + type = integer + dimensions = () + intent = in +[ no_deep_pbl_in ] + standard_name = flag_for_no_deep_convection_in_pbl + units = flag + type = logical + dimensions = () + intent = in +[ zmconv_tiedke_add ] + standard_name = parcel_temperature_perturbation_for_zhang_mcfarlane_deep_convection_scheme + units = flag + type = real | kind = kind_phys + dimensions = () + intent = in +[ zmconv_capelmt ] + standard_name = cape_threshold_for_zhang_mcfarlane_deep_convection_scheme + units = J kg-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ zmconv_dmpdz ] + standard_name = entrainment_rate_for_cape_for_zhang_mcfarlane_deep_convection_scheme + units = m-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ zmconv_parcel_pbl ] + standard_name = flag_for_well_mixed_pbl_parcel_property_for_zhang_mcfarlane_deep_convection_scheme + units = flag + type = logical + dimensions = () + intent = in +[ zmconv_tau ] + standard_name = deep_convective_adjustment_timescale_for_zhang_mcfarlane_deep_convection_scheme + units = s + type = real | kind = kind_phys + dimensions = () + intent = in +[ masterproc ] + standard_name = flag_for_mpi_root + units = flag + type = logical + dimensions = () + intent = in +[ iulog ] + standard_name = log_output_unit + units = 1 + type = integer + dimensions = () + intent = in +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out + +[ccpp-arg-table] + name = zm_convr_run + type = scheme +[ 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 +[ pverp ] + standard_name = vertical_interface_dimension + units = count + type = integer + dimensions = () + intent = in +[ gravit ] + standard_name = standard_gravitational_acceleration + units = m s-2 + type = real | kind = kind_phys + dimensions = () + intent = in +[ latice ] + standard_name = latent_heat_of_fusion_of_water_at_0c + units = J kg-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ cpwv ] + standard_name = specific_heat_of_water_vapor_at_constant_pressure + units = J kg-1 K-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ cpliq ] + standard_name = specific_heat_of_liquid_water_at_constant_pressure + units = J kg-1 K-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ rh2o ] + standard_name = gas_constant_of_water_vapor + units = J kg-1 K-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ t ] + standard_name = air_temperature + units = K + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ qh ] + standard_name = water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water + advected = true + units = kg kg-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ prec ] + standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ pblh ] + standard_name = atmosphere_boundary_layer_thickness + units = m + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in +[ zm ] + standard_name = geopotential_height_wrt_surface + units = m + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ geos ] + standard_name = surface_geopotential + units = m2 s-2 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in +[ zi ] + standard_name = geopotential_height_wrt_surface_at_interface + units = m + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_interface_dimension) + intent = in +[ qtnd ] + standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water + units = kg kg-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ heat ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure + units = J kg-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ pap ] + standard_name = air_pressure + units = Pa + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ paph ] + standard_name = air_pressure_at_interface + units = Pa + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_interface_dimension) + intent = in +[ dpp ] + standard_name = air_pressure_thickness + units = Pa + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ delt ] + standard_name = timestep_for_physics + units = s + type = real | kind = kind_phys + dimensions = () + intent = in +[ mcon ] + standard_name = atmosphere_convective_mass_flux_due_to_deep_convection + units = hPa s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ cme ] + standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_from_cloud_condensation_minus_precipitation_evaporation_due_to_deep_convection + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ cape ] + standard_name = zhang_mcfarlane_convective_available_potential_energy + units = J kg-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ tpert ] + standard_name = convective_temperature_perturbation_due_to_pbl_eddies + units = K + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in +[ dlf ] + standard_name = detrainment_of_cloud_liquid_due_to_deep_convection + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ zdu ] + standard_name = detrainment_mass_flux_due_to_deep_convection + units = s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ rprd ] + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ mu ] + standard_name = atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns + units = hPa s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ md ] + standard_name = atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns + units = hPa s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ du ] + standard_name = atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns + units = s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ eu ] + standard_name = atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns + units = s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ ed ] + standard_name = atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns + units = s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ dp ] + standard_name = pressure_thickness_for_deep_convection_for_convective_columns + units = hPa + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ dsubcld ] + standard_name = pressure_thickness_for_subcloud_layer_for_deep_convection_for_convective_columns + units = hPa + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ jt ] + standard_name = vertical_index_at_top_of_deep_convection_for_convective_columns + units = index + type = integer + dimensions = (horizontal_loop_extent) + intent = out +[ maxg ] + standard_name = vertical_index_of_deep_convection_launch_level_for_convective_columns + units = index + type = integer + dimensions = (horizontal_loop_extent) + intent = out +[ ideep ] + standard_name = horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns + units = index + type = integer + dimensions = (horizontal_loop_extent) + intent = out +[ ql ] + standard_name = in_cloud_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_deep_convection + units = kg kg-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = inout +[ rliq ] + standard_name = vertically_integrated_cloud_liquid_tendency_due_to_all_convection_to_be_applied_later_in_time_loop + units = kg m-2 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ landfrac ] + standard_name = land_area_fraction + units = fraction + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in +[ rice ] + standard_name = vertically_integrated_cloud_ice_tendency_due_to_all_convection_to_be_applied_later_in_time_loop + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ lengath ] + standard_name = index_of_last_column_of_gathered_deep_convection_arrays + units = index + type = integer + dimensions = () + intent = out +[ scheme_name ] + standard_name = scheme_name + long_name = scheme name + units = none + type = character | kind = len=40 + dimensions = () + intent = out +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out diff --git a/cam_diagnostics/zm_evap_tendency_diagnostics.F90 b/cam_diagnostics/zm_evap_tendency_diagnostics.F90 new file mode 100644 index 00000000..36b6f823 --- /dev/null +++ b/cam_diagnostics/zm_evap_tendency_diagnostics.F90 @@ -0,0 +1,95 @@ +module zm_evap_tendency_diagnostics +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! THIS IS A TEMPLATE +! 1. copy this file to a new file with the correct name +! (SCHEME_diagnostics.F90) +! 2. do a search and replace for "SCHEME" in this file and +! replace with your scheme name +! 3. Add desired history_add_field calls to the init phase +! 4. Add all fields that are being output as inputs to the run phase +! 5. Add desired history_out_field calls to the run phase +! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 +! file to generate the metadata +! 7. Complete the metadata (fill out standard names, units, dimensions) +! 8. Add this scheme to the SDF file for your suite (likely will be at end) +! 9. Delete this header section +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + use ccpp_kinds, only: kind_phys + + implicit none + private + save + + public :: zm_evap_tendency_diagnostics_init ! init routine + public :: zm_evap_tendency_diagnostics_run ! main routine + +CONTAINS + + !> \section arg_table_zm_evap_tendency_diagnostics_init Argument Table + !! \htmlinclude zm_evap_tendency_diagnostics_init.html + subroutine zm_evap_tendency_diagnostics_init(errmsg, errflg) + use cam_history, only: history_add_field + use cam_history_support, only: horiz_only + + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables: + + errmsg = '' + errflg = 0 + + call history_add_field ('EVAPTZM', 'T tendency - Evaporation/snow prod from Zhang convection', 'lev', 'avg', 'K s-1') + call history_add_field ('FZSNTZM', 'T tendency - Rain to snow conversion from Zhang convection', 'lev', 'avg', 'K s-1') + call history_add_field ('EVSNTZM', 'T tendency - Snow to rain prod from Zhang convection', 'lev', 'avg', 'K s-1') + call history_add_field ('EVAPQZM', 'Q tendency - Evaporation from Zhang-McFarlane moist convection', 'lev', 'avg', & + 'kg kg-1 s-1') + + end subroutine zm_evap_tendency_diagnostics_init + + !> \section arg_table_zm_evap_tendency_diagnostics_run Argument Table + !! \htmlinclude zm_evap_tendency_diagnostics_run.html + subroutine zm_evap_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, errmsg, errflg) + + use cam_history, only: history_out_field + use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t + !------------------------------------------------ + ! Input / output parameters + !------------------------------------------------ + integer, intent(in) :: ncol + integer, intent(in) :: pver + integer, intent(in) :: pverp + type(ccpp_constituent_prop_ptr_t), intent(in) :: const_props(:) + real(kind_phys), intent(in) :: dqdt(:,:,:) ! Tracer tendency array (ncol,pver,ncnst) + + ! CCPP error handling variables + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + integer :: lengath ! number of columns with deep convection + integer :: const_idx + character(len=256) :: standard_name + + real(kind_phys) :: ftem(ncol,pver) + real(kind_phys) :: mcon(ncol,pverp) + real(kind_phys) :: mconzm(ncol,pverp) + + errmsg = '' + errflg = 0 + + ftem(:ncol,:pver) = ptend_loc%s(:ncol,:pver)/cpair + call history_out_field('EVAPTZM ',ftem) + ftem(:ncol,:pver) = tend_s_snwprd (:ncol,:pver)/cpair + call history_out_field('FZSNTZM ',ftem) + ftem(:ncol,:pver) = tend_s_snwevmlt(:ncol,:pver)/cpair + call history_out_field('EVSNTZM ',ftem) + call history_out_field('EVAPQZM ',ptend_loc%q(1,1,1)) + + end subroutine zm_evap_tendency_diagnostics_run + + !======================================================================= + +end module zm_evap_tendency_diagnostics diff --git a/cam_diagnostics/zm_momtran_tendency_diagnostics.F90 b/cam_diagnostics/zm_momtran_tendency_diagnostics.F90 new file mode 100644 index 00000000..f87ac182 --- /dev/null +++ b/cam_diagnostics/zm_momtran_tendency_diagnostics.F90 @@ -0,0 +1,91 @@ +module zm_tendency_diagnostics +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! THIS IS A TEMPLATE +! 1. copy this file to a new file with the correct name +! (SCHEME_diagnostics.F90) +! 2. do a search and replace for "SCHEME" in this file and +! replace with your scheme name +! 3. Add desired history_add_field calls to the init phase +! 4. Add all fields that are being output as inputs to the run phase +! 5. Add desired history_out_field calls to the run phase +! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 +! file to generate the metadata +! 7. Complete the metadata (fill out standard names, units, dimensions) +! 8. Add this scheme to the SDF file for your suite (likely will be at end) +! 9. Delete this header section +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + use ccpp_kinds, only: kind_phys + + implicit none + private + save + + public :: zm_tendency_diagnostics_init ! init routine + public :: zm_tendency_diagnostics_run ! main routine + +CONTAINS + + !> \section arg_table_zm_tendency_diagnostics_init Argument Table + !! \htmlinclude zm_tendency_diagnostics_init.html + subroutine zm_tendency_diagnostics_init(errmsg, errflg) + use cam_history, only: history_add_field + use cam_history_support, only: horiz_only + + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables: + + errmsg = '' + errflg = 0 + + call history_add_field ('ZMMTT', 'T tendency - ZM convective momentum transport', 'lev', 'avg', 'K s-1') + call history_add_field ('ZMMTU', 'U tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') + call history_add_field ('ZMMTV', 'V tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') + + end subroutine zm_tendency_diagnostics_init + + !> \section arg_table_zm_tendency_diagnostics_run Argument Table + !! \htmlinclude zm_tendency_diagnostics_run.html + subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, errmsg, errflg) + + use cam_history, only: history_out_field + use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t + !------------------------------------------------ + ! Input / output parameters + !------------------------------------------------ + integer, intent(in) :: ncol + integer, intent(in) :: pver + integer, intent(in) :: pverp + type(ccpp_constituent_prop_ptr_t), intent(in) :: const_props(:) + real(kind_phys), intent(in) :: dqdt(:,:,:) ! Tracer tendency array (ncol,pver,ncnst) + + ! CCPP error handling variables + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + integer :: lengath ! number of columns with deep convection + integer :: const_idx + character(len=256) :: standard_name + + real(kind_phys) :: ftem(ncol,pver) + real(kind_phys) :: mcon(ncol,pverp) + real(kind_phys) :: mconzm(ncol,pverp) + + errmsg = '' + errflg = 0 + + call history_out_field('ZMMTU', windu_tend) + call history_out_field('ZMMTV', windv_tend) + + ftem(:ncol,:pver) = seten(:ncol,:pver)/cpair + call history_out_field('ZMMTT', ftem) + + end subroutine zm_tendency_diagnostics_run + + !======================================================================= + +end module zm_tendency_diagnostics diff --git a/cam_diagnostics/zm_tendency_diagnostics.F90 b/cam_diagnostics/zm_tendency_diagnostics.F90 index d7a4c9b3..fce13c3f 100644 --- a/cam_diagnostics/zm_tendency_diagnostics.F90 +++ b/cam_diagnostics/zm_tendency_diagnostics.F90 @@ -42,18 +42,8 @@ subroutine zm_tendency_diagnostics_init(errmsg, errflg) errmsg = '' errflg = 0 - call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') - call history_add_field ('ZMDQ', 'Q tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'kg kg-1 s-1') call history_add_field ('ZMDICE', 'Cloud ice tendency - Zhang-McFarlane convection', 'lev', 'avg', 'kg kg-1 s-1') call history_add_field ('ZMDLIQ', 'Cloud liq tendency - Zhang-McFarlane convection', 'lev', 'avg', 'kg kg-1 s-1') - call history_add_field ('EVAPTZM', 'T tendency - Evaporation/snow prod from Zhang convection', 'lev', 'avg', 'K s-1') - call history_add_field ('FZSNTZM', 'T tendency - Rain to snow conversion from Zhang convection', 'lev', 'avg', 'K s-1') - call history_add_field ('EVSNTZM', 'T tendency - Snow to rain prod from Zhang convection', 'lev', 'avg', 'K s-1') - call history_add_field ('EVAPQZM', 'Q tendency - Evaporation from Zhang-McFarlane moist convection', 'lev', 'avg', & - 'kg kg-1 s-1') - call history_add_field ('ZMMTT', 'T tendency - ZM convective momentum transport', 'lev', 'avg', 'K s-1') - call history_add_field ('ZMMTU', 'U tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') - call history_add_field ('ZMMTV', 'V tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') end subroutine zm_tendency_diagnostics_init @@ -89,6 +79,8 @@ subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, err do const_idx = 1, size(const_props) call const_props(const_idx)%standard_name(standard_name, errflg, errmsg) +!CACNOTE -remove this debug statement + write(0,*) ' const_idx=', const_idx, ' standard_name=',standard_name ! Use the regular constituent names, as the location in the dqdt array match the constituent ordering in the ! constituent properties @@ -97,6 +89,10 @@ subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, err case('cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water') call history_out_field('ZMDLIQ', dqdt(:,:,const_idx)) + + case('cloud_ice_mixing_ratio_wrt_moist_air_and_condensed_water') + call history_out_field('ZMDICE', dqdt(:,:,const_idx)) + end select end do diff --git a/suite_zhang_mcfarlane.xml b/suite_zhang_mcfarlane.xml index bf604f3e..e94d9a0d 100644 --- a/suite_zhang_mcfarlane.xml +++ b/suite_zhang_mcfarlane.xml @@ -25,6 +25,7 @@ zm_conv_convtran zm_tendency_diagnostics apply_constituent_tendencies + qneg geopotential_temp zm_diagnostics From cb796e9f131af6569d53b9616a5acd37c003b19b Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 26 Nov 2024 16:24:50 -0700 Subject: [PATCH 25/36] Add diagnostics for ZM --- .../zm_convr_tendency_diagnostics.F90 | 21 +- .../zm_convr_tendency_diagnostics.meta | 70 +++ cam_diagnostics/zm_diagnostics.F90 | 75 ++- cam_diagnostics/zm_diagnostics.meta | 471 +++--------------- .../zm_evap_tendency_diagnostics.F90 | 14 +- .../zm_evap_tendency_diagnostics.meta | 76 +++ .../zm_momtran_tendency_diagnostics.F90 | 11 +- .../zm_momtran_tendency_diagnostics.meta | 75 +++ suite_zh_geopotential | 27 + zhang_mcfarlane/zm_convr.F90 | 5 +- zhang_mcfarlane/zm_convr.meta | 6 + 11 files changed, 394 insertions(+), 457 deletions(-) create mode 100644 cam_diagnostics/zm_convr_tendency_diagnostics.meta create mode 100644 cam_diagnostics/zm_evap_tendency_diagnostics.meta create mode 100644 cam_diagnostics/zm_momtran_tendency_diagnostics.meta create mode 100644 suite_zh_geopotential diff --git a/cam_diagnostics/zm_convr_tendency_diagnostics.F90 b/cam_diagnostics/zm_convr_tendency_diagnostics.F90 index d3363b11..4dab829b 100644 --- a/cam_diagnostics/zm_convr_tendency_diagnostics.F90 +++ b/cam_diagnostics/zm_convr_tendency_diagnostics.F90 @@ -49,7 +49,7 @@ end subroutine zm_convr_diagnostics_init !> \section arg_table_zm_convr_diagnostics_run Argument Table !! \htmlinclude zm_convr_diagnostics_run.html - subroutine zm_convr_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, errmsg, errflg) + subroutine zm_convr_diagnostics_run(ncol, pver, cpair, heat, qtnd, errmsg, errflg) use cam_history, only: history_out_field @@ -58,39 +58,26 @@ subroutine zm_convr_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, !------------------------------------------------ integer, intent(in) :: ncol integer, intent(in) :: pver - integer, intent(in) :: pverp -! real(kind_phys), intent(in) :: const_array(:,:,:) - integer, intent(in) :: ideep(:) real(kind_phys), intent(in) :: cpair real(kind_phys), intent(in) :: heat(:,:) - real(kind_phys), intent(in) :: prec(:) - real(kind_phys), intent(in) :: cape(:) + real(kind_phys), intent(in) :: qtnd(:,:) ! CCPP error handling variables character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: lengath ! number of columns with deep convection - real(kind_phys) :: freqzm(ncol) real(kind_phys) :: ftem(ncol,pver) - real(kind_phys) :: mcon(ncol,pverp) - real(kind_phys) :: mconzm(ncol,pverp) - real(kind_phys) :: mu_out(ncol,pverp) - real(kind_phys) :: md_out(ncol,pverp) integer :: index_cldliq errmsg = '' errflg = 0 - lengath = count(ideep > 0) - if (lengath > ncol) lengath = ncol ! should not happen, but force it to not be larger than ncol for safety sake - - ftem(:ncol,:pver) = ptend_loc%s(:ncol,:pver)/cpair + ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair call history_out_field('ZMDT ', ftem) - call history_out_field('ZMDQ ',ptend_loc%q(1,1,1)) + call history_out_field('ZMDQ ',qtnd(1,1,1)) end subroutine zm_convr_diagnostics_run diff --git a/cam_diagnostics/zm_convr_tendency_diagnostics.meta b/cam_diagnostics/zm_convr_tendency_diagnostics.meta new file mode 100644 index 00000000..be3d08e7 --- /dev/null +++ b/cam_diagnostics/zm_convr_tendency_diagnostics.meta @@ -0,0 +1,70 @@ +[ccpp-table-properties] + name = zm_convr_diagnostics + type = scheme + +[ccpp-arg-table] + name = zm_convr_diagnostics_init + type = scheme +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out + +[ccpp-arg-table] + name = zm_convr_diagnostics_run + type = scheme +[ 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 +[ cpair ] + standard_name = specific_heat_of_dry_air_at_constant_pressure + units = J kg-1 K-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ heat ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure + units = J kg-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ qtnd ] + standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water + units = kg kg-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out + diff --git a/cam_diagnostics/zm_diagnostics.F90 b/cam_diagnostics/zm_diagnostics.F90 index 1224590a..0b95ba86 100644 --- a/cam_diagnostics/zm_diagnostics.F90 +++ b/cam_diagnostics/zm_diagnostics.F90 @@ -79,10 +79,10 @@ subroutine zm_diagnostics_init(errmsg, errflg) 'tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term',& 'lev', 'avg', 'm s-2') - call history_add_field ('ZMICUU', 'in_cloud_eastward_wind_in_updraft_due_to_deep_convection', 'lev', 'avg', 'm/s') - call history_add_field ('ZMICUD', 'in_cloud_eastward_wind_in_downdraft_due_to_deep_convection', 'lev', 'avg', 'm/s') - call history_add_field ('ZMICVU', 'in_cloud_northward_wind_in_updraft_due_to_deep_convection', 'lev', 'avg', 'm/s') - call history_add_field ('ZMICVD', 'in_cloud_northward_wind_in_downdraft_due_to_deep_convection', 'lev', 'avg', 'm/s') + call history_add_field ('ZMICUU', 'in_cloud_eastward_wind_in_updraft_due_to_deep_convection', 'lev', 'avg', 'm s-1') + call history_add_field ('ZMICUD', 'in_cloud_eastward_wind_in_downdraft_due_to_deep_convection', 'lev', 'avg', 'm s-1') + call history_add_field ('ZMICVU', 'in_cloud_northward_wind_in_updraft_due_to_deep_convection', 'lev', 'avg', 'm s-1') + call history_add_field ('ZMICVD', 'in_cloud_northward_wind_in_downdraft_due_to_deep_convection', 'lev', 'avg', 'm s-1') call history_add_field ('DLFZM', 'detrainment_of_cloud_liquid_due_to_deep_convection', 'lev', 'avg','kg kg-1 s-1 ') @@ -91,7 +91,9 @@ end subroutine zm_diagnostics_init !> \section arg_table_zm_diagnostics_run Argument Table !! \htmlinclude zm_diagnostics_run.html - subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, errmsg, errflg) + subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, gravit, mu, md, & + dif, dlf, ps, paph, maxg, jt, flxprec, flxsnow, ntprprd, ntsnprd, pguallu, pguallv, & + pgdallu, pgdallv, icwuu, icwuv, icwdu, icwdv, errmsg, errflg) use cam_history, only: history_out_field @@ -108,6 +110,27 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, real(kind_phys), intent(in) :: heat(:,:) real(kind_phys), intent(in) :: prec(:) real(kind_phys), intent(in) :: cape(:) + real(kind_phys), intent(in) :: gravit + real(kind_phys), intent(in) :: mu(:,:) + real(kind_phys), intent(in) :: md(:,:) + real(kind_phys), intent(in) :: dif(:,:) + real(kind_phys), intent(in) :: dlf(:,:) + real(kind_phys), intent(in) :: ps(:) + real(kind_phys), intent(in) :: paph(:,:) + integer, intent(in) :: maxg(ncol) + integer, intent(in) :: jt(ncol) + real(kind_phys),intent(in) :: flxprec(:,:) + real(kind_phys),intent(in) :: flxsnow(:,:) + real(kind_phys),intent(in) :: ntprprd(:,:) + real(kind_phys),intent(in) :: ntsnprd(:,:) + real(kind_phys),intent(in) :: pguallu(:,:) + real(kind_phys),intent(in) :: pguallv(:,:) + real(kind_phys),intent(in) :: pgdallu(:,:) + real(kind_phys),intent(in) :: pgdallv(:,:) + real(kind_phys),intent(in) :: icwuu(:,:) + real(kind_phys),intent(in) :: icwuv(:,:) + real(kind_phys),intent(in) :: icwdu(:,:) + real(kind_phys),intent(in) :: icwdv(:,:) ! CCPP error handling variables character(len=512), intent(out) :: errmsg @@ -116,6 +139,8 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, integer :: lengath ! number of columns with deep convection real(kind_phys) :: freqzm(ncol) + real(kind_phys) :: pcont(ncol) + real(kind_phys) :: pconb(ncol) real(kind_phys) :: ftem(ncol,pver) real(kind_phys) :: mcon(ncol,pverp) real(kind_phys) :: mconzm(ncol,pverp) @@ -123,6 +148,7 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, real(kind_phys) :: md_out(ncol,pverp) integer :: index_cldliq + integer i, ii, k errmsg = '' errflg = 0 @@ -132,13 +158,13 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, call history_out_field('CAPE', cape) - freqzm(:) = 0._r8 + freqzm(:) = 0._kind_phys do i = 1,lengath - freqzm(ideep(i)) = 1.0_r8 + freqzm(ideep(i)) = 1.0_kind_phys end do call history_out_field('FREQZM ',freqzm) - mcon(:ncol,:pverp) = mcon(:ncol,:pverp) * 100._r8/gravit + mcon(:ncol,:pverp) = mcon(:ncol,:pverp) * 100._kind_phys/gravit mconzm(:ncol,:pverp) = mcon(:ncol,:pverp) call history_out_field('CMFMC_DP', mconzm) @@ -149,8 +175,8 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, do i=1,lengath do k=1,pver ii = ideep(i) - mu_out(ii,k) = mu(i,k) * 100._r8/gravit - md_out(ii,k) = md(i,k) * 100._r8/gravit + mu_out(ii,k) = mu(i,k) * 100._kind_phys/gravit + md_out(ii,k) = md(i,k) * 100._kind_phys/gravit end do end do @@ -160,12 +186,12 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, call history_out_field('DIFZM' ,dif) call history_out_field('DLFZM' ,dlf) - pcont(:ncol) = pref_edge(:ncol) - pconb(:ncol) = pref_edge(:ncol) + pcont(:ncol) = ps(:ncol) + pconb(:ncol) = ps(:ncol) do i = 1,lengath if (maxg(i).gt.jt(i)) then - pcont(ideep(i)) = pref_mid(ideep(i),jt(i)) ! gathered array (or jctop ungathered) - pconb(ideep(i)) = pref_mid(ideep(i),maxg(i))! gathered array + pcont(ideep(i)) = paph(ideep(i),jt(i)) ! gathered array (or jctop ungathered) + pconb(ideep(i)) = paph(ideep(i),maxg(i))! gathered array endif ! write(iulog,*) ' pcont, pconb ', pcont(i), pconb(i), cnt(i), cnb(i) end do @@ -182,19 +208,18 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, call history_out_field('PRECCDZM ',prec) call history_out_field('PRECZ ', prec) - ! Output apparent force from pressure gradient - call history_out_field('ZMUPGU', pguallu) - call history_out_field('ZMUPGD', pgdallu) - call history_out_field('ZMVPGU', pguallv) - call history_out_field('ZMVPGD', pgdallv) + ! Output apparent force from pressure gradient + call history_out_field('ZMUPGU', pguallu) + call history_out_field('ZMUPGD', pgdallu) + call history_out_field('ZMVPGU', pguallv) + call history_out_field('ZMVPGD', pgdallv) - ! Output in-cloud winds - call history_out_field('ZMICUU', icwuu, pcols, lchnk) - call history_out_field('ZMICUD', icwdu, pcols, lchnk) - call history_out_field('ZMICVU', icwuv, pcols, lchnk) - call history_out_field('ZMICVD', icwdv, pcols, lchnk) + ! Output in-cloud winds + call history_out_field('ZMICUU', icwuu) + call history_out_field('ZMICUD', icwdu) + call history_out_field('ZMICVU', icwuv) + call history_out_field('ZMICVD', icwdv) - end if end subroutine zm_diagnostics_run !======================================================================= diff --git a/cam_diagnostics/zm_diagnostics.meta b/cam_diagnostics/zm_diagnostics.meta index dacaccd9..94750e88 100644 --- a/cam_diagnostics/zm_diagnostics.meta +++ b/cam_diagnostics/zm_diagnostics.meta @@ -71,459 +71,132 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent) intent = in -[ errmsg ] - standard_name = ccpp_error_message - long_name = Error message for error handling in CCPP - units = none - type = character | kind = len=512 - dimensions = () - intent = out -[ errflg ] - standard_name = ccpp_error_code - long_name = Error flag for error handling in CCPP - units = 1 - type = integer - dimensions = () - intent = out - - - -[ccpp-table-properties] - name = zm_convr - type = scheme - dependencies = ../to_be_ccppized/wv_saturation.F90 - -[ccpp-arg-table] - name = zm_convr_init - type = scheme -[ plev ] - standard_name = vertical_layer_dimension - units = count - type = integer - dimensions = () - intent = in -[ plevp ] - standard_name = vertical_interface_dimension - units = count - type = integer - dimensions = () - intent = in -[ cpair ] - standard_name = specific_heat_of_dry_air_at_constant_pressure - units = J kg-1 K-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ epsilo ] - standard_name = ratio_of_water_vapor_to_dry_air_molecular_weights - units = 1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ gravit ] - standard_name = standard_gravitational_acceleration - units = m s-2 - type = real | kind = kind_phys - dimensions = () - intent = in -[ latvap ] - standard_name = latent_heat_of_vaporization_of_water_at_0c - units = J kg-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ tmelt ] - standard_name = freezing_point_of_water - units = K - type = real | kind = kind_phys - dimensions = () - intent = in -[ rair ] - standard_name = gas_constant_of_dry_air - units = J kg-1 K-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ pref_edge ] - standard_name = reference_pressure_at_interface - units = Pa - type = real | kind = kind_phys - dimensions = (vertical_interface_dimension) - intent = in -[ zmconv_c0_lnd ] - standard_name = cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme - units = m-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ zmconv_c0_ocn ] - standard_name = cloud_condensate_to_precipitation_autoconversion_coefficient_over_ocean_for_zhang_mcfarlane_deep_convection_scheme - units = m-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ zmconv_ke ] - standard_name = tunable_evaporation_efficiency_over_ocean_for_zhang_mcfarlane_deep_convection_scheme - units = 1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ zmconv_ke_lnd ] - standard_name = tunable_evaporation_efficiency_over_land_for_zhang_mcfarlane_deep_convection_scheme - units = 1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ zmconv_momcu ] - standard_name = momentum_transport_parameter_for_vertical_pressure_gradient_force_for_updraft_for_zhang_mcfarlane_deep_convection_scheme - units = 1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ zmconv_momcd ] - standard_name = momentum_transport_parameter_for_vertical_pressure_gradient_force_for_downdraft_for_zhang_mcfarlane_deep_convection_scheme - units = 1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ zmconv_num_cin ] - standard_name = number_of_negative_buoyancy_layers_allowed_before_convection_top_for_zhang_mcfarlane_deep_convection_scheme - units = count - type = integer - dimensions = () - intent = in -[ no_deep_pbl_in ] - standard_name = flag_for_no_deep_convection_in_pbl - units = flag - type = logical - dimensions = () - intent = in -[ zmconv_tiedke_add ] - standard_name = parcel_temperature_perturbation_for_zhang_mcfarlane_deep_convection_scheme - units = flag - type = real | kind = kind_phys - dimensions = () - intent = in -[ zmconv_capelmt ] - standard_name = cape_threshold_for_zhang_mcfarlane_deep_convection_scheme - units = J kg-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ zmconv_dmpdz ] - standard_name = entrainment_rate_for_cape_for_zhang_mcfarlane_deep_convection_scheme - units = m-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ zmconv_parcel_pbl ] - standard_name = flag_for_well_mixed_pbl_parcel_property_for_zhang_mcfarlane_deep_convection_scheme - units = flag - type = logical - dimensions = () - intent = in -[ zmconv_tau ] - standard_name = deep_convective_adjustment_timescale_for_zhang_mcfarlane_deep_convection_scheme - units = s - type = real | kind = kind_phys - dimensions = () - intent = in -[ masterproc ] - standard_name = flag_for_mpi_root - units = flag - type = logical - dimensions = () - intent = in -[ iulog ] - standard_name = log_output_unit - units = 1 - type = integer - dimensions = () - intent = in -[ errmsg ] - standard_name = ccpp_error_message - long_name = Error message for error handling in CCPP - units = none - type = character | kind = len=512 - dimensions = () - intent = out -[ errflg ] - standard_name = ccpp_error_code - long_name = Error flag for error handling in CCPP - units = 1 - type = integer - dimensions = () - intent = out - -[ccpp-arg-table] - name = zm_convr_run - type = scheme -[ 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 -[ pverp ] - standard_name = vertical_interface_dimension - units = count - type = integer - dimensions = () - intent = in [ gravit ] standard_name = standard_gravitational_acceleration units = m s-2 type = real | kind = kind_phys dimensions = () intent = in -[ latice ] - standard_name = latent_heat_of_fusion_of_water_at_0c - units = J kg-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ cpwv ] - standard_name = specific_heat_of_water_vapor_at_constant_pressure - units = J kg-1 K-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ cpliq ] - standard_name = specific_heat_of_liquid_water_at_constant_pressure - units = J kg-1 K-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ rh2o ] - standard_name = gas_constant_of_water_vapor - units = J kg-1 K-1 - type = real | kind = kind_phys - dimensions = () - intent = in -[ t ] - standard_name = air_temperature - units = K +[ mu ] + standard_name = atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns + units = hPa s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in -[ qh ] - standard_name = water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water - advected = true - units = kg kg-1 +[ md ] + standard_name = atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns + units = hPa s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in -[ prec ] - standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection - units = m s-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent) - intent = out -[ pblh ] - standard_name = atmosphere_boundary_layer_thickness - units = m +[ dif ] + standard_name = detrainment_of_cloud_ice_due_to_deep_convection + units = kg kg-1 s-1 type = real | kind = kind_phys - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in -[ zm ] - standard_name = geopotential_height_wrt_surface - units = m +[ dlf ] + standard_name = detrainment_of_cloud_liquid_due_to_deep_convection + units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in -[ geos ] - standard_name = surface_geopotential - units = m2 s-2 +[ ps ] + standard_name = surface_air_pressure + units = Pa type = real | kind = kind_phys dimensions = (horizontal_loop_extent) intent = in -[ zi ] - standard_name = geopotential_height_wrt_surface_at_interface - units = m - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_interface_dimension) - intent = in -[ qtnd ] - standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water - units = kg kg-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ heat ] - standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure - units = J kg-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ pap ] +[ paph ] standard_name = air_pressure units = Pa type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in -[ paph ] - standard_name = air_pressure_at_interface - units = Pa - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_interface_dimension) +[ maxg ] + standard_name = vertical_index_of_deep_convection_launch_level_for_convective_columns + units = index + type = integer + dimensions = (horizontal_loop_extent) intent = in -[ dpp ] - standard_name = air_pressure_thickness - units = Pa - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) +[ jt ] + standard_name = vertical_index_at_top_of_deep_convection_for_convective_columns + units = index + type = integer + dimensions = (horizontal_loop_extent) intent = in -[ delt ] - standard_name = timestep_for_physics - units = s +[ flxprec ] + standard_name = precipitation_flux_at_interface_due_to_deep_convection + units = kg m-2 s-1 type = real | kind = kind_phys - dimensions = () + dimensions = (horizontal_loop_extent,vertical_interface_dimension) intent = in -[ mcon ] - standard_name = atmosphere_convective_mass_flux_due_to_deep_convection - units = hPa s-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ cme ] - standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_from_cloud_condensation_minus_precipitation_evaporation_due_to_deep_convection - units = kg kg-1 s-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ cape ] - standard_name = zhang_mcfarlane_convective_available_potential_energy - units = J kg-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent) - intent = out -[ tpert ] - standard_name = convective_temperature_perturbation_due_to_pbl_eddies - units = K +[ flxsnow ] + standard_name = frozen_precipitation_flux_at_interface_due_to_deep_convection + units = kg m-2 s-1 type = real | kind = kind_phys - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_loop_extent,vertical_interface_dimension) intent = in -[ dlf ] - standard_name = detrainment_of_cloud_liquid_due_to_deep_convection +[ ntprprd ] + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ zdu ] - standard_name = detrainment_mass_flux_due_to_deep_convection - units = s-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ rprd ] - standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation + intent = in +[ ntsnprd ] + standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ mu ] - standard_name = atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns - units = hPa s-1 + intent = in +[ pguallu ] + standard_name = tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term + units = m s-2 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ md ] - standard_name = atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns - units = hPa s-1 + intent = in +[ pguallv ] + standard_name = tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term + units = m s-2 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ du ] - standard_name = atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = s-1 + intent = in +[ pgdallu ] + standard_name = tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term + units = m s-2 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ eu ] - standard_name = atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = s-1 + intent = in +[ pgdallv ] + standard_name = tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term + units = m s-2 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ ed ] - standard_name = atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - units = s-1 + intent = in +[ icwuu ] + standard_name = in_cloud_eastward_wind_in_updraft_due_to_deep_convection + units = m s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ dp ] - standard_name = pressure_thickness_for_deep_convection_for_convective_columns - units = hPa + intent = in +[ icwuv ] + standard_name = in_cloud_northward_wind_in_updraft_due_to_deep_convection + units = m s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out -[ dsubcld ] - standard_name = pressure_thickness_for_subcloud_layer_for_deep_convection_for_convective_columns - units = hPa - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent) - intent = out -[ jt ] - standard_name = vertical_index_at_top_of_deep_convection_for_convective_columns - units = index - type = integer - dimensions = (horizontal_loop_extent) - intent = out -[ maxg ] - standard_name = vertical_index_of_deep_convection_launch_level_for_convective_columns - units = index - type = integer - dimensions = (horizontal_loop_extent) - intent = out -[ ideep ] - standard_name = horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns - units = index - type = integer - dimensions = (horizontal_loop_extent) - intent = out -[ ql ] - standard_name = in_cloud_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_deep_convection - units = kg kg-1 + intent = in +[ icwdu ] + standard_name = in_cloud_eastward_wind_in_downdraft_due_to_deep_convection + units = m s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = inout -[ rliq ] - standard_name = vertically_integrated_cloud_liquid_tendency_due_to_all_convection_to_be_applied_later_in_time_loop - units = kg m-2 s-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent) - intent = out -[ landfrac ] - standard_name = land_area_fraction - units = fraction - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent) intent = in -[ rice ] - standard_name = vertically_integrated_cloud_ice_tendency_due_to_all_convection_to_be_applied_later_in_time_loop +[ icwdv ] + standard_name = in_cloud_northward_wind_in_downdraft_due_to_deep_convection units = m s-1 type = real | kind = kind_phys - dimensions = (horizontal_loop_extent) - intent = out -[ lengath ] - standard_name = index_of_last_column_of_gathered_deep_convection_arrays - units = index - type = integer - dimensions = () - intent = out -[ scheme_name ] - standard_name = scheme_name - long_name = scheme name - units = none - type = character | kind = len=40 - dimensions = () - intent = out + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in [ errmsg ] standard_name = ccpp_error_message long_name = Error message for error handling in CCPP diff --git a/cam_diagnostics/zm_evap_tendency_diagnostics.F90 b/cam_diagnostics/zm_evap_tendency_diagnostics.F90 index 36b6f823..1f31baaa 100644 --- a/cam_diagnostics/zm_evap_tendency_diagnostics.F90 +++ b/cam_diagnostics/zm_evap_tendency_diagnostics.F90 @@ -52,7 +52,7 @@ end subroutine zm_evap_tendency_diagnostics_init !> \section arg_table_zm_evap_tendency_diagnostics_run Argument Table !! \htmlinclude zm_evap_tendency_diagnostics_run.html - subroutine zm_evap_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, errmsg, errflg) + subroutine zm_evap_tendency_diagnostics_run(ncol, pver, cpair, tend_s_snwprd, tend_s_snwevmlt, qtnd, errmsg, errflg) use cam_history, only: history_out_field use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t @@ -61,9 +61,11 @@ subroutine zm_evap_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt !------------------------------------------------ integer, intent(in) :: ncol integer, intent(in) :: pver - integer, intent(in) :: pverp - type(ccpp_constituent_prop_ptr_t), intent(in) :: const_props(:) - real(kind_phys), intent(in) :: dqdt(:,:,:) ! Tracer tendency array (ncol,pver,ncnst) + real(kind_phys), intent(in) :: cpair + real(kind_phys), intent(in) :: tend_s_snwprd(:,:) + real(kind_phys), intent(in) :: tend_s_snwevmlt(:,:) + real(kind_phys), intent(in) :: qtnd(:,:) + ! CCPP error handling variables character(len=512), intent(out) :: errmsg @@ -74,13 +76,11 @@ subroutine zm_evap_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt character(len=256) :: standard_name real(kind_phys) :: ftem(ncol,pver) - real(kind_phys) :: mcon(ncol,pverp) - real(kind_phys) :: mconzm(ncol,pverp) errmsg = '' errflg = 0 - ftem(:ncol,:pver) = ptend_loc%s(:ncol,:pver)/cpair + ftem(:ncol,:pver) = qtnd(:ncol,:pver)/cpair call history_out_field('EVAPTZM ',ftem) ftem(:ncol,:pver) = tend_s_snwprd (:ncol,:pver)/cpair call history_out_field('FZSNTZM ',ftem) diff --git a/cam_diagnostics/zm_evap_tendency_diagnostics.meta b/cam_diagnostics/zm_evap_tendency_diagnostics.meta new file mode 100644 index 00000000..4437b7a4 --- /dev/null +++ b/cam_diagnostics/zm_evap_tendency_diagnostics.meta @@ -0,0 +1,76 @@ +[ccpp-table-properties] + name = zm_evap_tendency_diagnostics + type = scheme + +[ccpp-arg-table] + name = zm_evap_tendency_diagnostics_init + type = scheme +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out + +[ccpp-arg-table] + name = zm_evap_tendency_diagnostics_run + type = scheme +[ ncol ] + standard_name = enter_standard_name_3 + units = enter_units + type = integer + dimensions = () + intent = in +[ pver ] + standard_name = enter_standard_name_4 + units = enter_units + type = integer + dimensions = () + intent = in +[ cpair ] + standard_name = enter_standard_name_5 + units = enter_units + type = real | kind = kind_phys + dimensions = () + intent = in +[ tend_s_snwprd ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_deep_convection + units = J kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ tend_s_snwevmlt ] + standard_name = +tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_deep_convection + units = J kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ qtnd ] + standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out diff --git a/cam_diagnostics/zm_momtran_tendency_diagnostics.F90 b/cam_diagnostics/zm_momtran_tendency_diagnostics.F90 index f87ac182..e7fa55bf 100644 --- a/cam_diagnostics/zm_momtran_tendency_diagnostics.F90 +++ b/cam_diagnostics/zm_momtran_tendency_diagnostics.F90 @@ -50,7 +50,7 @@ end subroutine zm_tendency_diagnostics_init !> \section arg_table_zm_tendency_diagnostics_run Argument Table !! \htmlinclude zm_tendency_diagnostics_run.html - subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, errmsg, errflg) + subroutine zm_tendency_diagnostics_run(ncol, pver, cpair, windu_tend, windv_tend, seten, errmsg, errflg) use cam_history, only: history_out_field use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t @@ -59,9 +59,10 @@ subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, err !------------------------------------------------ integer, intent(in) :: ncol integer, intent(in) :: pver - integer, intent(in) :: pverp - type(ccpp_constituent_prop_ptr_t), intent(in) :: const_props(:) - real(kind_phys), intent(in) :: dqdt(:,:,:) ! Tracer tendency array (ncol,pver,ncnst) + real(kind_phys), intent(in) :: cpair + real(kind_phys), intent(in) :: windu_tend(:,:) + real(kind_phys), intent(in) :: windv_tend(:,:) + real(kind_phys), intent(in) :: seten(:,:) ! CCPP error handling variables character(len=512), intent(out) :: errmsg @@ -72,8 +73,6 @@ subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, err character(len=256) :: standard_name real(kind_phys) :: ftem(ncol,pver) - real(kind_phys) :: mcon(ncol,pverp) - real(kind_phys) :: mconzm(ncol,pverp) errmsg = '' errflg = 0 diff --git a/cam_diagnostics/zm_momtran_tendency_diagnostics.meta b/cam_diagnostics/zm_momtran_tendency_diagnostics.meta new file mode 100644 index 00000000..95194136 --- /dev/null +++ b/cam_diagnostics/zm_momtran_tendency_diagnostics.meta @@ -0,0 +1,75 @@ +[ccpp-table-properties] + name = zm_tendency_diagnostics + type = scheme + +[ccpp-arg-table] + name = zm_tendency_diagnostics_init + type = scheme +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out + +[ccpp-arg-table] + name = zm_tendency_diagnostics_run + type = scheme +[ ncol ] + standard_name = enter_standard_name_3 + units = enter_units + type = integer + dimensions = () + intent = in +[ pver ] + standard_name = enter_standard_name_4 + units = enter_units + type = integer + dimensions = () + intent = in +[ cpair ] + standard_name = enter_standard_name_5 + units = enter_units + type = real | kind = kind_phys + dimensions = () + intent = in +[ windu_tend ] + standard_name = tendency_of_eastward_wind + units = m s-2 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ windv_tend ] + standard_name = tendency_of_northward_wind + units = m s-2 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ seten ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure + units = J kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ errmsg ] + standard_name = ccpp_error_message + long_name = Error message for error handling in CCPP + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + long_name = Error flag for error handling in CCPP + units = 1 + type = integer + dimensions = () + intent = out diff --git a/suite_zh_geopotential b/suite_zh_geopotential new file mode 100644 index 00000000..bc63ae49 --- /dev/null +++ b/suite_zh_geopotential @@ -0,0 +1,27 @@ + + + + + to_be_ccppized_temporary + zm_convr + apply_heating_rate + dadadj_apply_qv_tendency + geopotential_temp + cloud_fraction_fice + zm_conv_evap + apply_heating_rate + dadadj_apply_qv_tendency + geopotential_temp + cloud_fraction_fice + zm_conv_momtran + apply_heating_rate + apply_tendency_of_eastward_wind + apply_tendency_of_northward_wind + geopotential_temp + zm_conv_convtran + dadadj_apply_qv_tendency + geopotential_temp + zm_diagnostics + + + diff --git a/zhang_mcfarlane/zm_convr.F90 b/zhang_mcfarlane/zm_convr.F90 index a03a7096..1a16f8b4 100644 --- a/zhang_mcfarlane/zm_convr.F90 +++ b/zhang_mcfarlane/zm_convr.F90 @@ -167,7 +167,7 @@ subroutine zm_convr_run( ncol ,pver , & pblh ,zm ,geos ,zi ,qtnd , & heat ,pap ,paph ,dpp , & delt ,mcon ,cme ,cape , & - tpert ,dlf ,zdu ,rprd , & + tpert ,dlf ,dif ,zdu ,rprd , & mu ,md ,du ,eu ,ed , & dp ,dsubcld ,jt ,maxg ,ideep , & ql ,rliq ,landfrac, & @@ -311,6 +311,7 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys), intent(out) :: qtnd(:,:) ! specific humidity tendency (kg/kg/s) (ncol,pver) real(kind_phys), intent(out) :: heat(:,:) ! heating rate (dry static energy tendency, W/kg) (ncol,pver) real(kind_phys), intent(out) :: mcon(:,:) ! (ncol,pverp) + real(kind_phys), intent(out) :: dif(:,:) real(kind_phys), intent(out) :: dlf(:,:) ! scattrd version of the detraining cld h2o tend (ncol,pver) real(kind_phys), intent(out) :: cme(:,:) ! (ncol,pver) real(kind_phys), intent(out) :: cape(:) ! w convective available potential energy. (ncol) @@ -349,8 +350,6 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys) mumax(ncol) - real(kind_phys) :: dif(ncol,pver) ! detrained convective cloud ice mixing ratio. - !CACNOTE - Figure out real intent for jt and maxg integer, intent(out) :: jt(ncol) ! wg top level index of deep cumulus convection. integer, intent(out) :: maxg(ncol) ! wg gathered values of maxi. diff --git a/zhang_mcfarlane/zm_convr.meta b/zhang_mcfarlane/zm_convr.meta index 9cbda9f3..47732ed5 100644 --- a/zhang_mcfarlane/zm_convr.meta +++ b/zhang_mcfarlane/zm_convr.meta @@ -325,6 +325,12 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out +[ dif ] + standard_name = detrainment_of_cloud_ice_due_to_deep_convection + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out [ zdu ] standard_name = detrainment_mass_flux_due_to_deep_convection units = s-1 From f0f9ac6bcc60c815745fc644b3cc462892d464fe Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 9 Dec 2024 15:29:59 -0700 Subject: [PATCH 26/36] Further cleanup --- schemes/zhang_mcfarlane/zm_conv_convtran.F90 | 3 - schemes/zhang_mcfarlane/zm_convr.F90 | 75 ++++---------------- schemes/zhang_mcfarlane/zm_convr.meta | 2 +- 3 files changed, 13 insertions(+), 67 deletions(-) diff --git a/schemes/zhang_mcfarlane/zm_conv_convtran.F90 b/schemes/zhang_mcfarlane/zm_conv_convtran.F90 index 8b8e0794..248e002d 100644 --- a/schemes/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/schemes/zhang_mcfarlane/zm_conv_convtran.F90 @@ -173,12 +173,10 @@ subroutine zm_conv_convtran_run(ncol, pver, & end do ! Loop ever each constituent -!CACNOTE - This should probably loop 1, ncnst - figure out what was being done for 1 dqdt(:,:,:) = 0._kind_phys do m = 1, ncnst call const_metadata(m)%standard_name(standard_name) - write(0,*) ' standard_name=',standard_name if (standard_name == 'water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water') then cycle end if @@ -186,7 +184,6 @@ subroutine zm_conv_convtran_run(ncol, pver, & if (doconvtran(m)) then call const_metadata(m)%is_dry(is_dry, errflg, errmsg) - write(0,*) ' is_dry=', is_dry if (is_dry) then do k = 1,pver do i =il1g,il2g diff --git a/schemes/zhang_mcfarlane/zm_convr.F90 b/schemes/zhang_mcfarlane/zm_convr.F90 index a9eb641d..0c98c002 100644 --- a/schemes/zhang_mcfarlane/zm_convr.F90 +++ b/schemes/zhang_mcfarlane/zm_convr.F90 @@ -333,6 +333,13 @@ subroutine zm_convr_run( ncol ,pver , & integer, intent(out) :: ideep(:) ! column indices of gathered points (ncol) + integer, intent(out) :: jt(:) ! wg top level index of deep cumulus convection. + integer, intent(out) :: maxg(:)! wg gathered values of maxi. + + integer, intent(out) :: lengath + + real(kind_phys),intent(out):: ql(:,:) ! wg grid slice of cloud liquid water. + character(len=40), intent(out) :: scheme_name character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg @@ -350,14 +357,6 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys) mumax(ncol) -!CACNOTE - Figure out real intent for jt and maxg - integer, intent(out) :: jt(ncol) ! wg top level index of deep cumulus convection. - integer, intent(out) :: maxg(ncol) ! wg gathered values of maxi. - - integer, intent(out) :: lengath - -!CACNOTE - Figure out real intent for ql - real(kind_phys),intent(inout):: ql(ncol,pver) ! wg grid slice of cloud liquid water. ! real(kind_phys) pblt(ncol) ! i row of pbl top indices. @@ -1532,9 +1531,6 @@ SUBROUTINE ientropy (rcall,icol,s,p,qt,T,qst,Tfg,cpliq,cpwv,rh2o,errmsg,errflg) ! for T and saturated vapor mixing ratio ! -! CACNOTE - Remove this when pass in lat/lon or pass out lchnk,icol (Note: lchnk will not exist in CAM-SIMA) -! use phys_grid, only: get_rlon_p, get_rlat_p - integer, intent(in) :: icol, rcall real(kind_phys), intent(in) :: s, p, Tfg, qt real(kind_phys), intent(in) :: cpliq @@ -1660,28 +1656,9 @@ subroutine cldprp(ncol ,pver ,pverp ,cpliq , & rd ,grav ,cp ,msg , & evp ,cu ,rprd ,limcnv ,landfrac, & qcde ,qhat ) - -!----------------------------------------------------------------------- -!CACNOTE - fill in documentation -! -! Purpose: -! -! -! Method: -! may 09/91 - guang jun zhang, m.lazare, n.mcfarlane. -! original version cldprop. -! -! Author: See above, modified by P. Rasch -! This is contributed code not fully standardized by the CCM core group. -! -! this code is very much rougher than virtually anything else in the CCM -! there are debug statements left strewn about and code segments disabled -! these are to facilitate future development. We expect to release a -! cleaner code in a future release -! -! the documentation has been enhanced to the degree that we are able -! -!----------------------------------------------------------------------- +!---------------------------------------------- +! Purpose: Provide cloud properties +!---------------------------------------------- implicit none @@ -2371,26 +2348,7 @@ subroutine closure(ncol ,pver, & lcl ,lel ,jt ,mx ,il1g , & il2g ,rd ,grav ,cp ,rl , & msg ,capelmt ) -!----------------------------------------------------------------------- -!CACNOTE - fill in documentation -! -! Purpose: -! -! -! Method: -! -! -! -! Author: G. Zhang and collaborators. CCM contact:P. Rasch -! This is contributed code not fully standardized by the CCM core group. -! -! this code is very much rougher than virtually anything else in the CCM -! We expect to release cleaner code in a future release -! -! the documentation has been enhanced to the degree that we are able -! -!----------------------------------------------------------------------- - +! CACNOTE - add description ! !-----------------------------Arguments--------------------------------- ! @@ -2583,17 +2541,8 @@ subroutine q1q2_pjr(ncol ,pver ,latice ,& implicit none !----------------------------------------------------------------------- -! CACNOTE -fill in documentation -! ! Purpose: -! -! -! Method: -! -! -! -! Author: phil rasch dec 19 1995 -! +! compute temperature and moisture changes due to convection. !----------------------------------------------------------------------- diff --git a/schemes/zhang_mcfarlane/zm_convr.meta b/schemes/zhang_mcfarlane/zm_convr.meta index 068cbb2f..dbe0b750 100644 --- a/schemes/zhang_mcfarlane/zm_convr.meta +++ b/schemes/zhang_mcfarlane/zm_convr.meta @@ -409,7 +409,7 @@ units = kg kg-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = inout + intent = out [ rliq ] standard_name = vertically_integrated_cloud_liquid_tendency_due_to_all_convection_to_be_applied_later_in_time_loop units = kg m-2 s-1 From 3d44c2b2b68e340fc175d7063e148a9c3ddda24d Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 16 Dec 2024 15:06:12 -0700 Subject: [PATCH 27/36] Finalize ZM diagnostics --- .../zm_convr_tendency_diagnostics.F90 | 32 ++++++++++--------- .../zm_convr_tendency_diagnostics.meta | 6 ++-- schemes/sima_diagnostics/zm_diagnostics.F90 | 30 +++++++++-------- schemes/sima_diagnostics/zm_diagnostics.meta | 26 +++++++-------- .../zm_evap_tendency_diagnostics.F90 | 12 ++++--- .../zm_evap_tendency_diagnostics.meta | 21 +++++++----- .../zm_momtran_tendency_diagnostics.F90 | 24 +++++++------- .../zm_momtran_tendency_diagnostics.meta | 18 +++++------ .../zm_tendency_diagnostics.F90 | 2 -- schemes/zhang_mcfarlane/zm_convr.meta | 2 +- suites/suite_zhang_mcfarlane.xml | 3 ++ 11 files changed, 95 insertions(+), 81 deletions(-) diff --git a/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90 b/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90 index 4dab829b..8d29c918 100644 --- a/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90 @@ -1,4 +1,4 @@ -module zm_convr_diagnostics +module zm_convr_tendency_diagnostics !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! THIS IS A TEMPLATE @@ -23,14 +23,14 @@ module zm_convr_diagnostics private save - public :: zm_convr_diagnostics_init ! init routine - public :: zm_convr_diagnostics_run ! main routine + public :: zm_convr_tendency_diagnostics_init ! init routine + public :: zm_convr_tendency_diagnostics_run ! main routine CONTAINS - !> \section arg_table_zm_convr_diagnostics_init Argument Table - !! \htmlinclude zm_convr_diagnostics_init.html - subroutine zm_convr_diagnostics_init(errmsg, errflg) + !> \section arg_table_zm_convr_tendency_diagnostics_init Argument Table + !! \htmlinclude zm_convr_tendency_diagnostics_init.html + subroutine zm_convr_tendency_diagnostics_init(errmsg, errflg) use cam_history, only: history_add_field use cam_history_support, only: horiz_only @@ -45,11 +45,11 @@ subroutine zm_convr_diagnostics_init(errmsg, errflg) call history_add_field ('ZMDT', 'T tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'K s-1') call history_add_field ('ZMDQ', 'Q tendency - Zhang-McFarlane moist convection', 'lev', 'avg', 'kg kg-1 s-1') - end subroutine zm_convr_diagnostics_init + end subroutine zm_convr_tendency_diagnostics_init - !> \section arg_table_zm_convr_diagnostics_run Argument Table - !! \htmlinclude zm_convr_diagnostics_run.html - subroutine zm_convr_diagnostics_run(ncol, pver, cpair, heat, qtnd, errmsg, errflg) + !> \section arg_table_zm_convr_tendency_diagnostics_run Argument Table + !! \htmlinclude zm_convr_tendency_diagnostics_run.html + subroutine zm_convr_tendency_diagnostics_run(ncol, pver, cpair, heat, qtnd, errmsg, errflg) use cam_history, only: history_out_field @@ -75,12 +75,14 @@ subroutine zm_convr_diagnostics_run(ncol, pver, cpair, heat, qtnd, errmsg, errfl errmsg = '' errflg = 0 - ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair - call history_out_field('ZMDT ', ftem) - call history_out_field('ZMDQ ',qtnd(1,1,1)) + ftem(:,:) = 0._kind_phys - end subroutine zm_convr_diagnostics_run + ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair + call history_out_field('ZMDT ', ftem) + call history_out_field('ZMDQ ', qtnd) + + end subroutine zm_convr_tendency_diagnostics_run !======================================================================= -end module zm_convr_diagnostics +end module zm_convr_tendency_diagnostics diff --git a/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta b/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta index da9ce3f5..e23eb1bb 100644 --- a/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta +++ b/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta @@ -1,9 +1,9 @@ [ccpp-table-properties] - name = zm_convr_diagnostics + name = zm_convr_tendency_diagnostics type = scheme [ccpp-arg-table] - name = zm_convr_diagnostics_init + name = zm_convr_tendency_diagnostics_init type = scheme [ errmsg ] standard_name = ccpp_error_message @@ -21,7 +21,7 @@ intent = out [ccpp-arg-table] - name = zm_convr_diagnostics_run + name = zm_convr_tendency_diagnostics_run type = scheme [ ncol ] standard_name = horizontal_loop_extent diff --git a/schemes/sima_diagnostics/zm_diagnostics.F90 b/schemes/sima_diagnostics/zm_diagnostics.F90 index 0b95ba86..1a14fc41 100644 --- a/schemes/sima_diagnostics/zm_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_diagnostics.F90 @@ -52,7 +52,6 @@ subroutine zm_diagnostics_init(errmsg, errflg) call history_add_field ('ZMNTSNPD', & 'tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection', & 'lev', 'avg', 'kg kg-1 s-1') - call history_add_field ('ZMEIHEAT', 'Heating by ice and evaporation in ZM convection', 'lev', 'avg', 'W kg-1') call history_add_field ('CMFMC_DP', 'Convection mass flux from ZM deep ', 'ilev', 'avg', 'kg m-2 s-1') call history_add_field ('PRECCDZM', 'lwe_precipitation_rate_at_surface_due_to_deep_convection', horiz_only, 'avg', 'm s-1') @@ -91,9 +90,10 @@ end subroutine zm_diagnostics_init !> \section arg_table_zm_diagnostics_run Argument Table !! \htmlinclude zm_diagnostics_run.html - subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, gravit, mu, md, & - dif, dlf, ps, paph, maxg, jt, flxprec, flxsnow, ntprprd, ntsnprd, pguallu, pguallv, & - pgdallu, pgdallv, icwuu, icwuv, icwdu, icwdv, errmsg, errflg) + subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, prec, cape, gravit, mu, md, & +! dif, dlf, ps, pap, maxg, jt, flxprec, flxsnow, ntprprd, ntsnprd, pguallu, pguallv, & + dlf, ps, pap, maxg, jt, flxprec, flxsnow, ntprprd, ntsnprd, pguallu, pguallv, & + pgdallu, pgdallv, icwuu, icwuv, icwdu, icwdv, mcon, errmsg, errflg) use cam_history, only: history_out_field @@ -107,16 +107,15 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, integer, intent(in) :: ideep(:) real(kind_phys), intent(in) :: cpair - real(kind_phys), intent(in) :: heat(:,:) real(kind_phys), intent(in) :: prec(:) real(kind_phys), intent(in) :: cape(:) real(kind_phys), intent(in) :: gravit real(kind_phys), intent(in) :: mu(:,:) real(kind_phys), intent(in) :: md(:,:) - real(kind_phys), intent(in) :: dif(:,:) +! real(kind_phys), intent(in) :: dif(:,:) real(kind_phys), intent(in) :: dlf(:,:) real(kind_phys), intent(in) :: ps(:) - real(kind_phys), intent(in) :: paph(:,:) + real(kind_phys), intent(in) :: pap(:,:) integer, intent(in) :: maxg(ncol) integer, intent(in) :: jt(ncol) real(kind_phys),intent(in) :: flxprec(:,:) @@ -132,6 +131,8 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, real(kind_phys),intent(in) :: icwdu(:,:) real(kind_phys),intent(in) :: icwdv(:,:) + real(kind_phys),intent(inout) :: mcon(:,:) + ! CCPP error handling variables character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg @@ -142,10 +143,9 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, real(kind_phys) :: pcont(ncol) real(kind_phys) :: pconb(ncol) real(kind_phys) :: ftem(ncol,pver) - real(kind_phys) :: mcon(ncol,pverp) real(kind_phys) :: mconzm(ncol,pverp) - real(kind_phys) :: mu_out(ncol,pverp) - real(kind_phys) :: md_out(ncol,pverp) + real(kind_phys) :: mu_out(ncol,pver) + real(kind_phys) :: md_out(ncol,pver) integer :: index_cldliq integer i, ii, k @@ -153,6 +153,9 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, errmsg = '' errflg = 0 + mu_out(:,:) = 0._kind_phys + md_out(:,:) = 0._kind_phys + lengath = count(ideep > 0) if (lengath > ncol) lengath = ncol ! should not happen, but force it to not be larger than ncol for safety sake @@ -183,15 +186,15 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, call history_out_field('ZMMU', mu_out) call history_out_field('ZMMD', md_out) - call history_out_field('DIFZM' ,dif) +! call history_out_field('DIFZM' ,dif) call history_out_field('DLFZM' ,dlf) pcont(:ncol) = ps(:ncol) pconb(:ncol) = ps(:ncol) do i = 1,lengath if (maxg(i).gt.jt(i)) then - pcont(ideep(i)) = paph(ideep(i),jt(i)) ! gathered array (or jctop ungathered) - pconb(ideep(i)) = paph(ideep(i),maxg(i))! gathered array + pcont(ideep(i)) = pap(ideep(i),jt(i)) ! gathered array (or jctop ungathered) + pconb(ideep(i)) = pap(ideep(i),maxg(i))! gathered array endif ! write(iulog,*) ' pcont, pconb ', pcont(i), pconb(i), cnt(i), cnb(i) end do @@ -202,7 +205,6 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, heat, prec, cape, call history_out_field('ZMFLXSNW', flxsnow) call history_out_field('ZMNTPRPD', ntprprd) call history_out_field('ZMNTSNPD', ntsnprd) - call history_out_field('ZMEIHEAT', heat) !CACNOTE - CAM is outputting the exact same quantity to both fields call history_out_field('PRECCDZM ',prec) diff --git a/schemes/sima_diagnostics/zm_diagnostics.meta b/schemes/sima_diagnostics/zm_diagnostics.meta index 94750e88..c834f7d4 100644 --- a/schemes/sima_diagnostics/zm_diagnostics.meta +++ b/schemes/sima_diagnostics/zm_diagnostics.meta @@ -53,12 +53,6 @@ type = real | kind = kind_phys dimensions = () intent = in -[ heat ] - standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure - units = J kg-1 s-1 - type = real | kind = kind_phys - dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) - intent = in [ prec ] standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection units = m s-1 @@ -89,12 +83,12 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in -[ dif ] - standard_name = detrainment_of_cloud_ice_due_to_deep_convection - units = kg kg-1 s-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = in +#[ dif ] +# standard_name = detrainment_of_cloud_ice_due_to_deep_convection +# units = kg kg-1 s-1 +# type = real | kind = kind_phys +# dimensions = (horizontal_loop_extent,vertical_layer_dimension) +# intent = in [ dlf ] standard_name = detrainment_of_cloud_liquid_due_to_deep_convection units = kg kg-1 s-1 @@ -107,7 +101,7 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent) intent = in -[ paph ] +[ pap ] standard_name = air_pressure units = Pa type = real | kind = kind_phys @@ -197,6 +191,12 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in +[ mcon ] + standard_name = atmosphere_convective_mass_flux_due_to_deep_convection + units = hPa s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_interface_dimension) + intent = inout [ errmsg ] standard_name = ccpp_error_message long_name = Error message for error handling in CCPP diff --git a/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90 b/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90 index 1f31baaa..50a24c51 100644 --- a/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90 @@ -42,6 +42,8 @@ subroutine zm_evap_tendency_diagnostics_init(errmsg, errflg) errmsg = '' errflg = 0 + call history_add_field ('ZMEIHEAT', 'Heating by ice and evaporation in ZM convection', 'lev', 'avg', 'W kg-1') + call history_add_field ('EVAPTZM', 'T tendency - Evaporation/snow prod from Zhang convection', 'lev', 'avg', 'K s-1') call history_add_field ('FZSNTZM', 'T tendency - Rain to snow conversion from Zhang convection', 'lev', 'avg', 'K s-1') call history_add_field ('EVSNTZM', 'T tendency - Snow to rain prod from Zhang convection', 'lev', 'avg', 'K s-1') @@ -52,7 +54,7 @@ end subroutine zm_evap_tendency_diagnostics_init !> \section arg_table_zm_evap_tendency_diagnostics_run Argument Table !! \htmlinclude zm_evap_tendency_diagnostics_run.html - subroutine zm_evap_tendency_diagnostics_run(ncol, pver, cpair, tend_s_snwprd, tend_s_snwevmlt, qtnd, errmsg, errflg) + subroutine zm_evap_tendency_diagnostics_run(ncol, pver, cpair, tend_s_snwprd, tend_s_snwevmlt, qtnd, heat, errmsg, errflg) use cam_history, only: history_out_field use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t @@ -65,7 +67,7 @@ subroutine zm_evap_tendency_diagnostics_run(ncol, pver, cpair, tend_s_snwprd, te real(kind_phys), intent(in) :: tend_s_snwprd(:,:) real(kind_phys), intent(in) :: tend_s_snwevmlt(:,:) real(kind_phys), intent(in) :: qtnd(:,:) - + real(kind_phys), intent(in) :: heat(:,:) ! CCPP error handling variables character(len=512), intent(out) :: errmsg @@ -78,15 +80,17 @@ subroutine zm_evap_tendency_diagnostics_run(ncol, pver, cpair, tend_s_snwprd, te real(kind_phys) :: ftem(ncol,pver) errmsg = '' + errflg = 0 - ftem(:ncol,:pver) = qtnd(:ncol,:pver)/cpair + ftem(:ncol,:pver) = heat(:ncol,:pver)/cpair call history_out_field('EVAPTZM ',ftem) ftem(:ncol,:pver) = tend_s_snwprd (:ncol,:pver)/cpair call history_out_field('FZSNTZM ',ftem) ftem(:ncol,:pver) = tend_s_snwevmlt(:ncol,:pver)/cpair call history_out_field('EVSNTZM ',ftem) - call history_out_field('EVAPQZM ',ptend_loc%q(1,1,1)) + call history_out_field('EVAPQZM ',qtnd) + call history_out_field('ZMEIHEAT', heat) end subroutine zm_evap_tendency_diagnostics_run diff --git a/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.meta b/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.meta index 4437b7a4..09fa27ab 100644 --- a/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.meta +++ b/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.meta @@ -24,20 +24,20 @@ name = zm_evap_tendency_diagnostics_run type = scheme [ ncol ] - standard_name = enter_standard_name_3 - units = enter_units + standard_name = horizontal_loop_extent + units = count type = integer dimensions = () intent = in [ pver ] - standard_name = enter_standard_name_4 - units = enter_units + standard_name = vertical_layer_dimension + units = count type = integer dimensions = () intent = in [ cpair ] - standard_name = enter_standard_name_5 - units = enter_units + standard_name = specific_heat_of_dry_air_at_constant_pressure + units = J kg-1 K-1 type = real | kind = kind_phys dimensions = () intent = in @@ -48,8 +48,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ tend_s_snwevmlt ] - standard_name = -tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_deep_convection + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_deep_convection units = J kg-1 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) @@ -60,6 +59,12 @@ tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in +[ heat ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure + units = J kg-1 s-1 + type = real | kind = kind_phys + dimensions = (1:horizontal_loop_extent,1:vertical_layer_dimension) + intent = in [ errmsg ] standard_name = ccpp_error_message long_name = Error message for error handling in CCPP diff --git a/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90 b/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90 index e7fa55bf..64d0e391 100644 --- a/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90 @@ -1,4 +1,4 @@ -module zm_tendency_diagnostics +module zm_momtran_tendency_diagnostics !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! THIS IS A TEMPLATE @@ -23,14 +23,14 @@ module zm_tendency_diagnostics private save - public :: zm_tendency_diagnostics_init ! init routine - public :: zm_tendency_diagnostics_run ! main routine + public :: zm_momtran_tendency_diagnostics_init ! init routine + public :: zm_momtran_tendency_diagnostics_run ! main routine CONTAINS - !> \section arg_table_zm_tendency_diagnostics_init Argument Table - !! \htmlinclude zm_tendency_diagnostics_init.html - subroutine zm_tendency_diagnostics_init(errmsg, errflg) + !> \section arg_table_zm_momtran_tendency_diagnostics_init Argument Table + !! \htmlinclude zm_momtran_tendency_diagnostics_init.html + subroutine zm_momtran_tendency_diagnostics_init(errmsg, errflg) use cam_history, only: history_add_field use cam_history_support, only: horiz_only @@ -46,11 +46,11 @@ subroutine zm_tendency_diagnostics_init(errmsg, errflg) call history_add_field ('ZMMTU', 'U tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') call history_add_field ('ZMMTV', 'V tendency - ZM convective momentum transport', 'lev', 'avg', 'm s-2') - end subroutine zm_tendency_diagnostics_init + end subroutine zm_momtran_tendency_diagnostics_init - !> \section arg_table_zm_tendency_diagnostics_run Argument Table - !! \htmlinclude zm_tendency_diagnostics_run.html - subroutine zm_tendency_diagnostics_run(ncol, pver, cpair, windu_tend, windv_tend, seten, errmsg, errflg) + !> \section arg_table_zm_momtran_tendency_diagnostics_run Argument Table + !! \htmlinclude zm_momtran_tendency_diagnostics_run.html + subroutine zm_momtran_tendency_diagnostics_run(ncol, pver, cpair, windu_tend, windv_tend, seten, errmsg, errflg) use cam_history, only: history_out_field use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t @@ -83,8 +83,8 @@ subroutine zm_tendency_diagnostics_run(ncol, pver, cpair, windu_tend, windv_tend ftem(:ncol,:pver) = seten(:ncol,:pver)/cpair call history_out_field('ZMMTT', ftem) - end subroutine zm_tendency_diagnostics_run + end subroutine zm_momtran_tendency_diagnostics_run !======================================================================= -end module zm_tendency_diagnostics +end module zm_momtran_tendency_diagnostics diff --git a/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.meta b/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.meta index 95194136..8000522e 100644 --- a/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.meta +++ b/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.meta @@ -1,9 +1,9 @@ [ccpp-table-properties] - name = zm_tendency_diagnostics + name = zm_momtran_tendency_diagnostics type = scheme [ccpp-arg-table] - name = zm_tendency_diagnostics_init + name = zm_momtran_tendency_diagnostics_init type = scheme [ errmsg ] standard_name = ccpp_error_message @@ -21,23 +21,23 @@ intent = out [ccpp-arg-table] - name = zm_tendency_diagnostics_run + name = zm_momtran_tendency_diagnostics_run type = scheme [ ncol ] - standard_name = enter_standard_name_3 - units = enter_units + standard_name = horizontal_loop_extent + units = count type = integer dimensions = () intent = in [ pver ] - standard_name = enter_standard_name_4 - units = enter_units + standard_name = vertical_layer_dimension + units = count type = integer dimensions = () intent = in [ cpair ] - standard_name = enter_standard_name_5 - units = enter_units + standard_name = specific_heat_of_dry_air_at_constant_pressure + units = J kg-1 K-1 type = real | kind = kind_phys dimensions = () intent = in diff --git a/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 b/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 index fce13c3f..fcbc5ff0 100644 --- a/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 @@ -71,8 +71,6 @@ subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, err character(len=256) :: standard_name real(kind_phys) :: ftem(ncol,pver) - real(kind_phys) :: mcon(ncol,pverp) - real(kind_phys) :: mconzm(ncol,pverp) errmsg = '' errflg = 0 diff --git a/schemes/zhang_mcfarlane/zm_convr.meta b/schemes/zhang_mcfarlane/zm_convr.meta index dbe0b750..a3406c78 100644 --- a/schemes/zhang_mcfarlane/zm_convr.meta +++ b/schemes/zhang_mcfarlane/zm_convr.meta @@ -300,7 +300,7 @@ standard_name = atmosphere_convective_mass_flux_due_to_deep_convection units = hPa s-1 type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_interface_dimension) intent = out [ cme ] standard_name = tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_from_cloud_condensation_minus_precipitation_evaporation_due_to_deep_convection diff --git a/suites/suite_zhang_mcfarlane.xml b/suites/suite_zhang_mcfarlane.xml index 9d5a024f..52fb89a5 100644 --- a/suites/suite_zhang_mcfarlane.xml +++ b/suites/suite_zhang_mcfarlane.xml @@ -5,18 +5,21 @@ initialize_constituents to_be_ccppized_temporary zm_convr + zm_convr_tendency_diagnostics apply_heating_rate apply_constituent_tendencies qneg geopotential_temp cloud_fraction_fice zm_conv_evap + zm_evap_tendency_diagnostics apply_heating_rate apply_constituent_tendencies qneg geopotential_temp cloud_fraction_fice zm_conv_momtran + zm_momtran_tendency_diagnostics apply_heating_rate apply_tendency_of_eastward_wind apply_tendency_of_northward_wind From 3349c8f0b561ab38e7bf6576bc25f49eaf045bac Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 18 Dec 2024 13:23:36 -0700 Subject: [PATCH 28/36] restore diagnostic message --- schemes/zhang_mcfarlane/zm_convr.F90 | 57 ++++++++++++++++----------- schemes/zhang_mcfarlane/zm_convr.meta | 12 ++++++ 2 files changed, 46 insertions(+), 23 deletions(-) diff --git a/schemes/zhang_mcfarlane/zm_convr.F90 b/schemes/zhang_mcfarlane/zm_convr.F90 index 0c98c002..804c8f14 100644 --- a/schemes/zhang_mcfarlane/zm_convr.F90 +++ b/schemes/zhang_mcfarlane/zm_convr.F90 @@ -163,6 +163,7 @@ end subroutine zm_convr_init !! subroutine zm_convr_run( ncol ,pver , & pverp, gravit ,latice ,cpwv ,cpliq , rh2o, & + lat, long, & t ,qh ,prec , & pblh ,zm ,geos ,zi ,qtnd , & heat ,pap ,paph ,dpp , & @@ -294,6 +295,12 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys), intent(in) :: cpliq ! specific heat of fresh h2o (J K-1 kg-1) real(kind_phys), intent(in) :: rh2o ! Water vapor gas constant (J K-1 kg-1) + real(kind_phys), intent(in) :: lat(:) + real(kind_phys), intent(in) :: long(:) + +! real(kind_phys) :: lat(ncol) +! real(kind_phys) :: long(ncol) + real(kind_phys), intent(in) :: t(:,:) ! grid slice of temperature at mid-layer. (ncol,pver) real(kind_phys), intent(in) :: qh(:,:) ! grid slice of specific humidity. (ncol,pver) real(kind_phys), intent(in) :: pap(:,:) ! (ncol,pver) @@ -560,7 +567,7 @@ subroutine zm_convr_run( ncol ,pver , & pblt ,lcl ,lel ,lon ,maxi , & rgas ,grav ,cpres ,msg , & zi ,zs ,tpert , landfrac,& - errmsg ,errflg) + lat ,long ,errmsg ,errflg) ! ! determine whether grid points will undergo some deep convection @@ -800,7 +807,7 @@ subroutine buoyan_dilute( ncol ,pver , & pblt ,lcl ,lel ,lon ,mx , & rd ,grav ,cp ,msg , & zi ,zs ,tpert , landfrac,& - errmsg ,errflg) + lat ,long ,errmsg ,errflg) !----------------------------------------------------------------------- ! ! Purpose: @@ -850,6 +857,9 @@ subroutine buoyan_dilute( ncol ,pver , & real(kind_phys), intent(in) :: zi(ncol,pver+1) real(kind_phys), intent(in) :: zs(ncol) + real(kind_phys), intent(in) :: lat(:) + real(kind_phys), intent(in) :: long(:) + ! ! output arguments ! @@ -1073,7 +1083,7 @@ subroutine buoyan_dilute( ncol ,pver , & call parcel_dilute(ncol, pver, cpliq, cpwv, rh2o, latice, msg, mx, p, t, q, & tpert, tp, tpv, qstp, pl, tl, ql, lcl, & - landfrac, errmsg, errflg) + landfrac, lat, long, errmsg, errflg) ! If lcl is above the nominal level of non-divergence (600 mbs), @@ -1156,7 +1166,7 @@ end subroutine buoyan_dilute subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p, t, q, & tpert, tp, tpv, qstp, pl, tl, ql, lcl, & - landfrac,errmsg,errflg) + landfrac,lat,long,errmsg,errflg) ! Routine to determine ! 1. Tp - Parcel temperature @@ -1181,6 +1191,9 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p real(kind_phys), intent(in), dimension(ncol,pver) :: q real(kind_phys), intent(in), dimension(ncol) :: tpert ! PBL temperature perturbation. +real(kind_phys), intent(in) :: lat(:) +real(kind_phys), intent(in) :: long(:) + real(kind_phys), intent(inout), dimension(ncol,pver) :: tp ! Parcel temp. real(kind_phys), intent(inout), dimension(ncol,pver) :: qstp ! Parcel water vapour (sat value above lcl). real(kind_phys), intent(inout), dimension(ncol) :: tl ! Actual temp of LCL. @@ -1310,7 +1323,8 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p qtmix(i,k) = qtp0(i) tfguess = t(i,k) rcall = 1 - call ientropy (rcall,i,smix(i,k),p(i,k),qtmix(i,k),tmix(i,k),qsmix(i,k),tfguess,cpliq,cpwv,rh2o,errmsg,errflg) + call ientropy (rcall,i,smix(i,k),p(i,k),qtmix(i,k),tmix(i,k),qsmix(i,k),tfguess,cpliq,cpwv,rh2o,& + lat(i), long(i), errmsg,errflg) end if ! Entraining levels @@ -1350,7 +1364,8 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p tfguess = tmix(i,k+1) rcall = 2 - call ientropy(rcall,i,smix(i,k),p(i,k),qtmix(i,k),tmix(i,k),qsmix(i,k),tfguess,cpliq,cpwv,rh2o,errmsg,errflg) + call ientropy(rcall,i,smix(i,k),p(i,k),qtmix(i,k),tmix(i,k),qsmix(i,k),tfguess,cpliq,cpwv,rh2o,lat(i),& + long(i),errmsg,errflg) ! ! Determine if this is lcl of this column if qsmix <= qtmix. @@ -1369,7 +1384,7 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p tfguess = tmix(i,k) rcall = 3 - call ientropy (rcall,i,slcl,pl(i),qtlcl,tl(i),qslcl,tfguess,cpliq,cpwv,rh2o,errmsg,errflg) + call ientropy (rcall,i,slcl,pl(i),qtlcl,tl(i),qslcl,tfguess,cpliq,cpwv,rh2o,lat(i), long(i), errmsg,errflg) ! write(iulog,*)' ' ! write(iulog,*)' p',p(i,k+1),pl(i),p(i,lcl(i)) @@ -1465,7 +1480,8 @@ subroutine parcel_dilute (ncol, pver, cpliq, cpwv, rh2o, latice, msg, klaunch, p tfguess = tmix(i,k) rcall =4 - call ientropy (rcall,i,new_s, p(i,k), new_q, tmix(i,k), qsmix(i,k), tfguess,cpliq,cpwv,rh2o,errmsg,errflg) + call ientropy (rcall,i,new_s, p(i,k), new_q, tmix(i,k), qsmix(i,k), tfguess,cpliq,cpwv,rh2o,& + lat(i), long(i), errmsg,errflg) end do ! Iteration loop for freezing processes. @@ -1523,7 +1539,7 @@ end FUNCTION entropy ! !----------------------------------------------------------------------------------------- -SUBROUTINE ientropy (rcall,icol,s,p,qt,T,qst,Tfg,cpliq,cpwv,rh2o,errmsg,errflg) +SUBROUTINE ientropy (rcall,icol,s,p,qt,T,qst,Tfg,cpliq,cpwv,rh2o,this_lat,this_lon,errmsg,errflg) !----------------------------------------------------------------------------------------- ! ! p(mb), Tfg/T(K), qt/qv(kg/kg), s(J/kg). @@ -1536,11 +1552,15 @@ SUBROUTINE ientropy (rcall,icol,s,p,qt,T,qst,Tfg,cpliq,cpwv,rh2o,errmsg,errflg) real(kind_phys), intent(in) :: cpliq real(kind_phys), intent(in) :: cpwv real(kind_phys), intent(in) :: rh2o + + real(kind_phys), intent(in) :: this_lat + real(kind_phys), intent(in) :: this_lon + real(kind_phys), intent(out) :: qst, T character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind_phys) :: est, this_lat,this_lon + real(kind_phys) :: est real(kind_phys) :: a,b,c,d,ebr,fa,fb,fc,pbr,qbr,rbr,sbr,tol1,xm,tol integer :: i @@ -1625,18 +1645,10 @@ SUBROUTINE ientropy (rcall,icol,s,p,qt,T,qst,Tfg,cpliq,cpwv,rh2o,errmsg,errflg) call qsat_hPa(T, p, est, qst) if (.not. converged) then -!CACNOTE - Revisit this with Jesse -! Pass in lat/lon in degrees for this -! latitude_degrees_north -! longitude_degrees_east -! Use get_lat_all_p -! Use get_lon_all_p (lchnk,ncol,lats_all) -! this_lat = get_rlat_p(lchnk, icol)*57.296_kind_phys -! this_lon = get_rlon_p(lchnk, icol)*57.296_kind_phys -! write(errmsg,100) 'ZM_CONV: IENTROPY. Details: call#,lchnk,icol= ',rcall,lchnk,icol, & -! ' lat: ',this_lat,' lon: ',this_lon, & -! ' P(mb)= ', p, ' Tfg(K)= ', Tfg, ' qt(g/kg) = ', 1000._kind_phys*qt, & -! ' qst(g/kg) = ', 1000._kind_phys*qst,', s(J/kg) = ',s + write(errmsg,100) 'ZM_CONV: IENTROPY. Details: call#,icol= ',rcall,icol, & + ' lat: ',this_lat,' lon: ',this_lon, & + ' P(mb)= ', p, ' Tfg(K)= ', Tfg, ' qt(g/kg) = ', 1000._kind_phys*qt, & + ' qst(g/kg) = ', 1000._kind_phys*qst,', s(J/kg) = ',s errflg=1 end if @@ -2348,7 +2360,6 @@ subroutine closure(ncol ,pver, & lcl ,lel ,jt ,mx ,il1g , & il2g ,rd ,grav ,cp ,rl , & msg ,capelmt ) -! CACNOTE - add description ! !-----------------------------Arguments--------------------------------- ! diff --git a/schemes/zhang_mcfarlane/zm_convr.meta b/schemes/zhang_mcfarlane/zm_convr.meta index a3406c78..8c19a2e6 100644 --- a/schemes/zhang_mcfarlane/zm_convr.meta +++ b/schemes/zhang_mcfarlane/zm_convr.meta @@ -216,6 +216,18 @@ type = real | kind = kind_phys dimensions = () intent = in +[ lat ] + standard_name = latitude + units = rad + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in +[ long ] + standard_name = longitude + units = rad + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in [ t ] standard_name = air_temperature units = K From 73d6a7d5b9a07f2acad23f57331cd372dab45d05 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Wed, 18 Dec 2024 16:47:20 -0700 Subject: [PATCH 29/36] Fix error message --- schemes/zhang_mcfarlane/zm_convr.F90 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/schemes/zhang_mcfarlane/zm_convr.F90 b/schemes/zhang_mcfarlane/zm_convr.F90 index 804c8f14..21938f7b 100644 --- a/schemes/zhang_mcfarlane/zm_convr.F90 +++ b/schemes/zhang_mcfarlane/zm_convr.F90 @@ -298,9 +298,6 @@ subroutine zm_convr_run( ncol ,pver , & real(kind_phys), intent(in) :: lat(:) real(kind_phys), intent(in) :: long(:) -! real(kind_phys) :: lat(ncol) -! real(kind_phys) :: long(ncol) - real(kind_phys), intent(in) :: t(:,:) ! grid slice of temperature at mid-layer. (ncol,pver) real(kind_phys), intent(in) :: qh(:,:) ! grid slice of specific humidity. (ncol,pver) real(kind_phys), intent(in) :: pap(:,:) ! (ncol,pver) @@ -1645,14 +1642,14 @@ SUBROUTINE ientropy (rcall,icol,s,p,qt,T,qst,Tfg,cpliq,cpwv,rh2o,this_lat,this_l call qsat_hPa(T, p, est, qst) if (.not. converged) then - write(errmsg,100) 'ZM_CONV: IENTROPY. Details: call#,icol= ',rcall,icol, & + write(errmsg,100) ' ZM_CONV: IENTROPY. Details: call#,icol= ',rcall,icol, & ' lat: ',this_lat,' lon: ',this_lon, & ' P(mb)= ', p, ' Tfg(K)= ', Tfg, ' qt(g/kg) = ', 1000._kind_phys*qt, & ' qst(g/kg) = ', 1000._kind_phys*qst,', s(J/kg) = ',s errflg=1 end if -100 format (A,I1,I4,I4,7(A,F6.2)) +100 format (A,I4,I4,7(A,F6.2)) end SUBROUTINE ientropy From 2380fa67de05e03bd090e527b9addd6a317af3e5 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 24 Dec 2024 11:40:25 -0700 Subject: [PATCH 30/36] Make zm_conv_evap variables generic so it can be called by convect_shallow as well --- .../set_deep_conv_fluxes_to_general.F90 | 26 ++++ .../set_deep_conv_fluxes_to_general.meta | 31 +++++ .../set_general_conv_fluxes_to_deep.F90 | 49 ++++++++ .../set_general_conv_fluxes_to_deep.meta | 115 ++++++++++++++++++ schemes/zhang_mcfarlane/zm_conv_evap.F90 | 20 +-- schemes/zhang_mcfarlane/zm_conv_evap.meta | 22 ++-- suites/suite_zhang_mcfarlane.xml | 2 + 7 files changed, 244 insertions(+), 21 deletions(-) create mode 100644 schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.F90 create mode 100644 schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.meta create mode 100644 schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90 create mode 100644 schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta diff --git a/schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.F90 b/schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.F90 new file mode 100644 index 00000000..bd76369f --- /dev/null +++ b/schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.F90 @@ -0,0 +1,26 @@ +module set_deep_conv_fluxes_to_general + + use ccpp_kinds, only: kind_phys + + implicit none + +contains + +!=============================================================================== +!> \section arg_table_set_deep_conv_fluxes_to_general_run Argument Table +!! \htmlinclude set_deep_conv_fluxes_to_general_run.html +!! + + subroutine set_deep_conv_fluxes_to_general_run(prec_gen, prec_dp, prdprec_gen, prdprec_dp) + + real(kind_phys), intent(out) :: prec_gen(:) + real(kind_phys), intent(in) :: prec_dp(:) + real(kind_phys), intent(out) :: prdprec_gen(:,:) + real(kind_phys), intent(in) :: prdprec_dp(:,:) + + prec_gen = prec_dp + prdprec_gen = prdprec_dp + + end subroutine set_deep_conv_fluxes_to_general_run + +end module set_deep_conv_fluxes_to_general diff --git a/schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.meta b/schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.meta new file mode 100644 index 00000000..ecf21332 --- /dev/null +++ b/schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.meta @@ -0,0 +1,31 @@ +[ccpp-table-properties] + name = set_deep_conv_fluxes_to_general + type = scheme + +[ccpp-arg-table] + name = set_deep_conv_fluxes_to_general_run + type = scheme +[ prec_gen ] + standard_name = lwe_precipitation_rate_at_surface_due_to_convection + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ prec_dp ] + standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in +[ prdprec_gen ] + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection_excluding_subcloud_evaporation + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent, vertical_layer_dimension) + intent = out +[ prdprec_dp ] + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent, vertical_layer_dimension) + intent = in diff --git a/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90 b/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90 new file mode 100644 index 00000000..ef450ca5 --- /dev/null +++ b/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90 @@ -0,0 +1,49 @@ +module set_general_conv_fluxes_to_deep + + use ccpp_kinds, only: kind_phys + + implicit none + +contains + +!=============================================================================== +!> \section arg_table_set_general_conv_fluxes_to_deep_run Argument Table +!! \htmlinclude set_general_conv_fluxes_to_deep_run.html +!! + + subroutine set_general_conv_fluxes_to_deep_run(tend_s_snwprd_gen, tend_s_snwprd_dp, tend_s_snwevmlt_gen, tend_s_snwevmlt_dp, & + prdprec_gen, prdprec_dp, prec_gen, prec_dp, snow_gen, snow_dp, ntprprd_gen, ntprprd_dp, ntsnprd_gen, ntsnprd_dp, & + flxprec_gen, flxprec_dp, flxsnow_gen, flxsnow_dp) + + real(kind_phys), intent(in) :: tend_s_snwprd_gen(:,:) + real(kind_phys), intent(out) :: tend_s_snwprd_dp(:,:) + real(kind_phys), intent(in) :: tend_s_snwevmlt_gen(:,:) + real(kind_phys), intent(out) :: tend_s_snwevmlt_dp(:,:) + real(kind_phys), intent(in) :: prdprec_gen(:,:) + real(kind_phys), intent(out) :: prdprec_dp(:,:) + real(kind_phys), intent(in) :: prec_gen(:) + real(kind_phys), intent(out) :: prec_dp(:) + real(kind_phys), intent(in) :: snow_gen(:) + real(kind_phys), intent(out) :: snow_dp(:) + real(kind_phys), intent(in) :: ntprprd_gen(:,:) + real(kind_phys), intent(out) :: ntprprd_dp(:,:) + real(kind_phys), intent(in) :: ntsnprd_gen(:,:) + real(kind_phys), intent(out) :: ntsnprd_dp(:,:) + real(kind_phys), intent(in) :: flxprec_gen(:,:) + real(kind_phys), intent(out) :: flxprec_dp(:,:) + real(kind_phys), intent(in) :: flxsnow_gen(:,:) + real(kind_phys), intent(out) :: flxsnow_dp(:,:) + + tend_s_snwprd_dp = tend_s_snwprd_gen + tend_s_snwevmlt_dp = tend_s_snwevmlt_gen + prdprec_dp = prdprec_gen + prec_dp = prec_gen + snow_dp = snow_gen + ntprprd_dp = ntprprd_gen + ntsnprd_dp = ntsnprd_gen + flxprec_dp = flxprec_gen + flxsnow_dp = flxsnow_gen + + end subroutine set_general_conv_fluxes_to_deep_run + +end module set_general_conv_fluxes_to_deep diff --git a/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta b/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta new file mode 100644 index 00000000..8edbfb48 --- /dev/null +++ b/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta @@ -0,0 +1,115 @@ +[ccpp-table-properties] + name = set_general_conv_fluxes_to_deep + type = scheme + +[ccpp-arg-table] + name = set_general_conv_fluxes_to_deep_run + type = scheme +[ tend_s_snwprd_gen ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_convection + units = J kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ tend_s_snwprd_dp ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_deep_convection + units = J kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ tend_s_snwevmlt_gen ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_convection + units = J kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ tend_s_snwevmlt_dp ] + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_deep_convection + units = J kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ prdprec_gen ] + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection_excluding_subcloud_evaporation + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ prdprec_dp ] + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ prec_gen ] + standard_name = lwe_precipitation_rate_at_surface_due_to_convection + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in +[ prec_dp ] + standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ snow_gen ] + standard_name = lwe_frozen_precipitation_rate_at_surface_due_to_convection + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = in +[ snow_dp ] + standard_name = lwe_frozen_precipitation_rate_at_surface_due_to_deep_convection + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ ntprprd_gen ] + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ ntprprd_dp ] + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ ntsnprd_gen ] + standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_convection + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = in +[ ntsnprd_dp ] + standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + units = kg kg-1 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + intent = out +[ flxprec_gen ] + standard_name = precipitation_flux_at_interface_due_to_convection + units = kg m-2 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_interface_dimension) + intent = in +[ flxprec_dp ] + standard_name = precipitation_flux_at_interface_due_to_deep_convection + units = kg m-2 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_interface_dimension) + intent = out +[ flxsnow_gen ] + standard_name = frozen_precipitation_flux_at_interface_due_to_convection + units = kg m-2 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_interface_dimension) + intent = in +[ flxsnow_dp ] + standard_name = frozen_precipitation_flux_at_interface_due_to_deep_convection + units = kg m-2 s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent,vertical_interface_dimension) + intent = out diff --git a/schemes/zhang_mcfarlane/zm_conv_evap.F90 b/schemes/zhang_mcfarlane/zm_conv_evap.F90 index 5786b337..2333e0df 100644 --- a/schemes/zhang_mcfarlane/zm_conv_evap.F90 +++ b/schemes/zhang_mcfarlane/zm_conv_evap.F90 @@ -24,8 +24,8 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & t,pmid,pdel,q, & landfrac, & tend_s, tend_s_snwprd, tend_s_snwevmlt, tend_q, & - prdprec, cldfrc, deltat, & - prec, snow, ntprprd, ntsnprd, fsnow_conv, flxprec, flxsnow, scheme_name, errmsg, errflg) + prdprec_gen, cldfrc, deltat, & + prec_gen, snow, ntprprd, ntsnprd, fsnow_conv, flxprec, flxsnow, scheme_name, errmsg, errflg) !----------------------------------------------------------------------- ! Compute tendencies due to evaporation of rain from ZM scheme @@ -60,12 +60,12 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & - real(kind_phys), intent(in ) :: prdprec(:,:)! precipitation production (kg/ks/s) (ncol,pver) + real(kind_phys), intent(in ) :: prdprec_gen(:,:)! precipitation production (kg/ks/s) (ncol,pver) real(kind_phys), intent(in ) :: cldfrc(:,:) ! cloud fraction (ncol,pver) real(kind_phys), intent(in ) :: deltat ! time step real(kind_phys), intent(in ) :: fsnow_conv(:,:) ! snow fraction in precip production - real(kind_phys), intent(inout) :: prec(:) ! Convective-scale preciptn rate (ncol) + real(kind_phys), intent(inout) :: prec_gen(:) ! Convective-scale preciptn rate (ncol) real(kind_phys), intent(out) :: snow(:) ! Convective-scale snowfall rate (ncol) @@ -111,7 +111,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & old_snow=.true. ! convert input precip to kg/m2/s - prec(:ncol) = prec(:ncol)*1000._kind_phys + prec_gen(:ncol) = prec_gen(:ncol)*1000._kind_phys ! determine saturation vapor pressure do k = 1,pver @@ -176,7 +176,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & evplimit = min(evplimit, flxprec(i,k) * gravit / pdel(i,k)) ! Total evaporation cannot exceed input precipitation - evplimit = min(evplimit, (prec(i) - evpvint(i)) * gravit / pdel(i,k)) + evplimit = min(evplimit, (prec_gen(i) - evpvint(i)) * gravit / pdel(i,k)) evpprec(i) = min(evplimit, evpprec(i)) if( .not.old_snow ) then @@ -198,7 +198,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & evpvint(i) = evpvint(i) + evpprec(i) * pdel(i,k)/gravit ! net precip production is production - evaporation - ntprprd(i,k) = prdprec(i,k) - evpprec(i) + ntprprd(i,k) = prdprec_gen(i,k) - evpprec(i) ! net snow production is precip production * ice fraction - evaporation - melting ! the small amount added to flxprec in the work1 expression has been increased from ! 1e-36 to 8.64e-11 (1e-5 mm/day). This causes the temperature based partitioning @@ -213,8 +213,8 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & work2 = max(fsnow_conv(i,k), work1) if (snowmlt(i).gt.0._kind_phys) work2 = 0._kind_phys - ntsnprd(i,k) = prdprec(i,k)*work2 - evpsnow(i) - snowmlt(i) - tend_s_snwprd (i,k) = prdprec(i,k)*work2*latice + ntsnprd(i,k) = prdprec_gen(i,k)*work2 - evpsnow(i) - snowmlt(i) + tend_s_snwprd (i,k) = prdprec_gen(i,k)*work2*latice tend_s_snwevmlt(i,k) = - ( evpsnow(i) + snowmlt(i) )*latice end if @@ -239,7 +239,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & end do ! set output precipitation rates (m/s) - prec(:ncol) = flxprec(:ncol,pver+1) / 1000._kind_phys + prec_gen(:ncol) = flxprec(:ncol,pver+1) / 1000._kind_phys snow(:ncol) = flxsnow(:ncol,pver+1) / 1000._kind_phys end subroutine zm_conv_evap_run diff --git a/schemes/zhang_mcfarlane/zm_conv_evap.meta b/schemes/zhang_mcfarlane/zm_conv_evap.meta index 80cd30f7..023c82da 100644 --- a/schemes/zhang_mcfarlane/zm_conv_evap.meta +++ b/schemes/zhang_mcfarlane/zm_conv_evap.meta @@ -103,13 +103,13 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ tend_s_snwprd ] - standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_deep_convection + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_convection units = J kg-1 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ tend_s_snwevmlt ] - standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_deep_convection + standard_name = tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_convection units = J kg-1 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) @@ -121,8 +121,8 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out constituent = true -[ prdprec ] - standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation +[ prdprec_gen ] + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection_excluding_subcloud_evaporation units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) @@ -139,26 +139,26 @@ type = real | kind = kind_phys dimensions = () intent = in -[ prec ] - standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection +[ prec_gen ] + standard_name = lwe_precipitation_rate_at_surface_due_to_convection units = m s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent) intent = inout [ snow ] - standard_name = lwe_frozen_precipitation_rate_at_surface_due_to_deep_convection + standard_name = lwe_frozen_precipitation_rate_at_surface_due_to_convection units = m s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent) intent = out [ ntprprd ] - standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out [ ntsnprd ] - standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + standard_name = tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_convection units = kg kg-1 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) @@ -170,13 +170,13 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in [ flxprec ] - standard_name = precipitation_flux_at_interface_due_to_deep_convection + standard_name = precipitation_flux_at_interface_due_to_convection units = kg m-2 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_interface_dimension) intent = out [ flxsnow ] - standard_name = frozen_precipitation_flux_at_interface_due_to_deep_convection + standard_name = frozen_precipitation_flux_at_interface_due_to_convection units = kg m-2 s-1 type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_interface_dimension) diff --git a/suites/suite_zhang_mcfarlane.xml b/suites/suite_zhang_mcfarlane.xml index 52fb89a5..df676720 100644 --- a/suites/suite_zhang_mcfarlane.xml +++ b/suites/suite_zhang_mcfarlane.xml @@ -11,7 +11,9 @@ qneg geopotential_temp cloud_fraction_fice + set_deep_conv_fluxes_to_general zm_conv_evap + set_general_conv_fluxes_to_deep zm_evap_tendency_diagnostics apply_heating_rate apply_constituent_tendencies From 5766e6722001f22f27f7b47955104daf0139d267 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 24 Dec 2024 13:17:20 -0700 Subject: [PATCH 31/36] Update NamesNotInDictionary ane preliminary ChangeLog --- doc/ChangeLog | 56 +++++ doc/NamesNotInDictionary.txt | 463 +++++++++++++++++++++-------------- 2 files changed, 329 insertions(+), 190 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b08a0987..c5457571 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,59 @@ + +=============================================================== + +Tag name: +Originator(s): cacraig +Date: Dec 24, 2024 +One-line Summary: Complete Zhang McFarlane conversion to CCPP +Github PR URL: + +This PR fixes the following NCAR/atmospheric_physics Github issues: +Add ccpp'ized ZM : https://github.com/ESCOMP/atmospheric_physics/issues/66 + +Code reviewed by: + +List all existing files that have been added (A), modified (M), or deleted (D), +and describe the changes: +A schemes/cloud_fraction/cloud_fraction_fice.F90 +A schemes/cloud_fraction/cloud_fraction_fice.meta +A schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90 +A schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta +A schemes/sima_diagnostics/zm_diagnostics.F90 +A schemes/sima_diagnostics/zm_diagnostics.meta +A schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90 +A schemes/sima_diagnostics/zm_evap_tendency_diagnostics.meta +A schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90 +A schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.meta +A schemes/sima_diagnostics/zm_tendency_diagnostics.F90 +A schemes/sima_diagnostics/zm_tendency_diagnostics.meta +A schemes/utilities/to_be_ccppized_temporary.F90 +A schemes/utilities/to_be_ccppized_temporary.meta +A schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.F90 +A schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.meta +A schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90 +A schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta +M schemes/zhang_mcfarlane/zm_conv_convtran.F90 +M schemes/zhang_mcfarlane/zm_conv_convtran.meta +M schemes/zhang_mcfarlane/zm_conv_evap.F90 +M schemes/zhang_mcfarlane/zm_conv_evap.meta +M schemes/zhang_mcfarlane/zm_conv_momtran.F90 +M schemes/zhang_mcfarlane/zm_conv_momtran.meta +M schemes/zhang_mcfarlane/zm_convr.F90 +M schemes/zhang_mcfarlane/zm_convr.meta +A schemes/zhang_mcfarlane/zm_convr_namelist.xml +A suites/suite_zhang_mcfarlane.xml +M test/test_schemes/initialize_constituents.F90 +A to_be_ccppized/error_messages.F90 +A to_be_ccppized/namelist_utils.F90 +A to_be_ccppized/units.F90 +A to_be_ccppized/wv_sat_methods.F90 +A to_be_ccppized/wv_saturation.F90 + +List and Describe any test failures: + +Summarize any changes to answers: + +=============================================================== =============================================================== Tag name: atmos_phys0_07_000 diff --git a/doc/NamesNotInDictionary.txt b/doc/NamesNotInDictionary.txt index 99c2e48b..fa672759 100644 --- a/doc/NamesNotInDictionary.txt +++ b/doc/NamesNotInDictionary.txt @@ -1,14 +1,20 @@ ####################### Date/time of when script was run: -2024-12-16 11:19:41.130567 +2024-12-24 13:15:46.877558 ####################### Non-dictionary standard names found in the following metadata files: -------------------------- -atmospheric_physics/schemes/sima_diagnostics/check_energy_gmean_diagnostics.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/test/test_schemes/initialize_constituents.meta + + - dynamic_constituents_for_initialize_constituents + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/sima_diagnostics/check_energy_gmean_diagnostics.meta - flag_for_energy_global_means_output - global_mean_heating_rate_correction_for_energy_conservation @@ -17,30 +23,57 @@ atmospheric_physics/schemes/sima_diagnostics/check_energy_gmean_diagnostics.meta -------------------------- -atmospheric_physics/schemes/sima_diagnostics/check_energy_diagnostics.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.meta - - cumulative_total_energy_boundary_flux_using_physics_energy_formula - - cumulative_total_water_boundary_flux - - ratio_of_specific_heat_of_air_used_in_physics_energy_formula_to_specific_heat_of_air_used_in_dycore_energy_formula - - specific_heat_of_air_used_in_dycore - - vertically_integrated_total_energy_at_end_of_physics_timestep - - vertically_integrated_total_energy_using_dycore_energy_formula - - vertically_integrated_total_energy_using_physics_energy_formula - - vertically_integrated_total_water + - tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water -------------------------- -atmospheric_physics/schemes/sima_diagnostics/sima_state_diagnostics.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/sima_diagnostics/sima_state_diagnostics.meta - air_pressure_at_interface - air_pressure_of_dry_air_at_interface + - geopotential_height_wrt_surface_at_interface - ln_air_pressure_at_interface - ln_air_pressure_of_dry_air_at_interface - surface_air_pressure -------------------------- -atmospheric_physics/schemes/sima_diagnostics/tropopause_diagnostics.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/sima_diagnostics/zm_diagnostics.meta + + - atmosphere_convective_mass_flux_due_to_deep_convection + - atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns + - atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns + - detrainment_of_cloud_liquid_due_to_deep_convection + - frozen_precipitation_flux_at_interface_due_to_deep_convection + - horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns + - in_cloud_eastward_wind_in_downdraft_due_to_deep_convection + - in_cloud_eastward_wind_in_updraft_due_to_deep_convection + - in_cloud_northward_wind_in_downdraft_due_to_deep_convection + - in_cloud_northward_wind_in_updraft_due_to_deep_convection + - lwe_precipitation_rate_at_surface_due_to_deep_convection + - precipitation_flux_at_interface_due_to_deep_convection + - surface_air_pressure + - tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term + - tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term + - tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + - tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term + - tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term + - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + - vertical_index_at_top_of_deep_convection_for_convective_columns + - vertical_index_of_deep_convection_launch_level_for_convective_columns + - zhang_mcfarlane_convective_available_potential_energy + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/sima_diagnostics/zm_tendency_diagnostics.meta + + - ccpp_constituent_tendencies + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/sima_diagnostics/tropopause_diagnostics.meta - tropopause_air_pressure - tropopause_air_pressure_from_climatological_method @@ -68,37 +101,42 @@ atmospheric_physics/schemes/sima_diagnostics/tropopause_diagnostics.meta -------------------------- -atmospheric_physics/schemes/tj2016/tj2016_precip.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/sima_diagnostics/check_energy_diagnostics.meta - - gas_constant_of_water_vapor - - lwe_large_scale_precipitation_rate_at_surface - - ratio_of_water_vapor_to_dry_air_molecular_weights - - sum_of_sigma_pressure_hybrid_coordinate_a_coefficient_and_sigma_pressure_hybrid_coordinate_b_coefficient + - cumulative_total_energy_boundary_flux_using_physics_energy_formula + - cumulative_total_water_boundary_flux + - ratio_of_specific_heat_of_air_used_in_physics_energy_formula_to_specific_heat_of_air_used_in_dycore_energy_formula + - specific_heat_of_air_used_in_dycore + - vertically_integrated_total_energy_at_end_of_physics_timestep + - vertically_integrated_total_energy_using_dycore_energy_formula + - vertically_integrated_total_energy_using_physics_energy_formula + - vertically_integrated_total_water -------------------------- -atmospheric_physics/schemes/tj2016/tj2016_sfc_pbl_hs.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.meta - - air_pressure_at_interface - - eddy_heat_diffusivity - - eddy_momentum_diffusivity - - gas_constant_of_water_vapor - - ln_air_pressure_at_interface - - pi_constant - - ratio_of_water_vapor_to_dry_air_molecular_weights - - sum_of_sigma_pressure_hybrid_coordinate_a_coefficient_and_sigma_pressure_hybrid_coordinate_b_coefficient - - surface_air_pressure - - surface_eastward_wind_stress - - surface_evaporation_rate - - surface_northward_wind_stress - - surface_upward_sensible_heat_flux - - tendency_of_air_temperature_due_to_diabatic_heating - - tendency_of_air_temperature_due_to_vertical_diffusion - - tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_vertical_diffusion + - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_deep_convection + - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_deep_convection + - tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/musica/musica_ccpp.meta + + - blackbody_temperature_at_surface + - cloud_area_fraction + - dynamic_constituents_for_musica_ccpp + - earth_sun_distance + - extraterrestrial_radiation_flux + - geopotential_height_wrt_surface_at_interface + - photolysis_wavelength_grid_interfaces + - solar_zenith_angle + - surface_albedo_due_to_UV_and_VIS_direct -------------------------- -atmospheric_physics/schemes/dry_adiabatic_adjust/dadadj.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/dry_adiabatic_adjust/dadadj.meta - air_pressure_at_interface - binary_indicator_for_dry_adiabatic_adjusted_grid_cell @@ -108,7 +146,61 @@ atmospheric_physics/schemes/dry_adiabatic_adjust/dadadj.meta -------------------------- -atmospheric_physics/schemes/zhang_mcfarlane/zm_conv_momtran.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/utilities/geopotential_temp.meta + + - air_pressure_at_interface + - geopotential_height_wrt_surface_at_interface + - ln_air_pressure_at_interface + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/utilities/physics_tendency_updaters.meta + + - ccpp_constituent_tendencies + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/tropopause_find/tropopause_find.meta + + - air_pressure_at_interface + - fill_value_for_diagnostic_output + - fractional_calendar_days_on_end_of_current_timestep + - geopotential_height_wrt_surface_at_interface + - pi_constant + - ratio_of_dry_air_gas_constant_to_specific_heat_of_dry_air_at_constant_pressure + - tropopause_air_pressure + - tropopause_air_pressure_from_chemical_method + - tropopause_air_pressure_from_climatological_method + - tropopause_air_pressure_from_cold_point_method + - tropopause_air_pressure_from_hybrid_stobie_linoz_with_climatological_backup_method + - tropopause_air_pressure_from_lapse_rate_method + - tropopause_air_pressure_from_tropopause_climatology_dataset + - tropopause_air_temperature + - tropopause_air_temperature_from_chemical_method + - tropopause_air_temperature_from_climatological_method + - tropopause_air_temperature_from_cold_point_method + - tropopause_air_temperature_from_hybrid_stobie_linoz_with_climatological_backup_method + - tropopause_air_temperature_from_lapse_rate_method + - tropopause_calendar_days_from_tropopause_climatology + - tropopause_geopotential_height_wrt_surface + - tropopause_geopotential_height_wrt_surface_from_chemical_method + - tropopause_geopotential_height_wrt_surface_from_climatological_method + - tropopause_geopotential_height_wrt_surface_from_cold_point_method + - tropopause_geopotential_height_wrt_surface_from_hybrid_stobie_linoz_with_climatological_backup_method + - tropopause_geopotential_height_wrt_surface_from_lapse_rate_method + - tropopause_vertical_layer_index + - tropopause_vertical_layer_index_from_chemical_method + - tropopause_vertical_layer_index_from_climatological_method + - tropopause_vertical_layer_index_from_cold_point_method + - tropopause_vertical_layer_index_from_hybrid_stobie_linoz_with_climatological_backup_method + - tropopause_vertical_layer_index_from_hybrid_stobie_linoz_with_climatological_backup_method_for_chemistry + - tropopause_vertical_layer_index_from_lapse_rate_method + - vertical_layer_index_lower_bound_from_hybrid_stobie_linoz_with_climatological_backup_method_for_linearized_ozone_chemistry + - vertical_layer_index_lower_bound_from_hybrid_stobie_linoz_with_climatological_backup_method_for_stratospheric_chemistry + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/zhang_mcfarlane/zm_conv_momtran.meta - atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns @@ -116,14 +208,16 @@ atmospheric_physics/schemes/zhang_mcfarlane/zm_conv_momtran.meta - atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - current_timestep_number - - eastward_and_northward_winds_in_deep_convective_downdrafts? - - enter_name - - flag_for_zhang_mcfarlane_deep_momentum_transport? + - flag_for_momentum_transport_by_zhang_mcfarlane_deep_convection_scheme - horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns - - maximum_number_of_grid_cells_with_deep_convection? - - minimum_number_of_grid_cells_with_deep_convection? - - momentum_downward_transport_parameter_for_zhang_mcfarlane? - - momentum_upward_transport_parameter_for_zhang_mcfarlane? + - in_cloud_eastward_wind_in_downdraft_due_to_deep_convection + - in_cloud_eastward_wind_in_updraft_due_to_deep_convection + - in_cloud_northward_wind_in_downdraft_due_to_deep_convection + - in_cloud_northward_wind_in_updraft_due_to_deep_convection + - index_of_first_column_of_gathered_deep_convection_arrays + - index_of_last_column_of_gathered_deep_convection_arrays + - momentum_transport_parameter_for_vertical_pressure_gradient_force_for_downdraft_for_zhang_mcfarlane_deep_convection_scheme + - momentum_transport_parameter_for_vertical_pressure_gradient_force_for_updraft_for_zhang_mcfarlane_deep_convection_scheme - pressure_thickness_for_deep_convection_for_convective_columns - pressure_thickness_for_subcloud_layer_for_deep_convection_for_convective_columns - tendency_of_eastward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term @@ -131,135 +225,174 @@ atmospheric_physics/schemes/zhang_mcfarlane/zm_conv_momtran.meta - tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_downdraft_pressure_gradient_term - tendency_of_northward_wind_due_to_zhang_mcfarlane_deep_convective_updraft_pressure_gradient_term - vertical_index_at_top_of_deep_convection_for_convective_columns - - vertical_index_of_deep_conveciton_launch_level_for_convective_columns - --------------------------- - -atmospheric_physics/schemes/zhang_mcfarlane/zm_conv_evap.meta - - - - - cloud_area_fraction - - flag_for_zhang_mcfarlane_convective_organization_parameterization? - - freezing_point_of_water? - - frozen_precipitation_mass_flux_at_interface_due_to_deep_convection? - - heating_rate - - latent_heat_of_fusion_of_water_at_0c? - - latent_heat_of_vaporization_of_water_at_0c? - - lwe_frozen_precipitation_rate_at_surface_due_to_deep_convection - - lwe_precipitation_rate_at_surface_due_to_deep_convection - - precipitation_mass_flux_at_interface_due_to_deep_convection? - - pressure_thickness - - specific_heat_of_dry_air_at_constant_pressure? - - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_melt? - - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_in_deep_convection? - - tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection? - - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection? - - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation - - tendency_of_water_vapor_mixing_ratio_wrt_moist_air and_condensed_water? - - tunable_evaporation_efficiency_for_land_in_zhang_mcfarlane_deep_convection_scheme? - - tunable_evaporation_efficiency_in_zhang_mcfarlane_deep_convection_scheme? + - vertical_index_of_deep_convection_launch_level_for_convective_columns -------------------------- -atmospheric_physics/schemes/zhang_mcfarlane/zm_convr.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/zhang_mcfarlane/zm_convr.meta - air_pressure_at_interface - - atmosphere_convective_mass_flux_due_to all_convection? + - atmosphere_convective_mass_flux_due_to_deep_convection - atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - - condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane? - - condensate_to_precipitation_autoconversion_coefficient_over_ocean_for_zhang_mcfarlane? - - convective_available_potential_energy? + - cape_threshold_for_zhang_mcfarlane_deep_convection_scheme + - cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme + - cloud_condensate_to_precipitation_autoconversion_coefficient_over_ocean_for_zhang_mcfarlane_deep_convection_scheme - convective_temperature_perturbation_due_to_pbl_eddies - - deep_convection_triggering_cape_threshold_for_zhang_mcfarlane? - - deep_convective_adjustment_timescale_for_zhang_mcfarlane? - - deep_convective_entrainment_rate_for_zhang_mcfarlane? - - deep_convective_organization_amount? - - deep_convective_organization_amount_at_single_vertical_layer_spread_over_whole_column? - - deep_convective_organization_amount_for_zhang_mcfarlane? - - detrained_cloud_droplet_number_concentration_from_deep_convection? - - detrained_cloud_ice_crystal_number_concentration_from_deep_convection? + - deep_convective_adjustment_timescale_for_zhang_mcfarlane_deep_convection_scheme - detrainment_mass_flux_due_to_deep_convection - detrainment_of_cloud_ice_due_to_deep_convection - detrainment_of_cloud_liquid_due_to_deep_convection - - enter_name - - flag_for_no_deep_convection_in_pbl? - - freezing_point_of_water? - - gas_constant_of_water_vapor? + - entrainment_rate_for_cape_for_zhang_mcfarlane_deep_convection_scheme + - flag_for_no_deep_convection_in_pbl + - flag_for_well_mixed_pbl_parcel_property_for_zhang_mcfarlane_deep_convection_scheme + - freezing_point_of_water + - gas_constant_of_water_vapor + - geopotential_height_wrt_surface_at_interface - horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns - in_cloud_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_deep_convection - - initial_parcel_property_as_function_of_well-mixed_pbl_for_zhang_mcfarlane? - - latent_heat_of_fusion_of_water_at_0c? - - latent_heat_of_vaporization_of_water_at_0c? + - index_of_last_column_of_gathered_deep_convection_arrays + - latent_heat_of_fusion_of_water_at_0c - lwe_precipitation_rate_at_surface_due_to_deep_convection - - momentum_downward_transport_parameter_for_zhang_mcfarlane? - - momentum_upward_transport_parameter_for_zhang_mcfarlane? - - number_of_negative_buoyancy_regions_allowed_before_convection_top_for_zhang_mcfarlane? - - parcel_temperature_perturbation_for_zhang_mcfarlane? + - momentum_transport_parameter_for_vertical_pressure_gradient_force_for_downdraft_for_zhang_mcfarlane_deep_convection_scheme + - momentum_transport_parameter_for_vertical_pressure_gradient_force_for_updraft_for_zhang_mcfarlane_deep_convection_scheme + - number_of_negative_buoyancy_layers_allowed_before_convection_top_for_zhang_mcfarlane_deep_convection_scheme + - parcel_temperature_perturbation_for_zhang_mcfarlane_deep_convection_scheme - pressure_thickness_for_deep_convection_for_convective_columns - pressure_thickness_for_subcloud_layer_for_deep_convection_for_convective_columns - - ratio_of_h2o_to_dry_air_molecular_weights? - - specific_heat_of_water_vapor_at_constant_pressure? - - tendency_of_deep_convective_organization_amount? + - ratio_of_water_vapor_to_dry_air_molecular_weights + - reference_pressure_at_interface + - specific_heat_of_liquid_water_at_constant_pressure + - specific_heat_of_water_vapor_at_constant_pressure - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation - tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water - - tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_cloud_condensation_minus_precipitation_evaporation_in_deep_convection? - - tunable_evaporation_efficiency_for_land_in zhang_mcfarlane_deep_convection_scheme? - - tunable_evaporation_efficiency_in_zhang_mcfarlane_deep_convection_scheme? + - tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_from_cloud_condensation_minus_precipitation_evaporation_due_to_deep_convection + - tunable_evaporation_efficiency_over_land_for_zhang_mcfarlane_deep_convection_scheme + - tunable_evaporation_efficiency_over_ocean_for_zhang_mcfarlane_deep_convection_scheme - vertical_index_at_top_of_deep_convection_for_convective_columns - vertical_index_of_deep_convection_launch_level_for_convective_columns - - vertical_interface_index_of_deep_convection_height_limit? - vertically_integrated_cloud_ice_tendency_due_to_all_convection_to_be_applied_later_in_time_loop - vertically_integrated_cloud_liquid_tendency_due_to_all_convection_to_be_applied_later_in_time_loop + - zhang_mcfarlane_convective_available_potential_energy -------------------------- -atmospheric_physics/schemes/zhang_mcfarlane/zm_conv_convtran.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta + + - frozen_precipitation_flux_at_interface_due_to_convection + - frozen_precipitation_flux_at_interface_due_to_deep_convection + - lwe_frozen_precipitation_rate_at_surface_due_to_convection + - lwe_frozen_precipitation_rate_at_surface_due_to_deep_convection + - lwe_precipitation_rate_at_surface_due_to_convection + - lwe_precipitation_rate_at_surface_due_to_deep_convection + - precipitation_flux_at_interface_due_to_convection + - precipitation_flux_at_interface_due_to_deep_convection + - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_convection + - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_deep_convection + - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_convection + - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_deep_convection + - tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_convection + - tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection + - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection_excluding_subcloud_evaporation + - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection + - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/zhang_mcfarlane/zm_conv_convtran.meta - atmosphere_detrainment_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_downdraft_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_downdraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_updraft_convective_mass_flux_for_deep_convection_for_convective_columns - atmosphere_updraft_entrainment_convective_mass_flux_for_deep_convection_for_convective_columns + - ccpp_constituent_tendencies - current_timestep_number - - flag_for_zhang_mcfarlane_deep_convective_transport? + - flag_for_tracer_transport_by_zhang_mcfarlane_deep_scheme - fraction_of_water_insoluble_convectively_transported_species - horizontal_index_of_convective_columns_for_deep_convection_for_convective_columns - - maximum_number_of_grid_cells_with_deep_convection? - - minimum_number_of_grid_cells_with_deep_convection? + - index_of_first_column_of_gathered_deep_convection_arrays + - index_of_last_column_of_gathered_deep_convection_arrays - pressure_thickness_for_deep_convection_for_convective_columns - pressure_thickness_for_subcloud_layer_for_deep_convection_for_convective_columns - - pressure_thickness_of_dry_air_for_deep_convection_for_convective_columns? - - tendency_of_ccpp_constituents? - vertical_index_at_top_of_deep_convection_for_convective_columns - - vertical_index_of_deep_conveciton_launch_level_for_convective_columns + - vertical_index_of_deep_convection_launch_level_for_convective_columns -------------------------- -atmospheric_physics/schemes/utilities/geopotential_temp.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/zhang_mcfarlane/set_deep_conv_fluxes_to_general.meta - - air_pressure_at_interface - - ln_air_pressure_at_interface + - lwe_precipitation_rate_at_surface_due_to_convection + - lwe_precipitation_rate_at_surface_due_to_deep_convection + - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection_excluding_subcloud_evaporation + - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation -------------------------- -atmospheric_physics/schemes/utilities/physics_tendency_updaters.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/zhang_mcfarlane/zm_conv_evap.meta - - ccpp_constituent_tendencies + - cloud_area_fraction + - freezing_point_of_water + - frozen_precipitation_flux_at_interface_due_to_convection + - latent_heat_of_fusion_of_water_at_0c + - lwe_frozen_precipitation_rate_at_surface_due_to_convection + - lwe_precipitation_rate_at_surface_due_to_convection + - mass_fraction_of_snow_content_within_stratiform_cloud + - precipitation_flux_at_interface_due_to_convection + - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_evaporation_and_melting_of_frozen_precipitation_due_to_convection + - tendency_of_dry_air_enthalpy_at_constant_pressure_due_to_frozen_precipitation_production_due_to_convection + - tendency_of_frozen_precipitation_wrt_moist_air_and_condensed_water_due_to_convection + - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection + - tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection_excluding_subcloud_evaporation + - tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water + - tunable_evaporation_efficiency_over_land_for_zhang_mcfarlane_deep_convection_scheme + - tunable_evaporation_efficiency_over_ocean_for_zhang_mcfarlane_deep_convection_scheme + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/cloud_fraction/cloud_fraction_fice.meta + + - freezing_point_of_water + - index_of_pressure_at_troposphere_cloud_top + - mass_fraction_of_ice_content_within_stratiform_cloud + - mass_fraction_of_snow_content_within_stratiform_cloud + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/check_energy/dycore_energy_consistency_adjust.meta + + - flag_for_dycore_energy_consistency_adjustment + - ratio_of_specific_heat_of_air_used_in_physics_energy_formula_to_specific_heat_of_air_used_in_dycore_energy_formula + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/check_energy/check_energy_scaling.meta + + - ratio_of_specific_heat_of_air_used_in_physics_energy_formula_to_specific_heat_of_air_used_in_dycore_energy_formula + - specific_heat_of_air_used_in_dycore -------------------------- -atmospheric_physics/schemes/check_energy/check_energy_save_teout.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/check_energy/check_energy_fix.meta + + - air_pressure_at_interface + - global_mean_heating_rate_correction_for_energy_conservation + - net_sensible_heat_flux_through_top_and_bottom_of_atmosphere_column + +-------------------------- + +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/check_energy/check_energy_save_teout.meta - vertically_integrated_total_energy_at_end_of_physics_timestep - vertically_integrated_total_energy_using_dycore_energy_formula -------------------------- -atmospheric_physics/schemes/check_energy/check_energy_chng.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/check_energy/check_energy_chng.meta - air_pressure_of_dry_air_at_interface - air_temperature_at_start_of_physics_timestep @@ -287,7 +420,7 @@ atmospheric_physics/schemes/check_energy/check_energy_chng.meta -------------------------- -atmospheric_physics/schemes/check_energy/check_energy_zero_fluxes.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/check_energy/check_energy_zero_fluxes.meta - net_liquid_and_lwe_ice_fluxes_through_top_and_bottom_of_atmosphere_column - net_lwe_ice_fluxes_through_top_and_bottom_of_atmosphere_column @@ -296,29 +429,7 @@ atmospheric_physics/schemes/check_energy/check_energy_zero_fluxes.meta -------------------------- -atmospheric_physics/schemes/check_energy/dycore_energy_consistency_adjust.meta - - - flag_for_dycore_energy_consistency_adjustment - - ratio_of_specific_heat_of_air_used_in_physics_energy_formula_to_specific_heat_of_air_used_in_dycore_energy_formula - --------------------------- - -atmospheric_physics/schemes/check_energy/check_energy_scaling.meta - - - ratio_of_specific_heat_of_air_used_in_physics_energy_formula_to_specific_heat_of_air_used_in_dycore_energy_formula - - specific_heat_of_air_used_in_dycore - --------------------------- - -atmospheric_physics/schemes/check_energy/check_energy_fix.meta - - - air_pressure_at_interface - - global_mean_heating_rate_correction_for_energy_conservation - - net_sensible_heat_flux_through_top_and_bottom_of_atmosphere_column - --------------------------- - -atmospheric_physics/schemes/check_energy/check_energy_gmean/check_energy_gmean.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/check_energy/check_energy_gmean/check_energy_gmean.meta - air_pressure_at_interface - global_mean_air_pressure_at_top_of_atmosphere_model @@ -332,60 +443,32 @@ atmospheric_physics/schemes/check_energy/check_energy_gmean/check_energy_gmean.m -------------------------- -atmospheric_physics/schemes/tropopause_find/tropopause_find.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/tj2016/tj2016_precip.meta - - air_pressure_at_interface - - fill_value_for_diagnostic_output - - fractional_calendar_days_on_end_of_current_timestep - - pi_constant - - ratio_of_dry_air_gas_constant_to_specific_heat_of_dry_air_at_constant_pressure - - tropopause_air_pressure - - tropopause_air_pressure_from_chemical_method - - tropopause_air_pressure_from_climatological_method - - tropopause_air_pressure_from_cold_point_method - - tropopause_air_pressure_from_hybrid_stobie_linoz_with_climatological_backup_method - - tropopause_air_pressure_from_lapse_rate_method - - tropopause_air_pressure_from_tropopause_climatology_dataset - - tropopause_air_temperature - - tropopause_air_temperature_from_chemical_method - - tropopause_air_temperature_from_climatological_method - - tropopause_air_temperature_from_cold_point_method - - tropopause_air_temperature_from_hybrid_stobie_linoz_with_climatological_backup_method - - tropopause_air_temperature_from_lapse_rate_method - - tropopause_calendar_days_from_tropopause_climatology - - tropopause_geopotential_height_wrt_surface - - tropopause_geopotential_height_wrt_surface_from_chemical_method - - tropopause_geopotential_height_wrt_surface_from_climatological_method - - tropopause_geopotential_height_wrt_surface_from_cold_point_method - - tropopause_geopotential_height_wrt_surface_from_hybrid_stobie_linoz_with_climatological_backup_method - - tropopause_geopotential_height_wrt_surface_from_lapse_rate_method - - tropopause_vertical_layer_index - - tropopause_vertical_layer_index_from_chemical_method - - tropopause_vertical_layer_index_from_climatological_method - - tropopause_vertical_layer_index_from_cold_point_method - - tropopause_vertical_layer_index_from_hybrid_stobie_linoz_with_climatological_backup_method - - tropopause_vertical_layer_index_from_hybrid_stobie_linoz_with_climatological_backup_method_for_chemistry - - tropopause_vertical_layer_index_from_lapse_rate_method - - vertical_layer_index_lower_bound_from_hybrid_stobie_linoz_with_climatological_backup_method_for_linearized_ozone_chemistry - - vertical_layer_index_lower_bound_from_hybrid_stobie_linoz_with_climatological_backup_method_for_stratospheric_chemistry - --------------------------- - -atmospheric_physics/schemes/musica/musica_ccpp.meta - - - blackbody_temperature_at_surface - - cloud_area_fraction - - dynamic_constituents_for_musica_ccpp - - earth_sun_distance - - extraterrestrial_radiation_flux - - photolysis_wavelength_grid_interfaces - - solar_zenith_angle - - surface_albedo_due_to_UV_and_VIS_direct + - gas_constant_of_water_vapor + - lwe_large_scale_precipitation_rate_at_surface + - ratio_of_water_vapor_to_dry_air_molecular_weights + - sum_of_sigma_pressure_hybrid_coordinate_a_coefficient_and_sigma_pressure_hybrid_coordinate_b_coefficient -------------------------- -atmospheric_physics/test/test_schemes/initialize_constituents.meta +/home/cacraig/cam_sima_zm4/src/physics/ncar_ccpp/schemes/tj2016/tj2016_sfc_pbl_hs.meta - - dynamic_constituents_for_initialize_constituents + - air_pressure_at_interface + - eddy_heat_diffusivity + - eddy_momentum_diffusivity + - gas_constant_of_water_vapor + - ln_air_pressure_at_interface + - pi_constant + - ratio_of_water_vapor_to_dry_air_molecular_weights + - sum_of_sigma_pressure_hybrid_coordinate_a_coefficient_and_sigma_pressure_hybrid_coordinate_b_coefficient + - surface_air_pressure + - surface_eastward_wind_stress + - surface_evaporation_rate + - surface_northward_wind_stress + - surface_upward_sensible_heat_flux + - tendency_of_air_temperature_due_to_diabatic_heating + - tendency_of_air_temperature_due_to_vertical_diffusion + - tendency_of_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_vertical_diffusion ####################### From 52e951ebb62ad5031740539ca7a9c6f4231355b8 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 13 Jan 2025 10:47:18 -0700 Subject: [PATCH 32/36] Address reviewer comments --- .../zm_convr_tendency_diagnostics.F90 | 18 --------------- schemes/sima_diagnostics/zm_diagnostics.F90 | 20 +--------------- .../zm_evap_tendency_diagnostics.F90 | 18 --------------- .../zm_momtran_tendency_diagnostics.F90 | 23 ------------------- .../zm_tendency_diagnostics.F90 | 20 ---------------- .../set_general_conv_fluxes_to_deep.F90 | 5 +--- .../set_general_conv_fluxes_to_deep.meta | 12 ---------- schemes/zhang_mcfarlane/zm_conv_convtran.F90 | 3 --- 8 files changed, 2 insertions(+), 117 deletions(-) diff --git a/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90 b/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90 index 8d29c918..181465da 100644 --- a/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_convr_tendency_diagnostics.F90 @@ -1,22 +1,4 @@ module zm_convr_tendency_diagnostics -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! -! THIS IS A TEMPLATE -! 1. copy this file to a new file with the correct name -! (SCHEME_diagnostics.F90) -! 2. do a search and replace for "SCHEME" in this file and -! replace with your scheme name -! 3. Add desired history_add_field calls to the init phase -! 4. Add all fields that are being output as inputs to the run phase -! 5. Add desired history_out_field calls to the run phase -! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 -! file to generate the metadata -! 7. Complete the metadata (fill out standard names, units, dimensions) -! 8. Add this scheme to the SDF file for your suite (likely will be at end) -! 9. Delete this header section -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use ccpp_kinds, only: kind_phys implicit none diff --git a/schemes/sima_diagnostics/zm_diagnostics.F90 b/schemes/sima_diagnostics/zm_diagnostics.F90 index 1a14fc41..c0aa61f3 100644 --- a/schemes/sima_diagnostics/zm_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_diagnostics.F90 @@ -1,22 +1,4 @@ module zm_diagnostics -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! -! THIS IS A TEMPLATE -! 1. copy this file to a new file with the correct name -! (SCHEME_diagnostics.F90) -! 2. do a search and replace for "SCHEME" in this file and -! replace with your scheme name -! 3. Add desired history_add_field calls to the init phase -! 4. Add all fields that are being output as inputs to the run phase -! 5. Add desired history_out_field calls to the run phase -! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 -! file to generate the metadata -! 7. Complete the metadata (fill out standard names, units, dimensions) -! 8. Add this scheme to the SDF file for your suite (likely will be at end) -! 9. Delete this header section -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use ccpp_kinds, only: kind_phys implicit none @@ -206,7 +188,7 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, prec, cape, gravi call history_out_field('ZMNTPRPD', ntprprd) call history_out_field('ZMNTSNPD', ntsnprd) -!CACNOTE - CAM is outputting the exact same quantity to both fields +!CAM was outputting the exact same quantity to both fields call history_out_field('PRECCDZM ',prec) call history_out_field('PRECZ ', prec) diff --git a/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90 b/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90 index 50a24c51..450807bc 100644 --- a/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_evap_tendency_diagnostics.F90 @@ -1,22 +1,4 @@ module zm_evap_tendency_diagnostics -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! -! THIS IS A TEMPLATE -! 1. copy this file to a new file with the correct name -! (SCHEME_diagnostics.F90) -! 2. do a search and replace for "SCHEME" in this file and -! replace with your scheme name -! 3. Add desired history_add_field calls to the init phase -! 4. Add all fields that are being output as inputs to the run phase -! 5. Add desired history_out_field calls to the run phase -! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 -! file to generate the metadata -! 7. Complete the metadata (fill out standard names, units, dimensions) -! 8. Add this scheme to the SDF file for your suite (likely will be at end) -! 9. Delete this header section -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use ccpp_kinds, only: kind_phys implicit none diff --git a/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90 b/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90 index 64d0e391..7000d2fa 100644 --- a/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_momtran_tendency_diagnostics.F90 @@ -1,22 +1,4 @@ module zm_momtran_tendency_diagnostics -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! -! THIS IS A TEMPLATE -! 1. copy this file to a new file with the correct name -! (SCHEME_diagnostics.F90) -! 2. do a search and replace for "SCHEME" in this file and -! replace with your scheme name -! 3. Add desired history_add_field calls to the init phase -! 4. Add all fields that are being output as inputs to the run phase -! 5. Add desired history_out_field calls to the run phase -! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 -! file to generate the metadata -! 7. Complete the metadata (fill out standard names, units, dimensions) -! 8. Add this scheme to the SDF file for your suite (likely will be at end) -! 9. Delete this header section -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use ccpp_kinds, only: kind_phys implicit none @@ -53,7 +35,6 @@ end subroutine zm_momtran_tendency_diagnostics_init subroutine zm_momtran_tendency_diagnostics_run(ncol, pver, cpair, windu_tend, windv_tend, seten, errmsg, errflg) use cam_history, only: history_out_field - use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t !------------------------------------------------ ! Input / output parameters !------------------------------------------------ @@ -68,10 +49,6 @@ subroutine zm_momtran_tendency_diagnostics_run(ncol, pver, cpair, windu_tend, wi character(len=512), intent(out) :: errmsg integer, intent(out) :: errflg - integer :: lengath ! number of columns with deep convection - integer :: const_idx - character(len=256) :: standard_name - real(kind_phys) :: ftem(ncol,pver) errmsg = '' diff --git a/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 b/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 index fcbc5ff0..707426ae 100644 --- a/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 @@ -1,22 +1,4 @@ module zm_tendency_diagnostics -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! -! THIS IS A TEMPLATE -! 1. copy this file to a new file with the correct name -! (SCHEME_diagnostics.F90) -! 2. do a search and replace for "SCHEME" in this file and -! replace with your scheme name -! 3. Add desired history_add_field calls to the init phase -! 4. Add all fields that are being output as inputs to the run phase -! 5. Add desired history_out_field calls to the run phase -! 6. Run $ccpp_framework/scripts/ccpp_fortran_to_metadata.py on this .F90 -! file to generate the metadata -! 7. Complete the metadata (fill out standard names, units, dimensions) -! 8. Add this scheme to the SDF file for your suite (likely will be at end) -! 9. Delete this header section -! -!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - use ccpp_kinds, only: kind_phys implicit none @@ -77,8 +59,6 @@ subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, err do const_idx = 1, size(const_props) call const_props(const_idx)%standard_name(standard_name, errflg, errmsg) -!CACNOTE -remove this debug statement - write(0,*) ' const_idx=', const_idx, ' standard_name=',standard_name ! Use the regular constituent names, as the location in the dqdt array match the constituent ordering in the ! constituent properties diff --git a/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90 b/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90 index ef450ca5..2bd023f2 100644 --- a/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90 +++ b/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.F90 @@ -12,15 +12,13 @@ module set_general_conv_fluxes_to_deep !! subroutine set_general_conv_fluxes_to_deep_run(tend_s_snwprd_gen, tend_s_snwprd_dp, tend_s_snwevmlt_gen, tend_s_snwevmlt_dp, & - prdprec_gen, prdprec_dp, prec_gen, prec_dp, snow_gen, snow_dp, ntprprd_gen, ntprprd_dp, ntsnprd_gen, ntsnprd_dp, & + prec_gen, prec_dp, snow_gen, snow_dp, ntprprd_gen, ntprprd_dp, ntsnprd_gen, ntsnprd_dp, & flxprec_gen, flxprec_dp, flxsnow_gen, flxsnow_dp) real(kind_phys), intent(in) :: tend_s_snwprd_gen(:,:) real(kind_phys), intent(out) :: tend_s_snwprd_dp(:,:) real(kind_phys), intent(in) :: tend_s_snwevmlt_gen(:,:) real(kind_phys), intent(out) :: tend_s_snwevmlt_dp(:,:) - real(kind_phys), intent(in) :: prdprec_gen(:,:) - real(kind_phys), intent(out) :: prdprec_dp(:,:) real(kind_phys), intent(in) :: prec_gen(:) real(kind_phys), intent(out) :: prec_dp(:) real(kind_phys), intent(in) :: snow_gen(:) @@ -36,7 +34,6 @@ subroutine set_general_conv_fluxes_to_deep_run(tend_s_snwprd_gen, tend_s_snwprd_ tend_s_snwprd_dp = tend_s_snwprd_gen tend_s_snwevmlt_dp = tend_s_snwevmlt_gen - prdprec_dp = prdprec_gen prec_dp = prec_gen snow_dp = snow_gen ntprprd_dp = ntprprd_gen diff --git a/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta b/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta index 8edbfb48..b06351dc 100644 --- a/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta +++ b/schemes/zhang_mcfarlane/set_general_conv_fluxes_to_deep.meta @@ -29,18 +29,6 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = out -[ prdprec_gen ] - standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_convection_excluding_subcloud_evaporation - units = kg kg-1 s-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = in -[ prdprec_dp ] - standard_name = tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation - units = kg kg-1 s-1 - type = real | kind = kind_phys - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - intent = out [ prec_gen ] standard_name = lwe_precipitation_rate_at_surface_due_to_convection units = m s-1 diff --git a/schemes/zhang_mcfarlane/zm_conv_convtran.F90 b/schemes/zhang_mcfarlane/zm_conv_convtran.F90 index 248e002d..be1d808d 100644 --- a/schemes/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/schemes/zhang_mcfarlane/zm_conv_convtran.F90 @@ -54,7 +54,6 @@ subroutine zm_conv_convtran_run(ncol, pver, & jt ,mx ,ideep ,il1g ,il2g , & nstep ,fracis ,dqdt ,dpdry ,const_metadata, & scheme_name, errmsg, errflg) -! ccpp_constituent_properties - standard name -- see chat !----------------------------------------------------------------------- ! @@ -70,8 +69,6 @@ subroutine zm_conv_convtran_run(ncol, pver, & ! Author: P. Rasch ! !----------------------------------------------------------------------- -! use constituents, only: cnst_get_type_byind -! use ccpp_constituent_prop_mod, only: ccpp_const_props use ccpp_constituent_prop_mod, only: ccpp_constituent_prop_ptr_t From 5789a10f505ce714b151b4ce729f25566cd61b52 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Mon, 13 Jan 2025 11:03:49 -0700 Subject: [PATCH 33/36] Address one more review comment --- schemes/zhang_mcfarlane/zm_convr_namelist.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemes/zhang_mcfarlane/zm_convr_namelist.xml b/schemes/zhang_mcfarlane/zm_convr_namelist.xml index d370a52e..9f55aa8b 100644 --- a/schemes/zhang_mcfarlane/zm_convr_namelist.xml +++ b/schemes/zhang_mcfarlane/zm_convr_namelist.xml @@ -4,7 +4,7 @@ - + conv zmconv_nl cloud_condensate_to_precipitation_autoconversion_coefficient_over_land_for_zhang_mcfarlane_deep_convection_scheme From a7f33e51bdfcfc791fe73b3d68a4708f8dabb507 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 14 Jan 2025 15:42:38 -0700 Subject: [PATCH 34/36] Address second round of reviewer comments --- schemes/sima_diagnostics/zm_diagnostics.F90 | 5 ----- schemes/sima_diagnostics/zm_tendency_diagnostics.F90 | 2 +- schemes/utilities/to_be_ccppized_temporary.meta | 2 +- schemes/zhang_mcfarlane/zm_conv_convtran.F90 | 2 +- schemes/zhang_mcfarlane/zm_conv_convtran.meta | 1 + schemes/zhang_mcfarlane/zm_conv_evap.F90 | 9 +++------ schemes/zhang_mcfarlane/zm_conv_evap.meta | 2 +- schemes/zhang_mcfarlane/zm_conv_momtran.F90 | 2 +- schemes/zhang_mcfarlane/zm_convr.F90 | 2 -- 9 files changed, 9 insertions(+), 18 deletions(-) diff --git a/schemes/sima_diagnostics/zm_diagnostics.F90 b/schemes/sima_diagnostics/zm_diagnostics.F90 index c0aa61f3..58cea81f 100644 --- a/schemes/sima_diagnostics/zm_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_diagnostics.F90 @@ -73,7 +73,6 @@ end subroutine zm_diagnostics_init !> \section arg_table_zm_diagnostics_run Argument Table !! \htmlinclude zm_diagnostics_run.html subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, prec, cape, gravit, mu, md, & -! dif, dlf, ps, pap, maxg, jt, flxprec, flxsnow, ntprprd, ntsnprd, pguallu, pguallv, & dlf, ps, pap, maxg, jt, flxprec, flxsnow, ntprprd, ntsnprd, pguallu, pguallv, & pgdallu, pgdallv, icwuu, icwuv, icwdu, icwdv, mcon, errmsg, errflg) @@ -85,7 +84,6 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, prec, cape, gravi integer, intent(in) :: ncol integer, intent(in) :: pver integer, intent(in) :: pverp -! real(kind_phys), intent(in) :: const_array(:,:,:) integer, intent(in) :: ideep(:) real(kind_phys), intent(in) :: cpair @@ -94,7 +92,6 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, prec, cape, gravi real(kind_phys), intent(in) :: gravit real(kind_phys), intent(in) :: mu(:,:) real(kind_phys), intent(in) :: md(:,:) -! real(kind_phys), intent(in) :: dif(:,:) real(kind_phys), intent(in) :: dlf(:,:) real(kind_phys), intent(in) :: ps(:) real(kind_phys), intent(in) :: pap(:,:) @@ -168,7 +165,6 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, prec, cape, gravi call history_out_field('ZMMU', mu_out) call history_out_field('ZMMD', md_out) -! call history_out_field('DIFZM' ,dif) call history_out_field('DLFZM' ,dlf) pcont(:ncol) = ps(:ncol) @@ -178,7 +174,6 @@ subroutine zm_diagnostics_run(ncol, pver, pverp, ideep, cpair, prec, cape, gravi pcont(ideep(i)) = pap(ideep(i),jt(i)) ! gathered array (or jctop ungathered) pconb(ideep(i)) = pap(ideep(i),maxg(i))! gathered array endif - ! write(iulog,*) ' pcont, pconb ', pcont(i), pconb(i), cnt(i), cnb(i) end do call history_out_field('PCONVT ',pcont) call history_out_field('PCONVB ',pconb) diff --git a/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 b/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 index 707426ae..ea24cacb 100644 --- a/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 +++ b/schemes/sima_diagnostics/zm_tendency_diagnostics.F90 @@ -60,7 +60,7 @@ subroutine zm_tendency_diagnostics_run(ncol, pver, pverp, const_props, dqdt, err do const_idx = 1, size(const_props) call const_props(const_idx)%standard_name(standard_name, errflg, errmsg) - ! Use the regular constituent names, as the location in the dqdt array match the constituent ordering in the + ! Use the regular constituent names, as the location in the dqdt array does not match the constituent ordering in the ! constituent properties select case (trim(standard_name)) diff --git a/schemes/utilities/to_be_ccppized_temporary.meta b/schemes/utilities/to_be_ccppized_temporary.meta index 87325229..bceeb3f7 100644 --- a/schemes/utilities/to_be_ccppized_temporary.meta +++ b/schemes/utilities/to_be_ccppized_temporary.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = to_be_ccppized_temporary type = scheme - + dependencies = ../../to_be_ccppized/wv_saturation.F90 [ccpp-arg-table] name = to_be_ccppized_temporary_init type = scheme diff --git a/schemes/zhang_mcfarlane/zm_conv_convtran.F90 b/schemes/zhang_mcfarlane/zm_conv_convtran.F90 index be1d808d..ed3123a2 100644 --- a/schemes/zhang_mcfarlane/zm_conv_convtran.F90 +++ b/schemes/zhang_mcfarlane/zm_conv_convtran.F90 @@ -324,7 +324,7 @@ subroutine zm_conv_convtran_run(ncol, pver, & end do end do -! Initialize to zero everywhere, then scatter tendency back to full array +! Scatter tendency back to full array do k = 1,pver kp1 = min(pver,k+1) do i = il1g,il2g diff --git a/schemes/zhang_mcfarlane/zm_conv_convtran.meta b/schemes/zhang_mcfarlane/zm_conv_convtran.meta index 400d0e25..4f7c6cb1 100644 --- a/schemes/zhang_mcfarlane/zm_conv_convtran.meta +++ b/schemes/zhang_mcfarlane/zm_conv_convtran.meta @@ -64,6 +64,7 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_ccpp_constituents) intent = in + advected = true [ ncnst ] standard_name = number_of_ccpp_constituents units = count diff --git a/schemes/zhang_mcfarlane/zm_conv_evap.F90 b/schemes/zhang_mcfarlane/zm_conv_evap.F90 index 2333e0df..7f15f541 100644 --- a/schemes/zhang_mcfarlane/zm_conv_evap.F90 +++ b/schemes/zhang_mcfarlane/zm_conv_evap.F90 @@ -53,13 +53,12 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys),intent(in), dimension(:,:) :: pdel ! layer thickness (Pa) (ncol,pver) real(kind_phys),intent(in), dimension(:,:) :: q ! water vapor (kg/kg) (ncol,pver) real(kind_phys),intent(in), dimension(:) :: landfrac ! land fraction (ncol) + real(kind_phys),intent(out), dimension(:,:) :: tend_s ! heating rate (J/kg/s) (ncol,pver) real(kind_phys),intent(out), dimension(:,:) :: tend_q ! water vapor tendency (kg/kg/s) (ncol,pver) real(kind_phys),intent(out), dimension(:,:) :: tend_s_snwprd ! Heating rate of snow production (ncol,pver) real(kind_phys),intent(out), dimension(:,:) :: tend_s_snwevmlt ! Heating rate of evap/melting of snow (ncol,pver) - - real(kind_phys), intent(in ) :: prdprec_gen(:,:)! precipitation production (kg/ks/s) (ncol,pver) real(kind_phys), intent(in ) :: cldfrc(:,:) ! cloud fraction (ncol,pver) real(kind_phys), intent(in ) :: deltat ! time step @@ -68,12 +67,10 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & real(kind_phys), intent(inout) :: prec_gen(:) ! Convective-scale preciptn rate (ncol) real(kind_phys), intent(out) :: snow(:) ! Convective-scale snowfall rate (ncol) - ! !---------------------------Local storage------------------------------- - real(kind_phys) :: es (ncol,pver) ! Saturation vapor pressure -!! real(kind_phys) :: fice (ncol,pver) ! ice fraction in precip production + real(kind_phys) :: es (ncol,pver) ! Saturation vapor pressure real(kind_phys) :: qs (ncol,pver) ! saturation specific humidity real(kind_phys),intent(out) :: flxprec(:,:) ! Convective-scale flux of precip at interfaces (kg/m2/s) ! (ncol,pverp) real(kind_phys),intent(out) :: flxsnow(:,:) ! Convective-scale flux of snow at interfaces (kg/m2/s) ! (ncol,pverp) @@ -128,7 +125,7 @@ subroutine zm_conv_evap_run(ncol, pver, pverp, & do i = 1, ncol ! Melt snow falling into layer, if necessary. - if( old_snow ) then + if( old_snow ) then if (t(i,k) > tmelt) then flxsntm(i) = 0._kind_phys snowmlt(i) = flxsnow(i,k) * gravit/ pdel(i,k) diff --git a/schemes/zhang_mcfarlane/zm_conv_evap.meta b/schemes/zhang_mcfarlane/zm_conv_evap.meta index 023c82da..42e9fd84 100644 --- a/schemes/zhang_mcfarlane/zm_conv_evap.meta +++ b/schemes/zhang_mcfarlane/zm_conv_evap.meta @@ -2,7 +2,6 @@ name = zm_conv_evap type = scheme dependencies = ../../to_be_ccppized/wv_saturation.F90 - [ccpp-arg-table] name = zm_conv_evap_run type = scheme @@ -90,6 +89,7 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in + advected = true [ landfrac ] standard_name = land_area_fraction units = fraction diff --git a/schemes/zhang_mcfarlane/zm_conv_momtran.F90 b/schemes/zhang_mcfarlane/zm_conv_momtran.F90 index fc1c859a..a4b43419 100644 --- a/schemes/zhang_mcfarlane/zm_conv_momtran.F90 +++ b/schemes/zhang_mcfarlane/zm_conv_momtran.F90 @@ -45,7 +45,7 @@ subroutine zm_conv_momtran_run(ncol, pver, pverp, & ! integer, intent(in) :: ncol ! number of atmospheric columns integer, intent(in) :: pver, pverp - logical, intent(in) :: domomtran ! flag for doing convective transport (num_winds) + logical, intent(in) :: domomtran ! flag for doing convective transport real(kind_phys), intent(in) :: windu(:,:) ! U Wind array (ncol,pver) real(kind_phys), intent(in) :: windv(:,:) ! V Wind array (ncol,pver) real(kind_phys), intent(in) :: mu(:,:) ! Mass flux up (ncol,pver) diff --git a/schemes/zhang_mcfarlane/zm_convr.F90 b/schemes/zhang_mcfarlane/zm_convr.F90 index 21938f7b..dbe80d1c 100644 --- a/schemes/zhang_mcfarlane/zm_convr.F90 +++ b/schemes/zhang_mcfarlane/zm_convr.F90 @@ -1781,7 +1781,6 @@ subroutine cldprp(ncol ,pver ,pverp ,cpliq , & real(kind_phys) small real(kind_phys) mdt -!! real(kind_phys) fice(ncol,pver) ! ice fraction in precip production real(kind_phys) tug(ncol,pver) real(kind_phys) tvuo(ncol,pver) ! updraft virtual T w/o freezing heating @@ -1859,7 +1858,6 @@ subroutine cldprp(ncol ,pver ,pverp ,cpliq , & hd(i,k) = hmn(i,k) rprd(i,k) = 0._kind_phys -!! fice(i,k) = 0._kind_phys tug(i,k) = 0._kind_phys qcde(i,k) = 0._kind_phys tvuo(i,k) = (shat(i,k) - grav/cp*zf(i,k))*(1._kind_phys + 0.608_kind_phys*qhat(i,k)) From 9d03025bd666f50ea0edbfa33f83d9372fe04bcc Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Tue, 14 Jan 2025 16:25:19 -0700 Subject: [PATCH 35/36] one more change from second reviewer comments --- schemes/zhang_mcfarlane/zm_convr.meta | 1 + 1 file changed, 1 insertion(+) diff --git a/schemes/zhang_mcfarlane/zm_convr.meta b/schemes/zhang_mcfarlane/zm_convr.meta index 8c19a2e6..13c1ebee 100644 --- a/schemes/zhang_mcfarlane/zm_convr.meta +++ b/schemes/zhang_mcfarlane/zm_convr.meta @@ -241,6 +241,7 @@ type = real | kind = kind_phys dimensions = (horizontal_loop_extent,vertical_layer_dimension) intent = in + advected = true [ prec ] standard_name = lwe_precipitation_rate_at_surface_due_to_deep_convection units = m s-1 From 4eaff0dbea1fbef86d2778ef72b8f8230216eed1 Mon Sep 17 00:00:00 2001 From: Cheryl Craig Date: Thu, 16 Jan 2025 09:47:10 -0700 Subject: [PATCH 36/36] Update CAM7 SDF --- suites/suite_cam7.xml | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/suites/suite_cam7.xml b/suites/suite_cam7.xml index 7351223d..4a99bddc 100644 --- a/suites/suite_cam7.xml +++ b/suites/suite_cam7.xml @@ -1,7 +1,10 @@ + + + check_energy_gmean @@ -23,8 +26,45 @@ apply_heating_rate qneg geopotential_temp + + + initialize_constituents + to_be_ccppized_temporary + zm_convr + zm_convr_tendency_diagnostics + apply_heating_rate + apply_constituent_tendencies + qneg + geopotential_temp + cloud_fraction_fice + set_deep_conv_fluxes_to_general + zm_conv_evap + set_general_conv_fluxes_to_deep + zm_evap_tendency_diagnostics + apply_heating_rate + apply_constituent_tendencies + qneg + geopotential_temp + cloud_fraction_fice + zm_conv_momtran + zm_momtran_tendency_diagnostics + apply_heating_rate + apply_tendency_of_eastward_wind + apply_tendency_of_northward_wind + qneg + geopotential_temp + zm_conv_convtran + zm_tendency_diagnostics + apply_constituent_tendencies + qneg + geopotential_temp + zm_diagnostics + + + + sima_state_diagnostics @@ -46,5 +86,7 @@ sima_tend_diagnostics + +