Skip to content

Commit 3e2645a

Browse files
committed
Merge branch 'develop' into feature/mathomp4/2845-esmf-env-var
# Conflicts: # CHANGELOG.md
2 parents e0fc601 + c7a38da commit 3e2645a

File tree

9 files changed

+310
-99
lines changed

9 files changed

+310
-99
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ workflows:
229229
baselibs_version: *baselibs_version
230230
container_name: mapl
231231
mpi_name: openmpi
232-
mpi_version: 5.0.2
232+
mpi_version: 5.0.5
233233
compiler_name: gcc
234-
compiler_version: 13.2.0
234+
compiler_version: 14.2.0
235235
image_name: geos-env-mkl
236236
tag_build_arg_name: *tag_build_arg_name

CHANGELOG.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Allow update offsets of ±timestep in ExtData2G
1313
- Minor revision (and generalization) of grid-def for GSI purposes
1414
- Add ability to use an `ESMF_CONFIG_FILE` environment variable to specify name of file to pass in pre-`ESMF_Initialize` options to ESMF (see [ESMF Docs](https://earthsystemmodeling.org/docs/release/latest/ESMF_refdoc/node4.html#SECTION04024000000000000000) for allowed flags.
15+
- Trajectory sampler: fix a bug when group_name does not exist in netCDF file and a bug that omitted the first time point
16+
- Allow lat-lon grid factory to detect and use CF compliant lat-lon bounds in a file when making a grid
17+
- PFIO/Variable class, new procedures to retrieve string/reals/int attributes from a variable
1518

1619
### Changed
1720

18-
- refactored tableEnd check
21+
- Change minimum CMake version to 3.24
22+
- This is needed for f2py and meson support
23+
- Refactored tableEnd check
1924
- Added commandline options to `checkpoint_benchmark.x` and `restart_benchmark.x` to allow for easier testing of different configurations. Note that the old configuration file style of input is allowed via the `--config_file` option (which overrides any other command line options)
2025
- Update ESMF version for Baselibs to match that of Spack for consistency
2126
- Update `components.yaml`
@@ -28,9 +33,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2833
- GSL 2.8
2934
- jpeg 9f
3035
- Various build fixes
31-
- ESMA_cmake v3.52.0
36+
- ESMA_cmake v3.55.0
3237
- Fixes for using MAPL as a library in spack builds of GEOSgcm
3338
- Various backports from v4
39+
- Code for capturing `mepo status` output
40+
- Fixes for f2py and meson (NOTE: Requires CMake minimum version of 3.24 in project for complete functionality)
41+
- Fixes for `MPI_STACK` code run multiple times
3442
- Updates to CI
3543
- Use v7.27.0 Baselibs
3644
- Use GCC 14 for GNU tests
@@ -39,12 +47,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3947
### Fixed
4048

4149
- Fixed issue of some Baselibs builds appearing to support zstandard. This is not possible due to Baselibs building HDF5 and netCDF as static libraries
50+
<<<<<<< HEAD
4251
- Trajectory sampler: fix a bug when group_name does not exist in netCDF file and a bug that omitted the first time point
52+
=======
53+
- Fixed a bug where the periodicity around the earth of the lat-lon grid was not being set properly when grid did not span from pole to pole
54+
>>>>>>> develop
4355
4456
### Removed
4557

4658
### Deprecated
4759

60+
## [2.50.3] - 2024-12-02
61+
62+
### Fixed
63+
64+
- Fixed bug where c null character is not removed from end of string when reading netcdf attribute in NetCDF4\_FileFormatter.F90
65+
4866
## [2.50.2] - 2024-10-30
4967

5068
### Fixed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required (VERSION 3.23)
1+
cmake_minimum_required (VERSION 3.24)
22

33
get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
44
if(NOT is_multi_config AND NOT (CMAKE_BUILD_TYPE OR DEFINED ENV{CMAKE_BUILD_TYPE}))
@@ -8,7 +8,7 @@ endif ()
88

99
project (
1010
MAPL
11-
VERSION 2.50.2
11+
VERSION 2.50.3
1212
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF
1313

1414
# Set the possible values of build type for cmake-gui

base/FileMetadataUtilities.F90

Lines changed: 11 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -116,30 +116,15 @@ function get_var_attr_real32(this,var_name,attr_name,rc) result(attr_real32)
116116
character(len=*), intent(in) :: attr_name
117117
integer, optional, intent(out) :: rc
118118

119-
real(REAL32) :: tmp(1)
120-
real(REAL64) :: tmpd(1)
121119
integer :: status
122120
character(:), allocatable :: fname
123-
type(Attribute), pointer :: attr
124121
type(Variable), pointer :: var
125-
class(*), pointer :: attr_val(:)
126122

127123
fname = this%get_file_name(_RC)
128124
var => this%get_variable(var_name,_RC)
129125
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
130-
attr => var%get_attribute(attr_name,_RC)
131-
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
132-
attr_val => attr%get_values()
133-
select type(attr_val)
134-
type is(real(kind=REAL32))
135-
tmp = attr_val
136-
attr_real32 = tmp(1)
137-
type is(real(kind=REAL64))
138-
tmpd = attr_val
139-
attr_real32 = REAL(tmpd(1))
140-
class default
141-
_FAIL('unsupported subclass (not real32) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
142-
end select
126+
attr_real32 = var%get_attribute_real32(attr_name, rc=status)
127+
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)
143128

144129
_RETURN(_SUCCESS)
145130
end function get_var_attr_real32
@@ -151,28 +136,17 @@ function get_var_attr_real64(this,var_name,attr_name,rc) result(attr_real64)
151136
character(len=*), intent(in) :: attr_name
152137
integer, optional, intent(out) :: rc
153138

154-
real(REAL64) :: tmp(1)
155139
integer :: status
156140
character(:), allocatable :: fname
157-
type(Attribute), pointer :: attr
158141
type(Variable), pointer :: var
159-
class(*), pointer :: attr_val(:)
160142

161143
fname = this%get_file_name(_RC)
162144
var => this%get_variable(var_name,_RC)
163145
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
164-
attr => var%get_attribute(attr_name,_RC)
165-
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
166-
attr_val => attr%get_values()
167-
select type(attr_val)
168-
type is(real(kind=REAL64))
169-
tmp = attr_val
170-
attr_real64 = tmp(1)
171-
class default
172-
_FAIL('unsupported subclass (not real64) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
173-
end select
174-
146+
attr_real64 = var%get_attribute_real64(attr_name, rc=status)
147+
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)
175148
_RETURN(_SUCCESS)
149+
176150
end function get_var_attr_real64
177151

178152
function get_var_attr_int32(this,var_name,attr_name,rc) result(attr_int32)
@@ -182,26 +156,15 @@ function get_var_attr_int32(this,var_name,attr_name,rc) result(attr_int32)
182156
character(len=*), intent(in) :: attr_name
183157
integer, optional, intent(out) :: rc
184158

185-
integer(INT32) :: tmp(1)
186159
integer :: status
187160
character(:), allocatable :: fname
188-
type(Attribute), pointer :: attr
189161
type(Variable), pointer :: var
190-
class(*), pointer :: attr_val(:)
191162

192163
fname = this%get_file_name(_RC)
193164
var => this%get_variable(var_name,_RC)
194165
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
195-
attr => var%get_attribute(attr_name,_RC)
196-
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
197-
attr_val => attr%get_values()
198-
select type(attr_val)
199-
type is(integer(kind=INT32))
200-
tmp = attr_val
201-
attr_int32 = tmp(1)
202-
class default
203-
_FAIL('unsupported subclass (not int32) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
204-
end select
166+
attr_int32 = var%get_attribute_int32(attr_name, rc=status)
167+
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)
205168

206169
_RETURN(_SUCCESS)
207170
end function get_var_attr_int32
@@ -213,26 +176,15 @@ function get_var_attr_int64(this,var_name,attr_name,rc) result(attr_int64)
213176
character(len=*), intent(in) :: attr_name
214177
integer, optional, intent(out) :: rc
215178

216-
integer(INT64) :: tmp(1)
217179
integer :: status
218180
character(:), allocatable :: fname
219-
type(Attribute), pointer :: attr
220181
type(Variable), pointer :: var
221-
class(*), pointer :: attr_val(:)
222182

223183
fname = this%get_file_name(_RC)
224184
var => this%get_variable(var_name,_RC)
225185
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
226-
attr => var%get_attribute(attr_name,_RC)
227-
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
228-
attr_val => attr%get_values()
229-
select type(attr_val)
230-
type is(integer(kind=INT64))
231-
tmp = attr_val
232-
attr_int64 = tmp(1)
233-
class default
234-
_FAIL('unsupported subclass (not int64) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
235-
end select
186+
attr_int64 = var%get_attribute_int64(attr_name, rc=status)
187+
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)
236188

237189
_RETURN(_SUCCESS)
238190
end function get_var_attr_int64
@@ -246,22 +198,13 @@ function get_var_attr_string(this,var_name,attr_name,rc) result(attr_string)
246198

247199
integer :: status
248200
character(:), allocatable :: fname
249-
type(Attribute), pointer :: attr
250201
type(Variable), pointer :: var
251-
class(*), pointer :: attr_val
252202

253203
fname = this%get_file_name(_RC)
254204
var => this%get_variable(var_name,_RC)
255205
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
256-
attr => var%get_attribute(attr_name,_RC)
257-
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
258-
attr_val => attr%get_value()
259-
select type(attr_val)
260-
type is(character(*))
261-
attr_string = attr_val
262-
class default
263-
_FAIL('unsupported subclass (not string) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
264-
end select
206+
attr_string = var%get_attribute_string(attr_name, rc=status)
207+
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)
265208

266209
_RETURN(_SUCCESS)
267210
end function get_var_attr_string

0 commit comments

Comments
 (0)