Skip to content

Commit

Permalink
Fixed small errors, mostly indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckaustin committed May 7, 2024
1 parent 4349d43 commit 82ffcc7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 23 deletions.
34 changes: 17 additions & 17 deletions components/elm/src/biogeophys/CanopyHydrologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -838,8 +838,8 @@ subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, &
! 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
! 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
Expand All @@ -854,26 +854,26 @@ subroutine FracH2OSfc(bounds, num_h2osfc, filter_h2osfc, &
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
endif

else
! calculate water depth and inudation fraction if column is non-polygonal
d=0.0

sigma=1.0e3 * micro_sigma(c) ! convert to mm
do k=1,10
fd = 0.5*d*(1.0_r8+erf(d/(sigma*sqrt(2.0)))) &
+sigma/sqrt(2.0*shr_const_pi)*exp(-d**2/(2.0*sigma**2)) &
-h2osfc(c)
dfdd = 0.5*(1.0_r8+erf(d/(sigma*sqrt(2.0))))

d = d - fd/dfdd
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))))
! calculate water depth and inudation fraction if column is non-polygonal
d=0.0
sigma=1.0e3 * micro_sigma(c) ! convert to mm
do k=1,10
fd = 0.5*d*(1.0_r8+erf(d/(sigma*sqrt(2.0)))) &
+sigma/sqrt(2.0*shr_const_pi)*exp(-d**2/(2.0*sigma**2)) &
-h2osfc(c)
dfdd = 0.5*(1.0_r8+erf(d/(sigma*sqrt(2.0))))

d = d - fd/dfdd
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

else
Expand Down
12 changes: 6 additions & 6 deletions components/elm/src/data_types/LandunitType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ module LandunitType
logical , pointer :: urbpoi (:) => null() ! true=>urban point
logical , pointer :: glcmecpoi (:) => null() ! true=>glacier_mec point
logical , pointer :: active (:) => null() ! true=>do computations on this landunit
logical , pointer :: ispolygon (:) => null() ! true=>is polygonal tundra
integer , pointer :: polygontype (:) => null() ! ice wedge polygon initial condition (LCP, FCP, or HCP)
logical , pointer :: ispolygon (:) => null() ! true=>is polygonal tundra
integer , pointer :: polygontype (:) => null() ! ice wedge polygon initial condition (LCP, FCP, or HCP)

! urban properties
real(r8), pointer :: canyon_hwr (:) => null() ! urban landunit canyon height to width ratio (-)
Expand Down Expand Up @@ -95,8 +95,8 @@ subroutine lun_pp_Init(this, begl, endl)
allocate(this%lakpoi (begl:endl)); this%lakpoi (:) = .false.
allocate(this%urbpoi (begl:endl)); this%urbpoi (:) = .false.
allocate(this%glcmecpoi (begl:endl)); this%glcmecpoi (:) = .false.
allocate(this%ispolygon (begl:endl)); this%ispolygon (:) = .false.
allocate(this%polygontype (begl:endl)); this%polygontype(:) = ispval
allocate(this%ispolygon (begl:endl)); this%ispolygon (:) = .false.
allocate(this%polygontype (begl:endl)); this%polygontype(:) = ispval

! The following is initialized in routine setActive in module reweightMod
allocate(this%active (begl:endl))
Expand Down Expand Up @@ -133,8 +133,8 @@ subroutine lun_pp_clean(this)
deallocate(this%lakpoi )
deallocate(this%urbpoi )
deallocate(this%glcmecpoi )
deallocate(this%ispolygon )
deallocate(this%polygontype )
deallocate(this%ispolygon )
deallocate(this%polygontype )
deallocate(this%active )
deallocate(this%canyon_hwr )
deallocate(this%wtroad_perv )
Expand Down
8 changes: 8 additions & 0 deletions components/elm/src/main/landunit_varcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ module landunit_varcon
integer, parameter, public :: iflatcenpoly = 2 ! flat-centered polygons
integer, parameter, public :: ihighcenpoly = 3 ! high-centered polygons

integer, parameter, public :: max_poly = 3 !maximum value that lun_pp%polygontype can have
!(i.e., largest value in the above list)

integer, parameter, public :: polygon_name_length = 40 ! max length of landunit names
character(len=polygon_name_length), public :: polygon_names(max_poly) ! name of each landunit type



! parameters that depend on the above constants

integer, parameter, public :: numurbl = isturb_MAX - isturb_MIN + 1 ! number of urban landunits
Expand Down

0 comments on commit 82ffcc7

Please sign in to comment.