test_get_standard_name_from_alias_multi Subroutine

public subroutine test_get_standard_name_from_alias_multi()

Arguments

None

Calls

proc~~test_get_standard_name_from_alias_multi~~CallsGraph proc~test_get_standard_name_from_alias_multi test_get_standard_name_from_alias_multi assert_that assert_that proc~test_get_standard_name_from_alias_multi->assert_that assertequal assertequal proc~test_get_standard_name_from_alias_multi->assertequal none~get_standard_name FieldDictionary%get_standard_name proc~test_get_standard_name_from_alias_multi->none~get_standard_name at at none~get_standard_name->at proc~mapl_return MAPL_Return none~get_standard_name->proc~mapl_return proc~mapl_verify MAPL_Verify none~get_standard_name->proc~mapl_verify proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   subroutine test_get_standard_name_from_alias_multi()
      type(FieldDictionary) :: fd
      character(:), allocatable :: standard_name
      integer :: status
      
      fd = FieldDictionary(stream = '{' // &
           'X_Y_Z: {canonical_units: m, long_name: "X Y Z", aliases: [x, y]},' //  &
           'A_B_C: {canonical_units: s, long_name: "A B C", aliases: [a, b, c]} }')

      standard_name = fd%get_standard_name('y', rc=status)
      @assert_that(status, is(0))
      @assertEqual('X_Y_Z', standard_name)

      standard_name = fd%get_standard_name('b', rc=status)
      @assert_that(status, is(0))
      @assertEqual('A_B_C', standard_name)

      standard_name = fd%get_standard_name('c', rc=status)
      @assert_that(status, is(0))
      @assertEqual('A_B_C', standard_name)

   end subroutine test_get_standard_name_from_alias_multi