diff --git a/GeomIO/SharedIO.F90 b/GeomIO/SharedIO.F90 index 96e958191104..d899898ecb89 100644 --- a/GeomIO/SharedIO.F90 +++ b/GeomIO/SharedIO.F90 @@ -98,7 +98,7 @@ subroutine add_variable(metadata, field, rc) integer :: pfio_type variable_dim_names = get_variable_dim_names(field, geom, _RC) - call ESMF_FieldGet(field, name=short_name, typekind=typekind, _RC) + call MAPL_FieldGet(field, short_name=short_name, typekind=typekind, _RC) pfio_type = esmf_to_pfio_type(typekind ,_RC) v = Variable(type=pfio_type, dimensions=variable_dim_names) diff --git a/field/FieldGet.F90 b/field/FieldGet.F90 index 43d80b458ec0..c58d86248d08 100644 --- a/field/FieldGet.F90 +++ b/field/FieldGet.F90 @@ -24,13 +24,16 @@ module mapl3g_FieldGet contains subroutine field_get(field, unusable, & + short_name, typekind, & num_levels, vert_staggerloc, num_vgrid_levels, & ungridded_dims, & - units, standard_name, long_name, & + units, standard_name, long_name, & rc) type(ESMF_Field), intent(in) :: field class(KeywordEnforcer), optional, intent(in) :: unusable + character(len=:), optional, allocatable, intent(out) :: short_name + type(ESMF_TypeKind_Flag), optional, intent(out) :: typekind integer, optional, intent(out) :: num_levels type(VerticalStaggerLoc), optional, intent(out) :: vert_staggerloc integer, optional, intent(out) :: num_vgrid_levels @@ -43,9 +46,18 @@ subroutine field_get(field, unusable, & integer :: status type(ESMF_Info) :: field_info + character(len=ESMF_MAXSTR) :: fname + + if (present(short_name)) then + call ESMF_FieldGet(field, name=fname, _RC) + short_name = trim(fname) + end if + + if (present(typekind)) then + call ESMF_FieldGet(field, typekind=typekind, _RC) + end if call ESMF_InfoGetFromHost(field, field_info, _RC) - call MAPL_FieldInfoGetInternal(field_info, & num_levels=num_levels, & vert_staggerloc=vert_staggerloc, &