diff --git a/src/biogeochem/ch4Mod.F90 b/src/biogeochem/ch4Mod.F90 index 0768e702d1..d6337be9db 100644 --- a/src/biogeochem/ch4Mod.F90 +++ b/src/biogeochem/ch4Mod.F90 @@ -28,16 +28,16 @@ module ch4Mod use EnergyFluxType , only : energyflux_type use LakeStateType , only : lakestate_type use lnd2atmType , only : lnd2atm_type - use SoilHydrologyType , only : soilhydrology_type + use SoilHydrologyType , only : soilhydrology_type use SoilStateType , only : soilstate_type use TemperatureType , only : temperature_type use WaterFluxBulkType , only : waterfluxbulk_type use WaterStateBulkType , only : waterstatebulk_type use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type - use GridcellType , only : grc - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch + use GridcellType , only : grc + use LandunitType , only : lun + use ColumnType , only : col + use PatchType , only : patch use ch4FInundatedStreamType , only : ch4finundatedstream_type use CLMFatesInterfaceMod , only : hlm_fates_interface_type ! @@ -80,7 +80,7 @@ module ch4Mod ! ch4 oxidation constants real(r8) :: vmax_ch4_oxid ! oxidation rate constant (= 45.e-6_r8 * 1000._r8 / 3600._r8) [mol/m3-w/s]; - real(r8) :: k_m ! Michaelis-Menten oxidation rate constant for CH4 concentration + real(r8) :: k_m ! Michaelis-Menten oxidation rate constant for CH4 concentration real(r8) :: q10_ch4oxid ! Q10 oxidation constant real(r8) :: smp_crit ! Critical soil moisture potential real(r8) :: k_m_o2 ! Michaelis-Menten oxidation rate constant for O2 concentration @@ -94,7 +94,7 @@ module ch4Mod real(r8) :: scale_factor_aere ! scale factor on the aerenchyma area for sensitivity tests real(r8) :: nongrassporosratio ! Ratio of root porosity in non-grass to grass, used for aerenchyma transport real(r8) :: unsat_aere_ratio ! Ratio to multiply upland vegetation aerenchyma porosity by compared to inundated systems (= 0.05_r8 / 0.3_r8) - real(r8) :: porosmin ! minimum aerenchyma porosity (unitless)(= 0.05_r8) + real(r8) :: porosmin ! minimum aerenchyma porosity (unitless)(= 0.05_r8) ! ch4 ebbulition constants real(r8) :: vgc_max ! ratio of saturation pressure triggering ebullition @@ -108,7 +108,7 @@ module ch4Mod ! additional constants real(r8) :: f_sat ! volumetric soil water defining top of water table or where production is allowed (=0.95) real(r8) :: qflxlagd ! days to lag qflx_surf_lag in the tropics (days) ( = 30._r8) - real(r8) :: highlatfact ! multiple of qflxlagd for high latitudes (= 2._r8) + real(r8) :: highlatfact ! multiple of qflxlagd for high latitudes (= 2._r8) real(r8) :: q10lakebase ! (K) base temperature for lake CH4 production (= 298._r8) real(r8) :: atmch4 ! Atmospheric CH4 mixing ratio to prescribe if not provided by the atmospheric model (= 1.7e-6_r8) (mol/mol) real(r8) :: rob ! ratio of root length to vertical depth ("root obliquity") (= 3._r8) @@ -179,7 +179,7 @@ module ch4Mod real(r8), pointer, private :: ch4co2f_grc (:) ! grc CO2 production from CH4 oxidation (g C/m**2/s) real(r8), pointer, private :: ch4prodg_grc (:) ! grc average CH4 production (g C/m^2/s) ! - ! for aerenchyma calculations + ! for aerenchyma calculations real(r8), pointer, private :: annavg_agnpp_patch (:) ! patch (gC/m2/s) annual average aboveground NPP real(r8), pointer, private :: annavg_bgnpp_patch (:) ! patch (gC/m2/s) annual average belowground NPP real(r8), pointer, private :: tempavg_agnpp_patch (:) ! patch (gC/m2/s) temp. average aboveground NPP @@ -209,11 +209,11 @@ module ch4Mod contains - procedure, public :: Init - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold - procedure, public :: Restart + procedure, public :: Init + procedure, private :: InitAllocate + procedure, private :: InitHistory + procedure, private :: InitCold + procedure, public :: Restart procedure, public :: DynamicColumnAdjustments ! adjust state variables when column areas change end type ch4_type @@ -228,7 +228,7 @@ module ch4Mod subroutine Init( this, bounds, cellorg_col, fsurdat, NLFilename ) class(ch4_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds real(r8) , intent(in) :: cellorg_col (bounds%begc:, 1:) character(len=*) , intent(in) :: fsurdat ! surface data file name character(len=*), intent(in) :: NLFilename ! Namelist filename @@ -254,7 +254,7 @@ subroutine InitAllocate(this, bounds) ! ! !ARGUMENTS: class(ch4_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: begp, endp @@ -297,11 +297,11 @@ subroutine InitAllocate(this, bounds) allocate(this%ch4_surf_ebul_lake_col (begc:endc)) ; this%ch4_surf_ebul_lake_col (:) = nan allocate(this%conc_ch4_sat_col (begc:endc,1:nlevgrnd)) ; this%conc_ch4_sat_col (:,:) = spval ! detect file input allocate(this%conc_ch4_unsat_col (begc:endc,1:nlevgrnd)) ; this%conc_ch4_unsat_col (:,:) = spval ! detect file input - allocate(this%conc_ch4_lake_col (begc:endc,1:nlevgrnd)) ; this%conc_ch4_lake_col (:,:) = nan + allocate(this%conc_ch4_lake_col (begc:endc,1:nlevgrnd)) ; this%conc_ch4_lake_col (:,:) = nan allocate(this%ch4_surf_diff_sat_col (begc:endc)) ; this%ch4_surf_diff_sat_col (:) = nan allocate(this%ch4_surf_diff_unsat_col (begc:endc)) ; this%ch4_surf_diff_unsat_col (:) = nan allocate(this%ch4_surf_diff_lake_col (begc:endc)) ; this%ch4_surf_diff_lake_col (:) = nan - allocate(this%conc_o2_lake_col (begc:endc,1:nlevgrnd)) ; this%conc_o2_lake_col (:,:) = nan + allocate(this%conc_o2_lake_col (begc:endc,1:nlevgrnd)) ; this%conc_o2_lake_col (:,:) = nan allocate(this%ch4_dfsat_flux_col (begc:endc)) ; this%ch4_dfsat_flux_col (:) = nan allocate(this%zwt_ch4_unsat_col (begc:endc)) ; this%zwt_ch4_unsat_col (:) = nan allocate(this%lake_soilc_col (begc:endc,1:nlevgrnd)) ; this%lake_soilc_col (:,:) = spval !first time-step @@ -309,15 +309,15 @@ subroutine InitAllocate(this, bounds) allocate(this%totcolch4_grc (begg:endg)) ; this%totcolch4_grc (:) = nan allocate(this%totcolch4_bef_col (begc:endc)) ; this%totcolch4_bef_col (:) = nan allocate(this%totcolch4_bef_grc (begg:endg)) ; this%totcolch4_bef_grc (:) = nan - allocate(this%annsum_counter_col (begc:endc)) ; this%annsum_counter_col (:) = nan + allocate(this%annsum_counter_col (begc:endc)) ; this%annsum_counter_col (:) = nan allocate(this%tempavg_somhr_col (begc:endc)) ; this%tempavg_somhr_col (:) = nan - allocate(this%annavg_somhr_col (begc:endc)) ; this%annavg_somhr_col (:) = nan + allocate(this%annavg_somhr_col (begc:endc)) ; this%annavg_somhr_col (:) = nan allocate(this%tempavg_finrw_col (begc:endc)) ; this%tempavg_finrw_col (:) = nan - allocate(this%annavg_finrw_col (begc:endc)) ; this%annavg_finrw_col (:) = nan + allocate(this%annavg_finrw_col (begc:endc)) ; this%annavg_finrw_col (:) = nan allocate(this%sif_col (begc:endc)) ; this%sif_col (:) = nan allocate(this%ch4stress_unsat_col (begc:endc,1:nlevgrnd)) ; this%ch4stress_unsat_col (:,:) = nan - allocate(this%ch4stress_sat_col (begc:endc,1:nlevgrnd)) ; this%ch4stress_sat_col (:,:) = nan - allocate(this%qflx_surf_lag_col (begc:endc)) ; this%qflx_surf_lag_col (:) = nan + allocate(this%ch4stress_sat_col (begc:endc,1:nlevgrnd)) ; this%ch4stress_sat_col (:,:) = nan + allocate(this%qflx_surf_lag_col (begc:endc)) ; this%qflx_surf_lag_col (:) = nan allocate(this%finundated_lag_col (begc:endc)) ; this%finundated_lag_col (:) = nan allocate(this%layer_sat_lag_col (begc:endc,1:nlevgrnd)) ; this%layer_sat_lag_col (:,:) = nan allocate(this%pH_col (begc:endc)) ; this%pH_col (:) = nan @@ -335,13 +335,13 @@ subroutine InitAllocate(this, bounds) allocate(this%ch4_first_time_grc (begg:endg)) ; this%ch4_first_time_grc (:) = .true. - allocate(this%finundated_col (begc:endc)) ; this%finundated_col (:) = nan - allocate(this%finundated_pre_snow_col (begc:endc)) ; this%finundated_pre_snow_col (:) = nan - allocate(this%o2stress_unsat_col (begc:endc,1:nlevgrnd)) ; this%o2stress_unsat_col (:,:) = nan - allocate(this%o2stress_sat_col (begc:endc,1:nlevgrnd)) ; this%o2stress_sat_col (:,:) = nan + allocate(this%finundated_col (begc:endc)) ; this%finundated_col (:) = nan + allocate(this%finundated_pre_snow_col (begc:endc)) ; this%finundated_pre_snow_col (:) = nan + allocate(this%o2stress_unsat_col (begc:endc,1:nlevgrnd)) ; this%o2stress_unsat_col (:,:) = nan + allocate(this%o2stress_sat_col (begc:endc,1:nlevgrnd)) ; this%o2stress_sat_col (:,:) = nan allocate(this%conc_o2_sat_col (begc:endc,1:nlevgrnd)) ; this%conc_o2_sat_col (:,:) = nan allocate(this%conc_o2_unsat_col (begc:endc,1:nlevgrnd)) ; this%conc_o2_unsat_col (:,:) = nan - allocate(this%o2_decomp_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%o2_decomp_depth_sat_col (:,:) = nan + allocate(this%o2_decomp_depth_sat_col (begc:endc,1:nlevgrnd)) ; this%o2_decomp_depth_sat_col (:,:) = nan allocate(this%o2_decomp_depth_unsat_col (begc:endc,1:nlevgrnd)) ; this%o2_decomp_depth_unsat_col (:,:) = nan allocate(this%grnd_ch4_cond_patch (begp:endp)) ; this%grnd_ch4_cond_patch (:) = nan @@ -360,13 +360,13 @@ subroutine InitHistory(this, bounds) ! ! !ARGUMENTS: class(ch4_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: character(8) :: vr_suffix character(10) :: active integer :: begc,endc - integer :: begg,endg + integer :: begg,endg real(r8), pointer :: data2dptr(:,:) ! temp. pointers for slicing larger arrays !--------------------------------------------------------------------- @@ -375,7 +375,7 @@ subroutine InitHistory(this, bounds) if (nlevdecomp > 1) then vr_suffix = "_vr" - else + else vr_suffix = "" endif @@ -726,11 +726,11 @@ subroutine InitCold(this, bounds, cellorg_col, fsurdat) ! !DESCRIPTION: ! - Sets cold start values for time varying values. ! Initializes the following time varying variables: - ! conc_ch4_sat, conc_ch4_unsat, conc_o2_sat, conc_o2_unsat, + ! conc_ch4_sat, conc_ch4_unsat, conc_o2_sat, conc_o2_unsat, ! lake_soilc, o2stress, finunduated - ! - Sets variables for ch4 code that will not be input - ! from restart/inic file. - ! - Sets values for inactive CH4 columns to spval so that they will + ! - Sets variables for ch4 code that will not be input + ! from restart/inic file. + ! - Sets values for inactive CH4 columns to spval so that they will ! not be averaged in history file. ! ! !USES: @@ -742,18 +742,18 @@ subroutine InitCold(this, bounds, cellorg_col, fsurdat) use ch4varcon , only : finundation_mtd_ZWT_inversion use spmdMod , only : masterproc use fileutils , only : getfil - use ncdio_pio + use ncdio_pio ! ! !ARGUMENTS: class(ch4_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds real(r8) , intent(in) :: cellorg_col (bounds%begc:, 1:) character(len=*) , intent(in) :: fsurdat ! surface data file name ! ! !LOCAL VARIABLES: integer :: j ,g, l,c,p ! indices type(file_desc_t) :: ncid ! netcdf id - real(r8) ,pointer :: pH_in (:) ! read in - pH + real(r8) ,pointer :: pH_in (:) ! read in - pH character(len=256) :: locfn ! local file name logical :: readvar ! If read variable from file or not !----------------------------------------------------------------------- @@ -768,7 +768,7 @@ subroutine InitCold(this, bounds, cellorg_col, fsurdat) ! Methane code parameters for finundated - call getfil( fsurdat, locfn, 0 ) + call getfil( fsurdat, locfn, 0 ) call ncd_pio_openfile (ncid, trim(locfn), 0) ! pH factor for methane model @@ -800,8 +800,8 @@ subroutine InitCold(this, bounds, cellorg_col, fsurdat) do c = bounds%begc,bounds%endc ! To detect first year - this%annavg_somhr_col(c) = spval - this%annavg_finrw_col(c) = spval + this%annavg_somhr_col(c) = spval + this%annavg_finrw_col(c) = spval ! To detect file input this%qflx_surf_lag_col (c) = spval @@ -809,7 +809,7 @@ subroutine InitCold(this, bounds, cellorg_col, fsurdat) this%o2stress_unsat_col (c,:) = spval this%ch4stress_sat_col (c,:) = spval this%ch4stress_unsat_col(c,:) = spval - this%lake_soilc_col (c,:) = spval + this%lake_soilc_col (c,:) = spval ! The following variables need to be initialized for all columns, for the sake of ! DynamicColumnAdjustments @@ -975,7 +975,7 @@ subroutine InitCold(this, bounds, cellorg_col, fsurdat) ! totcolch4 Set to zero for inactive columns so that this can be used ! as an appropriate area-weighted gridcell average soil methane content. - this%totcolch4_col (c) = 0._r8 + this%totcolch4_col (c) = 0._r8 end if end do @@ -998,7 +998,7 @@ subroutine Restart( this, bounds, ncid, flag ) ! Read/Write biogeophysics information to/from restart file. ! ! !USES: - use ncdio_pio , only : ncd_double + use ncdio_pio , only : ncd_double use pio , only : file_desc_t use decompMod , only : bounds_type use restUtilMod @@ -1006,7 +1006,7 @@ subroutine Restart( this, bounds, ncid, flag ) ! ! !ARGUMENTS: class(ch4_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds type(file_desc_t), intent(inout) :: ncid ! netcdf id character(len=*), intent(in) :: flag ! 'read' or 'write' ! @@ -1385,7 +1385,7 @@ subroutine readParams ( ncid ) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%aereoxid=tempr else - ! value should never be used. + ! value should never be used. params_inst%aereoxid=nan endif @@ -1433,7 +1433,7 @@ subroutine readParams ( ncid ) call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%pHmax=tempr - + tString='pHmin' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) @@ -1457,21 +1457,21 @@ subroutine readParams ( ncid ) params_inst%k_m= 5.e-6_r8 * 1000._r8 ! FIX(FIX(SPM,032414),032414) can't be read off of param file. not bfb since it is a divide !params_inst%k_m=tempr - + tString='q10_ch4oxid' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%q10_ch4oxid=tempr - + tString='smp_crit' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%smp_crit=tempr - + tString='k_m_o2' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%k_m_o2 = 20.e-6_r8 * 1000._r8 + params_inst%k_m_o2 = 20.e-6_r8 * 1000._r8 ! FIX(FIX(SPM,032414),032414) can't be read off of param file. not bfb since it is a divide !params_inst%k_m_o2=tempr @@ -1492,17 +1492,17 @@ subroutine readParams ( ncid ) tString='scale_factor_aere' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%scale_factor_aere=tempr - + params_inst%scale_factor_aere=tempr + tString='nongrassporosratio' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%nongrassporosratio=tempr + params_inst%nongrassporosratio=tempr tString='unsat_aere_ratio' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%unsat_aere_ratio= 0.05_r8 / 0.3_r8 + params_inst%unsat_aere_ratio= 0.05_r8 / 0.3_r8 ! FIX(FIX(SPM,032414),032414) can't be read off of param file. not bfb since it is a divide !params_inst%unsat_aere_ratio=tempr @@ -1510,12 +1510,12 @@ subroutine readParams ( ncid ) call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%porosmin=tempr - + tString='vgc_max' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%vgc_max=tempr - + tString='satpow' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) @@ -1524,7 +1524,7 @@ subroutine readParams ( ncid ) tString='scale_factor_gasdiff' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%scale_factor_gasdiff=tempr + params_inst%scale_factor_gasdiff=tempr tString='scale_factor_liqdiff' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) @@ -1535,7 +1535,7 @@ subroutine readParams ( ncid ) call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%f_sat=tempr - + tString='qflxlagd' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) @@ -1545,27 +1545,27 @@ subroutine readParams ( ncid ) call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%highlatfact=tempr - + tString='q10lakebase' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%q10lakebase=tempr - + tString='atmch4' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%atmch4=tempr - + tString='rob' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%rob=tempr + params_inst%rob=tempr tString='capthick' call ncd_io(trim(tString),tempr, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) params_inst%capthick=tempr - + end subroutine readParams !----------------------------------------------------------------------- @@ -1638,7 +1638,7 @@ subroutine ch4_init_column_balance_check(bounds, num_nolakec, filter_nolakec, nu ! !USES: ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_lakec ! number of column lake points in column filter @@ -1680,7 +1680,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & use ch4varcon , only : finundation_mtd, finundation_mtd_h2osfc ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_soilc ! number of column soil points in column filter integer , intent(in) :: filter_soilc(:) ! column filter for soil points integer , intent(in) :: num_lakec ! number of column lake points in column filter @@ -1708,7 +1708,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & real(r8) , intent(in) :: annsum_npp( bounds%begp: ) ! annual sum NPP (gC/m2/yr) real(r8) , intent(in) :: rr ( bounds%begp: ) ! root respiration (fine root MR + total root GR) (gC/m2/s) type(hlm_fates_interface_type) , intent(inout) :: clm_fates - + ! ! !LOCAL VARIABLES: integer :: sat ! 0 = unsatured, 1 = saturated @@ -1724,13 +1724,13 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & real(r8) :: totalsat real(r8) :: totalunsat real(r8) :: dfsat - real(r8) :: rootfraction(bounds%begp:bounds%endp, 1:nlevgrnd) + real(r8) :: rootfraction(bounds%begp:bounds%endp, 1:nlevgrnd) real(r8) :: fsat_bef(bounds%begc:bounds%endc) ! finundated from previous timestep real(r8) :: errch4 ! g C / m^2 !real(r8) :: zwt_actual real(r8) :: qflxlags ! Time to lag qflx_surf_lag (s) - real(r8) :: redoxlag ! Redox time lag - real(r8) :: redoxlag_vertical ! Vertical redox lag time + real(r8) :: redoxlag ! Redox time lag + real(r8) :: redoxlag_vertical ! Vertical redox lag time real(r8) :: atmch4 ! Atmospheric CH4 mixing ratio to ! prescribe if not provided by the atmospheric model (= 1.7e-6_r8) (mol/mol) real(r8) :: redoxlags ! Redox time lag in s @@ -1747,43 +1747,43 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & SHR_ASSERT_ALL_FL((ubound(annsum_npp) == (/bounds%endp/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(rr) == (/bounds%endp/)), sourcefile, __LINE__) - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) + associate( & + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) + zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) + z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - forc_t => atm2lnd_inst%forc_t_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) - forc_pbot => atm2lnd_inst%forc_pbot_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - forc_po2 => atm2lnd_inst%forc_po2_grc , & ! Input: [real(r8) (:) ] O2 partial pressure (Pa) - forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] CO2 partial pressure (Pa) - forc_pch4 => atm2lnd_inst%forc_pch4_grc , & ! Input: [real(r8) (:) ] CH4 partial pressure (Pa) + forc_t => atm2lnd_inst%forc_t_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric temperature (Kelvin) + forc_pbot => atm2lnd_inst%forc_pbot_not_downscaled_grc , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) + forc_po2 => atm2lnd_inst%forc_po2_grc , & ! Input: [real(r8) (:) ] O2 partial pressure (Pa) + forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] CO2 partial pressure (Pa) + forc_pch4 => atm2lnd_inst%forc_pch4_grc , & ! Input: [real(r8) (:) ] CH4 partial pressure (Pa) - !zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - !zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) + !zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) + !zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevgrnd) rootfr_col => soilstate_inst%rootfr_col , & ! Output: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevgrnd) (p2c) frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) - tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) + snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) + tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) qflx_surf => waterfluxbulk_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] total surface runoff (mm H2O /s) - conc_o2_sat => ch4_inst%conc_o2_sat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2_sat => ch4_inst%conc_o2_sat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) totcolch4_bef_col => ch4_inst%totcolch4_bef_col , & ! Input: [real(r8) (:) ] column-level total methane in soil column, start of timestep (g C / m^2) totcolch4_bef_grc => ch4_inst%totcolch4_bef_grc , & ! Input: [real(r8) (:) ] gridcell-level total methane in soil column, start of timestep (g C / m^2) - grnd_ch4_cond_patch => ch4_inst%grnd_ch4_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for boundary layer [m/s] - grnd_ch4_cond_col => ch4_inst%grnd_ch4_cond_col , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] (p2c) - - ch4_surf_diff_sat => ch4_inst%ch4_surf_diff_sat_col , & ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) - ch4_surf_diff_unsat => ch4_inst%ch4_surf_diff_unsat_col , & ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) - ch4_surf_diff_lake => ch4_inst%ch4_surf_diff_lake_col , & ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) - ch4_surf_ebul_sat => ch4_inst%ch4_surf_ebul_sat_col , & ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_ebul_unsat => ch4_inst%ch4_surf_ebul_unsat_col , & ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_ebul_lake => ch4_inst%ch4_surf_ebul_lake_col , & ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_aere_sat => ch4_inst%ch4_surf_aere_sat_col , & ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) - ch4_surf_aere_unsat => ch4_inst%ch4_surf_aere_unsat_col , & ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) + grnd_ch4_cond_patch => ch4_inst%grnd_ch4_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for boundary layer [m/s] + grnd_ch4_cond_col => ch4_inst%grnd_ch4_cond_col , & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] (p2c) + + ch4_surf_diff_sat => ch4_inst%ch4_surf_diff_sat_col , & ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) + ch4_surf_diff_unsat => ch4_inst%ch4_surf_diff_unsat_col , & ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) + ch4_surf_diff_lake => ch4_inst%ch4_surf_diff_lake_col , & ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) + ch4_surf_ebul_sat => ch4_inst%ch4_surf_ebul_sat_col , & ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) + ch4_surf_ebul_unsat => ch4_inst%ch4_surf_ebul_unsat_col , & ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) + ch4_surf_ebul_lake => ch4_inst%ch4_surf_ebul_lake_col , & ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) + ch4_surf_aere_sat => ch4_inst%ch4_surf_aere_sat_col , & ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) + ch4_surf_aere_unsat => ch4_inst%ch4_surf_aere_unsat_col , & ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) ch4_oxid_depth_sat => ch4_inst%ch4_oxid_depth_sat_col , & ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) ch4_oxid_depth_unsat => ch4_inst%ch4_oxid_depth_unsat_col , & ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) ch4_oxid_depth_lake => ch4_inst%ch4_oxid_depth_lake_col , & ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) @@ -1791,23 +1791,23 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & ch4_prod_depth_unsat => ch4_inst%ch4_prod_depth_unsat_col , & ! Output: [real(r8) (:,:) ] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) ch4_prod_depth_lake => ch4_inst%ch4_prod_depth_lake_col , & ! Output: [real(r8) (:,:) ] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) lake_soilc => ch4_inst%lake_soilc_col , & ! Output: [real(r8) (:,:) ] total soil organic matter found in level (g C / m^3) (nlevsoi) - conc_ch4_sat => ch4_inst%conc_ch4_sat_col , & ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_ch4_unsat => ch4_inst%conc_ch4_unsat_col , & ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_ch4_lake => ch4_inst%conc_ch4_lake_col , & ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2_lake => ch4_inst%conc_o2_lake_col , & ! Output: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4_sat => ch4_inst%conc_ch4_sat_col , & ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4_unsat => ch4_inst%conc_ch4_unsat_col , & ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4_lake => ch4_inst%conc_ch4_lake_col , & ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2_lake => ch4_inst%conc_o2_lake_col , & ! Output: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) ch4_dfsat_flux => ch4_inst%ch4_dfsat_flux_col , & ! Output: [real(r8) (:) ] CH4 flux to atm due to decreasing finundated (kg C/m^2/s) [+] - zwt_ch4_unsat => ch4_inst%zwt_ch4_unsat_col , & ! Output: [real(r8) (:) ] depth of water table for unsaturated fraction (m) + zwt_ch4_unsat => ch4_inst%zwt_ch4_unsat_col , & ! Output: [real(r8) (:) ] depth of water table for unsaturated fraction (m) totcolch4_col => ch4_inst%totcolch4_col , & ! Output: [real(r8) (:) ] column-level total methane in soil column (g C / m^2) totcolch4_grc => ch4_inst%totcolch4_grc , & ! Output: [real(r8) (:) ] gridcell-level total methane in soil column (g C / m^2) finundated => ch4_inst%finundated_col , & ! Output: [real(r8) (:) ] fractional inundated area in soil column (excluding dedicated wetland columns) finundated_pre_snow => ch4_inst%finundated_pre_snow_col , & ! Output: [real(r8) (:) ] fractional inundated area in soil column (excluding dedicated wetland columns) before snow ch4_first_time_grc => ch4_inst%ch4_first_time_grc , & ! Output: [logical (:) ] grc whether this is the first time step that includes ch4 qflx_surf_lag => ch4_inst%qflx_surf_lag_col , & ! Output: [real(r8) (:) ] time-lagged surface runoff (mm H2O /s) - finundated_lag => ch4_inst%finundated_lag_col , & ! Output: [real(r8) (:) ] time-lagged fractional inundated area + finundated_lag => ch4_inst%finundated_lag_col , & ! Output: [real(r8) (:) ] time-lagged fractional inundated area layer_sat_lag => ch4_inst%layer_sat_lag_col , & ! Output: [real(r8) (:,:) ] Lagged saturation status of soil layer in the unsaturated zone (1 = sat) - c_atm => ch4_inst%c_atm_grc , & ! Output: [real(r8) (:,:) ] CH4, O2, CO2 atmospheric conc (mol/m3) + c_atm => ch4_inst%c_atm_grc , & ! Output: [real(r8) (:,:) ] CH4, O2, CO2 atmospheric conc (mol/m3) ch4co2f => ch4_inst%ch4co2f_grc , & ! Output: [real(r8) (:) ] gridcell CO2 production from CH4 oxidation (g C/m**2/s) - ch4prodg => ch4_inst%ch4prodg_grc , & ! Output: [real(r8) (:) ] gridcell average CH4 production (g C/m^2/s) + ch4prodg => ch4_inst%ch4prodg_grc , & ! Output: [real(r8) (:) ] gridcell average CH4 production (g C/m^2/s) ch4_surf_flux_tot_col => ch4_inst%ch4_surf_flux_tot_col , & ! Output: [real(r8) (:) ] col CH4 flux to atm. (kg C/m**2/s) ch4_surf_flux_tot_grc => lnd2atm_inst%ch4_surf_flux_tot_grc , & ! Output: [real(r8) (:) ] grc CH4 flux to atm. (kg C/m**2/s) @@ -1901,7 +1901,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & else finundated(c) = finundated_pre_snow(c) !If snow_depth>0, keep finundated from the previous time step of snow season. (by Xiyan Xu, 05/2016) end if - + ! Update lagged finundated for redox calculation if (redoxlags > 0._r8) then finundated_lag(c) = finundated_lag(c) * exp(-dtime/redoxlags) & @@ -1952,8 +1952,8 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & if (nlevdecomp == 1) then nc = bounds%clump_index - - ! Set rootfraction to spval for non-veg points, unless patch%wtcol > 0.99, + + ! Set rootfraction to spval for non-veg points, unless patch%wtcol > 0.99, ! in which case set it equal to uniform dist. do fp = 1, num_soilp @@ -1978,12 +1978,12 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & end do end if end do - + call p2c (bounds, nlevgrnd, & rootfraction(bounds%begp:bounds%endp, :), & rootfr_col(bounds%begc:bounds%endc, :), & 'unity') - + do j=1, nlevsoi do fc = 1, num_soilc c = filter_soilc(fc) @@ -2080,7 +2080,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & atm2lnd_inst, temperature_inst, lakestate_inst, soilstate_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, & ch4_inst) - ! Solve CH4 reaction/diffusion equation + ! Solve CH4 reaction/diffusion equation ! Competition for oxygen will occur here. call ch4_tran (bounds, & num_soilc, filter_soilc, & @@ -2127,7 +2127,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, & atm2lnd_inst, temperature_inst, lakestate_inst, soilstate_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, & ch4_inst) - ! Solve CH4 reaction/diffusion equation + ! Solve CH4 reaction/diffusion equation ! Competition for oxygen will occur here. call ch4_tran (bounds, num_lakec, filter_lakec, & jwt(begc:endc), dtime_ch4, sat, lake, & @@ -2357,7 +2357,7 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, & use pftconMod , only: noveg ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_methc ! number of column soil points in column filter integer , intent(in) :: filter_methc(:) ! column filter for soil points integer , intent(in) :: num_methp ! number of soil points in patch filter @@ -2385,16 +2385,16 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, & real(r8) :: q10lakebase ! (K) base temperature for lake CH4 production real(r8) :: partition_z real(r8) :: mino2lim ! minimum anaerobic decomposition rate as a fraction of potential aerobic rate - real(r8) :: q10ch4 ! additional Q10 for methane production ABOVE the soil decomposition temperature relationship + real(r8) :: q10ch4 ! additional Q10 for methane production ABOVE the soil decomposition temperature relationship real(r8) :: q10ch4base ! temperature at which the effective f_ch4 actually equals the constant f_ch4 real(r8) :: f_ch4 ! ratio of CH4 production to total C mineralization real(r8) :: rootlitfrac ! Fraction of soil organic matter associated with roots real(r8) :: cnscalefactor ! scale factor on CN decomposition for assigning methane flux real(r8) :: lake_decomp_fact ! Base decomposition rate (1/s) at 25C - ! added by Lei Meng to account for pH influence of CH4 production - real(r8) :: pHmax - real(r8) :: pHmin + ! added by Lei Meng to account for pH influence of CH4 production + real(r8) :: pHmax + real(r8) :: pHmin real(r8) :: pH_fact_ch4 ! pH factor in methane production ! Factors for methanogen temperature dependence being greater than soil aerobes @@ -2418,44 +2418,44 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, & SHR_ASSERT_ALL_FL((ubound(rr) == (/bounds%endp/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(jwt) == (/bounds%endc/)), sourcefile, __LINE__) - associate( & - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) + associate( & + wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) + z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) + zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) + t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - crootfr => soilstate_inst%crootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots for carbon in each soil layer (nlevsoi) - rootfr_col => soilstate_inst%rootfr_col , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevsoi) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + crootfr => soilstate_inst%crootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots for carbon in each soil layer (nlevsoi) + rootfr_col => soilstate_inst%rootfr_col , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevsoi) somhr => soilbiogeochem_carbonflux_inst%somhr_col , & ! Input: [real(r8) (:) ] (gC/m2/s) soil organic matter heterotrophic respiration - lithr => soilbiogeochem_carbonflux_inst%lithr_col , & ! Input: [real(r8) (:) ] (gC/m2/s) litter heterotrophic respiration + lithr => soilbiogeochem_carbonflux_inst%lithr_col , & ! Input: [real(r8) (:) ] (gC/m2/s) litter heterotrophic respiration hr_vr => soilbiogeochem_carbonflux_inst%hr_vr_col , & ! Input: [real(r8) (:,:) ] total vertically-resolved het. resp. from decomposing C pools (gC/m3/s) o_scalar => soilbiogeochem_carbonflux_inst%o_scalar_col , & ! Input: [real(r8) (:,:) ] fraction by which decomposition is limited by anoxia - fphr => soilbiogeochem_carbonflux_inst%fphr_col , & ! Input: [real(r8) (:,:) ] fraction of potential heterotrophic respiration + fphr => soilbiogeochem_carbonflux_inst%fphr_col , & ! Input: [real(r8) (:,:) ] fraction of potential heterotrophic respiration - pot_f_nit_vr => soilbiogeochem_nitrogenflux_inst%pot_f_nit_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3/s) potential soil nitrification flux + pot_f_nit_vr => soilbiogeochem_nitrogenflux_inst%pot_f_nit_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3/s) potential soil nitrification flux - finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area in soil column - pH => ch4_inst%pH_col , & ! Input: [real(r8) (:) ] soil water pH + finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area in soil column + pH => ch4_inst%pH_col , & ! Input: [real(r8) (:) ] soil water pH lake_soilc => ch4_inst%lake_soilc_col , & ! Input: [real(r8) (:,:) ] total soil organic matter found in level (g C / m^3) (nlevsoi) - annavg_finrw => ch4_inst%annavg_finrw_col , & ! Input: [real(r8) (:) ] respiration-weighted annual average of finundated - finundated_lag => ch4_inst%finundated_lag_col , & ! Input: [real(r8) (:) ] time-lagged fractional inundated area + annavg_finrw => ch4_inst%annavg_finrw_col , & ! Input: [real(r8) (:) ] respiration-weighted annual average of finundated + finundated_lag => ch4_inst%finundated_lag_col , & ! Input: [real(r8) (:) ] time-lagged fractional inundated area layer_sat_lag => ch4_inst%layer_sat_lag_col , & ! Input: [real(r8) (: ,:) ] Lagged saturation status of soil layer in the unsaturated zone (1 = sat) sif => ch4_inst%sif_col & ! Output: [real(r8) (:) ] (unitless) ratio applied to sat. prod. to account for seasonal inundation ) if (sat == 0) then ! unsaturated - conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) ch4_prod_depth => ch4_inst%ch4_prod_depth_unsat_col ! Output: [real(r8) (:,:)] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) o2_decomp_depth => ch4_inst%o2_decomp_depth_unsat_col ! Output: [real(r8) (:,:)] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) co2_decomp_depth => ch4_inst%co2_decomp_depth_unsat_col ! Output: [real(r8) (:,:)] CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) else ! saturated - conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) ch4_prod_depth => ch4_inst%ch4_prod_depth_sat_col ! Output: [real(r8) (:,:)] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) o2_decomp_depth => ch4_inst%o2_decomp_depth_sat_col ! Output: [real(r8) (:,:)] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) co2_decomp_depth => ch4_inst%co2_decomp_depth_sat_col ! Output: [real(r8) (:,:)] CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) @@ -2499,18 +2499,18 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, & end if end if end do - + if(use_fates) then nc = bounds%clump_index - do s = 1,clm_fates%fates(nc)%nsites + do s = 1,clm_fates%fates(nc)%nsites c = clm_fates%f2hmap(nc)%fcolumn(s) do j=1, clm_fates%fates(nc)%bc_in(s)%nlevsoil rr_vr(c,j) = clm_fates%fates(nc)%bc_out(s)%root_resp(j) end do end do end if - - + + end if partition_z = 1._r8 @@ -2613,7 +2613,7 @@ subroutine ch4_prod (bounds, num_methc, filter_methc, num_methp, & ! If switched on, use pH factor for production based on spatial pH data defined in surface data. if (.not. lake .and. usephfact .and. pH(c) > pHmin .and.pH(c) < pHmax) then pH_fact_ch4 = 10._r8**(-0.2235_r8*pH(c)*pH(c) + 2.7727_r8*pH(c) - 8.6_r8) - ! fitted function using data from Dunfield et al. 1993 + ! fitted function using data from Dunfield et al. 1993 ! Strictly less than one, with optimum at 6.5 ! From Lei Meng f_ch4_adj = f_ch4_adj * pH_fact_ch4 @@ -2698,12 +2698,12 @@ subroutine ch4_oxid (bounds, & ! !DESCRIPTION: ! Oxidation is based on double Michaelis-Mentin kinetics, and is adjusted for low soil moisture. ! Oxidation will be limited by available oxygen in ch4_tran. - + ! !USES: use clm_time_manager, only : get_step_size_real ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_methc ! number of column soil points in column filter integer , intent(in) :: filter_methc(:) ! column filter for soil points integer , intent(in) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] @@ -2731,46 +2731,46 @@ subroutine ch4_oxid (bounds, & real(r8):: vmax_eff ! effective vmax ! ch4 oxidation parameters real(r8) :: vmax_ch4_oxid ! oxidation rate constant (= 45.e-6_r8 * 1000._r8 / 3600._r8) [mol/m3-w/s]; - real(r8) :: k_m ! Michaelis-Menten oxidation rate constant for CH4 concentration + real(r8) :: k_m ! Michaelis-Menten oxidation rate constant for CH4 concentration real(r8) :: q10_ch4oxid ! Q10 oxidation constant real(r8) :: smp_crit ! Critical soil moisture potential real(r8) :: k_m_o2 ! Michaelis-Menten oxidation rate constant for O2 concentration real(r8) :: k_m_unsat ! Michaelis-Menten oxidation rate constant for CH4 concentration - real(r8) :: vmax_oxid_unsat ! (= 45.e-6_r8 * 1000._r8 / 3600._r8 / 10._r8) [mol/m3-w/s] + real(r8) :: vmax_oxid_unsat ! (= 45.e-6_r8 * 1000._r8 / 3600._r8 / 10._r8) [mol/m3-w/s] ! - real(r8), pointer :: ch4_oxid_depth(:,:) - real(r8), pointer :: o2_oxid_depth(:,:) - real(r8), pointer :: co2_oxid_depth(:,:) - real(r8), pointer :: o2_decomp_depth(:,:) - real(r8), pointer :: conc_o2(:,:) - real(r8), pointer :: conc_ch4(:,:) + real(r8), pointer :: ch4_oxid_depth(:,:) + real(r8), pointer :: o2_oxid_depth(:,:) + real(r8), pointer :: co2_oxid_depth(:,:) + real(r8), pointer :: o2_decomp_depth(:,:) + real(r8), pointer :: conc_o2(:,:) + real(r8), pointer :: conc_ch4(:,:) !----------------------------------------------------------------------- ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(jwt) == (/bounds%endc/)), sourcefile, __LINE__) - associate( & + associate( & h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - smp_l => soilstate_inst%smp_l_col , & ! Input: [real(r8) (: ,:) ] soil matrix potential [mm] - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + smp_l => soilstate_inst%smp_l_col , & ! Input: [real(r8) (: ,:) ] soil matrix potential [mm] + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - t_soisno => temperature_inst%t_soisno_col & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) + t_soisno => temperature_inst%t_soisno_col & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) ) if (sat == 0) then ! unsaturated ch4_oxid_depth => ch4_inst%ch4_oxid_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) o2_oxid_depth => ch4_inst%o2_oxid_depth_unsat_col ! Output: [real(r8) (:,:)] O2 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) co2_oxid_depth => ch4_inst%co2_oxid_depth_unsat_col ! Output: [real(r8) (:,:)] CO2 production rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) o2_decomp_depth => ch4_inst%o2_decomp_depth_unsat_col ! Output: [real(r8) (:,:)] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) else ! saturated ch4_oxid_depth => ch4_inst%ch4_oxid_depth_sat_col ! Output: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) o2_oxid_depth => ch4_inst%o2_oxid_depth_sat_col ! Output: [real(r8) (:,:)] O2 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) co2_oxid_depth => ch4_inst%co2_oxid_depth_sat_col ! Output: [real(r8) (:,:)] CO2 production rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) - conc_ch4 => ch4_inst%conc_ch4_sat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4 => ch4_inst%conc_ch4_sat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) o2_decomp_depth => ch4_inst%o2_decomp_depth_sat_col ! Output: [real(r8) (:,:)] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) endif @@ -2862,7 +2862,7 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, & use ch4varcon , only : transpirationloss, use_aereoxid_prog ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_methc ! number of column soil points in column filter integer , intent(in) :: filter_methc(:) ! column filter for soil points integer , intent(in) :: num_methp ! number of soil points in patch filter @@ -2879,19 +2879,19 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, & type(waterfluxbulk_type) , intent(in) :: waterfluxbulk_inst type(ch4_type) , intent(inout) :: ch4_inst type(hlm_fates_interface_type), intent(inout) :: clm_fates - + ! ! !LOCAL VARIABLES: integer :: nc ! clump index integer :: p,c,g,j,s ! indices integer :: fc,fp ! soil filter column index - integer :: itype ! temporary + integer :: itype ! temporary ! ch4 aerenchyma parameters integer :: pf ! fates patch index integer :: nlevsoil_f ! number of fates soil layers - real(r8) :: aereoxid ! fraction of methane flux entering aerenchyma rhizosphere + real(r8) :: aereoxid ! fraction of methane flux entering aerenchyma rhizosphere real(r8) :: tranloss(1:nlevsoi) ! loss due to transpiration (mol / m3 /s) - real(r8) :: aere(1:nlevsoi) + real(r8) :: aere(1:nlevsoi) real(r8) :: oxaere(1:nlevsoi) ! (mol / m3 /s) real(r8) :: rootfr_vr(1:nlevsoi) ! Root fraction over depth real(r8) :: aeretran @@ -2908,51 +2908,51 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, & ! These pointers help us swap between saturated and unsaturated boundary conditions real(r8), parameter :: smallnumber = 1.e-12_r8 - real(r8), pointer :: ch4_aere_depth(:,:) - real(r8), pointer :: ch4_tran_depth(:,:) - real(r8), pointer :: o2_aere_depth(:,:) - real(r8), pointer :: ch4_oxid_depth(:,:) - real(r8), pointer :: ch4_prod_depth(:,:) - real(r8), pointer :: conc_o2(:,:) - real(r8), pointer :: conc_ch4(:,:) + real(r8), pointer :: ch4_aere_depth(:,:) + real(r8), pointer :: ch4_tran_depth(:,:) + real(r8), pointer :: o2_aere_depth(:,:) + real(r8), pointer :: ch4_oxid_depth(:,:) + real(r8), pointer :: ch4_prod_depth(:,:) + real(r8), pointer :: conc_o2(:,:) + real(r8), pointer :: conc_ch4(:,:) !----------------------------------------------------------------------- ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(annsum_npp) == (/bounds%endp/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(jwt) == (/bounds%endc/)), sourcefile, __LINE__) - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) - elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + associate( & + z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) + wtcol => patch%wtcol , & ! Input: [real(r8) (:) ] weight (relative to column) + elai => canopystate_inst%elai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index with burying by snow + t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) rootr => soilstate_inst%rootr_patch , & ! Input: [real(r8) (:,:) ] effective fraction of roots in each soil layer (SMS method only) (nlevgrnd) - rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevsoi) + rootfr => soilstate_inst%rootfr_patch , & ! Input: [real(r8) (:,:) ] fraction of roots in each soil layer (nlevsoi) h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - qflx_tran_veg => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) - canopy_cond => energyflux_inst%canopy_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for canopy [m/s] - annavg_agnpp => ch4_inst%annavg_agnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average aboveground NPP - annavg_bgnpp => ch4_inst%annavg_bgnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average belowground NPP - grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for boundary layer [m/s] - c_atm => ch4_inst%c_atm_grc & ! Input: [real(r8) (: ,:) ] CH4, O2, CO2 atmospheric conc (mol/m3) + qflx_tran_veg => waterfluxbulk_inst%qflx_tran_veg_patch , & ! Input: [real(r8) (:) ] vegetation transpiration (mm H2O/s) (+ = to atm) + canopy_cond => energyflux_inst%canopy_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for canopy [m/s] + annavg_agnpp => ch4_inst%annavg_agnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average aboveground NPP + annavg_bgnpp => ch4_inst%annavg_bgnpp_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) annual average belowground NPP + grnd_ch4_cond => ch4_inst%grnd_ch4_cond_patch , & ! Input: [real(r8) (:) ] tracer conductance for boundary layer [m/s] + c_atm => ch4_inst%c_atm_grc & ! Input: [real(r8) (: ,:) ] CH4, O2, CO2 atmospheric conc (mol/m3) ) if (sat == 0) then ! unsaturated ch4_aere_depth => ch4_inst%ch4_aere_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) ch4_tran_depth => ch4_inst%ch4_tran_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 loss rate via transpiration in each soil layer (mol/m3/s) (nlevsoi) o2_aere_depth => ch4_inst%o2_aere_depth_unsat_col ! Output: [real(r8) (:,:)] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2 => ch4_inst%conc_o2_unsat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) ch4_oxid_depth => ch4_inst%ch4_oxid_depth_unsat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) ch4_prod_depth => ch4_inst%ch4_prod_depth_unsat_col ! Input: [real(r8) (:,:)] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) else ! saturated ch4_aere_depth => ch4_inst%ch4_aere_depth_sat_col ! Output: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) ch4_tran_depth => ch4_inst%ch4_tran_depth_sat_col ! Output: [real(r8) (:,:)] CH4 loss rate via transpiration in each soil layer (mol/m3/s) (nlevsoi) o2_aere_depth => ch4_inst%o2_aere_depth_sat_col ! Output: [real(r8) (:,:)] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - conc_ch4 => ch4_inst%conc_ch4_sat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4 => ch4_inst%conc_ch4_sat_col ! Input: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2 => ch4_inst%conc_o2_sat_col ! Input: [real(r8) (:,:)] O2 conc in each soil layer (mol/m3) (nlevsoi) ch4_oxid_depth => ch4_inst%ch4_oxid_depth_sat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) ch4_prod_depth => ch4_inst%ch4_prod_depth_sat_col ! Input: [real(r8) (:,:)] production of CH4 in each soil layer (nlevsoi) (mol/m3/s) endif @@ -2998,12 +2998,12 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, & annavg_agnpp_ptr => ch4_inst%annavg_agnpp_patch(p) annavg_bgnpp_ptr => ch4_inst%annavg_bgnpp_patch(p) rootfr_vr(1:nlevsoi) = rootfr(p,1:nlevsoi) - + else - + pf = p-col%patchi(c) s = clm_fates%f2hmap(nc)%hsites(c) - + wfrac = clm_fates%fates(nc)%bc_out(s)%woody_frac_aere_pa(pf) poros_tiller = wfrac*0.3_r8 + (1._r8-wfrac)*0.3_r8*params_inst%nongrassporosratio if(patch%is_bareground(p)) then @@ -3017,15 +3017,15 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, & nlevsoil_f = clm_fates%fates(nc)%bc_in(s)%nlevsoil rootfr_vr(1:nlevsoi) = 0._r8 rootfr_vr(1:nlevsoil_f) = clm_fates%fates(nc)%bc_out(s)%rootfr_pa(pf,1:nlevsoil_f) - + end if - call SiteOxAere(is_vegetated, watsat(c,1:nlevsoi), h2osoi_vol(c,1:nlevsoi), t_soisno(c,1:nlevsoi), & + call SiteOxAere(is_vegetated, watsat(c,1:nlevsoi), h2osoi_vol(c,1:nlevsoi), t_soisno(c,1:nlevsoi), & conc_ch4(c,1:nlevsoi), rootr(p,1:nlevsoi), qflx_tran_veg(p), jwt(c), & annsum_npp_ptr,annavg_agnpp_ptr, annavg_bgnpp_ptr, & elai(p), poros_tiller, rootfr_vr(1:nlevsoi), & grnd_ch4_cond(p), conc_o2(c,1:nlevsoi), c_atm(g,1:2), & - z(c,1:nlevsoi), dz(c,1:nlevsoi), sat, & + z(c,1:nlevsoi), dz(c,1:nlevsoi), sat, & tranloss(1:nlevsoi), & ! Out aere(1:nlevsoi), & ! Out oxaere(1:nlevsoi)) ! Out @@ -3047,11 +3047,11 @@ subroutine ch4_aere (bounds, num_methc, filter_methc, num_methp, filter_methp, & end subroutine ch4_aere !-------------------------------------------------------------------------------------- - - subroutine SiteOxAere(is_vegetated, & - watsat, & + + subroutine SiteOxAere(is_vegetated, & + watsat, & h2osoi_vol, & - t_soisno, & + t_soisno, & conc_ch4, & rootr, & qflx_tran_veg, & @@ -3070,7 +3070,7 @@ subroutine SiteOxAere(is_vegetated, & sat, & tranloss, & ! Out aere, & ! Out - oxaere) ! Out + oxaere) ! Out use clm_varcon , only : rpi @@ -3080,26 +3080,26 @@ subroutine SiteOxAere(is_vegetated, & ! !DESCRIPTION: ! Site(column) level fluxes for O2 gain rate via ! aerenchyma and ch4 losss rates from transpiration - + ! Arguments (in) - + logical, intent(in) :: is_vegetated real(r8), intent(in) :: watsat(:) ! volumetric soil water at saturation (porosity) real(r8), intent(in) :: h2osoi_vol(:) ! volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - real(r8), intent(in) :: t_soisno(:) ! soil temperature (Kelvin) + real(r8), intent(in) :: t_soisno(:) ! soil temperature (Kelvin) real(r8), intent(in) :: conc_ch4(:) ! CH4 conc in each soil layer (mol/m3) real(r8), intent(in) :: rootr(:) ! effective fraction of roots in each soil layer - real(r8), intent(in) :: qflx_tran_veg ! vegetation transpiration (mm H2O/s) (+ = to atm) + real(r8), intent(in) :: qflx_tran_veg ! vegetation transpiration (mm H2O/s) (+ = to atm) integer, intent(in) :: jwt ! index of the soil layer right above the water table (-) [col] real(r8), intent(in) :: annsum_npp ! annual sum NPP (gC/m2/yr) - real(r8), intent(in) :: annavg_agnpp ! (gC/m2/s) annual average aboveground NPP - real(r8), intent(in) :: annavg_bgnpp ! (gC/m2/s) annual average belowground NPP - real(r8), intent(in) :: elai ! one-sided leaf area index with burying by snow + real(r8), intent(in) :: annavg_agnpp ! (gC/m2/s) annual average aboveground NPP + real(r8), intent(in) :: annavg_bgnpp ! (gC/m2/s) annual average belowground NPP + real(r8), intent(in) :: elai ! one-sided leaf area index with burying by snow real(r8) :: poros_tiller real(r8), intent(in) :: rootfr(:) ! fraction of roots in each soil layer - real(r8), intent(in) :: grnd_ch4_cond ! tracer conductance for boundary layer [m/s] + real(r8), intent(in) :: grnd_ch4_cond ! tracer conductance for boundary layer [m/s] real(r8), intent(in) :: conc_o2(:) ! O2 conc in each soil layer (mol/m3) - real(r8), intent(in) :: c_atm(:) ! CH4 atmospheric conc (mol/m3) + real(r8), intent(in) :: c_atm(:) ! CH4 atmospheric conc (mol/m3) real(r8), intent(in) :: z(:) ! Soil layer depth [m] real(r8), intent(in) :: dz(:) ! Soil layer thickness [m] integer, intent(in) :: sat ! 0 == unsaturated; 1 = saturated @@ -3107,14 +3107,14 @@ subroutine SiteOxAere(is_vegetated, & ! Arguments (out) real(r8), intent(out) :: tranloss(:) real(r8), intent(out) :: aere(:) - real(r8), intent(out) :: oxaere(:) + real(r8), intent(out) :: oxaere(:) integer :: j,pf real(r8) :: oxdiffus real(r8) :: area_tiller ! cross-sectional area of tillers (m^2/m^2) real(r8) :: diffus_aere ! gas diffusivity through aerenchyma (m^2/s) - real(r8) :: m_tiller - real(r8) :: n_tiller + real(r8) :: m_tiller + real(r8) :: n_tiller real(r8) :: h2osoi_vol_min real(r8) :: k_h_cc, k_h_inv real(r8) :: anpp, nppratio @@ -3211,7 +3211,7 @@ subroutine SiteOxAere(is_vegetated, & return end subroutine SiteOxAere - + !----------------------------------------------------------------------- subroutine ch4_ebul (bounds, & num_methc, filter_methc, & @@ -3220,17 +3220,17 @@ subroutine ch4_ebul (bounds, & ch4_inst) ! ! !DESCRIPTION: - ! Bubbling is based on temperature & pressure dependent solubility (k_h_cc), + ! Bubbling is based on temperature & pressure dependent solubility (k_h_cc), ! with assumed proportion of bubbles ! which are CH4, and assumed early nucleation at vgc_max sat (Wania). ! Bubbles are released to the water table surface in ch4_tran. ! !USES: use clm_time_manager , only : get_step_size_real - use LakeCon + use LakeCon ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_methc ! number of column soil points in column filter integer , intent(in) :: filter_methc(:) ! column filter for soil points integer , intent(in) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] @@ -3238,7 +3238,7 @@ subroutine ch4_ebul (bounds, & logical , intent(in) :: lake ! function called with lake filter type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(temperature_type) , intent(in) :: temperature_inst - type(lakestate_type) , intent(in) :: lakestate_inst + type(lakestate_type) , intent(in) :: lakestate_inst type(soilstate_type) , intent(in) :: soilstate_inst type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst @@ -3251,9 +3251,9 @@ subroutine ch4_ebul (bounds, & real(r8) :: dtime ! land model time step (sec) real(r8) :: vgc ! volumetric CH4 content (m3 CH4/m3 pore air) real(r8) :: vgc_min ! minimum aqueous CH4 content when ebullition ceases - real(r8) :: k_h_inv ! - real(r8) :: k_h ! - real(r8) :: k_h_cc ! + real(r8) :: k_h_inv ! + real(r8) :: k_h ! + real(r8) :: k_h_cc ! real(r8) :: pressure! sum atmospheric and hydrostatic pressure real(r8) :: bubble_f! CH4 content in gas bubbles (Kellner et al. 2006) real(r8) :: ebul_timescale @@ -3268,35 +3268,35 @@ subroutine ch4_ebul (bounds, & ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(jwt) == (/bounds%endc/)), sourcefile, __LINE__) - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] soil layer depth (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - lakedepth => col%lakedepth , & ! Input: [real(r8) (:) ] column lake depth (m) + associate( & + z => col%z , & ! Input: [real(r8) (:,:) ] soil layer depth (m) + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) + zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) + lakedepth => col%lakedepth , & ! Input: [real(r8) (:) ] column lake depth (m) - forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) + forc_pbot => atm2lnd_inst%forc_pbot_downscaled_col , & ! Input: [real(r8) (:) ] atmospheric pressure (Pa) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) + t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) - lake_icefrac => lakestate_inst%lake_icefrac_col , & ! Input: [real(r8) (:,:) ] mass fraction of lake layer that is frozen + lake_icefrac => lakestate_inst%lake_icefrac_col , & ! Input: [real(r8) (:,:) ] mass fraction of lake layer that is frozen - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - h2osfc => waterstatebulk_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) + h2osfc => waterstatebulk_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) ) if (sat == 0) then ! unsaturated ch4_ebul_depth => ch4_inst%ch4_ebul_depth_unsat_col ! Output: [real(r8) (:,:)] CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - ch4_ebul_total => ch4_inst%ch4_ebul_total_unsat_col ! Output: [real(r8) (:)] Total column CH4 ebullition (mol/m2/s) - conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Output: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) + ch4_ebul_total => ch4_inst%ch4_ebul_total_unsat_col ! Output: [real(r8) (:)] Total column CH4 ebullition (mol/m2/s) + conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Output: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) ch4_aere_depth => ch4_inst%ch4_aere_depth_unsat_col ! Input: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) ch4_oxid_depth => ch4_inst%ch4_oxid_depth_unsat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) else ! saturated ch4_ebul_depth => ch4_inst%ch4_ebul_depth_sat_col ! Output: [real(r8) (:,:)] CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - ch4_ebul_total => ch4_inst%ch4_ebul_total_sat_col ! Output: [real(r8) (:)] Total column CH4 ebullition (mol/m2/s) - conc_ch4 => ch4_inst%conc_ch4_sat_col ! Output: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) + ch4_ebul_total => ch4_inst%ch4_ebul_total_sat_col ! Output: [real(r8) (:)] Total column CH4 ebullition (mol/m2/s) + conc_ch4 => ch4_inst%conc_ch4_sat_col ! Output: [real(r8) (:,:)] CH4 conc in each soil layer (mol/m3) (nlevsoi) ch4_aere_depth => ch4_inst%ch4_aere_depth_sat_col ! Input: [real(r8) (:,:)] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) ch4_oxid_depth => ch4_inst%ch4_oxid_depth_sat_col ! Input: [real(r8) (:,:)] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) endif @@ -3318,7 +3318,7 @@ subroutine ch4_ebul (bounds, & k_h_inv = exp(-c_h_inv(1) * (1._r8 / t_soisno(c,j) - 1._r8 / kh_tbase) + log (kh_theta(1))) ! (4.12 Wania) (atm.L/mol) k_h = 1._r8 / k_h_inv ! (mol/L.atm) - k_h_cc = t_soisno(c,j) * k_h * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)] + k_h_cc = t_soisno(c,j) * k_h * rgasLatm ! (4.21) Wania [(mol/m3w) / (mol/m3g)] if (.not. lake) then pressure = forc_pbot(c) + denh2o * grav * (z(c,j)-zi(c,jwt(c))) ! (Pa) @@ -3376,7 +3376,7 @@ subroutine ch4_tran (bounds, & use ch4varcon , only : ch4frzout, use_aereoxid_prog ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_methc ! number of column soil points in column filter integer , intent(in) :: filter_methc(:) ! column filter for soil points integer , intent(in) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] @@ -3405,7 +3405,7 @@ subroutine ch4_tran (bounds, & real(r8) :: diffus (bounds%begc:bounds%endc,0:nlevsoi) ! diffusivity (m2/s) real(r8) :: k_h_inv ! 1/Henry's Law Constant in Latm/mol real(r8) :: k_h_cc(bounds%begc:bounds%endc,0:nlevsoi,ngases) ! ratio of mol/m3 in liquid to mol/m3 in gas - real(r8) :: dzj ! + real(r8) :: dzj ! real(r8) :: dp1_zp1 (bounds%begc:bounds%endc,0:nlevsoi) ! diffusivity/delta_z for next j real(r8) :: dm1_zm1 (bounds%begc:bounds%endc,0:nlevsoi) ! diffusivity/delta_z for previous j real(r8) :: t_soisno_c ! soil temperature (C) (-nlevsno+1:nlevsoi) @@ -3440,24 +3440,24 @@ subroutine ch4_tran (bounds, & real(r8) :: scale_factor_gasdiff ! For sensitivity tests; convection would allow this to be > 1 real(r8) :: scale_factor_liqdiff ! For sensitivity tests; convection would allow this to be > 1 real(r8) :: organic_max ! organic matter content (kg/m3) where soil is assumed to act like peat - real(r8) :: aereoxid ! fraction of methane flux entering aerenchyma rhizosphere - - real(r8), pointer :: ch4_prod_depth (:,:) - real(r8), pointer :: ch4_oxid_depth (:,:) - real(r8), pointer :: ch4_aere_depth (:,:) - real(r8), pointer :: ch4_surf_aere (:) - real(r8), pointer :: ch4_ebul_depth (:,:) - real(r8), pointer :: ch4_ebul_total (:) - real(r8), pointer :: ch4_surf_ebul (:) - real(r8), pointer :: ch4_surf_diff (:) - real(r8), pointer :: o2_oxid_depth (:,:) - real(r8), pointer :: o2_decomp_depth (:,:) - real(r8), pointer :: o2_aere_depth (:,:) - real(r8), pointer :: o2stress (:,:) - real(r8), pointer :: ch4stress (:,:) + real(r8) :: aereoxid ! fraction of methane flux entering aerenchyma rhizosphere + + real(r8), pointer :: ch4_prod_depth (:,:) + real(r8), pointer :: ch4_oxid_depth (:,:) + real(r8), pointer :: ch4_aere_depth (:,:) + real(r8), pointer :: ch4_surf_aere (:) + real(r8), pointer :: ch4_ebul_depth (:,:) + real(r8), pointer :: ch4_ebul_total (:) + real(r8), pointer :: ch4_surf_ebul (:) + real(r8), pointer :: ch4_surf_diff (:) + real(r8), pointer :: o2_oxid_depth (:,:) + real(r8), pointer :: o2_decomp_depth (:,:) + real(r8), pointer :: o2_aere_depth (:,:) + real(r8), pointer :: o2stress (:,:) + real(r8), pointer :: ch4stress (:,:) real(r8), pointer :: co2_decomp_depth (:,:) - real(r8), pointer :: conc_o2 (:,:) - real(r8), pointer :: conc_ch4 (:,:) + real(r8), pointer :: conc_o2 (:,:) + real(r8), pointer :: conc_ch4 (:,:) integer :: nstep ! time step number character(len=32) :: subname='ch4_tran' ! subroutine name @@ -3465,30 +3465,30 @@ subroutine ch4_tran (bounds, & SHR_ASSERT_ALL_FL((ubound(jwt) == (/bounds%endc/)), sourcefile, __LINE__) - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] soil layer depth (m) - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) - zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) - snl => col%snl , & ! Input: [integer (:) ] negative of number of snow layers + associate( & + z => col%z , & ! Input: [real(r8) (:,:) ] soil layer depth (m) + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) + zi => col%zi , & ! Input: [real(r8) (:,:) ] interface level below a "z" level (m) + snl => col%snl , & ! Input: [integer (:) ] negative of number of snow layers - bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" (nlevgrnd) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" (nlevgrnd) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) cellorg => soilstate_inst%cellorg_col , & ! Input: [real(r8) (:,:) ] column 3D org (kg/m^3 organic matter) (nlevgrnd) - t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) - t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (Kelvin) - t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature + t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) + t_grnd => temperature_inst%t_grnd_col , & ! Input: [real(r8) (:) ] ground temperature (Kelvin) + t_h2osfc => temperature_inst%t_h2osfc_col , & ! Input: [real(r8) (:) ] surface water temperature frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) + snow_depth => waterdiagnosticbulk_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m) h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) [for snow & soil layers] - h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) [for snow & soil layers] - h2osfc => waterstatebulk_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) + h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) [for snow & soil layers] + h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice lens (kg/m2) [for snow & soil layers] + h2osfc => waterstatebulk_inst%h2osfc_col , & ! Input: [real(r8) (:) ] surface water (mm) - c_atm => ch4_inst%c_atm_grc , & ! Input: [real(r8) (:,:) ] CH4, O2, CO2 atmospheric conc (mol/m3) + c_atm => ch4_inst%c_atm_grc , & ! Input: [real(r8) (:,:) ] CH4, O2, CO2 atmospheric conc (mol/m3) - grnd_ch4_cond => ch4_inst%grnd_ch4_cond_col & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] + grnd_ch4_cond => ch4_inst%grnd_ch4_cond_col & ! Output: [real(r8) (:) ] tracer conductance for boundary layer [m/s] ) if (sat == 0) then ! unsaturated @@ -3497,34 +3497,34 @@ subroutine ch4_tran (bounds, & ch4_oxid_depth => ch4_inst%ch4_oxid_depth_unsat_col ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) ch4_prod_depth => ch4_inst%ch4_prod_depth_unsat_col ! Output: [real(r8) (:,:) ] CH4 production rate from methanotrophs (mol/m3/s) (nlevsoi) ch4_aere_depth => ch4_inst%ch4_aere_depth_unsat_col ! Output: [real(r8) (:,:) ] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4_surf_aere => ch4_inst%ch4_surf_aere_unsat_col ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) + ch4_surf_aere => ch4_inst%ch4_surf_aere_unsat_col ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) ch4_ebul_depth => ch4_inst%ch4_ebul_depth_unsat_col ! Output: [real(r8) (:,:) ] CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - ch4_ebul_total => ch4_inst%ch4_ebul_total_unsat_col ! Output: [real(r8) (:) ] Total column CH4 ebullition (mol/m2/s) - ch4_surf_ebul => ch4_inst%ch4_surf_ebul_unsat_col ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_diff => ch4_inst%ch4_surf_diff_unsat_col ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) + ch4_ebul_total => ch4_inst%ch4_ebul_total_unsat_col ! Output: [real(r8) (:) ] Total column CH4 ebullition (mol/m2/s) + ch4_surf_ebul => ch4_inst%ch4_surf_ebul_unsat_col ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) + ch4_surf_diff => ch4_inst%ch4_surf_diff_unsat_col ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) o2_oxid_depth => ch4_inst%o2_oxid_depth_unsat_col ! Output: [real(r8) (:,:) ] O2 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) o2_aere_depth => ch4_inst%o2_aere_depth_unsat_col ! Output: [real(r8) (:,:) ] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) ch4stress => ch4_inst%ch4stress_unsat_col ! Output: [real(r8) (:,:) ] Ratio of methane available to the total per-timestep methane sinks (nlevsoi) co2_decomp_depth => ch4_inst%co2_decomp_depth_unsat_col ! Output: [real(r8) (:,:) ] CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) - conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_unsat_col ! Output: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4 => ch4_inst%conc_ch4_unsat_col ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2 => ch4_inst%conc_o2_unsat_col ! Output: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) else ! saturated o2_decomp_depth => ch4_inst%o2_decomp_depth_sat_col ! Output: [real(r8) (:,:) ] O2 consumption during decomposition in each soil layer (nlevsoi) (mol/m3/s) o2stress => ch4_inst%o2stress_sat_col ! Output: [real(r8) (:,:) ] Ratio of oxygen available to that demanded by roots, aerobes, & methanotrophs (nlevsoi) ch4_oxid_depth => ch4_inst%ch4_oxid_depth_sat_col ! Output: [real(r8) (:,:) ] CH4 consumption rate via oxidation in each soil layer (mol/m3/s) (nlevsoi) ch4_prod_depth => ch4_inst%ch4_prod_depth_sat_col ! Output: [real(r8) (:,:) ] CH4 production rate from methanotrophs (mol/m3/s) (nlevsoi) ch4_aere_depth => ch4_inst%ch4_aere_depth_sat_col ! Output: [real(r8) (:,:) ] CH4 loss rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) - ch4_surf_aere => ch4_inst%ch4_surf_aere_sat_col ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) + ch4_surf_aere => ch4_inst%ch4_surf_aere_sat_col ! Output: [real(r8) (:) ] Total column CH4 aerenchyma (mol/m2/s) ch4_ebul_depth => ch4_inst%ch4_ebul_depth_sat_col ! Output: [real(r8) (:,:) ] CH4 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) - ch4_ebul_total => ch4_inst%ch4_ebul_total_sat_col ! Output: [real(r8) (:) ] Total column CH4 ebullition (mol/m2/s) - ch4_surf_ebul => ch4_inst%ch4_surf_ebul_sat_col ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) - ch4_surf_diff => ch4_inst%ch4_surf_diff_sat_col ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) + ch4_ebul_total => ch4_inst%ch4_ebul_total_sat_col ! Output: [real(r8) (:) ] Total column CH4 ebullition (mol/m2/s) + ch4_surf_ebul => ch4_inst%ch4_surf_ebul_sat_col ! Output: [real(r8) (:) ] CH4 ebullition to atmosphere (mol/m2/s) + ch4_surf_diff => ch4_inst%ch4_surf_diff_sat_col ! Output: [real(r8) (:) ] CH4 surface flux (mol/m2/s) o2_oxid_depth => ch4_inst%o2_oxid_depth_sat_col ! Output: [real(r8) (:,:) ] O2 loss rate via ebullition in each soil layer (mol/m3/s) (nlevsoi) o2_aere_depth => ch4_inst%o2_aere_depth_sat_col ! Output: [real(r8) (:,:) ] O2 gain rate via aerenchyma in each soil layer (mol/m3/s) (nlevsoi) ch4stress => ch4_inst%ch4stress_sat_col ! Output: [real(r8) (:,:) ] Ratio of methane available to the total per-timestep methane sinks (nlevsoi) co2_decomp_depth => ch4_inst%co2_decomp_depth_sat_col ! Output: [real(r8) (:,:) ] CO2 production during decomposition in each soil layer (nlevsoi) (mol/m3/s) - conc_ch4 => ch4_inst%conc_ch4_sat_col ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_o2 => ch4_inst%conc_o2_sat_col ! Output: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4 => ch4_inst%conc_ch4_sat_col ! Output: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_o2 => ch4_inst%conc_o2_sat_col ! Output: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi) endif ! Get land model time step @@ -3535,7 +3535,7 @@ subroutine ch4_tran (bounds, & satpow = params_inst%satpow scale_factor_gasdiff = params_inst%scale_factor_gasdiff scale_factor_liqdiff = params_inst%scale_factor_liqdiff - capthick = params_inst%capthick + capthick = params_inst%capthick aereoxid = params_inst%aereoxid ! Set shared constant @@ -3623,7 +3623,7 @@ subroutine ch4_tran (bounds, & do fc = 1, num_methc c = filter_methc (fc) - do s=1,2 + do s=1,2 if (j == 0) then k_h_inv = exp(-c_h_inv(s) * (1._r8 / t_grnd(c) - 1._r8 / kh_tbase) + log (kh_theta(s))) ! (4.12) Wania (L atm/mol) @@ -3833,7 +3833,7 @@ subroutine ch4_tran (bounds, & if (j <= jwt(c)) then ! Above the WT f_a = 1._r8 - h2osoi_vol_min(c,j) / watsat(c,j) - ! Provisionally calculate diffusivity as linear combination of the Millington-Quirk + ! Provisionally calculate diffusivity as linear combination of the Millington-Quirk ! expression in Wania (for peat) & Moldrup (for mineral soil) eps = watsat(c,j)-h2osoi_vol_min(c,j) ! Air-filled fraction of total soil volume if (organic_max > 0._r8) then @@ -4170,7 +4170,7 @@ subroutine get_jwt (bounds, num_methc, filter_methc, jwt, & ! Finds the first unsaturated layer going up. Also allows a perched water table over ice. ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_methc ! number of column soil points in column filter integer , intent(in) :: filter_methc(:) ! column filter for soil points integer , intent(out) :: jwt( bounds%begc: ) ! index of the soil layer right above the water table (-) [col] @@ -4186,10 +4186,10 @@ subroutine get_jwt (bounds, num_methc, filter_methc, jwt, & SHR_ASSERT_ALL_FL((ubound(jwt) == (/bounds%endc/)), sourcefile, __LINE__) - associate( & - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + associate( & + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) [m3/m3] - t_soisno => temperature_inst%t_soisno_col & ! Input: [real(r8) (: ,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) + t_soisno => temperature_inst%t_soisno_col & ! Input: [real(r8) (: ,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevsoi) ) f_sat = params_inst%f_sat @@ -4239,7 +4239,7 @@ subroutine ch4_annualupdate(bounds, num_methc, filter_methc, num_methp, filter_m use clm_varcon , only: secspday ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_methc ! number of soil columns in filter integer , intent(in) :: filter_methc(:) ! filter for soil columns integer , intent(in) :: num_methp ! number of soil points in patch filter @@ -4260,19 +4260,19 @@ subroutine ch4_annualupdate(bounds, num_methc, filter_methc, num_methp, filter_m SHR_ASSERT_ALL_FL((ubound(agnpp) == (/bounds%endp/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(bgnpp) == (/bounds%endp/)), sourcefile, __LINE__) - associate( & + associate( & somhr => soilbiogeochem_carbonflux_inst%somhr_col , & ! Input: [real(r8) (:) ] (gC/m2/s) soil organic matter heterotrophic respiration - finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area in soil column - tempavg_agnpp => ch4_inst%tempavg_agnpp_patch , & ! Output: [real(r8) (:) ] temporary average above-ground NPP (gC/m2/s) - annavg_agnpp => ch4_inst%annavg_agnpp_patch , & ! Output: [real(r8) (:) ] annual average above-ground NPP (gC/m2/s) - tempavg_bgnpp => ch4_inst%tempavg_bgnpp_patch , & ! Output: [real(r8) (:) ] temporary average below-ground NPP (gC/m2/s) - annavg_bgnpp => ch4_inst%annavg_bgnpp_patch , & ! Output: [real(r8) (:) ] annual average below-ground NPP (gC/m2/s) - annsum_counter => ch4_inst%annsum_counter_col , & ! Output: [real(r8) (:) ] seconds since last annual accumulator turnover + finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area in soil column + tempavg_agnpp => ch4_inst%tempavg_agnpp_patch , & ! Output: [real(r8) (:) ] temporary average above-ground NPP (gC/m2/s) + annavg_agnpp => ch4_inst%annavg_agnpp_patch , & ! Output: [real(r8) (:) ] annual average above-ground NPP (gC/m2/s) + tempavg_bgnpp => ch4_inst%tempavg_bgnpp_patch , & ! Output: [real(r8) (:) ] temporary average below-ground NPP (gC/m2/s) + annavg_bgnpp => ch4_inst%annavg_bgnpp_patch , & ! Output: [real(r8) (:) ] annual average below-ground NPP (gC/m2/s) + annsum_counter => ch4_inst%annsum_counter_col , & ! Output: [real(r8) (:) ] seconds since last annual accumulator turnover tempavg_somhr => ch4_inst%tempavg_somhr_col , & ! Output: [real(r8) (:) ] temporary average SOM heterotrophic resp. (gC/m2/s) - annavg_somhr => ch4_inst%annavg_somhr_col , & ! Output: [real(r8) (:) ] annual average SOM heterotrophic resp. (gC/m2/s) - tempavg_finrw => ch4_inst%tempavg_finrw_col , & ! Output: [real(r8) (:) ] respiration-weighted annual average of finundated - annavg_finrw => ch4_inst%annavg_finrw_col & ! Output: [real(r8) (:) ] respiration-weighted annual average of finundated + annavg_somhr => ch4_inst%annavg_somhr_col , & ! Output: [real(r8) (:) ] annual average SOM heterotrophic resp. (gC/m2/s) + tempavg_finrw => ch4_inst%tempavg_finrw_col , & ! Output: [real(r8) (:) ] respiration-weighted annual average of finundated + annavg_finrw => ch4_inst%annavg_finrw_col & ! Output: [real(r8) (:) ] respiration-weighted annual average of finundated ) ! set time steps @@ -4304,26 +4304,26 @@ subroutine ch4_annualupdate(bounds, num_methc, filter_methc, num_methp, filter_m tempavg_finrw(c) = tempavg_finrw(c) + dt/secsperyear * finundated(c) * somhr(c) end if end do - + do fp = 1,num_methp p = filter_methp(fp) c = patch%column(p) if(.not.col%is_fates(c)) then if (annsum_counter(c) >= secsperyear) then - + annavg_agnpp(p) = tempavg_agnpp(p) tempavg_agnpp(p) = 0._r8 - + annavg_bgnpp(p) = tempavg_bgnpp(p) tempavg_bgnpp(p) = 0._r8 - + else tempavg_agnpp(p) = tempavg_agnpp(p) + dt/secsperyear * agnpp(p) tempavg_bgnpp(p) = tempavg_bgnpp(p) + dt/secsperyear * bgnpp(p) end if end if end do - + ! column loop do fc = 1,num_methc c = filter_methc(fc) @@ -4348,7 +4348,7 @@ subroutine ch4_totcolch4(bounds, num_nolakec, filter_nolakec, num_lakec, filter_ use ch4varcon , only : allowlakeprod ! ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_nolakec ! number of column non-lake points in column filter integer , intent(in) :: filter_nolakec(:) ! column filter for non-lake points integer , intent(in) :: num_lakec ! number of column lake points in column filter @@ -4366,10 +4366,10 @@ subroutine ch4_totcolch4(bounds, num_nolakec, filter_nolakec, num_lakec, filter_ SHR_ASSERT_ALL_FL((ubound(totcolch4) == (/bounds%endc/)), sourcefile, __LINE__) associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer thickness (m) (-nlevsno+1:nlevsoi) finundated => ch4_inst%finundated_col , & ! Input: [real(r8) (:) ] fractional inundated area in soil column (excluding dedicated wetland columns) - conc_ch4_sat => ch4_inst%conc_ch4_sat_col , & ! Input: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) - conc_ch4_unsat => ch4_inst%conc_ch4_unsat_col & ! Input: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4_sat => ch4_inst%conc_ch4_sat_col , & ! Input: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) + conc_ch4_unsat => ch4_inst%conc_ch4_unsat_col & ! Input: [real(r8) (:,:) ] CH4 conc in each soil layer (mol/m3) (nlevsoi) ) do fc = 1, num_nolakec @@ -4385,9 +4385,36 @@ subroutine ch4_totcolch4(bounds, num_nolakec, filter_nolakec, num_lakec, filter_ do j = 1, nlevsoi do fc = 1, num_nolakec c = filter_nolakec(fc) - totcolch4(c) = totcolch4(c) + & - (finundated(c)*conc_ch4_sat(c,j) + (1._r8-finundated(c))*conc_ch4_unsat(c,j)) * & - dz(c,j)*catomw + l = col%landunit(c) + ! Rather than trying to keep the BGC variables physically meaningful in urban landunits, + ! we will just pack these variables in a way that should conserve these variables, even if + ! the values in each of the urban columns is somewhat nonsensical. Specifically: we'll take + ! col%wtgcell at face value in urban columns in dynColumnStateUpdaterMod – i.e., for the sake + ! of storing / conserving these BGC variables, we'll act as if that gives the true column + ! weight on the grid cell. This way we'll end up storing all of the C & N from the vegetated + ! column in the urban columns, and there shouldn't be any that is lost from the system. If that + ! urban landunit later shrinks, the stored C & N should be restored symmetrically. It shouldn't + ! really matter that it was stored in a non-physical way (e.g., with some C & N stored in urban + ! walls), since the BGC variables are irrelevant over the urban areas and we just want to be able + ! to restore the amount that was originally stored if an urban landunit grows and then later shrinks. + ! But for this to work right, we need to treat the relevant BGC variables as having the same dz over + ! all urban columns as over the soil column. Note that there already seems to be an implicit assumption + ! that dz is the same for all columns in the dynamic column state updates, in that dz doesn't enter + ! into the conservation equations. In terms of what needs to change, we think that the only relevant + ! code is the code that sums up total C / N / CH4 for the sake of balance checks: these balance checks + ! need to be consistent with the assumptions made in the conservation code. The C and N summations + ! already use dzsoi_decomp, which is the same for all columns, so this is already what we want. + ! So it may be that the only thing that needs to change is the use of dz in ch4_totcolch4: that will + ! need to use dzsoi_decomp over urban columns. (This begs the question of why this isn't already using + ! dzsoi_decomp for consistency with the C & N code; we're not sure about this.) + if (lun%itype(l) .eq. isturb_tbd .or. lun%itype(l) .eq. isturb_hd .or. lun%itype(l) .eq. isturb_md) then + totcolch4(c) = totcolch4(c) + & + (finundated(c)*conc_ch4_sat(c,j) + (1._r8-finundated(c))*conc_ch4_unsat(c,j)) * & + dzsoi_decomp(j)*catomw + else + totcolch4(c) = totcolch4(c) + & + (finundated(c)*conc_ch4_sat(c,j) + (1._r8-finundated(c))*conc_ch4_unsat(c,j)) * & + dz(c,j)*catomw ! mol CH4 --> g C end do @@ -4405,4 +4432,3 @@ end subroutine ch4_totcolch4 end module ch4Mod -