Skip to content

Commit

Permalink
Fixed indentation problem by changing tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckaustin committed May 6, 2024
1 parent fc8f584 commit 4349d43
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
58 changes: 29 additions & 29 deletions components/elm/src/biogeophys/CanopyHydrologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, &
integer :: c,f,l,k ! indices
real(r8):: d,fd,dfdd ! temporary variable for frac_h2oscs iteration
real(r8):: sigma ! microtopography pdf sigma in mm
real(r8):: swc ! surface water content in m
real(r8):: swc ! surface water content in m
real(r8):: min_h2osfc
!-----------------------------------------------------------------------

Expand All @@ -807,7 +807,7 @@ subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, &
iwp_microrel => col_pp%iwp_microrel , & ! Input: [real(r8) (:) ] ice wedge polygon microtopographic relief (m)
iwp_exclvol => col_pp%iwp_exclvol , & ! Input: [real(r8) (:) ] microtopography pdf sigma (m)
iwp_ddep => col_pp%iwp_ddep , & ! Input: [real(r8) (:) ] microtopography pdf sigma (m)
h2osno => col_ws%h2osno , & ! Input: [real(r8) (:) ] snow water (mm H2O)

h2osoi_liq => col_ws%h2osoi_liq , & ! Output: [real(r8) (:,:) ] liquid water (col,lyr) [kg/m2]
Expand All @@ -831,36 +831,36 @@ subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, &
! Use newton-raphson method to iteratively determine frac_h20sfc
! based on amount of surface water storage (h2osfc) and
! microtopography variability (micro_sigma) if nonpolygonal, or
! amount of surface water (h2osfc) and microtopographic attributes
! (iwp_microrel, iwp_exclvol) if polygonal tundra
! amount of surface water (h2osfc) and microtopographic attributes
! (iwp_microrel, iwp_exclvol) if polygonal tundra

if (h2osfc(c) > min_h2osfc) then
! a cutoff is needed for numerical reasons...(nonconvergence after 5 iterations)
if lun_pp%ispolygon(l) then
! calculate water depth and inundation fraction if column is polygonal
swc = h2osfc(c)/1000 ! convert to m
if swc > iwp_microrel - iwp_exclvol then
d = swc + iwp_exclvol
else
d = 0.0
do k=1,10
fd = (2_r8*iwp_exclvol - iwp_microrel) * (d/iwp_microrel)**3_r8 &
+ (2_r8*iwp_microrel - 3_r8*iwp_exclvol) * (d/iwp_microrel)**2_r8 &
- swc
dfdd = (3_r8/iwp_microrel) * (2_r8*iwp_exclvol - iwp_microrel) * (d/iwp_microrel)**2_r8 &
+ (2_r8/iwp_microrel) * (2_r8*iwp_microrel - 3_r8*iwp_exclvol) * (d/iwp_microrel)
d = d - fd/dfdd
enddo
endif
!-- update the submerged areal fraction using the new d value
frac_h2osfc(c) = (3_r8/iwp_microrel) * (2_r8*iwp_exclvol - iwp_microrel) * (d/iwp_microrel)**2_r8 &
+ (2_r8/iwp_microrel) * (2_r8*iwp_microrel - 3_r8*iwp_exclvol) * (d/iwp_microrel)
if lun_pp%ispolygon(l) then
! calculate water depth and inundation fraction if column is polygonal
swc = h2osfc(c)/1000 ! convert to m
if swc > iwp_microrel - iwp_exclvol then
d = swc + iwp_exclvol
else
d = 0.0
do k=1,10
fd = (2_r8*iwp_exclvol - iwp_microrel) * (d/iwp_microrel)**3_r8 &
+ (2_r8*iwp_microrel - 3_r8*iwp_exclvol) * (d/iwp_microrel)**2_r8 &
- swc
dfdd = (3_r8/iwp_microrel) * (2_r8*iwp_exclvol - iwp_microrel) * (d/iwp_microrel)**2_r8 &
+ (2_r8/iwp_microrel) * (2_r8*iwp_microrel - 3_r8*iwp_exclvol) * (d/iwp_microrel)
d = d - fd/dfdd
enddo
endif
!-- update the submerged areal fraction using the new d value
frac_h2osfc(c) = (3_r8/iwp_microrel) * (2_r8*iwp_exclvol - iwp_microrel) * (d/iwp_microrel)**2_r8 &
+ (2_r8/iwp_microrel) * (2_r8*iwp_microrel - 3_r8*iwp_exclvol) * (d/iwp_microrel)
endif
else
! calculate water depth and inudation fraction if column is non-polygonal
else
! calculate water depth and inudation fraction if column is non-polygonal
d=0.0

sigma=1.0e3 * micro_sigma(c) ! convert to mm
Expand All @@ -874,7 +874,7 @@ subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, &
enddo
!-- update the submerged areal fraction using the new d value
frac_h2osfc(c) = 0.5*(1.0_r8+erf(d/(sigma*sqrt(2.0))))
endif
endif

else
frac_h2osfc(c) = 0._r8
Expand Down
6 changes: 3 additions & 3 deletions components/elm/src/data_types/ColumnType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ module ColumnType
real(r8), pointer :: hslp_p10 (:,:) => null() ! hillslope slope percentiles (unitless)
integer, pointer :: nlevbed (:) => null() ! number of layers to bedrock
real(r8), pointer :: zibed (:) => null() ! bedrock depth in model (interface level at nlevbed)
real(r8), pointer :: iwp_microrel (:) => null() ! ice wedge polygon microtopographic relief (m)
real(r8), pointer :: iwp_exclvol (:) => null() ! ice wedge polygon excluded volume (m)
real(r8), pointer :: iwp_ddep (:) => null() ! ice wedge polygon depression depth (m)
real(r8), pointer :: iwp_microrel (:) => null() ! ice wedge polygon microtopographic relief (m)
real(r8), pointer :: iwp_exclvol (:) => null() ! ice wedge polygon excluded volume (m)
real(r8), pointer :: iwp_ddep (:) => null() ! ice wedge polygon depression depth (m)

! vertical levels
integer , pointer :: snl (:) => null() ! number of snow layers
Expand Down

0 comments on commit 4349d43

Please sign in to comment.