test_get_r4seq Subroutine

public subroutine test_get_r4seq()

Arguments

None

Calls

proc~~test_get_r4seq~~CallsGraph proc~test_get_r4seq test_get_r4seq ESMF_HConfigAdd ESMF_HConfigAdd proc~test_get_r4seq->ESMF_HConfigAdd assertequal assertequal proc~test_get_r4seq->assertequal asserttrue asserttrue proc~test_get_r4seq->asserttrue interface~get_value get_value proc~test_get_r4seq->interface~get_value

Source Code

   subroutine test_get_r4seq()
      character(len=*), parameter :: LABEL = 'four'
      real(kind=R4), parameter :: EXPECTED(4) = &
         [-1.23456780_R4, 1.23456780_R4, 9.87654300_R4, -9.87654300_R4]
      real(kind=R4), allocatable :: actual(:)
      type(HConfigParams) :: params
      logical :: found
      integer :: status

      call ESMF_HConfigAdd(hconfig, EXPECTED, addKeyString=LABEL, rc=status)
      @assertEqual(0, status, ERROR_ADD_FAIL)
      params = HConfigParams(hconfig, LABEL, check_value_set=.TRUE.)
      call get_value(params, actual, rc=status)
      found = params%value_set
      @assertEqual(0, status, ERROR_GET_FAILED)
      @assertTrue(found, ERROR_NOT_FOUND // LABEL)
      @assertTrue(all(actual == EXPECTED), ERROR_MISMATCH)

   end subroutine test_get_r4seq