Skip to content

Commit

Permalink
constrain range of variable soiltext
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangsp8 committed Jan 2, 2025
1 parent e0eec3b commit eb44a2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main/HYDRO/MOD_Catch_SubsurfaceFlow.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ MODULE MOD_Catch_SubsurfaceFlow

! anisotropy ratio of lateral/vertical hydraulic conductivity (unitless)
! for USDA soil texture class:
! -1, 0: undefined
! <= 0: undefined
! 1: clay; 2: silty clay; 3: sandy clay; 4: clay loam; 5: silty clay loam; 6: sandy clay loam; &
! 7: loam; 8: silty loam; 9: sandy loam; 10: silt; 11: loamy sand; 12: sand
real(r8), parameter :: raniso(-1:12) = (/ 1., 1., &
real(r8), parameter :: raniso(0:12) = (/ 1., &
48., 40., 28., 24., 20., 14., 12., 10., 4., 2., 3., 2. /)

! -- neighbour variables --
Expand Down Expand Up @@ -267,7 +267,7 @@ SUBROUTINE subsurface_flow (deltime)
DO ilev = 1, nl_soil
icefrac = min(1., wice_soisno(ilev,ipatch)/denice/dz_soi(ilev)/porsl(ilev,ipatch))
imped = 10.**(-e_ice*icefrac)
Kl_h(i) = Kl_h(i) + hru_patch%subfrc(ipatch) * raniso(soiltext(ipatch)) &
Kl_h(i) = Kl_h(i) + hru_patch%subfrc(ipatch) * raniso(max(soiltext(ipatch),0)) &
* hksati(ilev,ipatch)/1.0e3 * imped * dz_soi(ilev)/zi_soi(nl_soil)
ENDDO
sumwt = sumwt + hru_patch%subfrc(ipatch)
Expand Down
7 changes: 7 additions & 0 deletions mkinidata/MOD_SoilTextureReadin.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ SUBROUTINE soiltext_readin (dir_landdata, lc_year)
CALL ncio_read_vector (lndname, 'soiltext_patches', landpatch, soiltext)
#endif

IF (p_is_worker) THEN
IF (numpatch > 0) THEN
WHERE (soiltext < 0 ) soiltext = 0
WHERE (soiltext > 12) soiltext = 0
ENDIF
ENDIF

END SUBROUTINE soiltext_readin

END MODULE MOD_SoilTextureReadin
Expand Down

0 comments on commit eb44a2a

Please sign in to comment.