zinterpolatew Subroutine

public subroutine zinterpolatew(input, output)

Uses

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

Arguments

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

Called by

proc~~zinterpolatew~~CalledByGraph proc~zinterpolatew zinterpolatew proc~readinletfile readinletfile proc~readinletfile->proc~zinterpolatew proc~inletgen inletgen proc~inletgen->proc~readinletfile proc~inletgennotemp inletgennotemp proc~inletgennotemp->proc~readinletfile proc~readinitfiles readinitfiles proc~readinitfiles->proc~readinletfile program~dalesurban DALESURBAN program~dalesurban->proc~readinitfiles

Source Code

  subroutine zinterpolatew(input,output)
  use modglobal,      only : jb,je,kb,ke,zh,nstore
  implicit none
  real, dimension(jb:je,kbin:kein+1,1:nstore), intent(in)  :: input
  real, dimension(jb:je,kb:ke+1,1:nstore), 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) - zhin(linlh(k)))
        if ((zh(k) .gt. zhin(linuh(k))) .or. (zh(k) .lt. zhin(linlh(k)))) then
          write(6,*) '!!!Mistake in zinterpolatew !!!!'
        end if
      end if
    end do


  end subroutine zinterpolatew