fluxtopscal Subroutine

private subroutine fluxtopscal(flux)

Uses

  • proc~~fluxtopscal~~UsesGraph proc~fluxtopscal fluxtopscal module~modfields modfields proc~fluxtopscal->module~modfields module~modglobal modglobal proc~fluxtopscal->module~modglobal module~modsubgriddata modsubgriddata proc~fluxtopscal->module~modsubgriddata decomp_2d decomp_2d module~modfields->decomp_2d

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: flux(1:nsv)

Called by

proc~~fluxtopscal~~CalledByGraph proc~fluxtopscal fluxtopscal proc~boundary boundary proc~boundary->proc~fluxtopscal program~dalesurban DALESURBAN program~dalesurban->proc~boundary

Source Code

   subroutine fluxtopscal(flux)
      use modglobal, only:ib, ie, ih, jb, je, jh, kb, ke, kh, dzf, dzh, dzhi, nsv, khc
      use modfields, only:sv0, svm
      use modsubgriddata, only:ekh

      real, intent(in)    :: flux(1:nsv)
      integer :: m, n
      !
      !all the ghost cells have the same value?
      do m = 1, khc
      do n = 1, nsv
  sv0(ib-ih:ie+ih,jb-jh:je+jh,ke+m,n) = sv0(ib-ih:ie+ih,jb-jh:je+jh,ke,n) + dzh(ke+1) * flux(n) / ( dzhi(ke+1) * (0.5*(dzf(ke)*ekh(ib-ih:ie+ih,jb-jh:je+jh,ke+1)+dzf(ke+1)*ekh(ib-ih:ie+ih,jb-jh:je+jh,ke))))
  svm(ib-ih:ie+ih,jb-jh:je+jh,ke+m,n) = svm(ib-ih:ie+ih,jb-jh:je+jh,ke,n) + dzh(ke+1) * flux(n) / ( dzhi(ke+1) * (0.5*(dzf(ke)*ekh(ib-ih:ie+ih,jb-jh:je+jh,ke+1)+dzf(ke+1)*ekh(ib-ih:ie+ih,jb-jh:je+jh,ke))))
      end do
      end do
      !
   end subroutine fluxtopscal