compute_derived Subroutine

private subroutine compute_derived(kind, out)

Uses

  • proc~~compute_derived~~UsesGraph proc~compute_derived compute_derived modpois modpois proc~compute_derived->modpois module~modfields modfields proc~compute_derived->module~modfields module~modglobal modglobal proc~compute_derived->module~modglobal decomp_2d decomp_2d module~modfields->decomp_2d

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: kind
real, intent(out) :: out(ib:ie,jb:je,kb:ke)

Calls

proc~~compute_derived~~CallsGraph proc~compute_derived compute_derived poisson_rhs_diagnostic poisson_rhs_diagnostic proc~compute_derived->poisson_rhs_diagnostic

Called by

proc~~compute_derived~~CalledByGraph proc~compute_derived compute_derived proc~fielddump fielddump proc~fielddump->proc~compute_derived program~udales uDALES program~udales->proc~fielddump

Source Code

  subroutine compute_derived(kind, out)
    use modfields, only : u0, v0, w0
    use modglobal, only : ib,ie,jb,je,kb,ke,dxfi,dyi,dzfi
    use modpois,   only : poisson_rhs_diagnostic
    implicit none
    integer, intent(in)  :: kind
    real,    intent(out) :: out(ib:ie,jb:je,kb:ke)
    integer i,j,k

    select case (kind)
    case (DERIV_DIV)
      do k=kb,ke
        do j=jb,je
          do i=ib,ie
            out(i,j,k) = (u0(i+1,j,k) - u0(i,j,k))*dxfi(i) &
                       + (v0(i,j+1,k) - v0(i,j,k))*dyi &
                       + (w0(i,j,k+1) - w0(i,j,k))*dzfi(k)
          end do
        end do
      end do
    case (DERIV_DUDX)
      do k=kb,ke
        do j=jb,je
          do i=ib,ie
            out(i,j,k) = (u0(i+1,j,k) - u0(i,j,k))*dxfi(i)
          end do
        end do
      end do
    case (DERIV_DVDY)
      do k=kb,ke
        do j=jb,je
          do i=ib,ie
            out(i,j,k) = (v0(i,j+1,k) - v0(i,j,k))*dyi
          end do
        end do
      end do
    case (DERIV_DWDZ)
      do k=kb,ke
        do j=jb,je
          do i=ib,ie
            out(i,j,k) = (w0(i,j,k+1) - w0(i,j,k))*dzfi(k)
          end do
        end do
      end do
    case (DERIV_PRHS)
      call poisson_rhs_diagnostic(0, out)
    case (DERIV_PDX)
      call poisson_rhs_diagnostic(1, out)
    case (DERIV_PDY)
      call poisson_rhs_diagnostic(2, out)
    case (DERIV_PDZ)
      call poisson_rhs_diagnostic(3, out)
    case default
      write(0, *) 'ERROR: fielddump: unknown derived field code ', kind
      stop 1
    end select
  end subroutine compute_derived