test_arithmetic_mixed Subroutine

public subroutine test_arithmetic_mixed(this)

Arguments

Type IntentOptional Attributes Name
class(ESMF_TestMethod), intent(inout) :: this

Calls

proc~~test_arithmetic_mixed~~CallsGraph proc~test_arithmetic_mixed test_arithmetic_mixed assertequal assertequal proc~test_arithmetic_mixed->assertequal esmf_fieldget esmf_fieldget proc~test_arithmetic_mixed->esmf_fieldget proc~mapl_return MAPL_Return proc~test_arithmetic_mixed->proc~mapl_return proc~mapl_stateeval MAPL_StateEval proc~test_arithmetic_mixed->proc~mapl_stateeval proc~mapl_verify MAPL_Verify proc~test_arithmetic_mixed->proc~mapl_verify

Source Code

   subroutine test_arithmetic_mixed(this)
      class(ESMF_TestMethod), intent(inout) :: this

      integer :: status, rc
      real(ESMF_KIND_R4), pointer :: ptr3d(:,:,:), extra_ptr(:,:)
      real(ESMF_KIND_R4), allocatable :: expected_array(:,:,:)
      real(ESMF_KIND_R4) :: rval
      character(len=:), allocatable :: expr

      call ESMF_FieldGet(extra_2d, 0, farrayPtr=extra_ptr, _RC)
      call ESMF_FieldGet(field_3d, 0, farrayPtr=ptr3d, _RC)
      expr = "field_3d*extra_2d"
      rval = 5.0 
      ptr3d = rval
      rval = 3.0
      extra_ptr = rval
      allocate(expected_array(3,3,2),_STAT)
      expected_array = 15.0
      call  MAPL_StateEval(state, expr, field_3d, _RC)
      @assertEqual(expected_array, ptr3d)
      _RETURN(_SUCCESS)

   end subroutine test_arithmetic_mixed