zinterpolatet Subroutine

public subroutine zinterpolatet(input, output)

Uses

  • proc~~zinterpolatet~~UsesGraph proc~zinterpolatet zinterpolatet module~modglobal modglobal proc~zinterpolatet->module~modglobal module~modsurfdata modsurfdata proc~zinterpolatet->module~modsurfdata

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~~zinterpolatet~~CalledByGraph proc~zinterpolatet zinterpolatet proc~readinletfile readinletfile proc~readinletfile->proc~zinterpolatet 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 zinterpolatet(input,output)
  use modglobal,      only : jb,je,kb,ke,zf,nstore
  use modsurfdata,     only : thls
  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,:) = thls + (input(:,kb,:)-thls)/zfin(kbin)*zf(k)
!         output(:,k,:) = (input(:,kb,:)-thls)/zfin(kbin)*zf(k)
!        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 zinterpolatet !!!!'
        end if
      end if
    end do


  end subroutine zinterpolatet