-
Notifications
You must be signed in to change notification settings - Fork 170
Extended non-LTE CO2 cooling parameterization #1457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: cam_development
Are you sure you want to change the base?
Changes from all commits
e8942b6
f253e2a
176a6ae
6890146
d6e14b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7994,6 +7994,13 @@ Call ALI-ARMS every X timesteps | |
| Default: 1 | ||
| </entry> | ||
|
|
||
| <entry id="nlte_use_extco2" type="logical" category="waccm_phys" | ||
| group="radheat_nl" valid_values="" > | ||
| If TRUE, then use the extended CO2 scheme of Lopez-Puertas et al. 2024 as an alernative method of computing non-LTE | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a comment which will show up on a web page, would it be appropriate to include the DOI here also?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DOI has been added here |
||
| CO2 cooling rates in the upper atmosphere. (DOI:10.5194/gmd-17-4401-2024) | ||
| Default: FALSE | ||
| </entry> | ||
|
|
||
| <entry id="qbo_cyclic" type="logical" category="waccm_phys" | ||
| group="qbo_nl" valid_values="" > | ||
| TRUE implies assume cyclic qbo data. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| ./xmlchange ROF_NCPL=\$ATM_NCPL | ||
| ./xmlchange GLC_NCPL=\$ATM_NCPL | ||
| ./xmlchange --append CAM_CONFIG_OPTS="-ext_co2_cool" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| source/modules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| !-------------------------------------------------------------------------------- | ||
| ! Ref: | ||
| ! Lopez-Puertas, M., Fabiano, F., Fomichev, V., Funke, B., and Marsh, D. R.: | ||
| ! An improved and extended parameterization of the CO2 15 um cooling in the middle | ||
| ! and upper atmosphere (CO2_cool_fort-1.0), Geosci. Model Dev., 17, 4401-4432, | ||
| ! https://doi.org/10.5194/gmd-17-4401-2024, 2024. | ||
| !-------------------------------------------------------------------------------- | ||
| module nlte_extco2 | ||
|
|
||
| use ppgrid, only: pcols, pver | ||
| use shr_kind_mod, only: r8 => shr_kind_r8 | ||
| use cam_logfile, only: iulog | ||
| use spmd_utils, only: masterproc | ||
| use cam_history, only: add_default, addfld, outfld | ||
|
|
||
| implicit none | ||
|
|
||
| private | ||
| public :: nlte_extco2_init | ||
| public :: nlte_extco2_hrate | ||
|
|
||
| real(r8) :: o1_mw_inv = -huge(1.0_r8) ! O molecular weight (inverse) | ||
| real(r8) :: o2_mw_inv = -huge(1.0_r8) ! O2 molecular weight (inverse) | ||
| real(r8) :: co2_mw_inv = -huge(1.0_r8) ! CO2 molecular weight (inverse) | ||
| real(r8) :: n2_mw_inv = -huge(1.0_r8) ! N2 molecular weight (inverse) | ||
|
|
||
| contains | ||
|
|
||
| !------------------------------------------------------------------------------ | ||
| !------------------------------------------------------------------------------ | ||
| subroutine nlte_extco2_init(co2_mw,n2_mw,o1_mw,o2_mw) | ||
| use ref_pres, only: pref_mid | ||
|
|
||
| ! Input variables | ||
| real(r8), intent(in) :: o1_mw ! O molecular weight | ||
| real(r8), intent(in) :: o2_mw ! O2 molecular weight | ||
| real(r8), intent(in) :: co2_mw ! CO2 molecular weight | ||
| real(r8), intent(in) :: n2_mw ! N2 molecular weight | ||
|
|
||
| #ifdef EXT_CO2_COOL | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering about why you felt the need to encapsulate this code within a #ifdef. We try to avoid using these directives and backtracing this particular routine, it is only called when
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The external code ext_co2_cooling code does not compile with NAG compiler.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With that in mind, does it make sense to only #ifdef the calls and the use statements (keep it contained around the code which only needed to not compiled)?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer not to add the history fields when the model is not configured to use the extended cooling method. |
||
|
|
||
| co2_mw_inv = 1._r8/co2_mw | ||
| o1_mw_inv = 1._r8/o1_mw | ||
| o2_mw_inv = 1._r8/o2_mw | ||
| n2_mw_inv = 1._r8/n2_mw | ||
|
|
||
| call addfld ('QCO2ext', (/ 'lev' /), 'A','K/s','Extended CO2 cooling') | ||
| call addfld ('TCO2ext', (/ 'lev' /), 'A','K','Temp used in Extended CO2 cooling') | ||
| call addfld ('PCO2ext', (/ 'lev' /), 'A','hPa','Press used in Extended CO2 cooling') | ||
| call addfld ('CO2_ext', (/ 'lev' /), 'A','mol/mol','CO2 vmr used in Extended CO2 cooling') | ||
| call addfld ('N2_ext', (/ 'lev' /), 'A','mol/mol','N2 vmr used in Extended CO2 cooling') | ||
| call addfld ('O_ext', (/ 'lev' /), 'A','mol/mol','O vmr used in Extended CO2 cooling') | ||
| call addfld ('O2_ext', (/ 'lev' /), 'A','mol/mol','O2 vmr used in Extended CO2 cooling') | ||
|
|
||
| #endif | ||
| end subroutine nlte_extco2_init | ||
|
|
||
|
|
||
| !------------------------------------------------------------------------------ | ||
| !------------------------------------------------------------------------------ | ||
| subroutine nlte_extco2_hrate(lchnk, ncol, temp, pres, co2mmr, n2mmr, ommr, o2mmr, & | ||
| co2cooling) | ||
| use air_composition, only: mbarv | ||
| #ifdef EXT_CO2_COOL | ||
| use co2cool, only: co2_nlte_cool | ||
| #endif | ||
| ! Input variables | ||
| integer, intent(in) :: ncol ! number of atmospheric columns | ||
| integer, intent(in) :: lchnk ! chunk identifier | ||
|
|
||
| real(r8), intent(in) :: temp(:,:) ! temperature (K) | ||
| real(r8), intent(in) :: pres(:,:) ! pressure (Pa) | ||
| real(r8), intent(in) :: co2mmr(:,:) ! CO2 mass mixing ratio | ||
| real(r8), intent(in) :: n2mmr(:,:) ! N2 mass mixing ratio | ||
| real(r8), intent(in) :: ommr(:,:) ! O mass mixing ratio | ||
| real(r8), intent(in) :: o2mmr(:,:) ! O2 mass mixing ratio | ||
|
|
||
| ! Output | ||
| real(r8), intent(out) :: co2cooling(:,:) ! K sec-1 | ||
|
|
||
| ! Local vars | ||
| real(r8) :: co2vmr(pver) | ||
| real(r8) :: ovmr(pver) | ||
| real(r8) :: n2vmr(pver) | ||
| real(r8) :: o2vmr(pver) | ||
| real(r8) :: heatrate(pver) ! K/day | ||
| real(r8) :: hPa(pver) | ||
|
|
||
| real(r8) :: surf_temp ! K | ||
| integer :: icol | ||
|
|
||
| real(r8) :: tempout(pcols,pver) | ||
| real(r8) :: presout(pcols,pver) | ||
| real(r8) :: co2_out(pcols,pver) | ||
| real(r8) :: n2_out(pcols,pver) | ||
| real(r8) :: o_out(pcols,pver) | ||
| real(r8) :: o2_out(pcols,pver) | ||
|
|
||
| real(r8), parameter :: day_per_sec = 1._r8/86400._r8 | ||
|
|
||
| co2cooling = 0._r8 | ||
|
|
||
| #ifdef EXT_CO2_COOL | ||
| do icol=1,ncol | ||
|
|
||
| ! Convert to VMR from mmr | ||
| co2vmr(:) = mbarv(icol,:,lchnk) * co2mmr(icol,:) * co2_mw_inv | ||
| ovmr(:) = mbarv(icol,:,lchnk) * ommr(icol,:) * o1_mw_inv | ||
| n2vmr(:) = mbarv(icol,:,lchnk) * n2mmr(icol,:) * n2_mw_inv | ||
| o2vmr(:) = mbarv(icol,:,lchnk) * o2mmr(icol,:) * o2_mw_inv | ||
| hPa(:) = pres(icol,:) * 1.e-2_r8 ! Pa --> hPa | ||
| surf_temp = temp(icol,pver) | ||
|
|
||
| tempout(icol,:) = temp(icol,:) | ||
| presout(icol,:) = hPa(:) | ||
| co2_out(icol,:) = co2vmr(:) | ||
| o_out(icol,:) = ovmr(:) | ||
| o2_out(icol,:) = o2vmr(:) | ||
| n2_out(icol,:) = n2vmr(:) | ||
|
|
||
| heatrate(:) = 0._r8 | ||
|
|
||
| ! Units: Temperature in K, pressure in hPa, vmrs in mol/mol, heating rate in K/day | ||
| call co2_nlte_cool(temp(icol,:), hPa, co2vmr, ovmr, o2vmr, n2vmr, pver, & | ||
| surf_temp, heatrate) ! (K day-1) | ||
|
|
||
| co2cooling(icol,:) = heatrate(:) * day_per_sec ! K day-1 --> K sec-1 | ||
|
|
||
| end do | ||
|
|
||
| call outfld ('QCO2ext', co2cooling(:ncol,:), ncol, lchnk) | ||
| call outfld ('TCO2ext', tempout(:ncol,:), ncol, lchnk) | ||
| call outfld ('PCO2ext', presout(:ncol,:), ncol, lchnk) | ||
| call outfld ('CO2_ext', co2_out(:ncol,:), ncol, lchnk) | ||
| call outfld ('O_ext', o_out(:ncol,:), ncol, lchnk) | ||
| call outfld ('O2_ext', o2_out(:ncol,:), ncol, lchnk) | ||
| call outfld ('N2_ext', n2_out(:ncol,:), ncol, lchnk) | ||
| #endif | ||
| end subroutine nlte_extco2_hrate | ||
|
|
||
| end module nlte_extco2 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this file been "rimport"ed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done