diff --git a/field_utils/FieldCondensedArray.F90 b/field_utils/FieldCondensedArray.F90 index bb8ad6e467e..407b81b427b 100644 --- a/field_utils/FieldCondensedArray.F90 +++ b/field_utils/FieldCondensedArray.F90 @@ -56,13 +56,13 @@ function get_fptr_shape(f, rc) result(fptr_shape) logical :: has_vertical character(len=:), allocatable :: spec_name character(len=*), parameter :: VERTICAL_DIM_NONE_NAME = 'VERTICAL_DIM_NONE' - integer :: dimCount + integer :: geomDimCount - call ESMF_FieldGet(f, dimCount=dimCount, rank=rank, _RC) + call ESMF_FieldGet(f, geomDimCount=geomDimCount, rank=rank, _RC) _ASSERT(.not. rank < 0, 'rank cannot be negative.') - _ASSERT(.not. dimCount < 0, 'dimCount cannot be negative.') + _ASSERT(.not. geomDimCount < 0, 'geomDimCount cannot be negative.') allocate(localElementCount(rank)) - allocate(gridToFieldMap(dimCount)) + allocate(gridToFieldMap(geomDimCount)) call ESMF_FieldGet(f, gridToFieldMap=gridToFieldMap, _RC) ! Due to an ESMF bug, getting the localElementCount must use the module function. ! See FieldGetLocalElementCount (specific function) comments. @@ -71,6 +71,7 @@ function get_fptr_shape(f, rc) result(fptr_shape) has_vertical = spec_name /= VERTICAL_DIM_NONE_NAME fptr_shape = get_fptr_shape_private(gridToFieldMap, localElementCount, has_vertical, _RC) + _RETURN(_SUCCESS) end function get_fptr_shape end module mapl3g_FieldCondensedArray diff --git a/field_utils/FieldCondensedArray_private.F90 b/field_utils/FieldCondensedArray_private.F90 index b641c43545e..3ca2edde971 100644 --- a/field_utils/FieldCondensedArray_private.F90 +++ b/field_utils/FieldCondensedArray_private.F90 @@ -26,7 +26,7 @@ function get_fptr_shape_private(gridToFieldMap, localElementCount, has_vertical, vert_dim = 0 vert_size = 1 - + rank = size(localElementCount) grid_dims = pack(gridToFieldMap, gridToFieldMap /= 0) _ASSERT(all(grid_dims <= size(grid_dims)), 'MAPL expects geom dims before ungridded.')