zinterpolate Subroutine

public subroutine zinterpolate(input, output)

Uses

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

Arguments

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

Called by

proc~~zinterpolate~~CalledByGraph proc~zinterpolate zinterpolate proc~readinletfile readinletfile proc~readinletfile->proc~zinterpolate 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 zinterpolate(input,output)
  use modglobal,      only : jb,je,kb,ke,zf,nstore
  implicit none
  real, dimension(jb:je,kbin:kein,1:nstore), intent(in)  :: input
  real, dimension(jb:je,kb:ke,1:nstore), 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) - zfin(linlf(k)))
        if ((zf(k) .gt. zfin(linuf(k))) .or. (zf(k) .lt. zfin(linlf(k)))) then
          write(6,*) '!!!Mistake in zinterpolate !!!!'
        end if
      end if
    end do


  end subroutine zinterpolate