zinterpolatew1d Subroutine

public subroutine zinterpolatew1d(input, output)

Uses

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

Arguments

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

Called by

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

Source Code

  subroutine zinterpolatew1d(input,output)
  use modglobal,      only : kb,ke,zh
  implicit none
  real, dimension(kbin:kein+1), intent(in)  :: input
  real, dimension(kb:ke+1), intent(inout) :: output
  integer k


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


  end subroutine zinterpolatew1d