These are the changes from Danica to add Ozone from atm in CLM. These are based off of clm4_5_1_r104. There are also changes in cime needed for datm and driver, that are documented in cime issue: 389 and 390.
[erik@yslogin3 clm4_5_1_r104_Fire_O3_spinupFinal]$ diff -cwb /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/main/atm2lndType.F90 SourceMods/src.clm/
*** /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/main/atm2lndType.F90 2015-02-18 15:49:02.749875754 -0700
--- SourceMods/src.clm/atm2lndType.F90 2015-05-12 13:44:46.565581000 -0600
***************
*** 51,56 ****
--- 51,57 ----
real(r8), pointer :: forc_solai_grc (:,:) => null() ! diffuse radiation (numrad) (vis=forc_solsd, nir=forc_solld)
real(r8), pointer :: forc_solar_grc (:) => null() ! incident solar radiation
real(r8), pointer :: forc_ndep_grc (:) => null() ! nitrogen deposition rate (gN/m2/s)
+ real(r8), pointer :: forc_ozone_grc (:) => null() ! ozone concentration
real(r8), pointer :: forc_pc13o2_grc (:) => null() ! C13O2 partial pressure (Pa)
real(r8), pointer :: forc_po2_grc (:) => null() ! O2 partial pressure (Pa)
real(r8), pointer :: forc_aer_grc (:,:) => null() ! aerosol deposition array
***************
*** 167,172 ****
--- 168,174 ----
allocate(this%forc_solai_grc (begg:endg,numrad)) ; this%forc_solai_grc (:,:) = ival
allocate(this%forc_solar_grc (begg:endg)) ; this%forc_solar_grc (:) = ival
allocate(this%forc_ndep_grc (begg:endg)) ; this%forc_ndep_grc (:) = ival
+ allocate(this%forc_ozone_grc (begg:endg)) ; this%forc_ozone_grc (:) = ival
allocate(this%forc_pc13o2_grc (begg:endg)) ; this%forc_pc13o2_grc (:) = ival
allocate(this%forc_po2_grc (begg:endg)) ; this%forc_po2_grc (:) = ival
allocate(this%forc_aer_grc (begg:endg,14)) ; this%forc_aer_grc (:,:) = ival
***************
*** 271,276 ****
--- 273,283 ----
avgflag='A', long_name='atmospheric incident solar radiation', &
ptr_lnd=this%forc_solar_grc)
+ this%forc_ozone_grc(begg:endg) = spval
+ call hist_addfld1d (fname='OZONE', units='mol/mol', &
+ avgflag='A', long_name='ozone concentration', &
+ ptr_lnd=this%forc_ozone_grc)
+
this%forc_pco2_grc(begg:endg) = spval
call hist_addfld1d (fname='PCO2', units='Pa', &
avgflag='A', long_name='atmospheric partial pressure of CO2', &
[erik@yslogin3 clm4_5_1_r104_Fire_O3_spinupFinal]$ diff -cwb /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/biogeophys/OzoneBaseMod.F90 SourceMods/src.clm/
*** /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/biogeophys/OzoneBaseMod.F90 2015-02-18 15:49:08.658344475 -0700
--- SourceMods/src.clm/OzoneBaseMod.F90 2015-05-12 13:44:46.650799000 -0600
***************
*** 61,67 ****
end subroutine Restart_interface
subroutine CalcOzoneStress_interface(this, bounds, num_exposedvegp, filter_exposedvegp, &
! forc_pbot, forc_th, rssun, rssha, rb, ram, tlai)
use decompMod , only : bounds_type
use shr_kind_mod , only : r8 => shr_kind_r8
import :: ozone_base_type
--- 61,67 ----
end subroutine Restart_interface
subroutine CalcOzoneStress_interface(this, bounds, num_exposedvegp, filter_exposedvegp, &
! forc_ozone, forc_pbot, forc_th, rssun, rssha, rb, ram, tlai)
use decompMod , only : bounds_type
use shr_kind_mod , only : r8 => shr_kind_r8
import :: ozone_base_type
***************
*** 71,76 ****
--- 71,77 ----
integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp
integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg
real(r8) , intent(in) :: forc_pbot( bounds%begc: ) ! atmospheric pressure (Pa)
+ real(r8) , intent(in) :: forc_ozone( bounds%begg: )! ozone concentration
real(r8) , intent(in) :: forc_th( bounds%begc: ) ! atmospheric potential temperature (K)
real(r8) , intent(in) :: rssun( bounds%begp: ) ! leaf stomatal resistance, sunlit leaves (s/m)
real(r8) , intent(in) :: rssha( bounds%begp: ) ! leaf stomatal resistance, shaded leaves (s/m)
[erik@yslogin3 clm4_5_1_r104_Fire_O3_spinupFinal]$ diff -cwb /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/biogeophys/OzoneMod.F90 SourceMods/src.clm/
*** /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/biogeophys/OzoneMod.F90 2015-02-18 15:49:08.662545401 -0700
--- SourceMods/src.clm/OzoneMod.F90 2015-05-12 13:44:46.664578000 -0600
***************
*** 30,35 ****
--- 30,37 ----
! Private data members
real(r8), pointer :: o3uptakesha_patch(:) ! ozone dose, shaded leaves (mmol O3/m^2)
real(r8), pointer :: o3uptakesun_patch(:) ! ozone dose, sunlit leaves (mmol O3/m^2)
+ ! can delete after checking that ozone = o3test
+ real(r8), pointer :: forc_ozone(:) ! ozone concentration (mol/mol)
! NOTE(wjs, 2014-09-29) tlai_old_patch really belongs alongside tlai_patch in
! CanopyStateType. But there are problems with any way I can think to implement
***************
*** 72,78 ****
! TODO(wjs, 2014-09-29) This parameter will eventually become a spatially-varying
! value, obtained from ATM
! real(r8), parameter :: forc_ozone = 100._r8 * 1.e-9_r8 ! ozone partial pressure [mol/mol]
! TODO(wjs, 2014-09-29) The following parameters should eventually be moved to the
! params file. Parameters differentiated on veg type should be put on the params file
--- 74,80 ----
! TODO(wjs, 2014-09-29) This parameter will eventually become a spatially-varying
! value, obtained from ATM
! ! real(r8), parameter :: forc_ozone = 100._r8 * 1.e-9_r8 ! ozone partial pressure [mol/mol]
! TODO(wjs, 2014-09-29) The following parameters should eventually be moved to the
! params file. Parameters differentiated on veg type should be put on the params file
***************
*** 186,191 ****
--- 188,195 ----
allocate(this%o3uptakesha_patch(begp:endp)) ; this%o3uptakesha_patch(:) = nan
allocate(this%o3uptakesun_patch(begp:endp)) ; this%o3uptakesun_patch(:) = nan
+ !delete later
+ allocate(this%forc_ozone(bounds%begg:bounds%endg)) ; this%forc_ozone(:) = nan
allocate(this%tlai_old_patch(begp:endp)) ; this%tlai_old_patch(:) = nan
end subroutine InitAllocate
***************
*** 222,227 ****
--- 226,238 ----
avgflag='A', long_name='total ozone flux into shaded leaves', &
ptr_patch=this%o3uptakesha_patch)
+ ! delete later
+ ! this%forc_ozone(bounds%begg:bounds%endg) = spval
+ ! call hist_addfld1d (fname='O3_TEST', units='mol/mol', &
+ ! avgflag='A', long_name='ozone concentration', &
+ ! ptr_lnd=this%forc_ozone)
+
+
end subroutine InitHistory
!-----------------------------------------------------------------------
***************
*** 316,328 ****
!-----------------------------------------------------------------------
subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp, &
! forc_pbot, forc_th, rssun, rssha, rb, ram, tlai)
!
! !DESCRIPTION:
! Calculate ozone stress.
!
! !USES:
use PatchType , only : patch
!
! !ARGUMENTS:
class(ozone_type) , intent(inout) :: this
--- 327,340 ----
!-----------------------------------------------------------------------
subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp, &
! forc_ozone, forc_pbot, forc_th, rssun, rssha, rb, ram, tlai)
!
! !DESCRIPTION:
! Calculate ozone stress.
!
! !USES:
use PatchType , only : patch
+ ! use clm_varctl , only : iulog
!
! !ARGUMENTS:
class(ozone_type) , intent(inout) :: this
***************
*** 331,336 ****
--- 343,349 ----
integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg
real(r8) , intent(in) :: forc_pbot( bounds%begc: ) ! atmospheric pressure (Pa)
real(r8) , intent(in) :: forc_th( bounds%begc: ) ! atmospheric potential temperature (K)
+ real(r8) , intent(in) :: forc_ozone( bounds%begg: )! ozone concentration
real(r8) , intent(in) :: rssun( bounds%begp: ) ! leaf stomatal resistance, sunlit leaves (s/m)
real(r8) , intent(in) :: rssha( bounds%begp: ) ! leaf stomatal resistance, shaded leaves (s/m)
real(r8) , intent(in) :: rb( bounds%begp: ) ! boundary layer resistance (s/m)
***************
*** 341,346 ****
--- 354,360 ----
integer :: fp ! filter index
integer :: p ! patch index
integer :: c ! column index
+ integer :: g ! gridcell index
character(len=*), parameter :: subname = 'CalcOzoneStress'
!-----------------------------------------------------------------------
***************
*** 348,353 ****
--- 362,368 ----
! Enforce expected array sizes
SHR_ASSERT_ALL((ubound(forc_pbot) == (/bounds%endc/)), errMsg(__FILE__, __LINE__))
SHR_ASSERT_ALL((ubound(forc_th) == (/bounds%endc/)), errMsg(__FILE__, __LINE__))
+ SHR_ASSERT_ALL((ubound(forc_ozone) == (/bounds%endg/)), errMsg(__FILE__, __LINE__))
SHR_ASSERT_ALL((ubound(rssun) == (/bounds%endp/)), errMsg(__FILE__, __LINE__))
SHR_ASSERT_ALL((ubound(rssha) == (/bounds%endp/)), errMsg(__FILE__, __LINE__))
SHR_ASSERT_ALL((ubound(rb) == (/bounds%endp/)), errMsg(__FILE__, __LINE__))
***************
*** 367,389 ****
do fp = 1, num_exposedvegp
p = filter_exposedvegp(fp)
c = patch%column(p)
! Ozone stress for shaded leaves
call CalcOzoneStressOnePoint( &
! forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), &
rs=rssha(p), rb=rb(p), ram=ram(p), &
tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), &
o3uptake=o3uptakesha(p), o3coefv=o3coefvsha(p), o3coefg=o3coefgsha(p))
! Ozone stress for sunlit leaves
call CalcOzoneStressOnePoint( &
! forc_ozone=forc_ozone, forc_pbot=forc_pbot(c), forc_th=forc_th(c), &
rs=rssun(p), rb=rb(p), ram=ram(p), &
tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), &
o3uptake=o3uptakesun(p), o3coefv=o3coefvsun(p), o3coefg=o3coefgsun(p))
tlai_old(p) = tlai(p)
end do
end associate
--- 382,409 ----
do fp = 1, num_exposedvegp
p = filter_exposedvegp(fp)
c = patch%column(p)
+ g = patch%gridcell(p)
+ ! delete later
+ this%forc_ozone(g) = forc_ozone(g)
! Ozone stress for shaded leaves
call CalcOzoneStressOnePoint( &
! forc_ozone=forc_ozone(g), forc_pbot=forc_pbot(c), forc_th=forc_th(c), &
rs=rssha(p), rb=rb(p), ram=ram(p), &
tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), &
o3uptake=o3uptakesha(p), o3coefv=o3coefvsha(p), o3coefg=o3coefgsha(p))
! Ozone stress for sunlit leaves
call CalcOzoneStressOnePoint( &
! forc_ozone=forc_ozone(g), forc_pbot=forc_pbot(c), forc_th=forc_th(c), &
rs=rssun(p), rb=rb(p), ram=ram(p), &
tlai=tlai(p), tlai_old=tlai_old(p), pft_type=patch%itype(p), &
o3uptake=o3uptakesun(p), o3coefv=o3coefvsun(p), o3coefg=o3coefgsun(p))
tlai_old(p) = tlai(p)
+ ! write(iulog,*) '[O3] = ',g,forc_ozone(g),o3uptakesun(p),o3uptakesha(p),rssun(p)
+
end do
end associate
[erik@yslogin3 clm4_5_1_r104_Fire_O3_spinupFinal]$ diff -cwb /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/biogeophys/OzoneOffMod.F90 SourceMods/src.clm/
*** /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/biogeophys/OzoneOffMod.F90 2015-02-18 15:49:08.604774935 -0700
--- SourceMods/src.clm/OzoneOffMod.F90 2015-05-12 13:44:46.685219000 -0600
***************
*** 78,84 ****
end subroutine Restart
subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp, &
! forc_pbot, forc_th, rssun, rssha, rb, ram, tlai)
class(ozone_off_type) , intent(inout) :: this
type(bounds_type) , intent(in) :: bounds
--- 78,84 ----
end subroutine Restart
subroutine CalcOzoneStress(this, bounds, num_exposedvegp, filter_exposedvegp, &
! forc_ozone, forc_pbot, forc_th, rssun, rssha, rb, ram, tlai)
class(ozone_off_type) , intent(inout) :: this
type(bounds_type) , intent(in) :: bounds
***************
*** 86,91 ****
--- 86,92 ----
integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg
real(r8) , intent(in) :: forc_pbot( bounds%begc: ) ! atmospheric pressure (Pa)
real(r8) , intent(in) :: forc_th( bounds%begc: ) ! atmospheric potential temperature (K)
+ real(r8) , intent(in) :: forc_ozone( bounds%begg: )! ozone concentration
real(r8) , intent(in) :: rssun( bounds%begp: ) ! leaf stomatal resistance, sunlit leaves (s/m)
real(r8) , intent(in) :: rssha( bounds%begp: ) ! leaf stomatal resistance, shaded leaves (s/m)
real(r8) , intent(in) :: rb( bounds%begp: ) ! boundary layer resistance (s/m)
***************
*** 96,101 ****
--- 97,103 ----
! ozone-off can pick up problems with the call to this routine)
SHR_ASSERT_ALL((ubound(forc_pbot) == (/bounds%endc/)), errMsg(__FILE__, __LINE__))
SHR_ASSERT_ALL((ubound(forc_th) == (/bounds%endc/)), errMsg(__FILE__, __LINE__))
+ SHR_ASSERT_ALL((ubound(forc_ozone) == (/bounds%endg/)), errMsg(__FILE__, __LINE__))
SHR_ASSERT_ALL((ubound(rssun) == (/bounds%endp/)), errMsg(__FILE__, __LINE__))
SHR_ASSERT_ALL((ubound(rssha) == (/bounds%endp/)), errMsg(__FILE__, __LINE__))
SHR_ASSERT_ALL((ubound(rb) == (/bounds%endp/)), errMsg(__FILE__, __LINE__))
[erik@yslogin3 clm4_5_1_r104_Fire_O3_spinupFinal]$ diff -cwb /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 SourceMods/src.clm/
*** /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/biogeophys/CanopyFluxesMod.F90 2015-02-18 15:49:08.646431176 -0700
--- SourceMods/src.clm/CanopyFluxesMod.F90 2015-05-12 13:44:46.590002000 -0600
***************
*** 293,298 ****
--- 293,299 ----
forc_q => atm2lnd_inst%forc_q_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric specific humidity (kg/kg)
forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa)
forc_th => atm2lnd_inst%forc_th_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric potential temperature (Kelvin)
+ forc_ozone => atm2lnd_inst%forc_ozone_grc , & ! Input: [real(r8) (:) ] ozone concentration (mol/mol)
forc_rho => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:) ] density (kg/m**3)
forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin)
forc_u => atm2lnd_inst%forc_u_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in east direction (m/s)
***************
*** 1145,1150 ****
--- 1146,1152 ----
bounds, fn, filterp, &
forc_pbot = atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc), &
forc_th = atm2lnd_inst%forc_th_downscaled_col(bounds%begc:bounds%endc), &
+ forc_ozone= atm2lnd_inst%forc_ozone_grc(bounds%begg:bounds%endg), &
rssun = photosyns_inst%rssun_patch(bounds%begp:bounds%endp), &
rssha = photosyns_inst%rssha_patch(bounds%begp:bounds%endp), &
rb = frictionvel_inst%rb1_patch(bounds%begp:bounds%endp),
[erik@yslogin3 clm4_5_1_r104_Fire_O3_spinupFinal]$ diff -cwb /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/cpl/clm_cpl_indices.F90 SourceMods/src.clm/
*** /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/cpl/clm_cpl_indices.F90 2015-02-18 15:49:11.260046207 -0700
--- SourceMods/src.clm/clm_cpl_indices.F90 2015-05-12 13:44:46.606482000 -0600
***************
*** 98,103 ****
--- 98,104 ----
integer, public ::index_x2l_Faxa_dstdry2 ! flux: Size 2 dust -- dry deposition
integer, public ::index_x2l_Faxa_dstdry3 ! flux: Size 3 dust -- dry deposition
integer, public ::index_x2l_Faxa_dstdry4 ! flux: Size 4 dust -- dry deposition
+ integer, public ::index_x2l_Faxa_ozone
integer, public ::index_x2l_Flrr_flood ! rtm->lnd rof (flood) flux
integer, public ::index_x2l_Flrr_volr ! rtm->lnd rof volr
***************
*** 225,230 ****
--- 226,232 ----
index_x2l_Flrr_volr = mct_avect_indexra(x2l,'Flrr_volr')
index_x2l_Faxa_lwdn = mct_avect_indexra(x2l,'Faxa_lwdn')
+ index_x2l_Faxa_ozone = mct_avect_indexra(x2l,'Faxa_ozone')
index_x2l_Faxa_rainc = mct_avect_indexra(x2l,'Faxa_rainc')
index_x2l_Faxa_rainl = mct_avect_indexra(x2l,'Faxa_rainl')
index_x2l_Faxa_snowc = mct_avect_indexra(x2l,'Faxa_snowc')
[erik@yslogin3 clm4_5_1_r104_Fire_O3_spinupFinal]$ diff -cwb /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/cpl/lnd_import_export.F90 SourceMods/src.clm/
*** /glade/p/work/dll/clm4_5_1_r104/models/lnd/clm/src/cpl/lnd_import_export.F90 2015-02-18 15:49:11.261632747 -0700
--- SourceMods/src.clm/lnd_import_export.F90 2015-05-12 13:44:46.642144000 -0600
***************
*** 119,124 ****
--- 119,125 ----
atm2lnd_inst%forc_pbot_not_downscaled_grc(g) = x2l(index_x2l_Sa_pbot,i) ! ptcmxy Atm state Pa
atm2lnd_inst%forc_t_not_downscaled_grc(g) = x2l(index_x2l_Sa_tbot,i) ! forc_txy Atm state K
atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) = x2l(index_x2l_Faxa_lwdn,i) ! flwdsxy Atm flux W/m^2
+ atm2lnd_inst%forc_ozone_grc(g) = x2l(index_x2l_Faxa_ozone,i)
forc_rainc = x2l(index_x2l_Faxa_rainc,i) ! mm/s
forc_rainl = x2l(index_x2l_Faxa_rainl,i) ! mm/s
Erik Kluzek < erik > - 2016-03-04 16:03:57 -0700
Bugzilla Id: 2294
Bugzilla CC: dll, rfisher,
These are the changes from Danica to add Ozone from atm in CLM. These are based off of clm4_5_1_r104. There are also changes in cime needed for datm and driver, that are documented in cime issue: 389 and 390.