test_merge_meta Subroutine

public subroutine test_merge_meta()

Arguments

None

Calls

proc~~test_merge_meta~~CallsGraph proc~test_merge_meta test_merge_meta asserttrue asserttrue proc~test_merge_meta->asserttrue none~add_attribute~2 Variable%add_attribute proc~test_merge_meta->none~add_attribute~2 none~add_dimension FileMetadata%add_dimension proc~test_merge_meta->none~add_dimension none~add_variable~2 FileMetadata%add_variable proc~test_merge_meta->none~add_variable~2 none~add_attribute_1d Variable%add_attribute_1d none~add_attribute~2->none~add_attribute_1d insert insert none~add_dimension->insert proc~mapl_return MAPL_Return none~add_dimension->proc~mapl_return at at none~add_variable~2->at begin begin none~add_variable~2->begin get get none~add_variable~2->get interface~mapl_assert MAPL_Assert none~add_variable~2->interface~mapl_assert next next none~add_variable~2->next none~get_const_value Variable%get_const_value none~add_variable~2->none~get_const_value none~get_dimensions Variable%get_dimensions none~add_variable~2->none~get_dimensions none~get_shape UnlimitedEntity%get_shape none~add_variable~2->none~get_shape none~insert~7 StringVariableMap%insert none~add_variable~2->none~insert~7 none~is_empty UnlimitedEntity%is_empty none~add_variable~2->none~is_empty none~add_variable~2->proc~mapl_return push_back push_back none~add_variable~2->push_back none~add_attribute_1d->proc~mapl_return none~insert~98 StringAttributeMap%insert none~add_attribute_1d->none~insert~98 none~get_shape->proc~mapl_return none~insert_pair StringVariableMap%insert_pair none~insert~7->none~insert_pair none~is_empty->proc~mapl_return none~get_value UnlimitedEntity%get_value none~is_empty->none~get_value proc~mapl_return->at proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception none~get_value->proc~mapl_return none~insert_pair~12 StringAttributeMap%insert_pair none~insert~98->none~insert_pair~12

Source Code

   subroutine test_merge_meta()
      type (FileMetadata) :: cf1, cf2,cf3
      type (Variable) :: v1, v2, v3

      call cf1%add_dimension('x', 10)
      call cf1%add_dimension('y', 20)
      call cf1%add_dimension('z', 30)

      v1 = Variable(type=pFIO_INT32, dimensions='x')
      call v3%add_attribute('flag', .true.)

      call cf1%add_variable('v1', v1)
    
      call cf2%merge(cf1)
      @assertTrue(cf2 == cf1)

      ! merge again, should be the same
      call cf2%merge(cf1)
      @assertTrue(cf2 == cf1)

      call cf3%add_dimension('x', 10)
      call cf3%add_dimension('a', 3)
      v3 = Variable(type=pFIO_REAL64, dimensions='x,a')
      call cf3%add_variable('v3', v3)
      call cf2%merge(cf3)
    
      call cf1%add_dimension('a',3)
      call cf1%add_variable('v3', v3)
      
      @assertTrue(cf2 == cf1)
      
   end subroutine test_merge_meta