From 0e72761b47796e2433d3cb020fc3a35fc4bf7c65 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 26 Oct 2021 10:58:27 -0700 Subject: [PATCH 01/18] update the Li fire modules to reference gdp and related variables via the extended fire types --- src/biogeochem/CNFireLi2014Mod.F90 | 546 ++++++++++++++--------------- src/biogeochem/CNFireLi2016Mod.F90 | 166 ++++----- src/biogeochem/CNFireLi2021Mod.F90 | 166 ++++----- 3 files changed, 439 insertions(+), 439 deletions(-) diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index b9a6f705d0..454d760268 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -4,12 +4,12 @@ module CNFireLi2014Mod !----------------------------------------------------------------------- ! !DESCRIPTION: - ! module for fire dynamics + ! module for fire dynamics ! created in Nov, 2012 and revised in Apr, 2013 by F. Li and S. Levis ! based on Li et al. (2012a,b; 2013) ! revised in Apr, 2014 according Li et al.(2014) - ! Fire-related parameters were calibrated or tuned in Apr, 2013 based on the - ! 20th Century transient simulations at f19_g16 with (newfire05_clm45sci15_clm4_0_58) + ! Fire-related parameters were calibrated or tuned in Apr, 2013 based on the + ! 20th Century transient simulations at f19_g16 with (newfire05_clm45sci15_clm4_0_58) ! a CLM4.5 version, Qian et al. (2006) atmospheric forcing, and ! climatological lightning data. ! @@ -39,9 +39,9 @@ module CNFireLi2014Mod use WaterStateBulkType , only : waterstatebulk_type use SoilStateType , only : soilstate_type use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type - use GridcellType , only : grc - use ColumnType , only : col - use PatchType , only : patch + use GridcellType , only : grc + use ColumnType , only : col + use PatchType , only : patch use FireMethodType , only : fire_method_type use CNFireBaseMod , only : cnfire_base_type, cnfire_const, cnfire_params ! @@ -88,7 +88,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: - ! Computes column-level burned area + ! Computes column-level burned area ! ! !USES: use clm_time_manager , only: get_step_size_real, get_days_per_year, get_curr_date, get_nstep @@ -99,7 +99,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ ! ! !ARGUMENTS: class(cnfire_li2014_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_soilc ! number of soil columns in filter integer , intent(in) :: filter_soilc(:) ! filter for soil columns integer , intent(in) :: num_soilp ! number of soil patches in filter @@ -107,7 +107,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp - integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst @@ -134,7 +134,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ real(r8) :: fgdp ! impact of gdp on agricultural fire real(r8) :: fire_m ! combustability of fuel for fire occurrence real(r8) :: spread_m ! combustability of fuel for fire spread - real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang + real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang integer :: i_cwd ! cwd pool real(r8) :: lh ! anthro. ignitions (count/km2/hr) real(r8) :: fs ! hd-dependent fires suppression (0-1) @@ -152,10 +152,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ SHR_ASSERT_ALL_FL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(t_soi17cm_col) == (/bounds%endc/)) , sourcefile, __LINE__) - associate( & - totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) + associate( & + totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) - tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m + tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m lfuel => cnfire_const%lfuel , & ! Input: [real(r8) ] (gC/m2) Lower threshold of fuel mass ufuel => cnfire_const%ufuel , & ! Input: [real(r8) ] (gC/m2) Upper threshold of fuel mass rh_hgh => cnfire_const%rh_hgh , & ! Input: [real(r8) ] (%) High relative humidity @@ -167,71 +167,71 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire - + fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: - btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface - wf => waterdiagnosticbulk_inst%wf_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.05 m - wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m - - is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool - - forc_rh => wateratm2lndbulk_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity - forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) - forc_rain => wateratm2lndbulk_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain - forc_snow => wateratm2lndbulk_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow - prec60 => wateratm2lndbulk_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation - prec10 => wateratm2lndbulk_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation - + btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness + fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + wf => waterdiagnosticbulk_inst%wf_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.05 m + wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m + + is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool + + forc_rh => wateratm2lndbulk_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity + forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) + forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) + forc_rain => wateratm2lndbulk_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain + forc_snow => wateratm2lndbulk_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow + prec60 => wateratm2lndbulk_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation + prec10 => wateratm2lndbulk_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation + dwt_smoothed => cnveg_state_inst%dwt_smoothed_patch , & ! Input: [real(r8) (:) ] change in patch weight (-1 to 1) on the gridcell, smoothed over the year - cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column - gdp_lf => cnveg_state_inst%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data - peatf_lf => cnveg_state_inst%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data - abm_lf => cnveg_state_inst%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time - baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) - baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) - burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop + cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column + gdp_lf => this%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data + peatf_lf => this%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data + abm_lf => this%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time + baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) + baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) + burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop fbac => cnveg_state_inst%fbac_col , & ! Output: [real(r8) (:) ] total burned area out of conversion (/sec) fbac1 => cnveg_state_inst%fbac1_col , & ! Output: [real(r8) (:) ] burned area out of conversion region due to land use fire farea_burned => cnveg_state_inst%farea_burned_col , & ! Output: [real(r8) (:) ] total fractional area burned (/sec) nfire => cnveg_state_inst%nfire_col , & ! Output: [real(r8) (:) ] fire counts (count/km2/sec), valid only in Reg. C fsr_col => cnveg_state_inst%fsr_col , & ! Output: [real(r8) (:) ] fire spread rate at column level fd_col => cnveg_state_inst%fd_col , & ! Output: [real(r8) (:) ] fire duration rate at column level - lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire - lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire - lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire + lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire + lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire + lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire lfwt => cnveg_state_inst%lfwt_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop and non-bare-soil Patches - trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) - trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) + trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) + trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Output: [real(r8) (:) ] decreased frac. coverage of BET+BDT on grid for dt lfc => cnveg_state_inst%lfc_col , & ! Output: [real(r8) (:) ] conversion area frac. of BET+BDT that haven't burned before - wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches - - totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level - deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer - rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon - leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level - fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel avalability factor for Reg.C - fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel avalability factor for Reg.A + wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches + + totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level + deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C + deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage + deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer + frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C + frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage + frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer + livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C + livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage + livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer + leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C + leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage + leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer + rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon + leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level + fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel avalability factor for Reg.C + fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel avalability factor for Reg.A ) - + transient_landcover = run_has_transient_landcover() - !pft to column average + !pft to column average prec10_col =>prec10_col_target call p2c(bounds, num_soilc, filter_soilc, & prec10(bounds%begp:bounds%endp), & @@ -261,18 +261,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ baf_peatf(c) = 0._r8 fbac(c) = 0._r8 fbac1(c) = 0._r8 - cropf_col(c) = 0._r8 + cropf_col(c) = 0._r8 end do return end if ! - ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil + ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil ! vegetation (lfwt) in vegetated column ! do fc = 1,num_soilc c = filter_soilc(fc) - cropf_col(c) = 0._r8 - lfwt(c) = 0._r8 + cropf_col(c) = 0._r8 + lfwt(c) = 0._r8 end do do fp = 1, num_soilp p = filter_soilp(fp) @@ -286,8 +286,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ lfwt(c) = lfwt(c) + patch%wtcol(p) end if end do - ! - ! Calculate crop fuel + ! + ! Calculate crop fuel ! do fc = 1,num_soilc c = filter_soilc(fc) @@ -306,7 +306,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) end if end do - ! + ! ! Calculate noncrop column variables ! do fc = 1,num_soilc @@ -407,12 +407,12 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fsr_col(c) = fsr_col(c) + fsr_pft(patch%itype(p))*patch%wtcol(p)/(1.0_r8-cropf_col(c)) - if( lfwt(c) /= 0.0_r8 )then + if( lfwt(c) /= 0.0_r8 )then hdmlf=this%forc_hdm(g) ! all these constants are in Li et al. BG (2012a,b;2013) - if( hdmlf > 0.1_r8 )then + if( hdmlf > 0.1_r8 )then ! For NOT bare-soil if( patch%itype(p) /= noveg )then ! For shrub and grass (crop already excluded above) @@ -430,10 +430,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ else ! for trees if( gdp_lf(c) > 20._r8 )then lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1.0_r8 - cropf_col(c)) - else + else lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) end if - if( gdp_lf(c) > 20._r8 )then + if( gdp_lf(c) > 20._r8 )then lgdp1_col(c) = lgdp1_col(c)+0.62_r8*patch%wtcol(p)/lfwt(c) else if( gdp_lf(c) > 8._r8 ) then @@ -444,7 +444,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ end if lpop_col(c) = lpop_col(c) + (0.4_r8 + 0.6_r8* & exp(-1._r8*SHR_CONST_PI* & - (hdmlf/125._r8)))*patch%wtcol(p)/lfwt(c) + (hdmlf/125._r8)))*patch%wtcol(p)/lfwt(c) end if end if else @@ -454,12 +454,12 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ end if end if - fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) + fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) end if end do ! estimate annual decreased fractional coverage of BET+BDT - ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning + ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning if (transient_landcover) then do fc = 1,num_soilc @@ -485,7 +485,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ end do do fp = 1,num_soilp - p = filter_soilp(fp) + p = filter_soilp(fp) if( kmo == 1 .and. kda == 1 .and. mcsec == 0 )then burndate(p) = 10000 ! init. value; actual range [0 365] end if @@ -564,7 +564,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ farea_burned(c)=min(1.0_r8,baf_crop(c)+baf_peatf(c)) else fuelc(c) = totlitc(c)+totvegc(c)-rootc_col(c)-fuelc_crop(c)*cropf_col(c) - do j = 1, nlevdecomp + do j = 1, nlevdecomp fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) end do fuelc(c) = fuelc(c)/(1._r8-cropf_col(c)) @@ -576,7 +576,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8 fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf)) ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8*cos(3._r8*grc%lat(g)))* & - cnfire_params%ignition_efficiency)*(1._r8-fs)*(1._r8-cropf_col(c)) + cnfire_params%ignition_efficiency)*(1._r8-fs)*(1._r8-cropf_col(c)) nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) !fire counts/km2/sec Lb_lf = 1._r8+10.0_r8*(1._r8-EXP(-0.06_r8*forc_wind(g))) if ( wtlf(c) > 0.0_r8 )then @@ -592,7 +592,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ baf_crop(c)+baf_peatf(c)) ! fraction (0-1) per sec end if ! - ! if landuse change data is used, calculate deforestation fires and + ! if landuse change data is used, calculate deforestation fires and ! add it in the total of burned area fraction ! if (transient_landcover) then @@ -609,10 +609,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) farea_burned(c) = cli*(cli_scale/secspday)+baf_crop(c)+baf_peatf(c) ! burned area out of conversion region due to land use fire - fbac1(c) = max(0._r8,cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) + fbac1(c) = max(0._r8,cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) end if - ! total burned area out of conversion - fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) + ! total burned area out of conversion + fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) else fbac(c) = farea_burned(c) end if @@ -639,8 +639,8 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte ! Fire effects routine for coupled carbon-nitrogen code (CN). ! Relies primarily on estimate of fractional area burned, from CNFireArea(). ! - ! Total fire carbon emissions (g C/m2 land area/yr) - ! =avg(COL_FIRE_CLOSS)*seconds_per_year + avg(SOMC_FIRE)*seconds_per_year + + ! Total fire carbon emissions (g C/m2 land area/yr) + ! =avg(COL_FIRE_CLOSS)*seconds_per_year + avg(SOMC_FIRE)*seconds_per_year + ! avg(LF_CONV_CFLUX)*seconds_per_year*min(1.0,avg(LFC2)*seconds_per_year)*0.8 ! where avg means the temporal average in a year ! seconds_per_year is the number of seconds in a year. @@ -655,7 +655,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte ! ! !ARGUMENTS: class(cnfire_li2014_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_soilc ! number of soil columns in filter integer , intent(in) :: filter_soilc(:) ! filter for soil columns integer , intent(in) :: num_soilp ! number of soil patches in filter @@ -706,176 +706,176 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte ! emis. = emissions ! decomp. = decomposing - associate( & - croot_prof => croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots - stem_prof => stem_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of stems - froot_prof => froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots - leaf_prof => leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves + associate( & + croot_prof => croot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of coarse roots + stem_prof => stem_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of stems + froot_prof => froot_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of fine roots + leaf_prof => leaf_prof_patch , & ! Input: [real(r8) (:,:) ] (1/m) profile of leaves totsomc => totsomc_col , & ! Input: [real(r8) (:) ] (gC/m2) total soil organic matter C decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) decomp_npools_vr => decomp_npools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) somc_fire => somc_fire_col , & ! Output: [real(r8) (:) ] (gC/m2/s) fire C emissions due to peat burning - - is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool - is_litter => decomp_cascade_con%is_litter , & ! Input: [logical (:) ] TRUE => pool is a litter pool - - woody => pftcon%woody , & ! Input: woody lifeform (1=woody, 0=not woody) - cc_leaf => pftcon%cc_leaf , & ! Input: - cc_lstem => pftcon%cc_lstem , & ! Input: - cc_dstem => pftcon%cc_dstem , & ! Input: - cc_other => pftcon%cc_other , & ! Input: - fm_leaf => pftcon%fm_leaf , & ! Input: - fm_lstem => pftcon%fm_lstem , & ! Input: - fm_other => pftcon%fm_other , & ! Input: - fm_root => pftcon%fm_root , & ! Input: - fm_lroot => pftcon%fm_lroot , & ! Input: - fm_droot => pftcon%fm_droot , & ! Input: + + is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool + is_litter => decomp_cascade_con%is_litter , & ! Input: [logical (:) ] TRUE => pool is a litter pool + + woody => pftcon%woody , & ! Input: woody lifeform (1=woody, 0=not woody) + cc_leaf => pftcon%cc_leaf , & ! Input: + cc_lstem => pftcon%cc_lstem , & ! Input: + cc_dstem => pftcon%cc_dstem , & ! Input: + cc_other => pftcon%cc_other , & ! Input: + fm_leaf => pftcon%fm_leaf , & ! Input: + fm_lstem => pftcon%fm_lstem , & ! Input: + fm_other => pftcon%fm_other , & ! Input: + fm_root => pftcon%fm_root , & ! Input: + fm_lroot => pftcon%fm_lroot , & ! Input: + fm_droot => pftcon%fm_droot , & ! Input: lf_f => pftcon%lf_f , & ! Input: fr_f => pftcon%fr_f , & ! Input: - - nind => dgvs_inst%nind_patch , & ! Input: [real(r8) (:) ] number of individuals (#/m2) - - cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column + + nind => dgvs_inst%nind_patch , & ! Input: [real(r8) (:) ] number of individuals (#/m2) + + cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column farea_burned => cnveg_state_inst%farea_burned_col , & ! Input: [real(r8) (:) ] fractional area burned (/sec) - fbac1 => cnveg_state_inst%fbac1_col , & ! Input: [real(r8) (:) ] burned area out of conv. region due to LU fire + fbac1 => cnveg_state_inst%fbac1_col , & ! Input: [real(r8) (:) ] burned area out of conv. region due to LU fire fbac => cnveg_state_inst%fbac_col , & ! Input: [real(r8) (:) ] total burned area out of conversion (/sec) - baf_crop => cnveg_state_inst%baf_crop_col , & ! Input: [real(r8) (:) ] BAF for cropland - baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Input: [real(r8) (:) ] BAF for peatlabd - trotr1_col => cnveg_state_inst%trotr1_col , & ! Input: [real(r8) (:) ] patch weight of BET on the column (0-1) - trotr2_col => cnveg_state_inst%trotr2_col , & ! Input: [real(r8) (:) ] patch weight of BDT on the column (0-1) + baf_crop => cnveg_state_inst%baf_crop_col , & ! Input: [real(r8) (:) ] BAF for cropland + baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Input: [real(r8) (:) ] BAF for peatlabd + trotr1_col => cnveg_state_inst%trotr1_col , & ! Input: [real(r8) (:) ] patch weight of BET on the column (0-1) + trotr2_col => cnveg_state_inst%trotr2_col , & ! Input: [real(r8) (:) ] patch weight of BDT on the column (0-1) dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Input: [real(r8) (:) ] ann. decreased frac. coverage of BET+BDT (0-1) on GC lfc => cnveg_state_inst%lfc_col , & ! Input: [real(r8) (:) ] conv. area frac. of BET+BDT that haven't burned before lfc2 => cnveg_state_inst%lfc2_col , & ! Output: [real(r8) (:) ] conv. area frac. of BET+BDT burned this dt (/sec) - - leafcmax => cnveg_carbonstate_inst%leafcmax_patch , & ! Output: [real(r8) (:) ] (gC/m2) ann max leaf C - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer - livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C - livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C storage - livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C transfer - deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C - deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C storage - deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C transfer - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer - deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer - gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration storage - gresp_xfer => cnveg_carbonstate_inst%gresp_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration transfer - - leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N storage - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N transfer - livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N - livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N storage - livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N transfer - deadstemn => cnveg_nitrogenstate_inst%deadstemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N - deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N storage - deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N transfer - frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N - frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N storage - frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N transfer - livecrootn => cnveg_nitrogenstate_inst%livecrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N - livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N storage - livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N transfer - deadcrootn => cnveg_nitrogenstate_inst%deadcrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N - deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N storage - deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N transfer - retransn => cnveg_nitrogenstate_inst%retransn_patch , & ! Input: [real(r8) (:) ] (gN/m2) plant pool of retranslocated N - + + leafcmax => cnveg_carbonstate_inst%leafcmax_patch , & ! Output: [real(r8) (:) ] (gC/m2) ann max leaf C + leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C + leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage + leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer + livestemc => cnveg_carbonstate_inst%livestemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C + livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C storage + livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live stem C transfer + deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C + deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C storage + deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem C transfer + frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C + frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage + frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer + livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C + livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage + livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer + deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C + deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage + deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer + gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration storage + gresp_xfer => cnveg_carbonstate_inst%gresp_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) growth respiration transfer + + leafn => cnveg_nitrogenstate_inst%leafn_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N + leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N storage + leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) leaf N transfer + livestemn => cnveg_nitrogenstate_inst%livestemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N + livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N storage + livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live stem N transfer + deadstemn => cnveg_nitrogenstate_inst%deadstemn_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N + deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N storage + deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead stem N transfer + frootn => cnveg_nitrogenstate_inst%frootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N + frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N storage + frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) fine root N transfer + livecrootn => cnveg_nitrogenstate_inst%livecrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N + livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N storage + livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) live coarse root N transfer + deadcrootn => cnveg_nitrogenstate_inst%deadcrootn_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N + deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N storage + deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! Input: [real(r8) (:) ] (gN/m2) dead coarse root N transfer + retransn => cnveg_nitrogenstate_inst%retransn_patch , & ! Input: [real(r8) (:) ] (gN/m2) plant pool of retranslocated N + fire_mortality_c_to_cwdc => cnveg_carbonflux_inst%fire_mortality_c_to_cwdc_col , & ! Input: [real(r8) (:,:) ] C flux fire mortality to CWD (gC/m3/s) - m_leafc_to_fire => cnveg_carbonflux_inst%m_leafc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc - m_leafc_storage_to_fire => cnveg_carbonflux_inst%m_leafc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc_storage - m_leafc_xfer_to_fire => cnveg_carbonflux_inst%m_leafc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc_xfer - m_livestemc_to_fire => cnveg_carbonflux_inst%m_livestemc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from livestemc - m_livestemc_storage_to_fire => cnveg_carbonflux_inst%m_livestemc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livestemc_storage - m_livestemc_xfer_to_fire => cnveg_carbonflux_inst%m_livestemc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livestemc_xfer - m_deadstemc_to_fire => cnveg_carbonflux_inst%m_deadstemc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_xfer - m_deadstemc_storage_to_fire => cnveg_carbonflux_inst%m_deadstemc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_storage - m_deadstemc_xfer_to_fire => cnveg_carbonflux_inst%m_deadstemc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_xfer - m_frootc_to_fire => cnveg_carbonflux_inst%m_frootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc - m_frootc_storage_to_fire => cnveg_carbonflux_inst%m_frootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc_storage - m_frootc_xfer_to_fire => cnveg_carbonflux_inst%m_frootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc_xfer - m_livecrootc_to_fire => cnveg_carbonflux_inst%m_livecrootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc - m_livecrootc_storage_to_fire => cnveg_carbonflux_inst%m_livecrootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc_storage - m_livecrootc_xfer_to_fire => cnveg_carbonflux_inst%m_livecrootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc_xfer - m_deadcrootc_to_fire => cnveg_carbonflux_inst%m_deadcrootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc - m_deadcrootc_storage_to_fire => cnveg_carbonflux_inst%m_deadcrootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc_storage - m_deadcrootc_xfer_to_fire => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc_xfer - m_gresp_storage_to_fire => cnveg_carbonflux_inst%m_gresp_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. gresp_storage - m_gresp_xfer_to_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. gresp_xfer - m_leafc_to_litter_fire => cnveg_carbonflux_inst%m_leafc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafc_storage_to_litter_fire => cnveg_carbonflux_inst%m_leafc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_leafc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_storage_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemc_to_deadstemc_fire => cnveg_carbonflux_inst%m_livestemc_to_deadstemc_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemc_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemc_storage_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootc_to_litter_fire => cnveg_carbonflux_inst%m_frootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_frootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_frootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootc_to_deadcrootc_fire => cnveg_carbonflux_inst%m_livecrootc_to_deadcrootc_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootc_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_gresp_storage_to_litter_fire => cnveg_carbonflux_inst%m_gresp_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_gresp_xfer_to_litter_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_leafc_to_fire => cnveg_carbonflux_inst%m_leafc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc + m_leafc_storage_to_fire => cnveg_carbonflux_inst%m_leafc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc_storage + m_leafc_xfer_to_fire => cnveg_carbonflux_inst%m_leafc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from leafc_xfer + m_livestemc_to_fire => cnveg_carbonflux_inst%m_livestemc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) fire C emis. from livestemc + m_livestemc_storage_to_fire => cnveg_carbonflux_inst%m_livestemc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livestemc_storage + m_livestemc_xfer_to_fire => cnveg_carbonflux_inst%m_livestemc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livestemc_xfer + m_deadstemc_to_fire => cnveg_carbonflux_inst%m_deadstemc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_xfer + m_deadstemc_storage_to_fire => cnveg_carbonflux_inst%m_deadstemc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_storage + m_deadstemc_xfer_to_fire => cnveg_carbonflux_inst%m_deadstemc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadstemc_xfer + m_frootc_to_fire => cnveg_carbonflux_inst%m_frootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc + m_frootc_storage_to_fire => cnveg_carbonflux_inst%m_frootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc_storage + m_frootc_xfer_to_fire => cnveg_carbonflux_inst%m_frootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. frootc_xfer + m_livecrootc_to_fire => cnveg_carbonflux_inst%m_livecrootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc + m_livecrootc_storage_to_fire => cnveg_carbonflux_inst%m_livecrootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc_storage + m_livecrootc_xfer_to_fire => cnveg_carbonflux_inst%m_livecrootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. livecrootc_xfer + m_deadcrootc_to_fire => cnveg_carbonflux_inst%m_deadcrootc_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc + m_deadcrootc_storage_to_fire => cnveg_carbonflux_inst%m_deadcrootc_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc_storage + m_deadcrootc_xfer_to_fire => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. deadcrootc_xfer + m_gresp_storage_to_fire => cnveg_carbonflux_inst%m_gresp_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. gresp_storage + m_gresp_xfer_to_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gC/m2/s) C emis. gresp_xfer + m_leafc_to_litter_fire => cnveg_carbonflux_inst%m_leafc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_leafc_storage_to_litter_fire => cnveg_carbonflux_inst%m_leafc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_leafc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_leafc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livestemc_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livestemc_storage_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livestemc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_livestemc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livestemc_to_deadstemc_fire => cnveg_carbonflux_inst%m_livestemc_to_deadstemc_fire_patch , & ! Output: [real(r8) (:) ] + m_deadstemc_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_deadstemc_storage_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_deadstemc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_deadstemc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_frootc_to_litter_fire => cnveg_carbonflux_inst%m_frootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_frootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_frootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_frootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_frootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livecrootc_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livecrootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livecrootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_livecrootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livecrootc_to_deadcrootc_fire => cnveg_carbonflux_inst%m_livecrootc_to_deadcrootc_fire_patch , & ! Output: [real(r8) (:) ] + m_deadcrootc_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_deadcrootc_storage_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_deadcrootc_xfer_to_litter_fire => cnveg_carbonflux_inst%m_deadcrootc_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_gresp_storage_to_litter_fire => cnveg_carbonflux_inst%m_gresp_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_gresp_xfer_to_litter_fire => cnveg_carbonflux_inst%m_gresp_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] m_decomp_cpools_to_fire_vr => cnveg_carbonflux_inst%m_decomp_cpools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] (gC/m3/s) VR decomp. C fire loss m_c_to_litr_fire => cnveg_carbonflux_inst%m_c_to_litr_fire_col , & ! Output: [real(r8) (:,:,:) ] - + fire_mortality_n_to_cwdn => cnveg_nitrogenflux_inst%fire_mortality_n_to_cwdn_col , & ! Input: [real(r8) (:,:) ] N flux fire mortality to CWD (gN/m3/s) - m_leafn_to_fire => cnveg_nitrogenflux_inst%m_leafn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn - m_leafn_storage_to_fire => cnveg_nitrogenflux_inst%m_leafn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn_storage - m_leafn_xfer_to_fire => cnveg_nitrogenflux_inst%m_leafn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn_xfer - m_livestemn_to_fire => cnveg_nitrogenflux_inst%m_livestemn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn - m_livestemn_storage_to_fire => cnveg_nitrogenflux_inst%m_livestemn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn_s - m_livestemn_xfer_to_fire => cnveg_nitrogenflux_inst%m_livestemn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn_xfer - m_deadstemn_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn - m_deadstemn_storage_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn_storage - m_deadstemn_xfer_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn_xfer - m_frootn_to_fire => cnveg_nitrogenflux_inst%m_frootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn - m_frootn_storage_to_fire => cnveg_nitrogenflux_inst%m_frootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn_storage - m_frootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_frootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn_xfer - m_livecrootn_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. m_livecrootn_to_fire - m_livecrootn_storage_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livecrootn_storage - m_livecrootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livecrootn_xfer - m_deadcrootn_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn - m_deadcrootn_storage_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn_storage - m_deadcrootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn_xfer - m_retransn_to_fire => cnveg_nitrogenflux_inst%m_retransn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. retransn - m_leafn_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_leafn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livestemn_to_deadstemn_fire => cnveg_nitrogenflux_inst%m_livestemn_to_deadstemn_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemn_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadstemn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootn_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_frootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_livecrootn_to_deadcrootn_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_deadcrootn_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootn_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_deadcrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] - m_retransn_to_litter_fire => cnveg_nitrogenflux_inst%m_retransn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_leafn_to_fire => cnveg_nitrogenflux_inst%m_leafn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn + m_leafn_storage_to_fire => cnveg_nitrogenflux_inst%m_leafn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn_storage + m_leafn_xfer_to_fire => cnveg_nitrogenflux_inst%m_leafn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. leafn_xfer + m_livestemn_to_fire => cnveg_nitrogenflux_inst%m_livestemn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn + m_livestemn_storage_to_fire => cnveg_nitrogenflux_inst%m_livestemn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn_s + m_livestemn_xfer_to_fire => cnveg_nitrogenflux_inst%m_livestemn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livestemn_xfer + m_deadstemn_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn + m_deadstemn_storage_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn_storage + m_deadstemn_xfer_to_fire => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadstemn_xfer + m_frootn_to_fire => cnveg_nitrogenflux_inst%m_frootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn + m_frootn_storage_to_fire => cnveg_nitrogenflux_inst%m_frootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn_storage + m_frootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_frootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. frootn_xfer + m_livecrootn_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. m_livecrootn_to_fire + m_livecrootn_storage_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livecrootn_storage + m_livecrootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. livecrootn_xfer + m_deadcrootn_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn + m_deadcrootn_storage_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn_storage + m_deadcrootn_xfer_to_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. deadcrootn_xfer + m_retransn_to_fire => cnveg_nitrogenflux_inst%m_retransn_to_fire_patch , & ! Input: [real(r8) (:) ] (gN/m2/s) N emis. retransn + m_leafn_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_leafn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_leafn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_leafn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livestemn_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livestemn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livestemn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_livestemn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livestemn_to_deadstemn_fire => cnveg_nitrogenflux_inst%m_livestemn_to_deadstemn_fire_patch , & ! Output: [real(r8) (:) ] + m_deadstemn_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_deadstemn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_deadstemn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadstemn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_frootn_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_frootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_frootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_frootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livecrootn_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livecrootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livecrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_livecrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_livecrootn_to_deadcrootn_fire => cnveg_nitrogenflux_inst%m_livecrootn_to_deadcrootn_fire_patch , & ! Output: [real(r8) (:) ] + m_deadcrootn_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_deadcrootn_storage_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_storage_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_deadcrootn_xfer_to_litter_fire => cnveg_nitrogenflux_inst%m_deadcrootn_xfer_to_litter_fire_patch , & ! Output: [real(r8) (:) ] + m_retransn_to_litter_fire => cnveg_nitrogenflux_inst%m_retransn_to_litter_fire_patch , & ! Output: [real(r8) (:) ] m_decomp_npools_to_fire_vr => cnveg_nitrogenflux_inst%m_decomp_npools_to_fire_vr_col , & ! Output: [real(r8) (:,:,:) ] VR decomp. N fire loss (gN/m3/s) m_n_to_litr_fire => cnveg_nitrogenflux_inst%m_n_to_litr_fire_col & ! Output: [real(r8) (:,:,:) ] ) @@ -925,14 +925,14 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte m_deadstemc_storage_to_fire(p) = deadstemc_storage(p) * f * cc_other(patch%itype(p)) m_deadstemc_xfer_to_fire(p) = deadstemc_xfer(p) * f * cc_other(patch%itype(p)) m_frootc_to_fire(p) = frootc(p) * f * 0._r8 - m_frootc_storage_to_fire(p) = frootc_storage(p) * f * cc_other(patch%itype(p)) + m_frootc_storage_to_fire(p) = frootc_storage(p) * f * cc_other(patch%itype(p)) m_frootc_xfer_to_fire(p) = frootc_xfer(p) * f * cc_other(patch%itype(p)) m_livecrootc_to_fire(p) = livecrootc(p) * f * 0._r8 - m_livecrootc_storage_to_fire(p) = livecrootc_storage(p) * f * cc_other(patch%itype(p)) - m_livecrootc_xfer_to_fire(p) = livecrootc_xfer(p) * f * cc_other(patch%itype(p)) + m_livecrootc_storage_to_fire(p) = livecrootc_storage(p) * f * cc_other(patch%itype(p)) + m_livecrootc_xfer_to_fire(p) = livecrootc_xfer(p) * f * cc_other(patch%itype(p)) m_deadcrootc_to_fire(p) = deadcrootc(p) * f * 0._r8 - m_deadcrootc_storage_to_fire(p) = deadcrootc_storage(p) * f* cc_other(patch%itype(p)) - m_deadcrootc_xfer_to_fire(p) = deadcrootc_xfer(p) * f * cc_other(patch%itype(p)) + m_deadcrootc_storage_to_fire(p) = deadcrootc_storage(p) * f* cc_other(patch%itype(p)) + m_deadcrootc_xfer_to_fire(p) = deadcrootc_xfer(p) * f * cc_other(patch%itype(p)) m_gresp_storage_to_fire(p) = gresp_storage(p) * f * cc_other(patch%itype(p)) m_gresp_xfer_to_fire(p) = gresp_xfer(p) * f * cc_other(patch%itype(p)) @@ -950,11 +950,11 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte m_frootn_to_fire(p) = frootn(p) * f * 0._r8 m_frootn_storage_to_fire(p) = frootn_storage(p) * f * cc_other(patch%itype(p)) m_frootn_xfer_to_fire(p) = frootn_xfer(p) * f * cc_other(patch%itype(p)) - m_livecrootn_to_fire(p) = livecrootn(p) * f * 0._r8 - m_livecrootn_storage_to_fire(p) = livecrootn_storage(p) * f * cc_other(patch%itype(p)) + m_livecrootn_to_fire(p) = livecrootn(p) * f * 0._r8 + m_livecrootn_storage_to_fire(p) = livecrootn_storage(p) * f * cc_other(patch%itype(p)) m_livecrootn_xfer_to_fire(p) = livecrootn_xfer(p) * f * cc_other(patch%itype(p)) m_deadcrootn_to_fire(p) = deadcrootn(p) * f * 0._r8 - m_deadcrootn_xfer_to_fire(p) = deadcrootn_xfer(p) * f * cc_other(patch%itype(p)) + m_deadcrootn_xfer_to_fire(p) = deadcrootn_xfer(p) * f * cc_other(patch%itype(p)) m_deadcrootn_storage_to_fire(p) = deadcrootn_storage(p) * f * cc_other(patch%itype(p)) m_retransn_to_fire(p) = retransn(p) * f * cc_other(patch%itype(p)) @@ -971,19 +971,19 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte fm_other(patch%itype(p)) m_livestemc_to_litter_fire(p) = livestemc(p) * f * & (1._r8 - cc_lstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) + fm_droot(patch%itype(p)) m_livestemc_storage_to_litter_fire(p) = livestemc_storage(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & fm_other(patch%itype(p)) m_livestemc_xfer_to_litter_fire(p) = livestemc_xfer(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) m_livestemc_to_deadstemc_fire(p) = livestemc(p) * f * & (1._r8 - cc_lstem(patch%itype(p))) * & (fm_lstem(patch%itype(p))-fm_droot(patch%itype(p))) m_deadstemc_to_litter_fire(p) = deadstemc(p) * f * m * & (1._r8 - cc_dstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) + fm_droot(patch%itype(p)) m_deadstemc_storage_to_litter_fire(p) = deadstemc_storage(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & fm_other(patch%itype(p)) @@ -1002,10 +1002,10 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte fm_droot(patch%itype(p)) m_livecrootc_storage_to_litter_fire(p) = livecrootc_storage(p) * f * & (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) m_livecrootc_xfer_to_litter_fire(p) = livecrootc_xfer(p) * f * & (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) m_livecrootc_to_deadcrootc_fire(p) = livecrootc(p) * f * & (fm_lroot(patch%itype(p))-fm_droot(patch%itype(p))) m_deadcrootc_to_litter_fire(p) = deadcrootc(p) * f * m * & @@ -1015,22 +1015,22 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte fm_other(patch%itype(p)) m_deadcrootc_xfer_to_litter_fire(p) = deadcrootc_xfer(p) * f * & (1._r8- cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) m_gresp_storage_to_litter_fire(p) = gresp_storage(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) m_gresp_xfer_to_litter_fire(p) = gresp_xfer(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) - ! nitrogen pools + ! nitrogen pools m_leafn_to_litter_fire(p) = leafn(p) * f * & (1._r8 - cc_leaf(patch%itype(p))) * & fm_leaf(patch%itype(p)) m_leafn_storage_to_litter_fire(p) = leafn_storage(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) m_leafn_xfer_to_litter_fire(p) = leafn_xfer(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & fm_other(patch%itype(p)) @@ -1039,7 +1039,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte fm_droot(patch%itype(p)) m_livestemn_storage_to_litter_fire(p) = livestemn_storage(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) m_livestemn_xfer_to_litter_fire(p) = livestemn_xfer(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & fm_other(patch%itype(p)) @@ -1048,7 +1048,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte (fm_lstem(patch%itype(p))-fm_droot(patch%itype(p))) m_deadstemn_to_litter_fire(p) = deadstemn(p) * f * m * & (1._r8 - cc_dstem(patch%itype(p))) * & - fm_droot(patch%itype(p)) + fm_droot(patch%itype(p)) m_deadstemn_storage_to_litter_fire(p) = deadstemn_storage(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & fm_other(patch%itype(p)) @@ -1070,7 +1070,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte fm_other(patch%itype(p)) m_livecrootn_xfer_to_litter_fire(p) = livecrootn_xfer(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) m_livecrootn_to_deadcrootn_fire(p) = livecrootn(p) * f * & (fm_lroot(patch%itype(p))-fm_droot(patch%itype(p))) m_deadcrootn_to_litter_fire(p) = deadcrootn(p) * f * m * & @@ -1083,12 +1083,12 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte fm_other(patch%itype(p)) m_retransn_to_litter_fire(p) = retransn(p) * f * & (1._r8 - cc_other(patch%itype(p))) * & - fm_other(patch%itype(p)) + fm_other(patch%itype(p)) if (use_cndv) then if ( woody(patch%itype(p)) == 1._r8 )then if ( livestemc(p)+deadstemc(p) > 0._r8 )then - nind(p) = nind(p)*(1._r8-1._r8*fm_droot(patch%itype(p))*f) + nind(p) = nind(p)*(1._r8-1._r8*fm_droot(patch%itype(p))*f) else nind(p) = 0._r8 end if @@ -1097,7 +1097,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte if (patch%itype(p) == noveg) leafcmax(p) = 0._r8 end if - end do ! end of patches loop + end do ! end of patches loop ! fire-induced transfer of carbon and nitrogen pools to litter and cwd @@ -1105,7 +1105,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte do fp = 1, num_soilp p = filter_soilp(fp) c = patch%column(p) - + fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & m_deadstemc_to_litter_fire(p) * patch%wtcol(p) * stem_prof(p,j) fire_mortality_c_to_cwdc(c,j) = fire_mortality_c_to_cwdc(c,j) + & @@ -1143,11 +1143,11 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte +(m_livecrootc_storage_to_litter_fire(p) + & m_livecrootc_xfer_to_litter_fire(p) & +m_deadcrootc_storage_to_litter_fire(p) + & - m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) + m_deadcrootc_xfer_to_litter_fire(p))* croot_prof(p,j))* patch%wtcol(p) do i = i_met_lit+1, i_litr_max m_c_to_litr_fire(c,j,i) = m_c_to_litr_fire(c,j,i) + & (m_leafc_to_litter_fire(p) * lf_f(patch%itype(p),i) * leaf_prof(p,j) + & - m_frootc_to_litter_fire(p) * fr_f(patch%itype(p),i) * froot_prof(p,j)) * patch%wtcol(p) + m_frootc_to_litter_fire(p) * fr_f(patch%itype(p),i) * froot_prof(p,j)) * patch%wtcol(p) end do m_n_to_litr_fire(c,j,i_met_lit) = & @@ -1176,21 +1176,21 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte end do end do ! - ! vertically-resolved decomposing C/N fire loss + ! vertically-resolved decomposing C/N fire loss ! column loop ! do fc = 1,num_soilc c = filter_soilc(fc) - f = farea_burned(c) + f = farea_burned(c) ! change CC for litter from 0.4_r8 to 0.5_r8 and CC for CWD from 0.2_r8 - ! to 0.25_r8 according to Li et al.(2014) + ! to 0.25_r8 according to Li et al.(2014) do j = 1, nlevdecomp ! carbon fluxes do l = 1, ndecomp_pools if ( is_litter(l) ) then - m_decomp_cpools_to_fire_vr(c,j,l) = decomp_cpools_vr(c,j,l) * f * 0.5_r8 + m_decomp_cpools_to_fire_vr(c,j,l) = decomp_cpools_vr(c,j,l) * f * 0.5_r8 end if if ( is_cwd(l) ) then m_decomp_cpools_to_fire_vr(c,j,l) = decomp_cpools_vr(c,j,l) * & @@ -1250,7 +1250,7 @@ subroutine CNFireFluxes (this, bounds, num_soilc, filter_soilc, num_soilp, filte ! They will be added here in proportion to the carbon emission ! Emission factors differ for various fire types - end associate + end associate end subroutine CNFireFluxes diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index afd661cd28..ed5ff6a0c8 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -4,12 +4,12 @@ module CNFireLi2016Mod !----------------------------------------------------------------------- ! !DESCRIPTION: - ! module for fire dynamics + ! module for fire dynamics ! created in Nov, 2012 and revised in Apr, 2013 by F. Li and S. Levis ! based on Li et al. (2012a,b; 2013) ! revised in Apr, 2014 according to Li et al.(2014) ! revised in May, 2015, according to Li et al. (2015, in prep.) - ! Fire-related parameters were calibrated or tuned in May, 2015 based on the + ! Fire-related parameters were calibrated or tuned in May, 2015 based on the ! 20th Century transient simulations at f19_g16 with a CLM4.5 version ! (clm50fire), CRUNCEPv5, and climatological lightning data. ! @@ -39,9 +39,9 @@ module CNFireLi2016Mod use WaterStateBulkType , only : waterstatebulk_type use SoilStateType , only : soilstate_type use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type - use GridcellType , only : grc - use ColumnType , only : col - use PatchType , only : patch + use GridcellType , only : grc + use ColumnType , only : col + use PatchType , only : patch use SoilBiogeochemStateType , only : get_spinup_latitude_term use FireMethodType , only : fire_method_type use CNFireBaseMod , only : cnfire_base_type, cnfire_const, cnfire_params @@ -92,7 +92,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: - ! Computes column-level burned area + ! Computes column-level burned area ! ! !USES: use clm_time_manager , only: get_step_size_real, get_days_per_year, get_curr_date, get_nstep @@ -104,7 +104,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ ! ! !ARGUMENTS: class(cnfire_li2016_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_soilc ! number of soil columns in filter integer , intent(in) :: filter_soilc(:) ! filter for soil columns integer , intent(in) :: num_soilp ! number of soil patches in filter @@ -112,7 +112,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp - integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst @@ -139,7 +139,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ real(r8) :: fgdp ! impact of gdp on agricultural fire real(r8) :: fire_m ! combustability of fuel for fire occurrence real(r8) :: spread_m ! combustability of fuel for fire spread - real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang + real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang integer :: i_cwd ! cwd pool real(r8) :: lh ! anthro. ignitions (count/km2/hr) real(r8) :: fs ! hd-dependent fires suppression (0-1) @@ -151,7 +151,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ logical :: transient_landcover ! whether this run has any prescribed transient landcover real(r8), target :: prec60_col_target(bounds%begc:bounds%endc) real(r8), target :: prec10_col_target(bounds%begc:bounds%endc) - real(r8), target :: rh30_col_target(bounds%begc:bounds%endc) + real(r8), target :: rh30_col_target(bounds%begc:bounds%endc) real(r8), pointer :: prec60_col(:) real(r8), pointer :: prec10_col(:) real(r8), pointer :: rh30_col(:) @@ -161,10 +161,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ SHR_ASSERT_ALL_FL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(t_soi17cm_col) == (/bounds%endc/)) , sourcefile, __LINE__) - associate( & - totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) + associate( & + totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) - tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m + tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m lfuel => cnfire_const%lfuel , & ! Input: [real(r8) ] (gC/m2) Lower threshold of fuel mass ufuel => cnfire_const%ufuel , & ! Input: [real(r8) ] (gC/m2) Upper threshold of fuel mass @@ -177,73 +177,73 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire - + fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: - btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface - wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m - - is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool - spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool - - forc_rh => wateratm2lndbulk_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity - forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) - forc_rain => wateratm2lndbulk_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain - forc_snow => wateratm2lndbulk_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow - prec60 => wateratm2lndbulk_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation - prec10 => wateratm2lndbulk_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation - rh30 => wateratm2lndbulk_inst%rh30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation + btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness + fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m + + is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool + spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool + + forc_rh => wateratm2lndbulk_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity + forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) + forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) + forc_rain => wateratm2lndbulk_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain + forc_snow => wateratm2lndbulk_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow + prec60 => wateratm2lndbulk_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation + prec10 => wateratm2lndbulk_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation + rh30 => wateratm2lndbulk_inst%rh30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation dwt_smoothed => cnveg_state_inst%dwt_smoothed_patch , & ! Input: [real(r8) (:) ] change in patch weight (-1 to 1) on the gridcell, smoothed over the year - cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column - gdp_lf => cnveg_state_inst%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data - peatf_lf => cnveg_state_inst%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data - abm_lf => cnveg_state_inst%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time - baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) - baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) - burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop + cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column + gdp_lf => this%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data + peatf_lf => this%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data + abm_lf => this%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time + baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) + baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) + burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop fbac => cnveg_state_inst%fbac_col , & ! Output: [real(r8) (:) ] total burned area out of conversion (/sec) fbac1 => cnveg_state_inst%fbac1_col , & ! Output: [real(r8) (:) ] burned area out of conversion region due to land use fire farea_burned => cnveg_state_inst%farea_burned_col , & ! Output: [real(r8) (:) ] total fractional area burned (/sec) nfire => cnveg_state_inst%nfire_col , & ! Output: [real(r8) (:) ] fire counts (count/km2/sec), valid only in Reg. C fsr_col => cnveg_state_inst%fsr_col , & ! Output: [real(r8) (:) ] fire spread rate at column level fd_col => cnveg_state_inst%fd_col , & ! Output: [real(r8) (:) ] fire duration rate at column level - lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire - lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire - lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire + lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire + lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire + lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire lfwt => cnveg_state_inst%lfwt_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop and non-bare-soil Patches - trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) - trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) + trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) + trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Output: [real(r8) (:) ] decreased frac. coverage of BET+BDT on grid for dt lfc => cnveg_state_inst%lfc_col , & ! Output: [real(r8) (:) ] conversion area frac. of BET+BDT that haven't burned before - wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches - - totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level - deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer + wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches + + totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level + deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C + deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage + deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem root C - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer - rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon - leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level + frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C + frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage + frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer + livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C + livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage + livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer + leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C + leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage + leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer + rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon + leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level deadstemc_col => cnveg_carbonstate_inst%deadstemc_col , & ! Output: [real(r8) (:) ] deadstem carbon at column level - fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel load coutside cropland - fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel load for cropland + fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel load coutside cropland + fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel load for cropland ) - + transient_landcover = run_has_transient_landcover() - !pft to column average + !pft to column average prec10_col =>prec10_col_target call p2c(bounds, num_soilc, filter_soilc, & prec10(bounds%begp:bounds%endp), & @@ -257,8 +257,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ rh30_col =>rh30_col_target call p2c(bounds, num_soilc, filter_soilc, & rh30(bounds%begp:bounds%endp), & - rh30_col(bounds%begc:bounds%endc)) - + rh30_col(bounds%begc:bounds%endc)) + call p2c(bounds, num_soilc, filter_soilc, & leafc(bounds%begp:bounds%endp), & leafc_col(bounds%begc:bounds%endc)) @@ -282,18 +282,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ baf_peatf(c) = 0._r8 fbac(c) = 0._r8 fbac1(c) = 0._r8 - cropf_col(c) = 0._r8 + cropf_col(c) = 0._r8 end do return end if ! - ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil + ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil ! vegetation (lfwt) in vegetated column ! do fc = 1,num_soilc c = filter_soilc(fc) - cropf_col(c) = 0._r8 - lfwt(c) = 0._r8 + cropf_col(c) = 0._r8 + lfwt(c) = 0._r8 end do do fp = 1, num_soilp p = filter_soilp(fp) @@ -307,8 +307,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ lfwt(c) = lfwt(c) + patch%wtcol(p) end if end do - ! - ! Calculate crop fuel + ! + ! Calculate crop fuel ! do fc = 1,num_soilc c = filter_soilc(fc) @@ -327,7 +327,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) end if end do - ! + ! ! Calculate noncrop column variables ! do fc = 1,num_soilc @@ -432,7 +432,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ ! all these constants are in Li et al. BG (2012a,b;2013) - if( hdmlf > 0.1_r8 )then + if( hdmlf > 0.1_r8 )then ! For NOT bare-soil if( patch%itype(p) /= noveg )then ! For shrub and grass (crop already excluded above) @@ -450,7 +450,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ else ! for trees if( gdp_lf(c) > 20._r8 )then lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1._r8 - cropf_col(c)) - lgdp1_col(c) =lgdp1_col(c)+0.62_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c) =lgdp1_col(c)+0.62_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) else if( gdp_lf(c) > 8._r8 )then lgdp_col(c)=lgdp_col(c)+0.79_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) @@ -471,12 +471,12 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ lpop_col(c) = lpop_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) end if - fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) + fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) end if end do ! estimate annual decreased fractional coverage of BET+BDT - ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning + ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning if (transient_landcover) then do fc = 1,num_soilc @@ -502,7 +502,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ end do do fp = 1,num_soilp - p = filter_soilp(fp) + p = filter_soilp(fp) if( kmo == 1 .and. kda == 1 .and. mcsec == 0 )then burndate(p) = 10000 ! init. value; actual range [0 365] end if @@ -581,18 +581,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fuelc(c) = totlitc(c)+totvegc(c)-rootc_col(c)-fuelc_crop(c)*cropf_col(c) if (spinup_state == 2) then fuelc(c) = fuelc(c) + ((spinup_factor_deadwood - 1._r8)*deadstemc_col(c)) - do j = 1, nlevdecomp + do j = 1, nlevdecomp fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) * spinup_factor(i_cwd) & * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) end do else - do j = 1, nlevdecomp + do j = 1, nlevdecomp fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) end do end if fuelc(c) = fuelc(c)/(1._r8-cropf_col(c)) fb = max(0.0_r8,min(1.0_r8,(fuelc(c)-lfuel)/(ufuel-lfuel))) - if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then + if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/90._r8)) @@ -617,7 +617,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ farea_burned(c)=min(1._r8,baf_crop(c)+baf_peatf(c)) end if ! - ! if landuse change data is used, calculate deforestation fires and + ! if landuse change data is used, calculate deforestation fires and ! add it in the total of burned area fraction ! if (transient_landcover) then @@ -634,10 +634,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) farea_burned(c) = cli*(cli_scale/secspday)+baf_crop(c)+baf_peatf(c) ! burned area out of conversion region due to land use fire - fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) + fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) end if - ! total burned area out of conversion - fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) + ! total burned area out of conversion + fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) else fbac(c) = farea_burned(c) end if diff --git a/src/biogeochem/CNFireLi2021Mod.F90 b/src/biogeochem/CNFireLi2021Mod.F90 index aa61e291e9..66598b1ca1 100644 --- a/src/biogeochem/CNFireLi2021Mod.F90 +++ b/src/biogeochem/CNFireLi2021Mod.F90 @@ -4,12 +4,12 @@ module CNFireLi2021Mod !----------------------------------------------------------------------- ! !DESCRIPTION: - ! module for fire dynamics + ! module for fire dynamics ! created in Nov, 2012 and revised in Apr, 2013 by F. Li and S. Levis ! based on Li et al. (2012a,b; 2013) ! revised in Apr, 2014 according to Li et al.(2014) ! revised in May, 2015, according to Li et al. (2015, in prep.) - ! Fire-related parameters were calibrated or tuned in May, 2015 based on the + ! Fire-related parameters were calibrated or tuned in May, 2015 based on the ! 20th Century transient simulations at f19_g16 with a CLM4.5 version ! (clm50fire), CRUNCEPv5, and climatological lightning data. ! @@ -39,9 +39,9 @@ module CNFireLi2021Mod use WaterStateBulkType , only : waterstatebulk_type use SoilStateType , only : soilstate_type use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type - use GridcellType , only : grc - use ColumnType , only : col - use PatchType , only : patch + use GridcellType , only : grc + use ColumnType , only : col + use PatchType , only : patch use SoilBiogeochemStateType , only : get_spinup_latitude_term use FireMethodType , only : fire_method_type use CNFireBaseMod , only : cnfire_base_type, cnfire_const, cnfire_params @@ -92,7 +92,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: - ! Computes column-level burned area + ! Computes column-level burned area ! ! !USES: use clm_time_manager , only: get_step_size_real, get_days_per_year, get_curr_date, get_nstep @@ -104,7 +104,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ ! ! !ARGUMENTS: class(cnfire_li2021_type) :: this - type(bounds_type) , intent(in) :: bounds + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_soilc ! number of soil columns in filter integer , intent(in) :: filter_soilc(:) ! filter for soil columns integer , intent(in) :: num_soilp ! number of soil patches in filter @@ -112,7 +112,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp - integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(energyflux_type) , intent(in) :: energyflux_inst type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst @@ -139,7 +139,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ real(r8) :: fgdp ! impact of gdp on agricultural fire real(r8) :: fire_m ! combustability of fuel for fire occurrence real(r8) :: spread_m ! combustability of fuel for fire spread - real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang + real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang integer :: i_cwd ! cwd pool real(r8) :: lh ! anthro. ignitions (count/km2/hr) real(r8) :: fs ! hd-dependent fires suppression (0-1) @@ -151,7 +151,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ logical :: transient_landcover ! whether this run has any prescribed transient landcover real(r8), target :: prec60_col_target(bounds%begc:bounds%endc) real(r8), target :: prec10_col_target(bounds%begc:bounds%endc) - real(r8), target :: rh30_col_target(bounds%begc:bounds%endc) + real(r8), target :: rh30_col_target(bounds%begc:bounds%endc) real(r8), pointer :: prec60_col(:) real(r8), pointer :: prec10_col(:) real(r8), pointer :: rh30_col(:) @@ -161,10 +161,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ SHR_ASSERT_ALL_FL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(t_soi17cm_col) == (/bounds%endc/)), sourcefile, __LINE__) - associate( & - totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) + associate( & + totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) - tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m + tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m lfuel => cnfire_const%lfuel , & ! Input: [real(r8) ] (gC/m2) Lower threshold of fuel mass ufuel => cnfire_const%ufuel , & ! Input: [real(r8) ] (gC/m2) Upper threshold of fuel mass @@ -175,74 +175,74 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire - + fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: rswf_min => pftcon%rswf_min , & ! Input: rswf_max => pftcon%rswf_max , & ! Input: - btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness - fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface - wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m - - is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool - spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool - - forc_rh => wateratm2lndbulk_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity - forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) - forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) - forc_rain => wateratm2lndbulk_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain - forc_snow => wateratm2lndbulk_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow - prec60 => wateratm2lndbulk_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation - prec10 => wateratm2lndbulk_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation - rh30 => wateratm2lndbulk_inst%rh30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation + btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness + fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m + + is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool + spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool + + forc_rh => wateratm2lndbulk_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity + forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) + forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) + forc_rain => wateratm2lndbulk_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain + forc_snow => wateratm2lndbulk_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow + prec60 => wateratm2lndbulk_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation + prec10 => wateratm2lndbulk_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation + rh30 => wateratm2lndbulk_inst%rh30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation dwt_smoothed => cnveg_state_inst%dwt_smoothed_patch , & ! Input: [real(r8) (:) ] change in patch weight (-1 to 1) on the gridcell, smoothed over the year - cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column - gdp_lf => cnveg_state_inst%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data - peatf_lf => cnveg_state_inst%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data - abm_lf => cnveg_state_inst%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time - baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) - baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) - burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop + cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column + gdp_lf => this%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data + peatf_lf => this%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data + abm_lf => this%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time + baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) + baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) + burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop fbac => cnveg_state_inst%fbac_col , & ! Output: [real(r8) (:) ] total burned area out of conversion (/sec) fbac1 => cnveg_state_inst%fbac1_col , & ! Output: [real(r8) (:) ] burned area out of conversion region due to land use fire farea_burned => cnveg_state_inst%farea_burned_col , & ! Output: [real(r8) (:) ] total fractional area burned (/sec) nfire => cnveg_state_inst%nfire_col , & ! Output: [real(r8) (:) ] fire counts (count/km2/sec), valid only in Reg. C fsr_col => cnveg_state_inst%fsr_col , & ! Output: [real(r8) (:) ] fire spread rate at column level fd_col => cnveg_state_inst%fd_col , & ! Output: [real(r8) (:) ] fire duration rate at column level - lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire - lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire - lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire + lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire + lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire + lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire lfwt => cnveg_state_inst%lfwt_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop and non-bare-soil Patches - trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) - trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) + trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) + trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Output: [real(r8) (:) ] decreased frac. coverage of BET+BDT on grid for dt lfc => cnveg_state_inst%lfc_col , & ! Output: [real(r8) (:) ] conversion area frac. of BET+BDT that haven't burned before - wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches - - totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level - deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer + wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches + + totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level + deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C + deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage + deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem root C - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer - livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer - leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer - rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon - leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level + frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C + frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage + frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer + livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C + livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage + livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer + leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C + leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage + leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer + rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon + leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level deadstemc_col => cnveg_carbonstate_inst%deadstemc_col , & ! Output: [real(r8) (:) ] deadstem carbon at column level - fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel load coutside cropland - fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel load for cropland + fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel load coutside cropland + fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel load for cropland ) - + transient_landcover = run_has_transient_landcover() - !pft to column average + !pft to column average prec10_col =>prec10_col_target call p2c(bounds, num_soilc, filter_soilc, & prec10(bounds%begp:bounds%endp), & @@ -256,8 +256,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ rh30_col =>rh30_col_target call p2c(bounds, num_soilc, filter_soilc, & rh30(bounds%begp:bounds%endp), & - rh30_col(bounds%begc:bounds%endc)) - + rh30_col(bounds%begc:bounds%endc)) + call p2c(bounds, num_soilc, filter_soilc, & leafc(bounds%begp:bounds%endp), & leafc_col(bounds%begc:bounds%endc)) @@ -281,18 +281,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ baf_peatf(c) = 0._r8 fbac(c) = 0._r8 fbac1(c) = 0._r8 - cropf_col(c) = 0._r8 + cropf_col(c) = 0._r8 end do return end if ! - ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil + ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil ! vegetation (lfwt) in vegetated column ! do fc = 1,num_soilc c = filter_soilc(fc) - cropf_col(c) = 0._r8 - lfwt(c) = 0._r8 + cropf_col(c) = 0._r8 + lfwt(c) = 0._r8 end do do fp = 1, num_soilp p = filter_soilp(fp) @@ -306,8 +306,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ lfwt(c) = lfwt(c) + patch%wtcol(p) end if end do - ! - ! Calculate crop fuel + ! + ! Calculate crop fuel ! do fc = 1,num_soilc c = filter_soilc(fc) @@ -326,7 +326,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) end if end do - ! + ! ! Calculate noncrop column variables ! do fc = 1,num_soilc @@ -433,7 +433,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ ! all these constants are in Li et al. BG (2012a,b;2013) - if( hdmlf > 0.1_r8 )then + if( hdmlf > 0.1_r8 )then ! For NOT bare-soil if( patch%itype(p) /= noveg )then ! For shrub and grass (crop already excluded above) @@ -451,7 +451,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ else ! for trees if( gdp_lf(c) > 20._r8 )then lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1._r8 - cropf_col(c)) - lgdp1_col(c) =lgdp1_col(c)+0.62_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c) =lgdp1_col(c)+0.62_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) else if( gdp_lf(c) > 8._r8 )then lgdp_col(c)=lgdp_col(c)+0.79_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) @@ -472,12 +472,12 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ lpop_col(c) = lpop_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) end if - fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) + fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) end if end do ! estimate annual decreased fractional coverage of BET+BDT - ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning + ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning if (transient_landcover) then do fc = 1,num_soilc @@ -503,7 +503,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ end do do fp = 1,num_soilp - p = filter_soilp(fp) + p = filter_soilp(fp) if( kmo == 1 .and. kda == 1 .and. mcsec == 0 )then burndate(p) = 10000 ! init. value; actual range [0 365] end if @@ -582,18 +582,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fuelc(c) = totlitc(c)+totvegc(c)-rootc_col(c)-fuelc_crop(c)*cropf_col(c) if (spinup_state == 2) then fuelc(c) = fuelc(c) + ((spinup_factor_deadwood - 1._r8)*deadstemc_col(c)) - do j = 1, nlevdecomp + do j = 1, nlevdecomp fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) * spinup_factor(i_cwd) & * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) end do else - do j = 1, nlevdecomp + do j = 1, nlevdecomp fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) end do end if fuelc(c) = fuelc(c)/(1._r8-cropf_col(c)) fb = max(0.0_r8,min(1.0_r8,(fuelc(c)-lfuel)/(ufuel-lfuel))) - if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then + if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/90._r8)) @@ -619,7 +619,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ farea_burned(c)=min(1._r8,baf_crop(c)+baf_peatf(c)) end if ! - ! if landuse change data is used, calculate deforestation fires and + ! if landuse change data is used, calculate deforestation fires and ! add it in the total of burned area fraction ! if (transient_landcover) then @@ -636,10 +636,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) farea_burned(c) = fb*cli*(cli_scale/secspday)+baf_crop(c)+baf_peatf(c) ! burned area out of conversion region due to land use fire - fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) + fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) end if - ! total burned area out of conversion - fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) + ! total burned area out of conversion + fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) else fbac(c) = farea_burned(c) end if From 79df5d5c43ee2557f73224dd557e5ff2ae2c4819 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 26 Oct 2021 11:08:44 -0700 Subject: [PATCH 02/18] Move the gdp and related variable definitions to FireDataBaseType IDE auto cleaned up trailing whitespaces. --- src/biogeochem/CNVegStateType.F90 | 152 ++++++++++++------------ src/cpl/mct/FireDataBaseType.F90 | 4 + src/cpl/share_esmf/FireDataBaseType.F90 | 5 + 3 files changed, 83 insertions(+), 78 deletions(-) diff --git a/src/biogeochem/CNVegStateType.F90 b/src/biogeochem/CNVegStateType.F90 index afdfa190aa..c85cdc4ad1 100644 --- a/src/biogeochem/CNVegStateType.F90 +++ b/src/biogeochem/CNVegStateType.F90 @@ -10,9 +10,9 @@ module CNVegStateType use clm_varctl , only : use_cn, iulog, fsurdat, use_crop, use_cndv use clm_varcon , only : spval, ispval, grlnd use landunit_varcon, only : istsoil, istcrop - use LandunitType , only : lun - use ColumnType , only : col - use PatchType , only : patch + use LandunitType , only : lun + use ColumnType , only : col + use PatchType , only : patch use AnnualFluxDribbler, only : annual_flux_dribbler_type, annual_flux_dribbler_patch use dynSubgridControlMod, only : get_for_testing_allow_non_annual_changes ! @@ -45,10 +45,6 @@ module CNVegStateType integer , pointer :: idop_patch (:) ! patch date of planting - real(r8) , pointer :: gdp_lf_col (:) ! col global real gdp data (k US$/capita) - real(r8) , pointer :: peatf_lf_col (:) ! col global peatland fraction data (0-1) - integer , pointer :: abm_lf_col (:) ! col global peak month of crop fire emissions - real(r8) , pointer :: lgdp_col (:) ! col gdp limitation factor for fire occurrence (0-1) real(r8) , pointer :: lgdp1_col (:) ! col gdp limitation factor for fire spreading (0-1) real(r8) , pointer :: lpop_col (:) ! col pop limitation factor for fire spreading (0-1) @@ -74,7 +70,7 @@ module CNVegStateType real(r8) , pointer :: fbac1_col (:) ! col burned area out of conversion region due to land use fire (/sec) real(r8) , pointer :: wtlf_col (:) ! col fractional coverage of non-crop Patches (0-1) real(r8) , pointer :: lfwt_col (:) ! col fractional coverage of non-crop and non-bare-soil Patches (0-1) - real(r8) , pointer :: farea_burned_col (:) ! col fractional area burned (/sec) + real(r8) , pointer :: farea_burned_col (:) ! col fractional area burned (/sec) real(r8), pointer :: dormant_flag_patch (:) ! patch dormancy flag real(r8), pointer :: days_active_patch (:) ! patch number of days since last dormancy @@ -105,11 +101,11 @@ module CNVegStateType contains - procedure, public :: Init - procedure, public :: Restart - procedure, private :: InitAllocate - procedure, private :: InitHistory - procedure, private :: InitCold + procedure, public :: Init + procedure, public :: Restart + procedure, private :: InitAllocate + procedure, private :: InitHistory + procedure, private :: InitCold end type cnveg_state_type !------------------------------------------------------------------------ @@ -123,13 +119,13 @@ module CNVegStateType subroutine Init(this, bounds) class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds call this%InitAllocate ( bounds ) if (use_cn) then call this%InitHistory ( bounds ) end if - call this%InitCold ( bounds ) + call this%InitCold ( bounds ) end subroutine Init @@ -144,7 +140,7 @@ subroutine InitAllocate(this, bounds) ! ! !ARGUMENTS: class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: begp, endp @@ -211,12 +207,12 @@ subroutine InitAllocate(this, bounds) allocate(this%idop_patch (begp:endp)) ; this%idop_patch (:) = huge(1) allocate(this%gdp_lf_col (begc:endc)) ; - allocate(this%peatf_lf_col (begc:endc)) ; - allocate(this%abm_lf_col (begc:endc)) ; + allocate(this%peatf_lf_col (begc:endc)) ; + allocate(this%abm_lf_col (begc:endc)) ; - allocate(this%lgdp_col (begc:endc)) ; - allocate(this%lgdp1_col (begc:endc)) ; - allocate(this%lpop_col (begc:endc)) ; + allocate(this%lgdp_col (begc:endc)) ; + allocate(this%lgdp1_col (begc:endc)) ; + allocate(this%lpop_col (begc:endc)) ; allocate(this%tempavg_t2m_patch (begp:endp)) ; this%tempavg_t2m_patch (:) = nan allocate(this%annsum_counter_col (begc:endc)) ; this%annsum_counter_col (:) = nan @@ -280,7 +276,7 @@ subroutine InitHistory(this, bounds) ! ! !ARGUMENTS: class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: begp, endp @@ -334,7 +330,7 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='BAF_PEATF', units='s-1', & avgflag='A', long_name='fractional area burned in peatland', & ptr_col=this%baf_peatf_col) - + this%annavg_t2m_patch(begp:endp) = spval call hist_addfld1d (fname='ANNAVG_T2M', units='K', & avgflag='A', long_name='annual average 2m air temperature', & @@ -477,7 +473,7 @@ subroutine initCold(this, bounds) ! ! !ARGUMENTS: class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: g,l,c,p,n,j,m ! indices @@ -488,7 +484,7 @@ subroutine initCold(this, bounds) integer :: dimid ! dimension id integer :: ier ! error status type(file_desc_t) :: ncid ! netcdf id - logical :: readvar + logical :: readvar character(len=256) :: locfn ! local filename integer :: begc, endc integer :: begg, endg @@ -505,13 +501,13 @@ subroutine initCold(this, bounds) call ncd_pio_openfile (ncid, locfn, 0) ! -------------------------------------------------------------------- - ! Read in GDP data + ! Read in GDP data ! -------------------------------------------------------------------- allocate(gdp(bounds%begg:bounds%endg)) call ncd_io(ncid=ncid, varname='gdp', flag='read', data=gdp, dim1name=grlnd, readvar=readvar) if (.not. readvar) then - call endrun(msg=' ERROR: gdp NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + call endrun(msg=' ERROR: gdp NOT on surfdata file'//errMsg(sourcefile, __LINE__)) end if do c = bounds%begc, bounds%endc g = col%gridcell(c) @@ -520,13 +516,13 @@ subroutine initCold(this, bounds) deallocate(gdp) ! -------------------------------------------------------------------- - ! Read in peatf data + ! Read in peatf data ! -------------------------------------------------------------------- allocate(peatf(bounds%begg:bounds%endg)) call ncd_io(ncid=ncid, varname='peatf', flag='read', data=peatf, dim1name=grlnd, readvar=readvar) if (.not. readvar) then - call endrun(msg=' ERROR: peatf NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + call endrun(msg=' ERROR: peatf NOT on surfdata file'//errMsg(sourcefile, __LINE__)) end if do c = bounds%begc, bounds%endc g = col%gridcell(c) @@ -535,13 +531,13 @@ subroutine initCold(this, bounds) deallocate(peatf) ! -------------------------------------------------------------------- - ! Read in ABM data + ! Read in ABM data ! -------------------------------------------------------------------- allocate(abm(bounds%begg:bounds%endg)) call ncd_io(ncid=ncid, varname='abm', flag='read', data=abm, dim1name=grlnd, readvar=readvar) if (.not. readvar) then - call endrun(msg=' ERROR: abm NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + call endrun(msg=' ERROR: abm NOT on surfdata file'//errMsg(sourcefile, __LINE__)) end if do c = bounds%begc, bounds%endc g = col%gridcell(c) @@ -557,12 +553,12 @@ subroutine initCold(this, bounds) write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' write(iulog,*) endif - + ! -------------------------------------------------------------------- ! Initialize terms needed for dust model - ! TODO - move these terms to DUSTMod module variables + ! TODO - move these terms to DUSTMod module variables ! -------------------------------------------------------------------- - + do c = bounds%begc, bounds%endc l = col%landunit(c) if (lun%ifspecial(l)) then @@ -577,15 +573,15 @@ subroutine initCold(this, bounds) end if if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - this%annsum_counter_col(c) = 0._r8 - this%annavg_t2m_col(c) = 280._r8 - - ! fire related variables - this%baf_crop_col(c) = 0._r8 - this%baf_peatf_col(c) = 0._r8 - this%fbac_col(c) = 0._r8 - this%fbac1_col(c) = 0._r8 - this%farea_burned_col(c) = 0._r8 + this%annsum_counter_col(c) = 0._r8 + this%annavg_t2m_col(c) = 280._r8 + + ! fire related variables + this%baf_crop_col(c) = 0._r8 + this%baf_peatf_col(c) = 0._r8 + this%fbac_col(c) = 0._r8 + this%fbac1_col(c) = 0._r8 + this%farea_burned_col(c) = 0._r8 this%nfire_col(c) = 0._r8 end if end do @@ -654,8 +650,8 @@ subroutine initCold(this, bounds) this%tempmax_retransn_patch(p) = 0._r8 this%annmax_retransn_patch(p) = 0._r8 this%downreg_patch(p) = 0._r8 - this%leafcn_offset_patch(p) = spval - this%plantCN_patch(p) = spval + this%leafcn_offset_patch(p) = spval + this%plantCN_patch(p) = spval end if end do @@ -684,9 +680,9 @@ subroutine Restart(this, bounds, ncid, flag, cnveg_carbonstate, & ! ! !ARGUMENTS: class(cnveg_state_type) :: this - type(bounds_type), intent(in) :: bounds - type(file_desc_t), intent(inout) :: ncid - character(len=*) , intent(in) :: flag + type(bounds_type), intent(in) :: bounds + type(file_desc_t), intent(inout) :: ncid + character(len=*) , intent(in) :: flag type(cnveg_nitrogenstate_type), intent(in) :: cnveg_nitrogenstate type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate integer , intent(out), optional :: filter_reseed_patch(:) @@ -704,128 +700,128 @@ subroutine Restart(this, bounds, ncid, flag, cnveg_carbonstate, & call restartvar(ncid=ncid, flag=flag, varname='dormant_flag', xtype=ncd_double, & dim1name='pft', & long_name='dormancy flag', units='unitless', & - interpinic_flag='interp', readvar=readvar, data=this%dormant_flag_patch) + interpinic_flag='interp', readvar=readvar, data=this%dormant_flag_patch) call restartvar(ncid=ncid, flag=flag, varname='days_active', xtype=ncd_double, & dim1name='pft', & long_name='number of days since last dormancy', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%days_active_patch) + interpinic_flag='interp', readvar=readvar, data=this%days_active_patch) call restartvar(ncid=ncid, flag=flag, varname='onset_flag', xtype=ncd_double, & dim1name='pft', & long_name='flag if critical growing degree-day sum is exceeded', units='unitless' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_flag_patch) + interpinic_flag='interp', readvar=readvar, data=this%onset_flag_patch) call restartvar(ncid=ncid, flag=flag, varname='onset_counter', xtype=ncd_double, & dim1name='pft', & long_name='onset days counter', units='sec' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_counter_patch) + interpinic_flag='interp', readvar=readvar, data=this%onset_counter_patch) call restartvar(ncid=ncid, flag=flag, varname='onset_gddflag', xtype=ncd_double, & dim1name='pft', & long_name='onset flag for growing degree day sum', units='' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_gddflag_patch) + interpinic_flag='interp', readvar=readvar, data=this%onset_gddflag_patch) call restartvar(ncid=ncid, flag=flag, varname='onset_fdd', xtype=ncd_double, & dim1name='pft', & long_name='onset freezing degree days counter', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_fdd_patch) + interpinic_flag='interp', readvar=readvar, data=this%onset_fdd_patch) call restartvar(ncid=ncid, flag=flag, varname='onset_gdd', xtype=ncd_double, & dim1name='pft', & long_name='onset growing degree days', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_gdd_patch) + interpinic_flag='interp', readvar=readvar, data=this%onset_gdd_patch) call restartvar(ncid=ncid, flag=flag, varname='onset_swi', xtype=ncd_double, & dim1name='pft', & long_name='onset soil water index', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%onset_swi_patch) + interpinic_flag='interp', readvar=readvar, data=this%onset_swi_patch) call restartvar(ncid=ncid, flag=flag, varname='offset_flag', xtype=ncd_double, & dim1name='pft', & long_name='offset flag', units='unitless' , & - interpinic_flag='interp', readvar=readvar, data=this%offset_flag_patch) + interpinic_flag='interp', readvar=readvar, data=this%offset_flag_patch) call restartvar(ncid=ncid, flag=flag, varname='offset_counter', xtype=ncd_double, & dim1name='pft', & long_name='offset days counter', units='sec' , & - interpinic_flag='interp', readvar=readvar, data=this%offset_counter_patch) + interpinic_flag='interp', readvar=readvar, data=this%offset_counter_patch) call restartvar(ncid=ncid, flag=flag, varname='offset_fdd', xtype=ncd_double, & dim1name='pft', & long_name='offset freezing degree days counter', units='days' , & - interpinic_flag='interp', readvar=readvar, data=this%offset_fdd_patch) + interpinic_flag='interp', readvar=readvar, data=this%offset_fdd_patch) call restartvar(ncid=ncid, flag=flag, varname='offset_swi', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%offset_swi_patch) + interpinic_flag='interp', readvar=readvar, data=this%offset_swi_patch) call restartvar(ncid=ncid, flag=flag, varname='lgsf', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%lgsf_patch) + interpinic_flag='interp', readvar=readvar, data=this%lgsf_patch) call restartvar(ncid=ncid, flag=flag, varname='bglfr', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%bglfr_patch) + interpinic_flag='interp', readvar=readvar, data=this%bglfr_patch) call restartvar(ncid=ncid, flag=flag, varname='bgtr', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%bgtr_patch) + interpinic_flag='interp', readvar=readvar, data=this%bgtr_patch) call restartvar(ncid=ncid, flag=flag, varname='annavg_t2m', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annavg_t2m_patch) + interpinic_flag='interp', readvar=readvar, data=this%annavg_t2m_patch) call restartvar(ncid=ncid, flag=flag, varname='tempavg_t2m', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tempavg_t2m_patch) + interpinic_flag='interp', readvar=readvar, data=this%tempavg_t2m_patch) call restartvar(ncid=ncid, flag=flag, varname='c_allometry', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%c_allometry_patch) + interpinic_flag='interp', readvar=readvar, data=this%c_allometry_patch) call restartvar(ncid=ncid, flag=flag, varname='n_allometry', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%n_allometry_patch) + interpinic_flag='interp', readvar=readvar, data=this%n_allometry_patch) call restartvar(ncid=ncid, flag=flag, varname='tempsum_potential_gpp', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tempsum_potential_gpp_patch) + interpinic_flag='interp', readvar=readvar, data=this%tempsum_potential_gpp_patch) call restartvar(ncid=ncid, flag=flag, varname='annsum_potential_gpp', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annsum_potential_gpp_patch) + interpinic_flag='interp', readvar=readvar, data=this%annsum_potential_gpp_patch) call restartvar(ncid=ncid, flag=flag, varname='tempmax_retransn', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%tempmax_retransn_patch) + interpinic_flag='interp', readvar=readvar, data=this%tempmax_retransn_patch) call restartvar(ncid=ncid, flag=flag, varname='annmax_retransn', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annmax_retransn_patch) + interpinic_flag='interp', readvar=readvar, data=this%annmax_retransn_patch) call restartvar(ncid=ncid, flag=flag, varname='downreg', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%downreg_patch) + interpinic_flag='interp', readvar=readvar, data=this%downreg_patch) call restartvar(ncid=ncid, flag=flag, varname='leafcn_offset', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & interpinic_flag='interp', readvar=readvar, data=this%leafcn_offset_patch) - + call restartvar(ncid=ncid, flag=flag, varname='plantCN', xtype=ncd_double, & dim1name='pft', & long_name='', units='', & @@ -834,22 +830,22 @@ subroutine Restart(this, bounds, ncid, flag, cnveg_carbonstate, & call restartvar(ncid=ncid, flag=flag, varname='annsum_counter', xtype=ncd_double, & dim1name='column', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annsum_counter_col) + interpinic_flag='interp', readvar=readvar, data=this%annsum_counter_col) call restartvar(ncid=ncid, flag=flag, varname='burndate', xtype=ncd_int, & dim1name='pft', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%burndate_patch) + interpinic_flag='interp', readvar=readvar, data=this%burndate_patch) call restartvar(ncid=ncid, flag=flag, varname='lfc', xtype=ncd_double, & dim1name='column', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%lfc_col) + interpinic_flag='interp', readvar=readvar, data=this%lfc_col) call restartvar(ncid=ncid, flag=flag, varname='cannavg_t2m', xtype=ncd_double, & dim1name='column', & long_name='', units='', & - interpinic_flag='interp', readvar=readvar, data=this%annavg_t2m_col) + interpinic_flag='interp', readvar=readvar, data=this%annavg_t2m_col) if (use_crop) then @@ -864,7 +860,7 @@ subroutine Restart(this, bounds, ncid, flag, cnveg_carbonstate, & interpinic_flag='interp', readvar=readvar, data=this%peaklai_patch) call restartvar(ncid=ncid, flag=flag, varname='idop', xtype=ncd_int, & - dim1name='pft', long_name='Date of planting', units='jday', nvalid_range=(/1,366/), & + dim1name='pft', long_name='Date of planting', units='jday', nvalid_range=(/1,366/), & interpinic_flag='interp', readvar=readvar, data=this%idop_patch) call restartvar(ncid=ncid, flag=flag, varname='aleaf', xtype=ncd_double, & diff --git a/src/cpl/mct/FireDataBaseType.F90 b/src/cpl/mct/FireDataBaseType.F90 index 2d95422fd7..86357da4ca 100644 --- a/src/cpl/mct/FireDataBaseType.F90 +++ b/src/cpl/mct/FireDataBaseType.F90 @@ -35,6 +35,10 @@ module FireDataBaseType real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency real(r8), public, pointer :: forc_hdm(:) ! Human population density + real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita) + real(r8), public, pointer :: peatf_lf_col(:) ! col global peatland fraction data (0-1) + integer , public, pointer :: abm_lf_col(:) ! col global peak month of crop fire emissions + type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream diff --git a/src/cpl/share_esmf/FireDataBaseType.F90 b/src/cpl/share_esmf/FireDataBaseType.F90 index 652295e0c5..aee2210cce 100644 --- a/src/cpl/share_esmf/FireDataBaseType.F90 +++ b/src/cpl/share_esmf/FireDataBaseType.F90 @@ -30,6 +30,11 @@ module FireDataBaseType type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency type(shr_strdata_type) :: sdat_lnfm ! Lightning frequency input data stream + + real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita) + real(r8), public, pointer :: peatf_lf_col(:) ! col global peatland fraction data (0-1) + integer , public, pointer :: abm_lf_col(:) ! col global peak month of crop fire emissions + contains ! ! !PUBLIC MEMBER FUNCTIONS: From 7ce6e169f9aa98f0950ce09a27dc69b924a84335 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 26 Oct 2021 12:04:11 -0700 Subject: [PATCH 03/18] Adding surfdataread method to FireDataBaseType (mct) This moves the the surface data read of gdp from CNVegStateType InitCold procedure into the fire_base_type --- src/biogeochem/CNVegStateType.F90 | 85 +---------------- src/cpl/mct/FireDataBaseType.F90 | 120 ++++++++++++++++++++++-- src/cpl/share_esmf/FireDataBaseType.F90 | 7 ++ 3 files changed, 118 insertions(+), 94 deletions(-) diff --git a/src/biogeochem/CNVegStateType.F90 b/src/biogeochem/CNVegStateType.F90 index c85cdc4ad1..e79172c22e 100644 --- a/src/biogeochem/CNVegStateType.F90 +++ b/src/biogeochem/CNVegStateType.F90 @@ -206,10 +206,6 @@ subroutine InitAllocate(this, bounds) allocate(this%idop_patch (begp:endp)) ; this%idop_patch (:) = huge(1) - allocate(this%gdp_lf_col (begc:endc)) ; - allocate(this%peatf_lf_col (begc:endc)) ; - allocate(this%abm_lf_col (begc:endc)) ; - allocate(this%lgdp_col (begc:endc)) ; allocate(this%lgdp1_col (begc:endc)) ; allocate(this%lpop_col (begc:endc)) ; @@ -466,94 +462,15 @@ end subroutine InitHistory subroutine initCold(this, bounds) ! ! !USES: - use spmdMod , only : masterproc - use fileutils , only : getfil - use clm_varctl , only : nsrest, nsrStartup - use ncdio_pio ! ! !ARGUMENTS: class(cnveg_state_type) :: this type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: - integer :: g,l,c,p,n,j,m ! indices - real(r8) ,pointer :: gdp (:) ! global gdp data (needs to be a pointer for use in ncdio) - real(r8) ,pointer :: peatf (:) ! global peatf data (needs to be a pointer for use in ncdio) - integer ,pointer :: abm (:) ! global abm data (needs to be a pointer for use in ncdio) - real(r8) ,pointer :: gti (:) ! read in - fmax (needs to be a pointer for use in ncdio) - integer :: dimid ! dimension id - integer :: ier ! error status - type(file_desc_t) :: ncid ! netcdf id - logical :: readvar - character(len=256) :: locfn ! local filename - integer :: begc, endc - integer :: begg, endg + integer :: g,l,c,p ! dices !----------------------------------------------------------------------- - begc = bounds%begc; endc= bounds%endc - begg = bounds%begg; endg= bounds%endg - - ! -------------------------------------------------------------------- - ! Open surface dataset - ! -------------------------------------------------------------------- - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - ! -------------------------------------------------------------------- - ! Read in GDP data - ! -------------------------------------------------------------------- - - allocate(gdp(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='gdp', flag='read', data=gdp, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: gdp NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%gdp_lf_col(c) = gdp(g) - end do - deallocate(gdp) - - ! -------------------------------------------------------------------- - ! Read in peatf data - ! -------------------------------------------------------------------- - - allocate(peatf(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='peatf', flag='read', data=peatf, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: peatf NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%peatf_lf_col(c) = peatf(g) - end do - deallocate(peatf) - - ! -------------------------------------------------------------------- - ! Read in ABM data - ! -------------------------------------------------------------------- - - allocate(abm(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='abm', flag='read', data=abm, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: abm NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%abm_lf_col(c) = abm(g) - end do - deallocate(abm) - - ! Close file - - call ncd_pio_closefile(ncid) - - if (masterproc) then - write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' - write(iulog,*) - endif - ! -------------------------------------------------------------------- ! Initialize terms needed for dust model ! TODO - move these terms to DUSTMod module variables diff --git a/src/cpl/mct/FireDataBaseType.F90 b/src/cpl/mct/FireDataBaseType.F90 index 86357da4ca..19b77e68d9 100644 --- a/src/cpl/mct/FireDataBaseType.F90 +++ b/src/cpl/mct/FireDataBaseType.F90 @@ -32,12 +32,12 @@ module FireDataBaseType private ! !PRIVATE MEMBER DATA: - real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency - real(r8), public, pointer :: forc_hdm(:) ! Human population density - - real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita) - real(r8), public, pointer :: peatf_lf_col(:) ! col global peatland fraction data (0-1) - integer , public, pointer :: abm_lf_col(:) ! col global peak month of crop fire emissions + real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency + real(r8), public, pointer :: forc_hdm(:) ! Human population density + + real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita) + real(r8), public, pointer :: peatf_lf_col(:) ! col global peatland fraction data (0-1) + integer , public, pointer :: abm_lf_col(:) ! col global peak month of crop fire emissions type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream @@ -53,10 +53,11 @@ module FireDataBaseType need_lightning_and_popdens ! Returns true if need lightning & popdens ! ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: hdm_init ! position datasets for dynamic human population density - procedure, private :: hdm_interp ! interpolates between two years of human pop. density file data - procedure, private :: lnfm_init ! position datasets for Lightning - procedure, private :: lnfm_interp ! interpolates between two years of Lightning file data + procedure, private :: hdm_init ! position datasets for dynamic human population density + procedure, private :: hdm_interp ! interpolates between two years of human pop. density file data + procedure, private :: lnfm_init ! position datasets for Lightning + procedure, private :: lnfm_interp ! interpolates between two years of Lightning file data + procedure, private :: surfdataread ! read fire related data from surface data set end type fire_base_type !----------------------------------------------------------------------- @@ -116,6 +117,14 @@ subroutine BaseFireInit( this, bounds, NLFilename ) ! Allocate pop dens forcing data allocate( this%forc_hdm(bounds%begg:bounds%endg) ) this%forc_hdm(bounds%begg:) = nan + + ! Allocate real gdp data + allocate(this%gdp_lf_col(bounds%begc:bounds%bounds%endc)) + ! Allocate peatland fraction data + allocate(this%peatf_lf_col(bounds%begc:bounds%bounds%endc)) + ! Allocates peak month of crop fire emissions + allocate(this%abm_lf_col(bounds%begc:bounds%bounds%endc)) + call this%hdm_init(bounds, NLFilename) call this%hdm_interp(bounds) @@ -456,4 +465,95 @@ subroutine lnfm_interp(this, bounds ) end subroutine lnfm_interp + !----------------------------------------------------------------------- + subroutine surfdataread(this, bounds) + ! + ! !DESCRIPTION: + ! Read surface data set to populate relevant fire-related variables + ! + ! !USES: + use spmdMod , only : masterproc + use clm_varctl , only : nsrest, nsrStartup, fsurdat + use ColumnType , only : col + use fileutils , only : getfil + use ncdio_pio + ! + ! !ARGUMENTS: + class(fire_base_type) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: g,c ! indices + type(file_desc_t) :: ncid ! netcdf id + logical :: readvar ! true => variable is on initial dataset + character(len=256) :: locfn ! local filename + real(r8), pointer :: gdp(:) ! global gdp data (needs to be a pointer for use in ncdio) + real(r8), pointer :: peatf(:) ! global peatf data (needs to be a pointer for use in ncdio) + integer, pointer :: abm(:) ! global abm data (needs to be a pointer for use in ncdio) + !----------------------------------------------------------------------- + + ! -------------------------------------------------------------------- + ! Open surface dataset + ! -------------------------------------------------------------------- + + call getfil (fsurdat, locfn, 0) + call ncd_pio_openfile (ncid, locfn, 0) + + ! -------------------------------------------------------------------- + ! Read in GDP data + ! -------------------------------------------------------------------- + + allocate(gdp(bounds%begg:bounds%endg)) + call ncd_io(ncid=ncid, varname='gdp', flag='read', data=gdp, dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun(msg=' ERROR: gdp NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + end if + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%gdp_lf_col(c) = gdp(g) + end do + deallocate(gdp) + + ! -------------------------------------------------------------------- + ! Read in peatf data + ! -------------------------------------------------------------------- + + allocate(peatf(bounds%begg:bounds%endg)) + call ncd_io(ncid=ncid, varname='peatf', flag='read', data=peatf, dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun(msg=' ERROR: peatf NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + end if + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%peatf_lf_col(c) = peatf(g) + end do + deallocate(peatf) + + ! -------------------------------------------------------------------- + ! Read in ABM data + ! -------------------------------------------------------------------- + + allocate(abm(bounds%begg:bounds%endg)) + call ncd_io(ncid=ncid, varname='abm', flag='read', data=abm, dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun(msg=' ERROR: abm NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + end if + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%abm_lf_col(c) = abm(g) + end do + deallocate(abm) + + ! Close file + + call ncd_pio_closefile(ncid) + + if (masterproc) then + write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' + write(iulog,*) + endif + + end subroutine surfdataread + + end module FireDataBaseType diff --git a/src/cpl/share_esmf/FireDataBaseType.F90 b/src/cpl/share_esmf/FireDataBaseType.F90 index aee2210cce..71eed3be87 100644 --- a/src/cpl/share_esmf/FireDataBaseType.F90 +++ b/src/cpl/share_esmf/FireDataBaseType.F90 @@ -110,6 +110,13 @@ subroutine BaseFireInit( this, bounds, NLFilename ) ! Allocate pop dens forcing data allocate( this%forc_hdm(bounds%begg:bounds%endg) ) this%forc_hdm(bounds%begg:) = nan + + ! Allocate real gdp data + allocate(this%gdp_lf_col(bounds%begc:bounds%bounds%endc)) + ! Allocate peatland fraction data + allocate(this%peatf_lf_col(bounds%begc:bounds%bounds%endc)) + ! Allocates peak month of crop fire emissions + allocate(this%abm_lf_col(bounds%begc:bounds%bounds%endc)) call this%hdm_init(bounds, NLFilename) call this%hdm_interp(bounds) From 3748a3527eb320284a9e3daaaab5c12820b08111 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 28 Oct 2021 12:33:14 -0600 Subject: [PATCH 04/18] build and typo fixes --- src/cpl/mct/FireDataBaseType.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cpl/mct/FireDataBaseType.F90 b/src/cpl/mct/FireDataBaseType.F90 index 19b77e68d9..429d003a3c 100644 --- a/src/cpl/mct/FireDataBaseType.F90 +++ b/src/cpl/mct/FireDataBaseType.F90 @@ -119,11 +119,11 @@ subroutine BaseFireInit( this, bounds, NLFilename ) this%forc_hdm(bounds%begg:) = nan ! Allocate real gdp data - allocate(this%gdp_lf_col(bounds%begc:bounds%bounds%endc)) + allocate(this%gdp_lf_col(bounds%begc:bounds%endc)) ! Allocate peatland fraction data - allocate(this%peatf_lf_col(bounds%begc:bounds%bounds%endc)) + allocate(this%peatf_lf_col(bounds%begc:bounds%endc)) ! Allocates peak month of crop fire emissions - allocate(this%abm_lf_col(bounds%begc:bounds%bounds%endc)) + allocate(this%abm_lf_col(bounds%begc:bounds%endc)) call this%hdm_init(bounds, NLFilename) @@ -474,6 +474,7 @@ subroutine surfdataread(this, bounds) ! !USES: use spmdMod , only : masterproc use clm_varctl , only : nsrest, nsrStartup, fsurdat + use clm_varcon , only : grlnd use ColumnType , only : col use fileutils , only : getfil use ncdio_pio From 8877b27ebbfbbe91e29190df3bc34732e745d185 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 28 Oct 2021 14:31:02 -0600 Subject: [PATCH 05/18] adding call to surfacedataread --- src/cpl/mct/FireDataBaseType.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cpl/mct/FireDataBaseType.F90 b/src/cpl/mct/FireDataBaseType.F90 index 429d003a3c..0ee635b2fa 100644 --- a/src/cpl/mct/FireDataBaseType.F90 +++ b/src/cpl/mct/FireDataBaseType.F90 @@ -130,6 +130,7 @@ subroutine BaseFireInit( this, bounds, NLFilename ) call this%hdm_interp(bounds) call this%lnfm_init(bounds, NLFilename) call this%lnfm_interp(bounds) + call this%surfdataread(bounds) end if end subroutine BaseFireInit From 2f95ed384a53f285ee51a5fa2f01548f53346a98 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 28 Oct 2021 13:51:42 -0700 Subject: [PATCH 06/18] adding surfdataread to share_esmf version of firedatabasetype --- src/cpl/share_esmf/FireDataBaseType.F90 | 107 ++++++++++++++++++++++-- 1 file changed, 100 insertions(+), 7 deletions(-) diff --git a/src/cpl/share_esmf/FireDataBaseType.F90 b/src/cpl/share_esmf/FireDataBaseType.F90 index 71eed3be87..40d5f3c260 100644 --- a/src/cpl/share_esmf/FireDataBaseType.F90 +++ b/src/cpl/share_esmf/FireDataBaseType.F90 @@ -47,10 +47,11 @@ module FireDataBaseType need_lightning_and_popdens ! Returns true if need lightning & popdens ! ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: hdm_init ! position datasets for dynamic human population density - procedure, private :: hdm_interp ! interpolates between two years of human pop. density file data - procedure, private :: lnfm_init ! position datasets for Lightning - procedure, private :: lnfm_interp ! interpolates between two years of Lightning file data + procedure, private :: hdm_init ! position datasets for dynamic human population density + procedure, private :: hdm_interp ! interpolates between two years of human pop. density file data + procedure, private :: lnfm_init ! position datasets for Lightning + procedure, private :: lnfm_interp ! interpolates between two years of Lightning file data + procedure, private :: surfdataread ! read fire related data from surface data set end type fire_base_type abstract interface @@ -112,16 +113,17 @@ subroutine BaseFireInit( this, bounds, NLFilename ) this%forc_hdm(bounds%begg:) = nan ! Allocate real gdp data - allocate(this%gdp_lf_col(bounds%begc:bounds%bounds%endc)) + allocate(this%gdp_lf_col(bounds%begc:bounds%endc)) ! Allocate peatland fraction data - allocate(this%peatf_lf_col(bounds%begc:bounds%bounds%endc)) + allocate(this%peatf_lf_col(bounds%begc:bounds%endc)) ! Allocates peak month of crop fire emissions - allocate(this%abm_lf_col(bounds%begc:bounds%bounds%endc)) + allocate(this%abm_lf_col(bounds%begc:bounds%endc)) call this%hdm_init(bounds, NLFilename) call this%hdm_interp(bounds) call this%lnfm_init(bounds, NLFilename) call this%lnfm_interp(bounds) + call this%surfdataread(bounds) end if end subroutine BaseFireInit @@ -476,5 +478,96 @@ subroutine lnfm_interp(this, bounds ) end do end subroutine lnfm_interp + + !----------------------------------------------------------------------- + subroutine surfdataread(this, bounds) + ! + ! !DESCRIPTION: + ! Read surface data set to populate relevant fire-related variables + ! + ! !USES: + use spmdMod , only : masterproc + use clm_varctl , only : nsrest, nsrStartup, fsurdat + use clm_varcon , only : grlnd + use ColumnType , only : col + use fileutils , only : getfil + use ncdio_pio + ! + ! !ARGUMENTS: + class(fire_base_type) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: g,c ! indices + type(file_desc_t) :: ncid ! netcdf id + logical :: readvar ! true => variable is on initial dataset + character(len=256) :: locfn ! local filename + real(r8), pointer :: gdp(:) ! global gdp data (needs to be a pointer for use in ncdio) + real(r8), pointer :: peatf(:) ! global peatf data (needs to be a pointer for use in ncdio) + integer, pointer :: abm(:) ! global abm data (needs to be a pointer for use in ncdio) + !----------------------------------------------------------------------- + + ! -------------------------------------------------------------------- + ! Open surface dataset + ! -------------------------------------------------------------------- + + call getfil (fsurdat, locfn, 0) + call ncd_pio_openfile (ncid, locfn, 0) + + ! -------------------------------------------------------------------- + ! Read in GDP data + ! -------------------------------------------------------------------- + + allocate(gdp(bounds%begg:bounds%endg)) + call ncd_io(ncid=ncid, varname='gdp', flag='read', data=gdp, dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun(msg=' ERROR: gdp NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + end if + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%gdp_lf_col(c) = gdp(g) + end do + deallocate(gdp) + + ! -------------------------------------------------------------------- + ! Read in peatf data + ! -------------------------------------------------------------------- + + allocate(peatf(bounds%begg:bounds%endg)) + call ncd_io(ncid=ncid, varname='peatf', flag='read', data=peatf, dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun(msg=' ERROR: peatf NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + end if + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%peatf_lf_col(c) = peatf(g) + end do + deallocate(peatf) + + ! -------------------------------------------------------------------- + ! Read in ABM data + ! -------------------------------------------------------------------- + + allocate(abm(bounds%begg:bounds%endg)) + call ncd_io(ncid=ncid, varname='abm', flag='read', data=abm, dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun(msg=' ERROR: abm NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + end if + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%abm_lf_col(c) = abm(g) + end do + deallocate(abm) + + ! Close file + + call ncd_pio_closefile(ncid) + + if (masterproc) then + write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' + write(iulog,*) + endif + + end subroutine surfdataread end module FireDataBaseType From bca6170326f0021442ba59fb9da3134ec107e370 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 8 Nov 2021 11:50:46 -0800 Subject: [PATCH 07/18] Prepping GetGDP function for anthropogenic fire suppression --- src/biogeochem/FATESFireBase.F90 | 16 +++++++++++ src/biogeochem/FATESFireDataMod.F90 | 15 ++++++++++ src/biogeochem/FATESFireFactoryMod.F90 | 11 ++++---- src/biogeochem/FATESFireNoDataMod.F90 | 17 ++++++++++- src/utils/clmfates_interfaceMod.F90 | 39 +++++++++++++++++++------- 5 files changed, 82 insertions(+), 16 deletions(-) diff --git a/src/biogeochem/FATESFireBase.F90 b/src/biogeochem/FATESFireBase.F90 index 457e577a7b..faa32d979b 100644 --- a/src/biogeochem/FATESFireBase.F90 +++ b/src/biogeochem/FATESFireBase.F90 @@ -26,6 +26,7 @@ module FATESFireBase contains ! !PUBLIC MEMBER FUNCTIONS: procedure(GetLight24_interface), public, deferred :: GetLight24 ! Return the 24-hour averaged lightning data + procedure(GetGDP_interface), public, deferred :: GetGDP ! Return the global gdp data procedure(InitAccBuffer_interface), public, deferred :: InitAccBuffer ! Initialize accumulation processes procedure(InitAccVars_interface), public, deferred :: InitAccVars ! Initialize accumulation variables procedure(UpdateAccVars_interface), public, deferred :: UpdateAccVars ! Update/extract accumulations vars @@ -56,6 +57,21 @@ function GetLight24_interface( this ) result(lnfm24) !--------------------------------------------------------------------- !--------------------------------------------------------------------- end function GetLight24_interface + + !------------------------------------------------------------------------ + function GetGDP_interface( this ) result(gdp) + ! + ! !DESCRIPTION: Get the 24-hour averaged lightning data + ! !USES + use shr_kind_mod , only: r8 => shr_kind_r8 + import :: fates_fire_base_type + ! + ! !ARGUMENTS: + class(fates_fire_base_type) :: this + real(r8), pointer :: gdp(:) + !--------------------------------------------------------------------- + !--------------------------------------------------------------------- + end function GetGDP_interface !----------------------------------------------------------------------- subroutine InitAccBuffer_interface (this, bounds) diff --git a/src/biogeochem/FATESFireDataMod.F90 b/src/biogeochem/FATESFireDataMod.F90 index ce842cbf1c..c19718ec04 100644 --- a/src/biogeochem/FATESFireDataMod.F90 +++ b/src/biogeochem/FATESFireDataMod.F90 @@ -27,6 +27,7 @@ module FATESFireDataMod ! !PUBLIC MEMBER FUNCTIONS: procedure, public :: need_lightning_and_popdens procedure, public :: GetLight24 ! Return 24-hour averaged lightning data + procedure, public :: GetGDP ! Return the global gdp data procedure, public :: InitAccBuffer ! Initialize accumulation processes procedure, public :: InitAccVars ! Initialize accumulation variables procedure, public :: UpdateAccVars ! Update/extract accumulations vars @@ -65,6 +66,20 @@ function GetLight24( this ) result(lnfm24) !--------------------------------------------------------------------- end function + !----------------------------------------------------------------------- + function GetGDP( this ) result(gdp) + ! + ! !DESCRIPTION: Get the global gross domestic product data + ! !USES + ! + ! !ARGUMENTS: + class(fates_fire_data_type) :: this + real(r8), pointer :: gdp(:) + !--------------------------------------------------------------------- + gdp => this%gdp + !--------------------------------------------------------------------- + end function GetGDP + !----------------------------------------------------------------------- subroutine InitAccBuffer (this, bounds) ! diff --git a/src/biogeochem/FATESFireFactoryMod.F90 b/src/biogeochem/FATESFireFactoryMod.F90 index 4e8ea8681f..fcdb97c5ee 100644 --- a/src/biogeochem/FATESFireFactoryMod.F90 +++ b/src/biogeochem/FATESFireFactoryMod.F90 @@ -22,11 +22,12 @@ module FATESFireFactoryMod ! use them as flags elsewhere in the CTSM and FATES-SPITFIRE. ! They correspond one-to-one to the fates_spitfire_mode options listed ! in bld/namelist_files/namelist_definition_clm4_5.xml - integer, public, parameter :: no_fire = 0 ! value of no_fire mode - integer, public, parameter :: scalar_lightning = 1 ! value of scalar_lightning mode + integer, public, parameter :: no_fire = 0 ! value of no_fire mode + integer, public, parameter :: scalar_lightning = 1 ! value of scalar_lightning mode integer, public, parameter :: lightning_from_data = 2 ! value of lightning_from_data mode - integer, public, parameter :: successful_ignitions = 3 ! value of successful_ignitions mode - integer, public, parameter :: anthro_ignitions = 4 ! value of anthro_ignitions mode + integer, public, parameter :: successful_ignitions = 3 ! value of successful_ignitions mode + integer, public, parameter :: anthro_ignitions = 4 ! value of anthro_ignitions mode + integer, public, parameter :: anthro_suppression = 5 ! value of anthro_supression mode character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -61,7 +62,7 @@ subroutine create_fates_fire_data_method( fates_fire_data_method ) case (no_fire:scalar_lightning) allocate(fates_fire_no_data_type :: fates_fire_data_method) - case (lightning_from_data:anthro_ignitions) + case (lightning_from_data:anthro_suppression) allocate(fates_fire_data_type :: fates_fire_data_method) case default diff --git a/src/biogeochem/FATESFireNoDataMod.F90 b/src/biogeochem/FATESFireNoDataMod.F90 index 3597bef678..6bc9162d43 100644 --- a/src/biogeochem/FATESFireNoDataMod.F90 +++ b/src/biogeochem/FATESFireNoDataMod.F90 @@ -29,8 +29,9 @@ module FATESFireNoDataMod ! !PUBLIC MEMBER FUNCTIONS: procedure, public :: need_lightning_and_popdens procedure, public :: GetLight24 ! Return the 24-hour averaged lightning data + procedure, public :: GetGDP ! Return the global gdp data procedure, public :: InitAccBuffer ! Initialize accumulation processes - procedure, public :: InitAccVars ! Initialize accumulation variables + procedure, public :: InitAccVars ! Initialize accumulation variables procedure, public :: UpdateAccVars ! Update/extract accumulations vars end type fates_fire_no_data_type @@ -66,6 +67,20 @@ function GetLight24( this ) result(lnfm24) call endrun( "GetLight24 should NOT be called for the FATES No-Data case" ) !--------------------------------------------------------------------- end function + + !----------------------------------------------------------------------- + function GetGDP( this ) result(gdp) + ! + ! !DESCRIPTION: Get the global gross domestic product data + ! !USES + ! + ! !ARGUMENTS: + class(fates_fire_no_data_type) :: this + real(r8), pointer :: gdp(:) + !--------------------------------------------------------------------- + call endrun( "GetGDP should NOT be called for the FATES No-Data case" ) + !--------------------------------------------------------------------- + end function !----------------------------------------------------------------------- subroutine InitAccBuffer (this, bounds) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 5476d91fcc..5d2c6d7ff8 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -144,8 +144,8 @@ module CLMFatesInterfaceMod use FatesPlantHydraulicsMod, only : InitHydrSites use FatesPlantHydraulicsMod, only : RestartHydrStates use FATESFireBase , only : fates_fire_base_type - use FATESFireFactoryMod , only : no_fire, scalar_lightning, & - successful_ignitions, anthro_ignitions + use FATESFireFactoryMod , only : no_fire, scalar_lightning, successful_ignitions,& + anthro_ignitions, anthro_supression use dynSubgridControlMod , only : get_do_harvest use dynHarvestMod , only : num_harvest_inst, harvest_varnames use dynHarvestMod , only : harvest_units, mass_units, unitless_units @@ -319,6 +319,7 @@ subroutine CLMFatesGlobals() call set_fates_ctrlparms('sf_scalar_lightning_def',ival=scalar_lightning) call set_fates_ctrlparms('sf_successful_ignitions_def',ival=successful_ignitions) call set_fates_ctrlparms('sf_anthro_ignitions_def',ival=anthro_ignitions) + call set_fates_ctrlparms('sf_anthro_supression_def',ival=anthro_supression) if(is_restart()) then pass_is_restart = 1 @@ -763,8 +764,9 @@ subroutine dynamics_driv(this, nc, bounds_clump, & integer :: p ! HLM patch index integer :: nlevsoil ! number of soil layers at the site integer :: nld_si ! site specific number of decomposition layers - integer :: ft ! plant functional type - real(r8), pointer :: lnfm24(:) + integer :: ft ! plant functional type + real(r8), pointer :: lnfm24(:) ! 24-hour averaged lightning data + real(r8), pointer :: gdp(:) ! gdp data integer :: ier integer :: begg,endg real(r8) :: harvest_rates(bounds_clump%begg:bounds_clump%endg,num_harvest_inst) @@ -796,13 +798,25 @@ subroutine dynamics_driv(this, nc, bounds_clump, & endif if (fates_spitfire_mode > scalar_lightning) then + allocate(lnfm24(bounds_clump%begg:bounds_clump%endg), stat=ier) if (ier /= 0) then call endrun(msg="allocation error for lnfm24"//& errmsg(sourcefile, __LINE__)) endif - lnfm24 = this%fates_fire_data_method%GetLight24() + + end if + + if (fates_spitfire_mode > scalar_lightning) then + + allocate(gdp(bounds_clump%begg:bounds_clump%endg), stat=ier) + if (ier /= 0) then + call endrun(msg="allocation error for gdp"//& + errmsg(sourcefile, __LINE__)) + endif + gdp = this%fates_fire_data_method%GetGDP() + end if do s=1,this%fates(nc)%nsites @@ -810,11 +824,16 @@ subroutine dynamics_driv(this, nc, bounds_clump, & g = col%gridcell(c) if (fates_spitfire_mode > scalar_lightning) then - do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno - this%fates(nc)%bc_in(s)%lightning24(ifp) = lnfm24(g) * 24._r8 ! #/km2/hr to #/km2/day - this%fates(nc)%bc_in(s)%pop_density(ifp) = this%fates_fire_data_method%forc_hdm(g) - end do ! ifp - end if + do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno + + this%fates(nc)%bc_in(s)%lightning24(ifp) = lnfm24(g) * 24._r8 ! #/km2/hr to #/km2/day + this%fates(nc)%bc_in(s)%pop_density(ifp) = this%fates_fire_data_method%forc_hdm(g) + + ! Placeholder for future fates use of gdp + this%fates(nc)%bc_in(s)%gdp(ifp) = gdp(g) ! k US$/capita(g) + + end do ! ifp + end if nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil From 1e556416d7d3e5bca00c4e90f428563a48261427 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 8 Nov 2021 12:01:22 -0800 Subject: [PATCH 08/18] refactor anthro data usage in clmfates_interfacemod --- src/utils/clmfates_interfaceMod.F90 | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 5d2c6d7ff8..1e7b5c4554 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -737,7 +737,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! to process array bounding information ! !USES - use FATESFireFactoryMod, only: scalar_lightning + use FATESFireFactoryMod, only: scalar_lightning, anthro_ignitions, anthro_suppression use subgridMod, only : natveg_patch_exists ! !ARGUMENTS: @@ -798,25 +798,21 @@ subroutine dynamics_driv(this, nc, bounds_clump, & endif if (fates_spitfire_mode > scalar_lightning) then - allocate(lnfm24(bounds_clump%begg:bounds_clump%endg), stat=ier) if (ier /= 0) then call endrun(msg="allocation error for lnfm24"//& errmsg(sourcefile, __LINE__)) endif lnfm24 = this%fates_fire_data_method%GetLight24() - end if - if (fates_spitfire_mode > scalar_lightning) then - + if (fates_spitfire_mode .eq. anthro_suppression) then allocate(gdp(bounds_clump%begg:bounds_clump%endg), stat=ier) if (ier /= 0) then call endrun(msg="allocation error for gdp"//& errmsg(sourcefile, __LINE__)) endif gdp = this%fates_fire_data_method%GetGDP() - end if do s=1,this%fates(nc)%nsites @@ -827,10 +823,15 @@ subroutine dynamics_driv(this, nc, bounds_clump, & do ifp = 1, this%fates(nc)%sites(s)%youngest_patch%patchno this%fates(nc)%bc_in(s)%lightning24(ifp) = lnfm24(g) * 24._r8 ! #/km2/hr to #/km2/day - this%fates(nc)%bc_in(s)%pop_density(ifp) = this%fates_fire_data_method%forc_hdm(g) + + if (fates_spitfire_mode .ge. anthro_ignitions) then) + this%fates(nc)%bc_in(s)%pop_density(ifp) = this%fates_fire_data_method%forc_hdm(g) + end if - ! Placeholder for future fates use of gdp - this%fates(nc)%bc_in(s)%gdp(ifp) = gdp(g) ! k US$/capita(g) + if (fates_spitfire_mode .eq. anthro_suppression) then + ! Placeholder for future fates use of gdp - comment out before integration + this%fates(nc)%bc_in(s)%gdp(ifp) = gdp(g) ! k US$/capita(g) + end if end do ! ifp end if From 8266b2d16854aaaabfa853c267f65a05407da9ed Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 8 Nov 2021 21:14:20 -0800 Subject: [PATCH 09/18] updating namelist defs with new spitfire mode --- bld/namelist_files/namelist_defaults_ctsm.xml | 1 + bld/namelist_files/namelist_definition_ctsm.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 8a10a96ebf..65f19e42d7 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1579,6 +1579,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts 360x720 360x720 360x720 +360x720 0001 0001 diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 67929c4bd4..876c221767 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -641,7 +641,7 @@ Switch deciding which nutrient model to use in FATES. + group="clm_inparm" valid_values="0,1,2,3,4,5" value=".false."> Turn on spitfire module to simulate fire by setting fates_spitfire_mode > 0. Allowed values are: 0 : Simulations of fire are off @@ -649,6 +649,7 @@ Allowed values are: 2 : use an external lightning dataset. 3 : use an external confirmed ignitions dataset (not available through standard CSEM dataset collection). 4 : use external lightning and population datasets to simulate both natural and anthropogenic + 5 : use gross domestic production and population datasets to simulate anthropogenic fire supression ignitions. (Only relevant if FATES is on) From 5aec0da2b6c5966c50da326ce1b4e97e95061c97 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 8 Nov 2021 21:32:25 -0800 Subject: [PATCH 10/18] adding missing gdp definition in fates_fire_base_type --- src/biogeochem/FATESFireDataMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/biogeochem/FATESFireDataMod.F90 b/src/biogeochem/FATESFireDataMod.F90 index c19718ec04..d54568fb51 100644 --- a/src/biogeochem/FATESFireDataMod.F90 +++ b/src/biogeochem/FATESFireDataMod.F90 @@ -22,7 +22,8 @@ module FATESFireDataMod ! type, extends(fates_fire_base_type) :: fates_fire_data_type ! !PRIVATE MEMBER DATA: - real(r8), private, pointer :: lnfm24(:) ! Daily avg lightning by grid cell (#/km2/hr) + real(r8), private, pointer :: lnfm24(:) ! Daily avg lightning by grid cell (#/km2/hr) + real(r8), private, pointer :: gdp(:) ! Global gross domestic product contains ! !PUBLIC MEMBER FUNCTIONS: procedure, public :: need_lightning_and_popdens From 545b29d36330552d1717cb25830cfb4b6039504e Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 8 Nov 2021 21:43:14 -0800 Subject: [PATCH 11/18] fixing spelling mistakes --- src/biogeochem/FATESFireFactoryMod.F90 | 2 +- src/utils/clmfates_interfaceMod.F90 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeochem/FATESFireFactoryMod.F90 b/src/biogeochem/FATESFireFactoryMod.F90 index fcdb97c5ee..0352994e5f 100644 --- a/src/biogeochem/FATESFireFactoryMod.F90 +++ b/src/biogeochem/FATESFireFactoryMod.F90 @@ -27,7 +27,7 @@ module FATESFireFactoryMod integer, public, parameter :: lightning_from_data = 2 ! value of lightning_from_data mode integer, public, parameter :: successful_ignitions = 3 ! value of successful_ignitions mode integer, public, parameter :: anthro_ignitions = 4 ! value of anthro_ignitions mode - integer, public, parameter :: anthro_suppression = 5 ! value of anthro_supression mode + integer, public, parameter :: anthro_suppression = 5 ! value of anthro_suppression mode character(len=*), parameter, private :: sourcefile = & __FILE__ diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 1e7b5c4554..8ef9d8b98c 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -145,7 +145,7 @@ module CLMFatesInterfaceMod use FatesPlantHydraulicsMod, only : RestartHydrStates use FATESFireBase , only : fates_fire_base_type use FATESFireFactoryMod , only : no_fire, scalar_lightning, successful_ignitions,& - anthro_ignitions, anthro_supression + anthro_ignitions, anthro_suppression use dynSubgridControlMod , only : get_do_harvest use dynHarvestMod , only : num_harvest_inst, harvest_varnames use dynHarvestMod , only : harvest_units, mass_units, unitless_units @@ -319,7 +319,7 @@ subroutine CLMFatesGlobals() call set_fates_ctrlparms('sf_scalar_lightning_def',ival=scalar_lightning) call set_fates_ctrlparms('sf_successful_ignitions_def',ival=successful_ignitions) call set_fates_ctrlparms('sf_anthro_ignitions_def',ival=anthro_ignitions) - call set_fates_ctrlparms('sf_anthro_supression_def',ival=anthro_supression) + call set_fates_ctrlparms('sf_anthro_suppression_def',ival=anthro_suppression) if(is_restart()) then pass_is_restart = 1 From baa6502469d6151c5c70ab4f649f2033129bce64 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 8 Nov 2021 22:45:56 -0800 Subject: [PATCH 12/18] fixing extra parenthesis --- src/utils/clmfates_interfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 8ef9d8b98c..fa086d3620 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -824,7 +824,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & this%fates(nc)%bc_in(s)%lightning24(ifp) = lnfm24(g) * 24._r8 ! #/km2/hr to #/km2/day - if (fates_spitfire_mode .ge. anthro_ignitions) then) + if (fates_spitfire_mode .ge. anthro_ignitions) then this%fates(nc)%bc_in(s)%pop_density(ifp) = this%fates_fire_data_method%forc_hdm(g) end if From 38e0f43a8e52ed43ae0185a349e26d4fc3c53849 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 9 Nov 2021 11:26:30 -0800 Subject: [PATCH 13/18] correct point assigment to the actual name of the input gdp data --- src/biogeochem/FATESFireDataMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/FATESFireDataMod.F90 b/src/biogeochem/FATESFireDataMod.F90 index d54568fb51..d1bb8c6d4c 100644 --- a/src/biogeochem/FATESFireDataMod.F90 +++ b/src/biogeochem/FATESFireDataMod.F90 @@ -77,7 +77,7 @@ function GetGDP( this ) result(gdp) class(fates_fire_data_type) :: this real(r8), pointer :: gdp(:) !--------------------------------------------------------------------- - gdp => this%gdp + gdp => this%gdp_lf_col !--------------------------------------------------------------------- end function GetGDP From 3587ecddcc2c1729a3b7c6744ac56306571f30f3 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 16 Nov 2021 11:41:24 -0700 Subject: [PATCH 14/18] fixing assignment for gdp in clmfates --- src/biogeochem/FATESFireDataMod.F90 | 1 - src/utils/clmfates_interfaceMod.F90 | 17 +++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/biogeochem/FATESFireDataMod.F90 b/src/biogeochem/FATESFireDataMod.F90 index d1bb8c6d4c..06845cf03a 100644 --- a/src/biogeochem/FATESFireDataMod.F90 +++ b/src/biogeochem/FATESFireDataMod.F90 @@ -23,7 +23,6 @@ module FATESFireDataMod type, extends(fates_fire_base_type) :: fates_fire_data_type ! !PRIVATE MEMBER DATA: real(r8), private, pointer :: lnfm24(:) ! Daily avg lightning by grid cell (#/km2/hr) - real(r8), private, pointer :: gdp(:) ! Global gross domestic product contains ! !PUBLIC MEMBER FUNCTIONS: procedure, public :: need_lightning_and_popdens diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index fa086d3620..89a14e469b 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -766,7 +766,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & integer :: nld_si ! site specific number of decomposition layers integer :: ft ! plant functional type real(r8), pointer :: lnfm24(:) ! 24-hour averaged lightning data - real(r8), pointer :: gdp(:) ! gdp data + real(r8), pointer :: gdp_lf_col(:) ! gdp data integer :: ier integer :: begg,endg real(r8) :: harvest_rates(bounds_clump%begg:bounds_clump%endg,num_harvest_inst) @@ -807,12 +807,12 @@ subroutine dynamics_driv(this, nc, bounds_clump, & end if if (fates_spitfire_mode .eq. anthro_suppression) then - allocate(gdp(bounds_clump%begg:bounds_clump%endg), stat=ier) + allocate(gdp_lf_col(bounds_clump%begc:bounds_clump%endc), stat=ier) if (ier /= 0) then call endrun(msg="allocation error for gdp"//& errmsg(sourcefile, __LINE__)) endif - gdp = this%fates_fire_data_method%GetGDP() + gdp_lf_col = this%fates_fire_data_method%GetGDP() end if do s=1,this%fates(nc)%nsites @@ -828,12 +828,12 @@ subroutine dynamics_driv(this, nc, bounds_clump, & this%fates(nc)%bc_in(s)%pop_density(ifp) = this%fates_fire_data_method%forc_hdm(g) end if - if (fates_spitfire_mode .eq. anthro_suppression) then - ! Placeholder for future fates use of gdp - comment out before integration - this%fates(nc)%bc_in(s)%gdp(ifp) = gdp(g) ! k US$/capita(g) - end if - end do ! ifp + + if (fates_spitfire_mode .eq. anthro_suppression) then + ! Placeholder for future fates use of gdp - comment out before integration + !this%fates(nc)%bc_in(s)%gdp = gdp_lf_col(c) ! k US$/capita(g) + end if end if nlevsoil = this%fates(nc)%bc_in(s)%nlevsoil @@ -2435,6 +2435,7 @@ subroutine Init2(this, bounds, NLFilename) call t_startf('fates_init2') + write(iulog,*) 'Init2: calling FireInit' call this%fates_fire_data_method%FireInit(bounds, NLFilename) call t_stopf('fates_init2') From 218d21f1953a37e09ad7ee4d81a4ca468810d8c0 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Mon, 29 Nov 2021 11:07:09 -0700 Subject: [PATCH 15/18] Squashed 'manage_externals/' changes from 39ad53263..a3b3a0373 a3b3a0373 Merge pull request #162 from ESMCI/fischer/python3 d4f1b1e8d Change shebang lines to python3 2fd941abc Merge pull request #158 from billsacks/modified_solution de08dc2ee Add another option for when an external is in a modified state e954582d0 Merge pull request #156 from billsacks/onbranch_show_hash 952e44d51 Change output: put tag/hash before branch name 10288430f Fix pre-existing pylint issues 01b13f78f When on a branch, show tag/hash, too git-subtree-dir: manage_externals git-subtree-split: a3b3a0373c36aa422994f2514a4d7d3d90f7da99 --- checkout_externals | 2 +- manic/checkout.py | 13 +++++++---- manic/externals_description.py | 5 ++++- manic/repository_git.py | 29 ++++++++++++------------- manic/utils.py | 2 +- test/test_sys_checkout.py | 3 +-- test/test_sys_repository_git.py | 2 +- test/test_unit_externals_description.py | 2 +- test/test_unit_externals_status.py | 2 +- test/test_unit_repository.py | 2 +- test/test_unit_repository_git.py | 4 ++-- test/test_unit_repository_svn.py | 2 +- test/test_unit_utils.py | 2 +- 13 files changed, 38 insertions(+), 32 deletions(-) diff --git a/checkout_externals b/checkout_externals index a0698baef0..48bce24010 100755 --- a/checkout_externals +++ b/checkout_externals @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Main driver wrapper around the manic/checkout utility. diff --git a/manic/checkout.py b/manic/checkout.py index 8dd1798d7a..2223b1f0d8 100755 --- a/manic/checkout.py +++ b/manic/checkout.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Tool to assemble repositories represented in a model-description file. @@ -392,7 +392,7 @@ def main(args): # exit gracefully msg = """The external repositories labeled with 'M' above are not in a clean state. -The following are three options for how to proceed: +The following are four options for how to proceed: (1) Go into each external that is not in a clean state and issue either a 'git status' or an 'svn status' command (depending on whether the external is managed by git or @@ -412,12 +412,17 @@ def main(args): {program_name}. Excluding externals labeled with 'M' will allow {program_name} to update the other, non-excluded externals. +(4) As a last resort, if you are confident that there is no work that needs to be saved + from a given external, you can remove that external (via "rm -rf [directory]") and + then rerun the {program_name} tool. This option is mainly useful as a workaround for + issues with this tool (such as https://github.com/ESMCI/manage_externals/issues/157). + The external repositories labeled with '?' above are not under version control using the expected protocol. If you are sure you want to switch protocols, and you don't have any work you need to save from this -directory, then run "rm -rf [directory]" before re-running the -checkout_externals tool. +directory, then run "rm -rf [directory]" before rerunning the +{program_name} tool. """.format(program_name=program_name, config_file=args.externals) printlog('-' * 70) diff --git a/manic/externals_description.py b/manic/externals_description.py index 918d616e37..6a54935935 100644 --- a/manic/externals_description.py +++ b/manic/externals_description.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Model description @@ -193,6 +193,9 @@ def parse_submodules_desc_section(section_items, file_path): def read_gitmodules_file(root_dir, file_name): # pylint: disable=deprecated-method # Disabling this check because the method is only used for python2 + # pylint: disable=too-many-locals + # pylint: disable=too-many-branches + # pylint: disable=too-many-statements """Read a .gitmodules file and convert it to be compatible with an externals description. """ diff --git a/manic/repository_git.py b/manic/repository_git.py index f986051001..3a6a0f1716 100644 --- a/manic/repository_git.py +++ b/manic/repository_git.py @@ -109,27 +109,21 @@ def _clone_repo(self, base_dir_path, repo_dir_name, verbosity): def _current_ref(self): """Determine the *name* associated with HEAD. - If we're on a branch, then returns the branch name; otherwise, - if we're on a tag, then returns the tag name; otherwise, returns + If we're on a tag, then returns the tag name; otherwise, returns the current hash. Returns an empty string if no reference can be determined (e.g., if we're not actually in a git repository). + + If we're on a branch, then the branch name is also included in + the returned string (in addition to the tag / hash). """ ref_found = False - # If we're on a branch, then use that as the current ref - branch_found, branch_name = self._git_current_branch() - if branch_found: - current_ref = branch_name + # If we're exactly at a tag, use that as the current ref + tag_found, tag_name = self._git_current_tag() + if tag_found: + current_ref = tag_name ref_found = True - if not ref_found: - # Otherwise, if we're exactly at a tag, use that as the - # current ref - tag_found, tag_name = self._git_current_tag() - if tag_found: - current_ref = tag_name - ref_found = True - if not ref_found: # Otherwise, use current hash as the current ref hash_found, hash_name = self._git_current_hash() @@ -137,7 +131,12 @@ def _current_ref(self): current_ref = hash_name ref_found = True - if not ref_found: + if ref_found: + # If we're on a branch, include branch name in current ref + branch_found, branch_name = self._git_current_branch() + if branch_found: + current_ref = "{} (branch {})".format(current_ref, branch_name) + else: # If we still can't find a ref, return empty string. This # can happen if we're not actually in a git repo current_ref = '' diff --git a/manic/utils.py b/manic/utils.py index f57f43930c..9c63ffe65e 100644 --- a/manic/utils.py +++ b/manic/utils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Common public utilities for manic package diff --git a/test/test_sys_checkout.py b/test/test_sys_checkout.py index 118bee5308..b13e96a17d 100644 --- a/test/test_sys_checkout.py +++ b/test/test_sys_checkout.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Unit test driver for checkout_externals @@ -38,7 +38,6 @@ import os import os.path import shutil -import sys import unittest from manic.externals_description import ExternalsDescription diff --git a/test/test_sys_repository_git.py b/test/test_sys_repository_git.py index f6dbf84284..29d5433b95 100644 --- a/test/test_sys_repository_git.py +++ b/test/test_sys_repository_git.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Tests of some of the functionality in repository_git.py that actually interacts with git repositories. diff --git a/test/test_unit_externals_description.py b/test/test_unit_externals_description.py index 0b1248f670..30e5288499 100644 --- a/test/test_unit_externals_description.py +++ b/test/test_unit_externals_description.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Unit test driver for checkout_externals diff --git a/test/test_unit_externals_status.py b/test/test_unit_externals_status.py index f8e953f756..f019514e9e 100644 --- a/test/test_unit_externals_status.py +++ b/test/test_unit_externals_status.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Unit test driver for the manic external status reporting module. diff --git a/test/test_unit_repository.py b/test/test_unit_repository.py index 5b9c242fd3..1b93861834 100644 --- a/test/test_unit_repository.py +++ b/test/test_unit_repository.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Unit test driver for checkout_externals diff --git a/test/test_unit_repository_git.py b/test/test_unit_repository_git.py index 4a0a334bb1..a6ad9f1003 100644 --- a/test/test_unit_repository_git.py +++ b/test/test_unit_repository_git.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Unit test driver for checkout_externals @@ -101,7 +101,7 @@ def test_ref_branch(self): True, 'feature3') self._repo._git_current_tag = self._git_current_tag(True, 'foo_tag') self._repo._git_current_hash = self._git_current_hash(True, 'abc123') - expected = 'feature3' + expected = 'foo_tag (branch feature3)' result = self._repo._current_ref() self.assertEqual(result, expected) diff --git a/test/test_unit_repository_svn.py b/test/test_unit_repository_svn.py index 7ff31c4218..41b173bf3d 100644 --- a/test/test_unit_repository_svn.py +++ b/test/test_unit_repository_svn.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Unit test driver for checkout_externals diff --git a/test/test_unit_utils.py b/test/test_unit_utils.py index c994e58ebe..80e1636649 100644 --- a/test/test_unit_utils.py +++ b/test/test_unit_utils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """Unit test driver for checkout_externals From ffe7716a15bcfcfe8aa901b7dcc9b8efcad98477 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 30 Nov 2021 11:16:11 -0700 Subject: [PATCH 16/18] Fix errors in technical note Eq. 2.3.16 --- .../Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst index 36bebbe56f..4aee9dbcd5 100644 --- a/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst +++ b/doc/source/tech_note/Surface_Albedos/CLM50_Tech_Note_Surface_Albedos.rst @@ -183,7 +183,7 @@ where the single scattering albedo is .. math:: :label: 3.16 - \begin{array}{rcl} {a_{s} \left(\mu \right)_{\Lambda } } & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \int _{0}^{1}\frac{\mu 'G\left(\mu \right)}{\mu G\left(\mu '\right)+\mu 'G\left(\mu \right)} d\mu '} \\ {} & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \frac{G\left(\mu \right)}{\min (\mu \phi _{2} +G\left(\mu \right),1e-6)} \left[1-\frac{\mu \phi _{1} }{\min (\mu \phi _{2} +G\left(\mu \right),1e-6)} \ln \left(\frac{\mu \phi _{1} +\min (\mu \phi _{2} +G\left(\mu \right),1e-6)}{\mu \phi _{1} } \right)\right].} \end{array} + \begin{array}{rcl} {a_{s} \left(\mu \right)_{\Lambda } } & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \int _{0}^{1}\frac{\mu 'G\left(\mu \right)}{\mu G\left(\mu '\right)+\mu 'G\left(\mu \right)} d\mu '} \\ {} & {=} & {\frac{\omega _{\Lambda }^{veg} }{2} \frac{G\left(\mu \right)}{\max (\mu \phi _{2} +G\left(\mu \right),1e-6)} \left[1-\frac{\mu \phi _{1} }{\max (\mu \phi _{2} +G\left(\mu \right),1e-6)} \ln \left(\frac{\mu \phi _{1} +\max (\mu \phi _{2} +G\left(\mu \right),1e-6)}{\mu \phi _{1} } \right)\right].} \end{array} Note here the restriction on :math:`\mu \phi _{2} +G\left(\mu \right)`. We have seen cases where small values can cause unrealistic single scattering albedo associated with the log calculation, From f9971ee981dbf82c048b1edd7e9182c7ebb5424f Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 1 Dec 2021 13:53:16 -0800 Subject: [PATCH 17/18] add changelog entry and correct typo in FatesFireBase --- doc/ChangeLog | 83 ++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + src/biogeochem/FATESFireBase.F90 | 2 +- 3 files changed, 85 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0c9f240f6c..30800a410d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,87 @@ =============================================================== +Tag name: ctsm5.1.dev065 +Originator(s): glemieux (Gregory Lemieux,LBL/NGEET,510-486-5049) +Date: Wed 01 Dec 2021 10:52:05 MST +One-line Summary: Refactor static fire data input by moving variables into fire_base_type from cnveg_state_type + +Purpose and description of changes +---------------------------------- + +This tag refactors the static fire data input methodology to enable a future anthropogenic fire suppression +methodology to FATES as described NGEET/fates#673. This future method requires that FATES have access to +GDP data that was previously defined in CNVegStateType.F90 as part of cnveg_state_type. As such, the GDP +variable has been moved into fire_base_type in FireDataBaseType.F90 to provide the data to the extended +fates_fire_base_type for eventual use in FATES. Similarly, the surface dataset read subroutine has been +moved along with the peat and ag-fire variables, which utilize the same read subroutine and where also +originally part of the cnveg_state_type. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): + Fixes #1104 -- Move static fire data into Fire class + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + The ncd_io calls for the gdp, peat, and ag-fire data has been moved from the + cnveg_state_type InitCold procedure into a new subroutine called surfdataread + which is a new fire_base_type procedure. + + The function GetGDP has been introduced to get the pointer to the GDP data. This has + been implemented in clmfates_interfaceMod.F90, but the assignment of this pointer + to a FATES-side bc_in variable has been commented out pending a future update to + define the necessary FATES GDP variable. + + A new namelist option has been added to the fates_spitfire_mode series. This option + is intended as a simple placeholder for a future FATES fire supression mode. The + option is currently being included as a check in clmfates_interfaceMod.F90 to allow + for the exercise of the GetGDP function. + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + cheyenne ---- OK + izumi ------- OK + + fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) + cheyenne ---- N/A + izumi ------- N/A + + any other testing (give details below): + A simple fates branch was created to test the potential handoff of the GDP data to FATES, which successfully + output the global gdp data. The branch is located here: https://github.com/glemieux/fates/tree/fire-gdp-simpletest + Note that this branch was not used in the standard regression tests above. + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #1536 -- Refactor static fire data to enable future use of GDP data in SPITFIRE + +=============================================================== +=============================================================== Tag name: ctsm5.1.dev064 Originator(s): afoster (Adrianna Foster) Date: Mon Nov 29 09:50:50 MST 2021 diff --git a/doc/ChangeSum b/doc/ChangeSum index 094b43e622..6d1a5de560 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.1.dev065 glemieux 12/01/2021 Refactor static fire data input by moving variables into fire_base_type from cnveg_state_type ctsm5.1.dev064 afoster 11/29/2021 Updates to facilitate FATES history variable overhaul ctsm5.1.dev063 glemieux 11/23/2021 Provide access to the fraction of canopy covered by snow variable to fates ctsm5.1.dev062 erik 11/19/2021 Make NUOPC the default driver rather than MCT diff --git a/src/biogeochem/FATESFireBase.F90 b/src/biogeochem/FATESFireBase.F90 index faa32d979b..dda7621430 100644 --- a/src/biogeochem/FATESFireBase.F90 +++ b/src/biogeochem/FATESFireBase.F90 @@ -61,7 +61,7 @@ end function GetLight24_interface !------------------------------------------------------------------------ function GetGDP_interface( this ) result(gdp) ! - ! !DESCRIPTION: Get the 24-hour averaged lightning data + ! !DESCRIPTION: Get the global gross domestic product data ! !USES use shr_kind_mod , only: r8 => shr_kind_r8 import :: fates_fire_base_type From 2aae453fb7ff3ddda95b575761fdbcff1299eac9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 Dec 2021 00:13:50 -0700 Subject: [PATCH 18/18] Update date of change files --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 30800a410d..01fa9b4f87 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.1.dev065 Originator(s): glemieux (Gregory Lemieux,LBL/NGEET,510-486-5049) -Date: Wed 01 Dec 2021 10:52:05 MST +Date: Thu Dec 2 00:13:37 MST 2021 One-line Summary: Refactor static fire data input by moving variables into fire_base_type from cnveg_state_type Purpose and description of changes diff --git a/doc/ChangeSum b/doc/ChangeSum index 6d1a5de560..f2afb0c60c 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.1.dev065 glemieux 12/01/2021 Refactor static fire data input by moving variables into fire_base_type from cnveg_state_type + ctsm5.1.dev065 glemieux 12/02/2021 Refactor static fire data input by moving variables into fire_base_type from cnveg_state_type ctsm5.1.dev064 afoster 11/29/2021 Updates to facilitate FATES history variable overhaul ctsm5.1.dev063 glemieux 11/23/2021 Provide access to the fraction of canopy covered by snow variable to fates ctsm5.1.dev062 erik 11/19/2021 Make NUOPC the default driver rather than MCT