Skip to content

Commit

Permalink
Merge pull request ESCOMP#11 from NCAR/bgc_surf_runoff
Browse files Browse the repository at this point in the history
Use full qflx_surf in BGC code

This uses the full qflx_surf in the bgc code

qflx_sat_excess_surf(c) + qflx_infl_excess_surf(c) + qflx_h2osfc_surf(c)

rather than just:

qflx_sat_excess_surf(c) + qflx_infl_excess_surf(c)

i.e., now uses of qflx_surf in the BGC code include qflx_h2osfc_surf.

We had been using a separate variable to avoid changing answers. We
discussed changing this at a CLM-CMT meeting a while ago, and Dave
Lawrence gave his approval there.
  • Loading branch information
billsacks committed Dec 28, 2017
2 parents 474dea3 + be83e33 commit dea2996
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/biogeochem/ch4Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1725,7 +1725,7 @@ subroutine ch4 (bounds, num_soilc, filter_soilc, num_lakec, filter_lakec, &
frac_h2osfc => waterstate_inst%frac_h2osfc_col , & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1)
snow_depth => waterstate_inst%snow_depth_col , & ! Input: [real(r8) (:) ] snow height (m)
tws => waterstate_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2)
qflx_surf => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s)
qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] total surface runoff (mm H2O /s)

conc_o2_sat => ch4_inst%conc_o2_sat_col , & ! Input: [real(r8) (:,:) ] O2 conc in each soil layer (mol/m3) (nlevsoi)
zwt0 => ch4_inst%zwt0_col , & ! Input: [real(r8) (:) ] decay factor for finundated (m)
Expand Down
11 changes: 0 additions & 11 deletions src/biogeophys/SoilHydrologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,6 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, &
snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers

qflx_surf => waterflux_inst%qflx_surf_col , & ! Output: [real(r8) (:) ] total surface runoff (mm H2O /s)
qflx_surf_for_bgc => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s)
qflx_infl_excess_surf => waterflux_inst%qflx_infl_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to infiltration excess (mm H2O /s)
qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col, & ! Input: [real(r8) (:) ] surface water runoff (mm H2O /s)
qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s)
Expand All @@ -640,16 +639,6 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, &
! Depending on whether h2osfcflag is 0 or 1, one of qflx_infl_excess or
! qflx_h2osfc_surf will always be 0. But it's safe to just add them both.
qflx_surf(c) = qflx_sat_excess_surf(c) + qflx_infl_excess_surf(c) + qflx_h2osfc_surf(c)

! TODO(wjs, 2017-07-11) I'm distinguishing between qflx_surf and qflx_surf_for_bgc
! simply to maintain answers as they were before. But I have a feeling that the
! BGC code should really be using the total qflx_surf in its calculations. Once
! Dave Lawrence or someone else signs off on this change, we should change the BGC
! code to use qflx_surf and remove this qflx_surf_for_bgc variable.
! Alternatively, if we deem the current implementation correct, we should
! consider renaming this something better than qflx_surf_for_bgc, or simply
! making the BGC code depend on qflx_sat_excess_surf, if that's what's intended.
qflx_surf_for_bgc(c) = qflx_sat_excess_surf(c) + qflx_infl_excess_surf(c)
end do

! ------------------------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions src/biogeophys/WaterfluxType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ module WaterfluxType
real(r8), pointer :: qflx_infl_excess_surf_col(:) ! col surface runoff due to infiltration excess (mm H2O /s)
real(r8), pointer :: qflx_h2osfc_surf_col (:) ! col surface water runoff (mm H2O /s)
real(r8), pointer :: qflx_surf_col (:) ! col total surface runoff (mm H2O /s)
real(r8), pointer :: qflx_surf_for_bgc_col (:) ! col total surface runoff for input into BGC code (mm H2O /s)
real(r8), pointer :: qflx_drain_col (:) ! col sub-surface runoff (mm H2O /s)
real(r8), pointer :: qflx_rain_plus_snomelt_col(:) ! col rain plus snow melt falling on the soil (mm/s)
real(r8), pointer :: qflx_top_soil_col (:) ! col net water input into soil from top (mm/s)
Expand Down Expand Up @@ -223,7 +222,6 @@ subroutine InitAllocate(this, bounds)
allocate(this%qflx_rootsoi_col (begc:endc,1:nlevsoi)) ; this%qflx_rootsoi_col (:,:) = nan
allocate(this%qflx_infl_col (begc:endc)) ; this%qflx_infl_col (:) = nan
allocate(this%qflx_surf_col (begc:endc)) ; this%qflx_surf_col (:) = nan
allocate(this%qflx_surf_for_bgc_col (begc:endc)) ; this%qflx_surf_for_bgc_col (:) = nan
allocate(this%qflx_drain_col (begc:endc)) ; this%qflx_drain_col (:) = nan
allocate(this%qflx_rain_plus_snomelt_col(begc:endc)) ; this%qflx_rain_plus_snomelt_col(:) = nan
allocate(this%qflx_top_soil_col (begc:endc)) ; this%qflx_top_soil_col (:) = nan
Expand Down
2 changes: 1 addition & 1 deletion src/soilbiogeochem/SoilBiogeochemNLeachingMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ subroutine SoilBiogeochemNLeaching(bounds, num_soilc, filter_soilc, &
h2osoi_liq => waterstate_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd)

qflx_drain => waterflux_inst%qflx_drain_col , & ! Input: [real(r8) (:) ] sub-surface runoff (mm H2O /s)
qflx_surf => waterflux_inst%qflx_surf_for_bgc_col , & ! Input: [real(r8) (:) ] surface runoff for input into BGC code (mm H2O /s)
qflx_surf => waterflux_inst%qflx_surf_col , & ! Input: [real(r8) (:) ] total surface runoff (mm H2O /s)

sminn_vr => soilbiogeochem_nitrogenstate_inst%sminn_vr_col , & ! Input: [real(r8) (:,:) ] (gN/m3) soil mineral N
smin_no3_vr => soilbiogeochem_nitrogenstate_inst%smin_no3_vr_col , & ! Input: [real(r8) (:,:) ]
Expand Down

0 comments on commit dea2996

Please sign in to comment.