advection Subroutine

subroutine advection()

Uses

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

Arguments

None

Calls

proc~~advection~~CallsGraph proc~advection advection advecc_2nd advecc_2nd proc~advection->advecc_2nd advecc_kappa advecc_kappa proc~advection->advecc_kappa advecc_upw advecc_upw proc~advection->advecc_upw advecu_2nd advecu_2nd proc~advection->advecu_2nd advecv_2nd advecv_2nd proc~advection->advecv_2nd advecw_2nd advecw_2nd proc~advection->advecw_2nd

Source Code

subroutine advection

   use modglobal, only:lmoist, nsv, iadv_mom, iadv_tke, iadv_thl, iadv_qt, iadv_sv, &
      iadv_cd2, iadv_kappa, iadv_upw, &
      ltempeq, ih, jh, kh, ihc, jhc, khc, kb, ke, ib, ie, jb, je
   use modfields, only:u0, up, v0, vp, w0, wp, e120, e12p, thl0, thl0c, thlp, thlpc, qt0, qtp, sv0, svp, pres0, uh, vh, wh, pres0h
   use modsubgriddata, only:loneeqn
   use decomp_2d
   implicit none
   integer :: n

   select case (iadv_mom)
   case (iadv_cd2)
     call advecu_2nd(u0,up)
     call advecv_2nd(v0,vp)
     call advecw_2nd(w0,wp)
   case default
      write(0, *) "ERROR: Unknown advection scheme"
      stop 1
   end select

   if (loneeqn) then
      select case (iadv_tke)
      case (iadv_cd2)
         call advecc_2nd(ih, jh, kh, e120, e12p)
      case default
         write(0, *) "ERROR: Unknown advection scheme"
         stop 1
      end select
   end if

   select case (iadv_thl)
   case (iadv_cd2)
      if (ltempeq) call advecc_2nd(ih, jh, kh, thl0, thlp)
   case (iadv_kappa)
      thlpc(ib:ie,jb:je,kb:ke) = thlp(ib:ie,jb:je,kb:ke)
      if (ltempeq) call advecc_kappa(ihc, jhc, khc, thl0c, thlpc)
      thlp(ib:ie,jb:je,kb:ke) = thlpc(ib:ie,jb:je,kb:ke)
   case default
      write(0, *) "ERROR: Unknown advection scheme"
      stop 1
   end select

   if (lmoist) then
      select case (iadv_qt)
      case (iadv_cd2)
         call advecc_2nd(ih, jh, kh, qt0, qtp)
      case default
         write(0, *) "ERROR: Unknown advection scheme"
         stop 1
      end select
   end if
   do n = 1, nsv
      select case (iadv_sv (n))
      case (iadv_cd2)
         call advecc_2nd(ihc, jhc, khc, sv0(:, :, :, n), svp(:, :, :, n))
      case (iadv_kappa)
         call advecc_kappa(ihc, jhc, khc, sv0(:, :, :, n), svp(:, :, :, n))
      case (iadv_upw)
         call advecc_upw(ihc, jhc, khc, sv0(:, :, :, n), svp(:, :, :, n))
      case default
         write(0, *) "ERROR: Unknown advection scheme"
         stop 1
      end select
   end do

end subroutine advection