calclw Subroutine

public subroutine calclw()

Uses

  • proc~~calclw~~UsesGraph proc~calclw calclw module~initfac initfac proc~calclw->module~initfac module~modglobal modglobal proc~calclw->module~modglobal module~initfac->module~modglobal module~modmpi modmpi module~initfac->module~modmpi mpi mpi module~initfac->mpi netcdf netcdf module~initfac->netcdf module~modmpi->mpi

Arguments

None

Called by

proc~~calclw~~CalledByGraph proc~calclw calclw proc~eb EB proc~eb->proc~calclw program~dalesurban DALESURBAN program~dalesurban->proc~eb

Source Code

  subroutine calclw
    !calculate the longwave exchange between facets
    use modglobal, only:nfcts, boltz, skyLW, nnz
    use initfac, only:facem, vf, svf, faca, facT, facLWin, facets, vfsparse, ivfsparse, jvfsparse
    integer :: n, m, i, j
    real :: ltemp = 0.

    if (lvfsparse) then
         facLWin = svf*skyLW*facem
         do n=1,nnz
            i = ivfsparse(n)
            j = jvfsparse(n)
            facLWin(i) = facLWin(i) + vfsparse(n)*facem(i)*facem(j)*boltz*facT(j,1)**4
         end do

      else
         do n = 1, nfcts
            !if (facets(n) < -100) cycle
            ltemp = 0.
            do m = 1, nfcts  !for n, sum over all other m facets
               !ltemp = ltemp + vf(m, n)*faca(m)/faca(n)*facem(m)*boltz*facT(m, 1)**4 ![W/m2]
               ltemp = ltemp + vf(n, m)*facem(m)*boltz*facT(m, 1)**4 ![W/m2]
            end do
            facLWin(n) = (ltemp + svf(n)*skyLW)*facem(n)

         end do
      end if

  end subroutine calclw