test_invalidate Subroutine

public subroutine test_invalidate()

Arguments

None

Calls

proc~~test_invalidate~~CallsGraph proc~test_invalidate test_invalidate anyexceptions anyexceptions proc~test_invalidate->anyexceptions assert_that assert_that proc~test_invalidate->assert_that assertfalse assertfalse proc~test_invalidate->assertfalse asserttrue asserttrue proc~test_invalidate->asserttrue interface~fieldisconstant FieldIsConstant proc~test_invalidate->interface~fieldisconstant interface~fieldset FieldSet proc~test_invalidate->interface~fieldset none~initialize~38 AccumulatorAction%initialize proc~test_invalidate->none~initialize~38 none~invalidate~3 AccumulatorAction%invalidate proc~test_invalidate->none~invalidate~3 proc~destroy_objects destroy_objects proc~test_invalidate->proc~destroy_objects proc~get_field~2 get_field proc~test_invalidate->proc~get_field~2 proc~initialize_objects initialize_objects proc~test_invalidate->proc~initialize_objects sourcelocation sourcelocation proc~test_invalidate->sourcelocation

Source Code

   subroutine test_invalidate()
      type(AccumulatorAction) :: acc
      type(ESMF_State) :: importState, exportState
      type(ESMF_Clock) :: clock
      integer :: status
      type(ESMF_Field) :: import_field
      real(kind=R4), parameter :: invalidate_value = 4.0_R4
      logical :: equals_expected_value

      call initialize_objects(importState, exportState, clock, ESMF_TYPEKIND_R4, _RC)
      call acc%initialize(importState, exportState, clock, _RC)
      call get_field(importState, import_field, _RC)
      call FieldSet(import_field, invalidate_value, _RC)
      call acc%invalidate(importState, exportState, clock, _RC)
      @assertFalse(acc%update_calculated, 'update_calculated .TRUE.')
      equals_expected_value = FieldIsConstant(acc%accumulation_field, invalidate_value, _RC)
      @assertTrue(equals_expected_value, 'accumulation_field not equal to invalidate_value')
      call acc%invalidate(importState, exportState, clock, _RC)
      @assertFalse(acc%update_calculated, 'update_calculated .TRUE.')
      equals_expected_value = FieldIsConstant(acc%accumulation_field, 2*invalidate_value, _RC)
      @assertTrue(equals_expected_value, 'accumulation_field .FALSE.')
      call destroy_objects(importState, exportState, clock, _RC)

   end subroutine test_invalidate