test_accumulate Subroutine

public subroutine test_accumulate()

Arguments

None

Calls

proc~~test_accumulate~~CallsGraph proc~test_accumulate test_accumulate anyexceptions anyexceptions proc~test_accumulate->anyexceptions assert_that assert_that proc~test_accumulate->assert_that asserttrue asserttrue proc~test_accumulate->asserttrue esmf_fielddestroy esmf_fielddestroy proc~test_accumulate->esmf_fielddestroy interface~fieldisconstant FieldIsConstant proc~test_accumulate->interface~fieldisconstant interface~fieldset FieldSet proc~test_accumulate->interface~fieldset none~accumulate~6 AccumulatorAction%accumulate proc~test_accumulate->none~accumulate~6 none~initialize~38 AccumulatorAction%initialize proc~test_accumulate->none~initialize~38 proc~destroy_objects destroy_objects proc~test_accumulate->proc~destroy_objects proc~initialize_field initialize_field proc~test_accumulate->proc~initialize_field proc~initialize_objects initialize_objects proc~test_accumulate->proc~initialize_objects sourcelocation sourcelocation proc~test_accumulate->sourcelocation

Source Code

   subroutine test_accumulate()
      type(AccumulatorAction) :: acc
      type(ESMF_State) :: importState, exportState
      type(ESMF_Clock) :: clock
      integer :: status
      type(ESMF_Field) :: update_field
      type(ESMF_TypeKind_Flag) :: typekind
      logical :: matches_expected
      real(kind=ESMF_KIND_R4), parameter :: value_r4 = 3.0_ESMF_KIND_R4

      typekind = ESMF_TYPEKIND_R4
      call initialize_objects(importState, exportState, clock, typekind, _RC)
      call acc%initialize(importState, exportState, clock, _RC)
      call initialize_field(update_field, typekind=typekind, _RC)
      call FieldSet(update_field, value_r4, _RC)
      call acc%accumulate(update_field, _RC)
      matches_expected = FieldIsConstant(acc%accumulation_field, value_r4, _RC)
      @assertTrue(matches_expected, 'accumulation_field not equal to value_r4')
      call ESMF_FieldDestroy(update_field, _RC)
      call destroy_objects(importState, exportState, clock, _RC)

   end subroutine test_accumulate