Skip to content

Commit

Permalink
Merge pull request #39 from rcnijzink/correct_soil_alignments
Browse files Browse the repository at this point in the history
Correct soil alignments
  • Loading branch information
schymans authored Oct 1, 2019
2 parents c794efe + fcba57b commit af4b929
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions VOM_Fortran/VOM-code/transpmodel.f90
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ subroutine vom_get_soilprofile ()
implicit none

INTEGER :: iostat, i, j, indlayer
LOGICAL :: foundlayer

! * The file soilprofile.par can contain information about thickness
! and soil properties in each soil layer, with the layer number in
Expand All @@ -717,11 +718,12 @@ subroutine vom_get_soilprofile ()
! Raise a warning and correct if this is not the case

! Find the layer of i_zr
foundlayer = .FALSE.
do j = 1, s_maxlayer
if( sum(s_delz(1:j)) .lt. (i_cz - i_zr) ) then
indlayer = 0
else
if( (abs(sum(s_delz(1:j)) - (i_cz - i_zr) ) .lt. 1.0d-6) .and. &
(foundlayer .eqv. .FALSE.) ) then
indlayer = j
foundlayer = .TRUE.
end if
enddo

Expand Down

0 comments on commit af4b929

Please # to comment.