Skip to content
Merged
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
1 change: 1 addition & 0 deletions schemes/cloud_fraction/compute_cloud_fraction_namelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
<value>0.900D0</value>
<value phys_suite="cam5">0.8975D0</value>
<value phys_suite="cam7">0.8975D0</value>
<value dyn="se" phys_suite="cam4">0.910D0</value>
</values>
</entry>
<entry id="cldfrc_rhminl_adj_land">
Expand Down
4 changes: 4 additions & 0 deletions schemes/gravity_wave_drag/gw_common_namelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
</desc>
<values>
<value>2.5D0</value>
<value phys_suite="cam4">0.D0</value>
</values>
</entry>

Expand All @@ -47,6 +48,7 @@
<values>
<value>10</value>
<!-- 0 for simple physics -->
<value phys_suite="cam4">0</value>
</values>
</entry>

Expand All @@ -63,6 +65,7 @@
<values>
<value>2.0D0</value>
<!-- 0 for simple physics -->
<value phys_suite="cam4">0.D0</value>
</values>
</entry>

Expand Down Expand Up @@ -94,6 +97,7 @@
</desc>
<values>
<value>.true.</value>
<value phys_suite="cam4">.false.</value>
</values>
</entry>

Expand Down
184 changes: 184 additions & 0 deletions schemes/radiation_utils/prescribe_radiative_gas_concentrations.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
!-------------------------------------------------------------------------------
! This module uses namelist variable to set prescribed concentrations
! for radiatively-active gases.

! Eventually this module should be replaced with a more comprehensive atmospheric
! composition/chemistry system, but is fine to use for now when running low-top,
! non-exoplanet CAM-SIMA configurations with minimal chemistry.
!-------------------------------------------------------------------------------
module prescribe_radiative_gas_concentrations

implicit none

private
public :: prescribe_radiative_gas_concentrations_init


!-------------------------------------------------------------------------------
contains
!-------------------------------------------------------------------------------

!> \section arg_table_prescribe_radiative_gas_concentrations_init Argument Table
!! \htmlinclude prescribe_radiative_gas_concentrations_init.html
!!
subroutine prescribe_radiative_gas_concentrations_init(ch4_vmr, co2_vmr, cfc11_vmr, &
cfc12_vmr, n2o_vmr, const_array, &
errmsg, errcode)

! Use statements
use ccpp_constituent_prop_mod, only: int_unassigned
use ccpp_scheme_utils, only: ccpp_constituent_index
use ccpp_kinds, only: kind_phys

! Use statement from RRTMGP,
! which should hopefully be replaced once
! molar masses for these species are included
! in the constituents properties themselves:
use radiation_utils, only: get_molar_mass_ratio


! Input arguments
real(kind_phys), intent(in) :: ch4_vmr
real(kind_phys), intent(in) :: co2_vmr
real(kind_phys), intent(in) :: cfc11_vmr
real(kind_phys), intent(in) :: cfc12_vmr
real(kind_phys), intent(in) :: n2o_vmr

! Input/output arguments
real(kind_phys), intent(inout) :: const_array(:,:,:) ! Constituents array

! Output arguments
character(len=512), intent(out) :: errmsg
integer, intent(out) :: errcode

! Local variables
integer :: const_idx !Constituents object index
real(kind_phys) :: dry_air_to_const_molar_mass_ratio !Ratio of dry air molar mass to constituent molar mass

!+++++++++++++++++++++++++++++++++++
! Convert number/mole fraction into
! mass mixing ratio w.r.t dry air
!+++++++++++++++++++++++++++++++++++

!----
! CH4:
!----

! Check if CH4 is present in constituents object:
call ccpp_constituent_index('CH4', const_idx, errcode, errmsg)
if (errcode /= 0) then
return
else if (const_idx /= int_unassigned) then

! Get ratio of molar mass of dry air / constituent molar mass
call get_molar_mass_ratio('CH4', dry_air_to_const_molar_mass_ratio, errmsg, errcode)
if (errcode /= 0) then
return
end if

! Convert namelist-provided number/mole fraction to
! mass mixing ratio w.r.t. dry air, and set constituents
! array to new coonverted value:
const_array(:,:,const_idx) = ch4_vmr*dry_air_to_const_molar_mass_ratio

end if

!----
! CO2:
!----

! Check if CO2 is present in constituents object:
call ccpp_constituent_index('CO2', const_idx, errcode, errmsg)
if (errcode /= 0) then
return
else if (const_idx /= int_unassigned) then

! Get ratio of molar mass of dry air / constituent molar mass
call get_molar_mass_ratio('CO2', dry_air_to_const_molar_mass_ratio, errmsg, errcode)
if (errcode /= 0) then
return
end if

! Convert namelist-provided number/mole fraction to
! mass mixing ratio w.r.t. dry air, and set constituents
! array to new coonverted value:
const_array(:,:,const_idx) = co2_vmr*dry_air_to_const_molar_mass_ratio

end if

!------
! CFC11:
!------

! Check if CFC-11 is present in constituents object:
call ccpp_constituent_index('CFC11', const_idx, errcode, errmsg)
if (errcode /= 0) then
return
else if (const_idx /= int_unassigned) then

! Get ratio of molar mass of dry air / constituent molar mass
call get_molar_mass_ratio('CFC11', dry_air_to_const_molar_mass_ratio, errmsg, errcode)
if (errcode /= 0) then
return
end if

! Convert namelist-provided number/mole fraction to
! mass mixing ratio w.r.t. dry air, and set constituents
! array to new coonverted value:
const_array(:,:,const_idx) = cfc11_vmr*dry_air_to_const_molar_mass_ratio

end if

!------
! CFC12:
!------

! Check if CFC-12 is present in constituents object:
call ccpp_constituent_index('CFC12', const_idx, errcode, errmsg)
if (errcode /= 0) then
return
else if (const_idx /= int_unassigned) then

! Get ratio of molar mass of dry air / constituent molar mass
call get_molar_mass_ratio('CFC12', dry_air_to_const_molar_mass_ratio, errmsg, errcode)
if (errcode /= 0) then
return
end if

! Convert namelist-provided number/mole fraction to
! mass mixing ratio w.r.t. dry air, and set constituents
! array to new coonverted value:
const_array(:,:,const_idx) = cfc12_vmr*dry_air_to_const_molar_mass_ratio

end if

!----
! N2O:
!----

! Check if N2O is present in constituents object:
call ccpp_constituent_index('N2O', const_idx, errcode, errmsg)
if (errcode /= 0) then
return
else if (const_idx /= int_unassigned) then

! Get ratio of molar mass of dry air / constituent molar mass
call get_molar_mass_ratio('N2O', dry_air_to_const_molar_mass_ratio, errmsg, errcode)
if (errcode /= 0) then
return
end if

! Convert namelist-provided number/mole fraction to
! mass mixing ratio w.r.t. dry air, and set constituents
! array to new coonverted value:
const_array(:,:,const_idx) = n2o_vmr*dry_air_to_const_molar_mass_ratio

end if

! Set error variables
errmsg = ''
errcode = 0

end subroutine prescribe_radiative_gas_concentrations_init

end module prescribe_radiative_gas_concentrations
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[ccpp-table-properties]
name = prescribe_radiative_gas_concentrations
type = scheme
dependencies = ../rrtmgp/utils/radiation_utils.F90

[ccpp-arg-table]
name = prescribe_radiative_gas_concentrations_init
type = scheme
[ ch4_vmr ]
standard_name = prescribed_volume_mixing_ratio_of_ch4
units = mol mol-1
type = real | kind = kind_phys
dimensions = ()
intent = in
[ co2_vmr ]
standard_name = prescribed_volume_mixing_ratio_of_co2
units = mol mol-1
type = real | kind = kind_phys
dimensions = ()
intent = in
[ cfc11_vmr ]
standard_name = prescribed_volume_mixing_ratio_of_cfc11
units = mol mol-1
type = real | kind = kind_phys
dimensions = ()
intent = in
[ cfc12_vmr ]
standard_name = prescribed_volume_mixing_ratio_of_cfc12
units = mol mol-1
type = real | kind = kind_phys
dimensions = ()
intent = in
[ n2o_vmr ]
standard_name = prescribed_volume_mixing_ratio_of_n2o
units = mol mol-1
type = real | kind = kind_phys
dimensions = ()
intent = in
[ const_array ]
standard_name = ccpp_constituents
units = none
type = real | kind = kind_phys
dimensions = (horizontal_dimension,vertical_layer_dimension,number_of_ccpp_constituents)
intent = inout
[ errmsg ]
standard_name = ccpp_error_message
units = none
type = character | kind = len=512
dimensions = ()
intent = out
[ errcode ]
standard_name = ccpp_error_code
units = 1
type = integer
dimensions = ()
intent = out
Loading
Loading