intqH Subroutine

public subroutine intqH()

Uses

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

Arguments

None

Calls

proc~~intqh~~CallsGraph proc~intqh intqH mpi_allreduce mpi_allreduce proc~intqh->mpi_allreduce

Called by

proc~~intqh~~CalledByGraph proc~intqh intqH proc~eb EB proc~eb->proc~intqh program~dalesurban DALESURBAN program~dalesurban->proc~eb

Source Code

  subroutine intqH !time integration of heat and latent heat from facets
    use modglobal, only:nfcts, dt, rk3step, lEB
    use initfac, only:faccth, fachfsum, fachf, fachfi, facef, facefi, facefsum
    use modmpi, only:nprocs, myid, comm3d, mpierr, mpi_sum, my_real
    real :: dummy
    integer :: n

    if (.not. lEB) return

    if (rk3step .eq. 3) then
      !sum over all processors since a facet can be split onto more than one processor
      fachfsum = 0.
      facefsum = 0.
      call MPI_ALLREDUCE(fachf(1:nfcts), fachfsum(1:nfcts), nfcts, MY_REAL, MPI_SUM, comm3d, mpierr)
      call MPI_ALLREDUCE(facef(1:nfcts), facefsum(1:nfcts), nfcts, MY_REAL, MPI_SUM, comm3d, mpierr)

      if (myid == 0) then
        !time summation of total facet heatlux (will be divided by dtEB in EB to get time mean flux)
        do n = 1, nfcts
          fachfi(n) = fachfi(n) + dt*fachfsum(n) !sum up the fluxes over time
          facefi(n) = facefi(n) + dt*facefsum(n)
        end do
      end if
    end if
    fachf = 0.
    fachfsum = 0.
    facefsum = 0.
    facef = 0.
  end subroutine intqH