TNO Intern

Commit dcb64c35 authored by Arjo Segers's avatar Arjo Segers
Browse files

Allow layers of zero thickness, used to denote no-data layers.

parent 6b05124d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@
! 2024-09, Arjo Segers
!   Added 'Apply_WeightedSumAdj' method.
!
! 2025-07, Arjo Segers
!   Allow layers of zero thickness, used to denote no-data layers.
!
!###############################################################################
!
#define TRACEBACK write (csol,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__; call csoErr
@@ -344,8 +347,8 @@ contains
    ! interval lengths:
    self%dy = ydir * ( yy(2:self%ny+1) - yy(1:self%ny) )
    ! check ..
    if ( any(self%dy <= 0.0) ) then
      write (csol,'("found zero or negative interval length in y:")'); call csoErr
    if ( any(self%dy < 0.0) ) then
      write (csol,'("found negative interval length in y:")'); call csoErr
      do i = 1, self%ny
        write (csol,'("  cell ",i6," [",f16.6,",",f16.6,"] ",f16.6)') i, yy(i), yy(i+1), self%dy(i); call csoErr
      end do
@@ -715,6 +718,8 @@ contains
    g = 0.0
    ! loop over mapping weights:
    do iw = 1, self%nw
      ! skip zero layers:
      if ( self%dy(self%jj(iw)) == 0.0 ) cycle
      ! add contribution:
      g(self%jj(iw)) = g(self%jj(iw)) + f(self%ii(iw)) * self%dx(self%ii(iw)) * self%ww(iw) / self%dy(self%jj(iw))
    end do ! iw