calccourant Subroutine

private subroutine calccourant()

Uses

  • proc~~calccourant~~UsesGraph proc~calccourant calccourant module~modfields modfields proc~calccourant->module~modfields module~modglobal modglobal proc~calccourant->module~modglobal module~modmpi modmpi proc~calccourant->module~modmpi decomp_2d decomp_2d module~modfields->decomp_2d mpi mpi module~modmpi->mpi

Arguments

None

Calls

proc~~calccourant~~CallsGraph proc~calccourant calccourant mpi_allreduce mpi_allreduce proc~calccourant->mpi_allreduce

Called by

proc~~calccourant~~CalledByGraph proc~calccourant calccourant proc~checksim checksim proc~checksim->proc~calccourant program~dalesurban DALESURBAN program~dalesurban->proc~checksim

Source Code

  subroutine calccourant
    use modglobal, only : ib,ie,jb,je,kb,ke,kh,dxhi,dyi,dzhi,dt,timee
    use modfields, only : um,vm,wm
    use modmpi,    only : myid,comm3d,mpierr,mpi_max,my_real
    implicit none


    real          :: courtotl, courtot
    integer       :: i, j, k

    courtotl = 0.0
    courtot  = 0.0
    do k=kb,ke
      do j=jb,je
        do i=ib,ie
          courtotl = max(courtotl,(um(i,j,k)*dxhi(i) + vm(i,j,k)*dyi + wm(i,j,k)*dzhi(k))*dtmn)
        end do
      end do
    end do

    call MPI_ALLREDUCE(courtotl,courtot,1,MY_REAL,MPI_MAX,comm3d,mpierr)
    if (myid==0) then
      write(*,'(A,ES10.2)') 'Courant numbers (x,y,z,tot):',courtot
    end if

    return
  end subroutine calccourant