diff --git a/Apps/time_ave_util.F90 b/Apps/time_ave_util.F90 index 70bf28ec4199..a275e9c4bc3e 100644 --- a/Apps/time_ave_util.F90 +++ b/Apps/time_ave_util.F90 @@ -1166,12 +1166,14 @@ subroutine get_file_levels(filename,vertical_data,rc) basic_metadata=formatter%read(_RC) call metadata%create(basic_metadata,trim(filename)) lev_name = metadata%get_level_name(_RC) - call metadata%get_coordinate_info(lev_name,coords=levs,coordUnits=lev_units,long_name=long_name,& - standard_name=standard_name,coordinate_attr=vcoord,_RC) - plevs => levs - vertical_data = VerticalData(levels=plevs,vunit=lev_units,vcoord=vcoord,standard_name=standard_name,long_name=long_name, & - force_no_regrid=.true.,_RC) - nullify(plevs) + if (lev_name /= '') then + call metadata%get_coordinate_info(lev_name,coords=levs,coordUnits=lev_units,long_name=long_name,& + standard_name=standard_name,coordinate_attr=vcoord,_RC) + plevs => levs + vertical_data = VerticalData(levels=plevs,vunit=lev_units,vcoord=vcoord,standard_name=standard_name,long_name=long_name, & + force_no_regrid=.true.,_RC) + nullify(plevs) + end if if (present(rc)) then rc=_SUCCESS @@ -1185,7 +1187,7 @@ function has_level(grid,rc) result(grid_has_level) integer, intent(out), optional :: rc integer :: status, global_dims(3) call MAPL_GridGet(grid,globalCellCountPerDim=global_dims,_RC) - grid_has_level = (global_dims(3)/=1) + grid_has_level = (global_dims(3)>1) if (present(rc)) then RC=_SUCCESS end if diff --git a/CHANGELOG.md b/CHANGELOG.md index 364de51d9909..bf23a59eab34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed +- Relaxed restriction in the tripolar grid factory so that grids can be made even when the decomposition deos not evenly divide the grid dimension so that the factory can be used in utilities where the core count makes such a condition impossible to satisfiy ### Fixed +- Fix a bug in time\_ave\_util.x so that it can work with files with no veritcal coordinate ### Removed diff --git a/base/MAPL_TripolarGridFactory.F90 b/base/MAPL_TripolarGridFactory.F90 index 0989cd3d4ed0..d44867b06121 100644 --- a/base/MAPL_TripolarGridFactory.F90 +++ b/base/MAPL_TripolarGridFactory.F90 @@ -488,10 +488,6 @@ subroutine check_and_fill_consistency(this, unusable, rc) end if ! Check decomposition/bounds - ! Tripolar requires even divisibility - _ASSERT(mod(this%im_world, this%nx) == 0,"needs message") - _ASSERT(mod(this%jm_world, this%ny) == 0,"needs message") - ! local extents call verify(this%nx, this%im_world, this%ims, rc=status) call verify(this%ny, this%jm_world, this%jms, rc=status)