Skip to content

Commit

Permalink
Rename qflx_sat_surf to qflx_sat_excess_surf
Browse files Browse the repository at this point in the history
This was suggested at a ctsm meeting, in order to have more symmetry
with qflx_infl_excess
  • Loading branch information
billsacks committed Dec 28, 2017
1 parent 6fae9c2 commit ad5efce
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
20 changes: 10 additions & 10 deletions src/biogeophys/SoilHydrologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, &
qflx_evap_grnd => waterflux_inst%qflx_evap_grnd_col , & ! Input: [real(r8) (:) ] ground surface evaporation rate (mm H2O/s) [+]
qflx_ev_h2osfc => waterflux_inst%qflx_ev_h2osfc_col , & ! Input: [real(r8) (:) ] evaporation flux from h2osfc (W/m**2) [+ to atm]

qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s)
qflx_sat_excess_surf => surf_runoff_sat_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s)

frac_sno => waterstate_inst%frac_sno_eff_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1)
frac_h2osfc => waterstate_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1)
Expand All @@ -242,8 +242,8 @@ subroutine SetQflxInputs(bounds, num_hydrologyc, filter_hydrologyc, &
qflx_evap(c)=qflx_ev_soil(c)
endif

qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_surf(c))
qflx_top_soil_to_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_surf(c))
qflx_in_soil(c) = (1._r8 - frac_h2osfc(c)) * (qflx_top_soil(c) - qflx_sat_excess_surf(c))
qflx_top_soil_to_h2osfc(c) = frac_h2osfc(c) * (qflx_top_soil(c) - qflx_sat_excess_surf(c))

! remove evaporation (snow treated in SnowHydrology)
qflx_in_soil(c) = qflx_in_soil(c) - (1.0_r8 - fsno - frac_h2osfc(c))*qflx_evap(c)
Expand Down Expand Up @@ -317,7 +317,7 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f
qflx_h2osfc_surf => waterflux_inst%qflx_h2osfc_surf_col , & ! Output: [real(r8) (:) ] surface water runoff (mm H2O /s)
qflx_infl => waterflux_inst%qflx_infl_col , & ! Output: [real(r8) (:) ] infiltration (mm H2O /s)

qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s)
qflx_sat_excess_surf => surf_runoff_sat_inst%qflx_sat_excess_surf_col, & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s)

h2osfc_thresh => soilhydrology_inst%h2osfc_thresh_col, & ! Input: [real(r8) (:) ] level at which h2osfc "percolates"
h2osfcflag => soilhydrology_inst%h2osfcflag & ! Input: logical
Expand Down Expand Up @@ -391,9 +391,9 @@ subroutine Infiltration(bounds, num_hydrologyc, filter_hydrologyc, num_urbanc, f
! non-vegetated landunits (i.e. urban) use original CLM4 code
if (snl(c) >= 0) then
! when no snow present, sublimation is removed in Drainage
qflx_infl(c) = qflx_top_soil(c) - qflx_sat_surf(c) - qflx_evap_grnd(c)
qflx_infl(c) = qflx_top_soil(c) - qflx_sat_excess_surf(c) - qflx_evap_grnd(c)
else
qflx_infl(c) = qflx_top_soil(c) - qflx_sat_surf(c) &
qflx_infl(c) = qflx_top_soil(c) - qflx_sat_excess_surf(c) &
- (1.0_r8 - frac_sno(c)) * qflx_ev_soil(c)
end if
qflx_h2osfc_surf(c) = 0._r8
Expand Down Expand Up @@ -459,7 +459,7 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, &

xs_urban => soilhydrology_inst%xs_urban_col , & ! Output: [real(r8) (:) ] excess soil water above urban ponding limit

qflx_sat_surf => surf_runoff_sat_inst%qflx_sat_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s)
qflx_sat_excess_surf => surf_runoff_sat_inst%qflx_sat_excess_surf_col , & ! Input: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s)

h2osoi_liq => waterstate_inst%h2osoi_liq_col & ! Input: [real(r8) (:,:) ] liquid water (kg/m2)
)
Expand All @@ -474,7 +474,7 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, &
c = filter_hydrologyc(fc)
! 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_surf(c) + qflx_infl_excess_surf(c) + qflx_h2osfc_surf(c)
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
Expand All @@ -483,8 +483,8 @@ subroutine TotalSurfaceRunoff(bounds, num_hydrologyc, filter_hydrologyc, &
! 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_surf, if that's what's intended.
qflx_surf_for_bgc(c) = qflx_sat_surf(c) + qflx_infl_excess_surf(c)
! 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
30 changes: 15 additions & 15 deletions src/biogeophys/SurfRunoffSatMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module SurfRunoffSatMod
private
! Public data members
! Note: these should be treated as read-only by other modules
real(r8), pointer, public :: qflx_sat_surf_col(:) ! surface runoff due to saturated surface (mm H2O /s)
real(r8), pointer, public :: qflx_sat_excess_surf_col(:) ! surface runoff due to saturated surface (mm H2O /s)
real(r8), pointer, public :: fsat_col(:) ! fractional area with water table at surface

! Private data members
Expand Down Expand Up @@ -106,9 +106,9 @@ subroutine InitAllocate(this, bounds)

begc = bounds%begc; endc= bounds%endc

allocate(this%qflx_sat_surf_col(begc:endc)); this%qflx_sat_surf_col(:) = nan
allocate(this%fsat_col (begc:endc)); this%fsat_col (:) = nan
allocate(this%fcov_col (begc:endc)); this%fcov_col (:) = nan
allocate(this%qflx_sat_excess_surf_col(begc:endc)) ; this%qflx_sat_excess_surf_col(:) = nan
allocate(this%fsat_col(begc:endc)) ; this%fsat_col(:) = nan
allocate(this%fcov_col(begc:endc)) ; this%fcov_col(:) = nan

end subroutine InitAllocate

Expand Down Expand Up @@ -197,17 +197,17 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog
!-----------------------------------------------------------------------

associate( &
fcov => this%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area
fsat => this%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface
qflx_sat_surf => this%qflx_sat_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s)
fcov => this%fcov_col , & ! Output: [real(r8) (:) ] fractional impermeable area
fsat => this%fsat_col , & ! Output: [real(r8) (:) ] fractional area with water table at surface
qflx_sat_excess_surf => this%qflx_sat_excess_surf_col , & ! Output: [real(r8) (:) ] surface runoff due to saturated surface (mm H2O /s)

snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers
snl => col%snl , & ! Input: [integer (:) ] minus number of snow layers

qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM
qflx_floodc => waterflux_inst%qflx_floodc_col , & ! Input: [real(r8) (:) ] column flux of flood water from RTM
qflx_rain_plus_snomelt => waterflux_inst%qflx_rain_plus_snomelt_col , & ! Input: [real(r8) (:) ] rain plus snow melt falling on the soil (mm/s)

origflag => soilhydrology_inst%origflag , & ! Input: logical
fracice => soilhydrology_inst%fracice_col & ! Input: [real(r8) (:,:) ] fractional impermeability (-)
origflag => soilhydrology_inst%origflag , & ! Input: logical
fracice => soilhydrology_inst%fracice_col & ! Input: [real(r8) (:,:) ] fractional impermeability (-)
)

! ------------------------------------------------------------------------
Expand All @@ -229,7 +229,7 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog
end select

! ------------------------------------------------------------------------
! Compute qflx_sat_surf
! Compute qflx_sat_excess_surf
!
! assume qinmax (maximum infiltration capacity) is large relative to
! qflx_rain_plus_snomelt in control
Expand All @@ -246,13 +246,13 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog
do fc = 1, num_hydrologyc
c = filter_hydrologyc(fc)
fcov(c) = (1._r8 - fracice(c,1)) * fsat(c) + fracice(c,1)
qflx_sat_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c)
qflx_sat_excess_surf(c) = fcov(c) * qflx_rain_plus_snomelt(c)
end do
else
do fc = 1, num_hydrologyc
c = filter_hydrologyc(fc)
! only send fast runoff directly to streams
qflx_sat_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c)
qflx_sat_excess_surf(c) = fsat(c) * qflx_rain_plus_snomelt(c)

! Set fcov just to have it on the history file
fcov(c) = fsat(c)
Expand All @@ -267,7 +267,7 @@ subroutine SaturatedSurfaceRunoff (this, bounds, num_hydrologyc, filter_hydrolog
c = filter_hydrologyc(fc)
if (col%urbpoi(c)) then
! send flood water flux to runoff for all urban columns
qflx_sat_surf(c) = qflx_sat_surf(c) + qflx_floodc(c)
qflx_sat_excess_surf(c) = qflx_sat_excess_surf(c) + qflx_floodc(c)
end if
end do

Expand Down

0 comments on commit ad5efce

Please sign in to comment.