Skip to content

Commit

Permalink
Merge pull request #3226 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: Merge develop into main for 2.51 release
  • Loading branch information
mathomp4 authored Dec 6, 2024
2 parents 7eb7786 + 4a0b7e1 commit 7f63dbe
Show file tree
Hide file tree
Showing 33 changed files with 1,612 additions and 306 deletions.
63 changes: 39 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ workflows:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
compiler: [gfortran, ifort, ifx]
cmake_generator: ['Unix Makefiles','Ninja']
baselibs_version: *baselibs_version
repo: MAPL
Expand All @@ -49,7 +49,7 @@ workflows:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
compiler: [gfortran, ifort, ifx]
baselibs_version: *baselibs_version
repo: MAPL
mepodevelop: false
Expand All @@ -60,14 +60,29 @@ workflows:
# ExtData1G tests were removed from ESSENTIAL, so we run them separately here as UFS might still use 1G?
ctest_options: "-L 'ESSENTIAL|EXTDATA1G_SMALL_TESTS' --output-on-failure"

# Builds MAPL without pFUnit support
- ci/build:
name: build-MAPL-without-pFUnit-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [ifort, ifx]
baselibs_version: *baselibs_version
repo: MAPL
mepodevelop: false
remove_pfunit: true
run_unit_tests: true
ctest_options: "-L 'ESSENTIAL' --output-on-failure"

# Run MAPL Tutorials
- ci/run_mapl_tutorial:
name: run-<< matrix.tutorial_name >>-Tutorial-with-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
compiler: [gfortran, ifort, ifx]
tutorial_name:
- hello_world
- parent_no_children
Expand All @@ -89,7 +104,7 @@ workflows:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
compiler: [gfortran, ifort, ifx]
baselibs_version: *baselibs_version
repo: GEOSgcm
checkout_fixture: true
Expand All @@ -104,7 +119,7 @@ workflows:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran, ifort]
compiler: [gfortran, ifort, ifx]
requires:
- build-GEOSgcm-on-<< matrix.compiler >>
repo: GEOSgcm
Expand Down Expand Up @@ -185,23 +200,23 @@ workflows:
compiler_version: "2021.13"
image_name: geos-env
tag_build_arg_name: *tag_build_arg_name
#- ci/publish_docker:
#filters:
#tags:
#only: /^v.*$/
#name: publish-ifx-docker-image
#context:
#- docker-hub-creds
#- ghcr-creds
#os_version: *os_version
#baselibs_version: *baselibs_version
#container_name: mapl
#mpi_name: intelmpi
#mpi_version: "2021.13"
#compiler_name: ifx
#compiler_version: "2024.2"
#image_name: geos-env
#tag_build_arg_name: *tag_build_arg_name
- ci/publish_docker:
filters:
tags:
only: /^v.*$/
name: publish-ifx-docker-image
context:
- docker-hub-creds
- ghcr-creds
os_version: *os_version
baselibs_version: *baselibs_version
container_name: mapl
mpi_name: intelmpi
mpi_version: "2021.14"
compiler_name: ifx
compiler_version: "2025.0"
image_name: geos-env
tag_build_arg_name: *tag_build_arg_name
- ci/publish_docker:
filters:
tags:
Expand All @@ -214,8 +229,8 @@ workflows:
baselibs_version: *baselibs_version
container_name: mapl
mpi_name: openmpi
mpi_version: 5.0.2
mpi_version: 5.0.5
compiler_name: gcc
compiler_version: 13.2.0
compiler_version: 14.2.0
image_name: geos-env-mkl
tag_build_arg_name: *tag_build_arg_name
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,59 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.51.0] - 2024-12-06

### Added

- Added macro `_RETURN(_SUCCESS)` to fetch_data
- Allow update offsets of &#177;timestep in ExtData2G
- Minor revision (and generalization) of grid-def for GSI purposes
- 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.
- Allow lat-lon grid factory to detect and use CF compliant lat-lon bounds in a file when making a grid
- PFIO/Variable class, new procedures to retrieve string/reals/int attributes from a variable
- Added a call in GenericRefresh to allow GC's refresh method to be called; in support
of CICE6 rewind

### Changed

- Change minimum CMake version to 3.24
- This is needed for f2py and meson support
- Refactored tableEnd check
- 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)
- Update ESMF version for Baselibs to match that of Spack for consistency
- Update `components.yaml`
- ESMA_env v4.32.0
- Baselibs 7.27.0
- ESMF 8.7.0
- curl 8.10.1
- NCO 5.2.8
- CDO 2.4.4
- GSL 2.8
- jpeg 9f
- Various build fixes
- ESMA_cmake v3.55.0
- Fixes for using MAPL as a library in spack builds of GEOSgcm
- Various backports from v4
- Code for capturing `mepo status` output
- Fixes for f2py and meson (NOTE: Requires CMake minimum version of 3.24 in project for complete functionality)
- Fixes for `MPI_STACK` code run multiple times
- Updates to CI
- Use v7.27.0 Baselibs
- Use GCC 14 for GNU tests
- Add pFUnit-less build test
- Enable ifx tests
- Improve some writes to be more informative
- In `base/MAPL_CFIO.F90`, added `Iam` to a print statement so that when a read fails we know which routine failed
- In `gridcomps/ExtData2G/ExtDataConfig.F90`, print out the name of the duplicate collection that causes model to fail

### Fixed

- Fixed issue of some Baselibs builds appearing to support zstandard. This is not possible due to Baselibs building HDF5 and netCDF as static libraries
- Workaround ifx bug in `pfio/ArrayReference.F90` (NOTE: This currently targets all versions of ifx, but will need to be qualified or removed in the future)
- Updates to support llvm-flang
- Trajectory sampler: fix a bug when group_name does not exist in netCDF file and a bug that omitted the first time point
- 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

## [2.50.3] - 2024-12-02

### Fixed
Expand Down
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.23)
cmake_minimum_required (VERSION 3.24)

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

project (
MAPL
VERSION 2.50.3
VERSION 2.51.0
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

# Set the possible values of build type for cmake-gui
Expand Down Expand Up @@ -156,8 +156,8 @@ else ()
# This is an ESMF version test when using Baselibs which doesn't use the
# same find_package internally in ESMA_cmake as used above (with a version
# number) so this lets us at least trap use of old Baselibs here.
if (ESMF_VERSION VERSION_LESS 8.6.0)
message(FATAL_ERROR "ESMF must be at least 8.6.0")
if (ESMF_VERSION VERSION_LESS 8.6.1)
message(FATAL_ERROR "ESMF must be at least 8.6.1")
endif ()
endif ()

Expand Down
9 changes: 0 additions & 9 deletions base/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
esma_set_this (OVERRIDE MAPL.base)

if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 20)
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 17)
add_definitions(-D__ifort_18)
endif()
endif()
endif()


set (srcs
MAPL_Profiler.F90
CFIOCollection.F90 MAPL_RegridderManager.F90
Expand Down
79 changes: 11 additions & 68 deletions base/FileMetadataUtilities.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,15 @@ function get_var_attr_real32(this,var_name,attr_name,rc) result(attr_real32)
character(len=*), intent(in) :: attr_name
integer, optional, intent(out) :: rc

real(REAL32) :: tmp(1)
real(REAL64) :: tmpd(1)
integer :: status
character(:), allocatable :: fname
type(Attribute), pointer :: attr
type(Variable), pointer :: var
class(*), pointer :: attr_val(:)

fname = this%get_file_name(_RC)
var => this%get_variable(var_name,_RC)
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
attr => var%get_attribute(attr_name,_RC)
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
attr_val => attr%get_values()
select type(attr_val)
type is(real(kind=REAL32))
tmp = attr_val
attr_real32 = tmp(1)
type is(real(kind=REAL64))
tmpd = attr_val
attr_real32 = REAL(tmpd(1))
class default
_FAIL('unsupported subclass (not real32) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
end select
attr_real32 = var%get_attribute_real32(attr_name, rc=status)
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)

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

real(REAL64) :: tmp(1)
integer :: status
character(:), allocatable :: fname
type(Attribute), pointer :: attr
type(Variable), pointer :: var
class(*), pointer :: attr_val(:)

fname = this%get_file_name(_RC)
var => this%get_variable(var_name,_RC)
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
attr => var%get_attribute(attr_name,_RC)
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
attr_val => attr%get_values()
select type(attr_val)
type is(real(kind=REAL64))
tmp = attr_val
attr_real64 = tmp(1)
class default
_FAIL('unsupported subclass (not real64) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
end select

attr_real64 = var%get_attribute_real64(attr_name, rc=status)
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)
_RETURN(_SUCCESS)

end function get_var_attr_real64

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

integer(INT32) :: tmp(1)
integer :: status
character(:), allocatable :: fname
type(Attribute), pointer :: attr
type(Variable), pointer :: var
class(*), pointer :: attr_val(:)

fname = this%get_file_name(_RC)
var => this%get_variable(var_name,_RC)
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
attr => var%get_attribute(attr_name,_RC)
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
attr_val => attr%get_values()
select type(attr_val)
type is(integer(kind=INT32))
tmp = attr_val
attr_int32 = tmp(1)
class default
_FAIL('unsupported subclass (not int32) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
end select
attr_int32 = var%get_attribute_int32(attr_name, rc=status)
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)

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

integer(INT64) :: tmp(1)
integer :: status
character(:), allocatable :: fname
type(Attribute), pointer :: attr
type(Variable), pointer :: var
class(*), pointer :: attr_val(:)

fname = this%get_file_name(_RC)
var => this%get_variable(var_name,_RC)
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
attr => var%get_attribute(attr_name,_RC)
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
attr_val => attr%get_values()
select type(attr_val)
type is(integer(kind=INT64))
tmp = attr_val
attr_int64 = tmp(1)
class default
_FAIL('unsupported subclass (not int64) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
end select
attr_int64 = var%get_attribute_int64(attr_name, rc=status)
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)

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

integer :: status
character(:), allocatable :: fname
type(Attribute), pointer :: attr
type(Variable), pointer :: var
class(*), pointer :: attr_val

fname = this%get_file_name(_RC)
var => this%get_variable(var_name,_RC)
_ASSERT(associated(var),"no variable named "//var_name//" in "//fname)
attr => var%get_attribute(attr_name,_RC)
_ASSERT(associated(attr),"no attribute named "//attr_name//" in "//var_name//" in "//fname)
attr_val => attr%get_value()
select type(attr_val)
type is(character(*))
attr_string = attr_val
class default
_FAIL('unsupported subclass (not string) for units of attribute named '//attr_name//' in '//var_name//' in '//fname)
end select
attr_string = var%get_attribute_string(attr_name, rc=status)
_ASSERT(status == _SUCCESS, 'failed to get attribute named '//attr_name//' in '//var_name//' in '//fname)

_RETURN(_SUCCESS)
end function get_var_attr_string
Expand Down
4 changes: 2 additions & 2 deletions base/MAPL_CFIO.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2840,8 +2840,8 @@ subroutine MAPL_CFIOReadBundle ( FILETMPL, TIME, BUNDLE, NOREAD, RC, &
call fill_grads_template ( filename, filetmpl, &
experiment_id=EXPID, nymd=nymd, nhms=nhms, rc=status )
_VERIFY(STATUS)
!call WRITE_PARALLEL("CFIO: Reading " // trim(filename))
if (mapl_am_i_root()) write(*,*)"CFIO: Reading ",trim(filename)," at ",nymd," ",nhms

if (mapl_am_i_root()) write(*,'(a, ": Reading ", a, " at ", i8, " ", i6)') Iam, trim(filename), nymd, nhms


cfioIsCreated = .false.
Expand Down
Loading

0 comments on commit 7f63dbe

Please sign in to comment.