diff --git a/schemes/zhang_mcfarlane/zm_prepare_flux_for_check_energy.F90 b/schemes/zhang_mcfarlane/zm_prepare_flux_for_check_energy.F90 new file mode 100644 index 00000000..59c6a385 --- /dev/null +++ b/schemes/zhang_mcfarlane/zm_prepare_flux_for_check_energy.F90 @@ -0,0 +1,57 @@ +! Prepare flux variables for energy checker after ZM deep convection +! Has to run after both zm_convr (provides reserved liquid) +! and zm_conv_evap+interstitial to deep (provides snow_dp and prec_dp) have +! been ran. +! The resulting net liquid and (lwe) ice fluxes are combined and provided to +! the check_energy_chng CCPPized scheme. +module zm_prepare_flux_for_check_energy + implicit none + private + + public :: zm_prepare_flux_for_check_energy_run + +contains + +!> \section arg_table_zm_prepare_flux_for_check_energy_run Argument Table +!! \htmlinclude zm_prepare_flux_for_check_energy_run.html + subroutine zm_prepare_flux_for_check_energy_run( & + ncol, & + prec_dp, rliq, snow_dp, & + scheme_name, & + flx_cnd, flx_ice, & + errmsg, errflg) + + use ccpp_kinds, only: kind_phys + + ! Input arguments + integer, intent(in) :: ncol + real(kind_phys), intent(in) :: prec_dp(:) ! Deep convection precipitation rate [m s-1] + real(kind_phys), intent(in) :: rliq(:) ! Reserved liquid water tendency [m s-1] + real(kind_phys), intent(in) :: snow_dp(:) ! Deep convection frozen precipitation rate [m s-1] + + ! Output arguments + character(len=16), intent(out) :: scheme_name ! Scheme name for energy checking + real(kind_phys), intent(out) :: flx_cnd(:) ! Liquid fluxes [m s-1] + real(kind_phys), intent(out) :: flx_ice(:) ! Ice fluxes [m s-1] + character(len=512), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables + integer :: i + + errmsg = '' + errflg = 0 + + ! Set scheme name for energy checking + scheme_name = "convect_deep_zm" + + ! Combine precipitation and reserved liquid for total liquid+ice flux + ! This represents net liquid and ice fluxes through column boundaries + flx_cnd(:ncol) = prec_dp(:ncol) + rliq(:ncol) + + ! Frozen precipitation represents net ice fluxes through column boundaries + flx_ice(:ncol) = snow_dp(:ncol) + + end subroutine zm_prepare_flux_for_check_energy_run + +end module zm_prepare_flux_for_check_energy diff --git a/schemes/zhang_mcfarlane/zm_prepare_flux_for_check_energy.meta b/schemes/zhang_mcfarlane/zm_prepare_flux_for_check_energy.meta new file mode 100644 index 00000000..e40f5fbf --- /dev/null +++ b/schemes/zhang_mcfarlane/zm_prepare_flux_for_check_energy.meta @@ -0,0 +1,61 @@ +[ccpp-table-properties] + name = zm_prepare_flux_for_check_energy + type = scheme + +[ccpp-arg-table] + name = zm_prepare_flux_for_check_energy_run + type = scheme +[ ncol ] + standard_name = horizontal_loop_extent + units = count + type = integer + dimensions = () + 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 = in +[ rliq ] + standard_name = vertically_integrated_cloud_liquid_water_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 = 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 = in +[ scheme_name ] + standard_name = scheme_name + units = none + type = character | kind = len=16 + dimensions = () + intent = out +[ flx_cnd ] + standard_name = net_liquid_and_lwe_ice_fluxes_through_top_and_bottom_of_atmosphere_column + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ flx_ice ] + standard_name = net_lwe_ice_fluxes_through_top_and_bottom_of_atmosphere_column + units = m s-1 + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ errmsg ] + standard_name = ccpp_error_message + units = none + type = character | kind = len=512 + dimensions = () + intent = out +[ errflg ] + standard_name = ccpp_error_code + units = 1 + type = integer + dimensions = () + intent = out diff --git a/suites/suite_cam4.xml b/suites/suite_cam4.xml index 0acd9cb8..21268484 100644 --- a/suites/suite_cam4.xml +++ b/suites/suite_cam4.xml @@ -74,6 +74,7 @@ zm_diagnostics + zm_prepare_flux_for_check_energy check_energy_scaling check_energy_chng diff --git a/suites/suite_cam7.xml b/suites/suite_cam7.xml index 7848685c..d9e7ef5d 100644 --- a/suites/suite_cam7.xml +++ b/suites/suite_cam7.xml @@ -37,6 +37,7 @@ geopotential_temp + check_energy_zero_fluxes zm_conv_options zm_convr zm_convr_tendency_diagnostics @@ -71,6 +72,7 @@ zm_diagnostics + zm_prepare_flux_for_check_energy check_energy_scaling check_energy_chng