From ddeafbbef7c961aa2a4ace81e338313d1da7ba22 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Mon, 20 Jul 2026 13:06:08 -0400 Subject: [PATCH 1/2] Populate diagnostic_volume_mixing_ratio_of_co2_to_coupler instead of co2diag_tbd to land model. Provenance: FIX-31 octopus Assisted-by: claude-fable:5 --- schemes/utilities/co2_diagnostic_export.F90 | 31 ++++++++++++++++++++ schemes/utilities/co2_diagnostic_export.meta | 31 ++++++++++++++++++++ suites/suite_cam5.xml | 2 ++ 3 files changed, 64 insertions(+) create mode 100644 schemes/utilities/co2_diagnostic_export.F90 create mode 100644 schemes/utilities/co2_diagnostic_export.meta diff --git a/schemes/utilities/co2_diagnostic_export.F90 b/schemes/utilities/co2_diagnostic_export.F90 new file mode 100644 index 00000000..75103500 --- /dev/null +++ b/schemes/utilities/co2_diagnostic_export.F90 @@ -0,0 +1,31 @@ +! Export the diagnostic CO2 concentration to the surface coupler. +module co2_diagnostic_export + + implicit none + private + + ! Public interfaces + public :: co2_diagnostic_export_run +contains +!> \section arg_table_co2_diagnostic_export_run Argument Table +!! \htmlinclude co2_diagnostic_export_run.html +subroutine co2_diagnostic_export_run(co2_vmr, co2diag, errmsg, errcode) + use ccpp_kinds, only: kind_phys + + ! Input arguments + real(kind_phys), intent(in) :: co2_vmr ! Prescribed CO2 volume mixing ratio [mol mol-1] + + ! Output arguments + real(kind_phys), intent(out) :: co2diag(:) ! Diagnostic CO2 concentration for coupler [ppmv] + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errcode + + errmsg = '' + errcode = 0 + + ! mol/mol -> ppmv expected by the coupler. (chem_surfvals sets CO2VMR * 1e6) + co2diag(:) = co2_vmr * 1.0e6_kind_phys + +end subroutine co2_diagnostic_export_run + +end module co2_diagnostic_export diff --git a/schemes/utilities/co2_diagnostic_export.meta b/schemes/utilities/co2_diagnostic_export.meta new file mode 100644 index 00000000..20e577a6 --- /dev/null +++ b/schemes/utilities/co2_diagnostic_export.meta @@ -0,0 +1,31 @@ +[ccpp-table-properties] + name = co2_diagnostic_export + type = scheme + +[ccpp-arg-table] + name = co2_diagnostic_export_run + type = scheme +[ co2_vmr ] + standard_name = prescribed_volume_mixing_ratio_of_co2 + units = mol mol-1 + type = real | kind = kind_phys + dimensions = () + intent = in +[ co2diag ] + standard_name = diagnostic_volume_mixing_ratio_of_co2_to_coupler + units = ppmv + type = real | kind = kind_phys + dimensions = (horizontal_loop_extent) + intent = out +[ errmsg ] + standard_name = ccpp_error_message + units = none + type = character | kind = len=* + dimensions = () + intent = out +[ errcode ] + standard_name = ccpp_error_code + units = 1 + type = integer + dimensions = () + intent = out diff --git a/suites/suite_cam5.xml b/suites/suite_cam5.xml index d5e6b3fa..53d13fba 100644 --- a/suites/suite_cam5.xml +++ b/suites/suite_cam5.xml @@ -160,6 +160,8 @@ of the "before_coupler" group. --> calc_dry_air_ideal_gas_density set_surface_coupling_vars + + co2_diagnostic_export From b7709c1855552ef55fb3a99839873f2847c22662 Mon Sep 17 00:00:00 2001 From: Haipeng Lin Date: Wed, 22 Jul 2026 16:25:00 -0400 Subject: [PATCH 2/2] Wire up to cam4, cam7 suites --- suites/suite_cam4.xml | 1 + suites/suite_cam7.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/suites/suite_cam4.xml b/suites/suite_cam4.xml index 06c89ac7..e953b1b2 100644 --- a/suites/suite_cam4.xml +++ b/suites/suite_cam4.xml @@ -278,6 +278,7 @@ of the "before_coupler" group. --> calc_dry_air_ideal_gas_density set_surface_coupling_vars + co2_diagnostic_export diff --git a/suites/suite_cam7.xml b/suites/suite_cam7.xml index aa091ebb..5e5cfac3 100644 --- a/suites/suite_cam7.xml +++ b/suites/suite_cam7.xml @@ -81,7 +81,8 @@ of the "before_coupler" group. --> + set_surface_coupling_vars + co2_diagnostic_export -->