zinterpolate1d Subroutine

public subroutine zinterpolate1d(input, output)

Uses

  • proc~~zinterpolate1d~~UsesGraph proc~zinterpolate1d zinterpolate1d module~modglobal modglobal proc~zinterpolate1d->module~modglobal

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension(kbin:kein) :: input
real, intent(inout), dimension(kb:ke) :: output

Called by

proc~~zinterpolate1d~~CalledByGraph proc~zinterpolate1d zinterpolate1d proc~readrestartfiles readrestartfiles proc~readrestartfiles->proc~zinterpolate1d proc~readinitfiles readinitfiles proc~readinitfiles->proc~readrestartfiles program~dalesurban DALESURBAN program~dalesurban->proc~readinitfiles

Source Code

  subroutine zinterpolate1d(input,output)
  use modglobal,      only : kb,ke,zf
  implicit none
  real, dimension(kbin:kein), intent(in)  :: input
  real, dimension(kb:ke), intent(inout) :: output
  integer k

     do k=kb,ke
      if (linuf(k) == kein+1) then      ! indicator for extrapolation!
        output(k) = input(kein)
      elseif (linlf(k) == kbin-1) then ! interprets this as extrapolation to bottom (use u=0 at z+=0)
        output(k) = input(kbin)/zfin(kbin) * zf(k)
!        output(:,k,:) = input(:,kbin,:)   ! temeperature is not zero at the wall, so line above is wrong
      else                            ! normal interpolation
        output(k) = input(linlf(k)) + (input(linuf(k)) - input(linlf(k))) / (zfin(linuf(k)) - zfin(linlf(k))) * (zf(k) - zf(linlf(k)))
        if ((zf(k) .gt. zfin(linuf(k))) .or. (zf(k) .lt. zfin(linlf(k)))) then
          write(6,*) '!!!Mistake in zinterpolate1d !!!!'
        end if
      end if
    end do

  end subroutine zinterpolate1d