Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions schemes/utilities/co2_diagnostic_export.F90
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions schemes/utilities/co2_diagnostic_export.meta
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions suites/suite_cam4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@
of the "before_coupler" group. -->
<scheme>calc_dry_air_ideal_gas_density</scheme>
<scheme>set_surface_coupling_vars</scheme>
<scheme>co2_diagnostic_export</scheme>

</group>

Expand Down
2 changes: 2 additions & 0 deletions suites/suite_cam5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@
of the "before_coupler" group. -->
<scheme>calc_dry_air_ideal_gas_density</scheme>
<scheme>set_surface_coupling_vars</scheme>
<!-- Write CO2 concentration for surface model (Sa_co2diag) diagnostic CO2 mode -->
<scheme>co2_diagnostic_export</scheme>

</group>

Expand Down
3 changes: 2 additions & 1 deletion suites/suite_cam7.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
of the "before_coupler" group. -->
<!-- UNCOMMENT ONCE ALL OTHER CAM7 SCHEMES ARE PRESENT -->
<!-- <scheme>calc_dry_air_ideal_gas_density</scheme>
<scheme>set_surface_coupling_vars</scheme> -->
<scheme>set_surface_coupling_vars</scheme>
<scheme>co2_diagnostic_export</scheme> -->

</group>

Expand Down
Loading