op_obj_d1dx3 Function

private impure function op_obj_d1dx3(this, in) result(out)

Computes the derivative in the x3-direction. Note: If input is face-centered (on x3), result is cell-centered (on x3m). If input is cell-centered (on x3m), result is face-centered (on x3).

Type Bound

op_obj

Arguments

Type IntentOptional Attributes Name
class(op_obj), intent(in) :: this

Differential operators utility

type(eulerian_obj_r), intent(in) :: in

Field to differentiate

Return Value type(eulerian_obj_r)

Result


Calls

proc~~op_obj_d1dx3~~CallsGraph proc~op_obj_d1dx3 op_obj%op_obj_d1dx3 proc~eulerian_obj_init eulerian_obj_base%eulerian_obj_Init proc~op_obj_d1dx3->proc~eulerian_obj_init

Source Code

    impure function op_obj_d1dx3(this,in) result(out)
      !> Computes the derivative in the x3-direction.
      ! Note: If input is face-centered (on x3), result is
      ! cell-centered (on x3m). If input is cell-centered (on x3m),
      ! result is face-centered (on x3).
      class(op_obj),        intent(in) :: this                                 !! Differential operators utility
      type(eulerian_obj_r), intent(in) :: in                                   !! Field to differentiate
      type(eulerian_obj_r)             :: out                                  !! Result
      ! Work variables
      integer :: i,j,k
      integer :: slo, shi

      call out%Initialize('d1dx3',this%block,this%parallel,in%staggering)

      associate (lo => this%block%lo,  hi => this%block%hi)
        select case (in%staggering)
        case (0,1,2)
          ! From xm to x
          do k=lo(3),hi(3)
            do j=lo(2),hi(2)
              do i=lo(1),hi(1)
                slo = k - this%st
                shi = k + this%st - 1

                out%cell(i,j,k)=dot_product(this%c_d1dx3m(:,k),in%cell(i,j,slo:shi))
              end do
            end do
          end do
        case (3)
          ! From x to xm
          do k=lo(3),hi(3)
            do j=lo(2),hi(2)
              do i=lo(1),hi(1)
                slo = k - this%st + 1
                shi = k + this%st

                out%cell(i,j,k)=dot_product(this%c_d1dx3 (:,k),in%cell(i,j,slo:shi))
              end do
            end do
          end do
        end select
      end associate

      return
    end function op_obj_d1dx3