calcdiffnr Subroutine

private subroutine calcdiffnr()

Uses

  • proc~~calcdiffnr~~UsesGraph proc~calcdiffnr calcdiffnr module~modglobal modglobal proc~calcdiffnr->module~modglobal module~modmpi modmpi proc~calcdiffnr->module~modmpi module~modsubgriddata modsubgriddata proc~calcdiffnr->module~modsubgriddata mpi mpi module~modmpi->mpi

Arguments

None

Calls

proc~~calcdiffnr~~CallsGraph proc~calcdiffnr calcdiffnr mpi_allreduce mpi_allreduce proc~calcdiffnr->mpi_allreduce

Called by

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

Source Code

  subroutine calcdiffnr

    use modglobal,      only : ib,ie,jb,je,kb,ke,kh,dxh2i,dy2i,dzh,dt,timee
    use modsubgriddata, only : ekm,ekh
    use modmpi,         only : myid,comm3d,mpierr,mpi_max,my_real
    implicit none


    real diffnrtotl,diffnrtot
    integer       :: i,j,k

    diffnrtotl = 0.
    diffnrtot  = 0.
    do k=kb,ke
    do j=jb,je
    do i=ib,ie
!      diffnrtotl = max(diffnrtotl,  ekm(i,j,k)*(1/dzh(k)**2 + dxh2i(i) + dy2i)*dtmn )  ! or should I interpolate ekm to the correct position?
      diffnrtotl = max(diffnrtotl,  ekm(i,j,k)*(1/dzh(k)**2 + dxh2i(i) + dy2i)*dtmn, &
                                    ekh(i,j,k)*(1/dzh(k)**2 + dxh2i(i) + dy2i)*dtmn )  ! or should I interpolate ekm to the correct position?
    end do
    end do
    end do

    call MPI_ALLREDUCE(diffnrtotl,diffnrtot,1,MY_REAL,MPI_MAX,comm3d,mpierr)
    if (myid==0) then
      write(6,'(A,ES10.2)') 'Diffusion number:',diffnrtot
    end if

    return
  end subroutine calcdiffnr