Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
b68fa7f
added support for calling refresh method of a GC if regeistered; suup…
zhaobin74 Aug 22, 2024
02bc1f9
updated CHANGELOG.md
zhaobin74 Aug 22, 2024
2451c6b
Add heartbeat option for offset
darianboggs Oct 9, 2024
3b2aa52
Add parse_heartbeat_string
darianboggs Oct 9, 2024
e2d3626
Fix bug with get_adjusted_time.
darianboggs Oct 9, 2024
fc69373
Add tests
darianboggs Oct 10, 2024
616144c
set_up & tear_down function.
darianboggs Oct 10, 2024
f4fb7c0
Add create_from_parameters test.
darianboggs Oct 11, 2024
28b58a8
(+/-)ISO_8601 string & (+/-)heartbeat tests pass.
darianboggs Oct 11, 2024
0a4d44e
Add options to benchmark scripts
mathomp4 Oct 15, 2024
e1b572a
More fixes
mathomp4 Oct 15, 2024
53ef0e1
More fixes 2
mathomp4 Oct 15, 2024
de27ff0
Merge branch 'develop' into feature/wdboggs/#3064_variant_spec_offset…
darianboggs Oct 15, 2024
fd473ee
Add verbose
mathomp4 Oct 15, 2024
09f907b
Latest to fix failing tests
darianboggs Oct 15, 2024
998b630
Additional troubleshooting
darianboggs Oct 15, 2024
c628520
Add netcdf_writes
mathomp4 Oct 15, 2024
2f834be
Clean up
mathomp4 Oct 15, 2024
31c296b
Turn off zstandard with Baselibs
mathomp4 Oct 15, 2024
5330401
Update changelog
mathomp4 Oct 15, 2024
2ffb01b
Define target before using
mathomp4 Oct 15, 2024
6629c73
Save current.
darianboggs Oct 15, 2024
d7874e3
All unit tests pass.
darianboggs Oct 15, 2024
af8c1c3
Update CHANGELOG.md
darianboggs Oct 16, 2024
2528357
Update changelog
mathomp4 Oct 16, 2024
925414c
Fix problem with cmake
darianboggs Oct 16, 2024
7a1a1b3
Re-design the custom refresh method
atrayano Oct 16, 2024
bc55755
Add tests to compare results from ISO8601 Duration and HEARTBEAT
darianboggs Oct 16, 2024
cfdff25
Allow "+" in front of "update_offset" string.
darianboggs Oct 16, 2024
a82497f
Add tests for "+HEARTBEAT" strings
darianboggs Oct 17, 2024
b8283be
Merge pull request #3099 from GEOS-ESM/feature/wdboggs/#3064_variant_…
darianboggs Oct 17, 2024
34c2be0
Merge branch 'develop' into bugfix/mathomp4/zstandard-on-bucy
mathomp4 Oct 17, 2024
69bd3db
Have to force the turn off
mathomp4 Oct 17, 2024
0d6ce1a
Merge pull request #3098 from GEOS-ESM/bugfix/mathomp4/zstandard-on-bucy
mathomp4 Oct 17, 2024
ad3db6c
Merge branch 'develop' into feature/mathomp4/options-to-benchmarks
mathomp4 Oct 17, 2024
654a453
Use positive options
mathomp4 Oct 18, 2024
9375d12
Merge branch 'main' into develop
mathomp4 Oct 18, 2024
e9cd6d5
Merge branch 'develop' into feature/mathomp4/options-to-benchmarks
mathomp4 Oct 21, 2024
76a668d
Update to ESMA_env v4.31.0 (ESMF 8.7.0)
mathomp4 Oct 22, 2024
812150b
Merge pull request #3114 from GEOS-ESM/feature/mathomp4/baselibs-7.27…
mathomp4 Oct 22, 2024
a08c46f
Merge branch 'develop' into feature/mathomp4/options-to-benchmarks
mathomp4 Oct 23, 2024
7cfb7d6
Update readmes
mathomp4 Oct 23, 2024
0ccb0d3
Update CI to use Baselibs 7.27.0
mathomp4 Oct 23, 2024
cc66518
simpler - better -grid name def - used in GSI
rtodling Oct 24, 2024
5c37df7
about
rtodling Oct 24, 2024
edb9eba
Update base/MAPL_DefGridName.F90
tclune Oct 24, 2024
fd4b1b4
Merge pull request #3120 from GEOS-ESM/feature/rtodling/used_in_gsi
tclune Oct 24, 2024
915462c
Merge branch 'develop' into feature/mathomp4/update-ci-baselibs-7.27-…
mathomp4 Oct 25, 2024
df6fe8a
Merge branch 'develop' into feature/mathomp4/options-to-benchmarks
mathomp4 Oct 25, 2024
a01d017
Update to new v4 orb
mathomp4 Oct 28, 2024
45d9b3a
Merge pull request #3116 from GEOS-ESM/feature/mathomp4/update-ci-bas…
tclune Oct 28, 2024
c1077b0
Merge branch 'develop' into feature/mathomp4/options-to-benchmarks
mathomp4 Oct 29, 2024
4a99e60
Merge branch 'main' into develop
mathomp4 Oct 30, 2024
6964c98
Update to use GCC 14 in CI GNU runs
mathomp4 Oct 31, 2024
f9faa49
Back to v4 orb
mathomp4 Oct 31, 2024
fdd60d7
Merge branch 'develop' into feature/mathomp4/options-to-benchmarks
mathomp4 Oct 31, 2024
7c6f101
Merge pull request #3138 from GEOS-ESM/feature/mathomp4/gcc-14-ci
mathomp4 Oct 31, 2024
7ef09a3
Merge branch 'develop' into feature/mathomp4/options-to-benchmarks
mathomp4 Nov 4, 2024
a39cae0
Merge pull request #3097 from GEOS-ESM/feature/mathomp4/options-to-be…
mathomp4 Nov 4, 2024
10b0905
Add CMake to skip ExtData2G unit test if pfunit not found
mathomp4 Nov 6, 2024
fdceeec
Add CI test to build without pfunit
mathomp4 Nov 6, 2024
611fcd3
Merge pull request #3157 from GEOS-ESM/bugfix/mathomp4/pfunit-check
mathomp4 Nov 6, 2024
1d1560d
Print file and variable names in case of errors, and pring offending …
AgilentGCMS Nov 6, 2024
5077b9d
Update gridcomps/ExtData2G/ExtDataConfig.F90
tclune Nov 6, 2024
e1a049d
Update gridcomps/ExtData2G/ExtDataConfig.F90
tclune Nov 6, 2024
27fa605
Merge branch 'develop' into feature/sbasu1/verbose_print
mathomp4 Nov 6, 2024
88f45e6
...
metdyn Nov 8, 2024
db3b06a
Fix bugs in trajectory sampler when test against ARGOS_geolocation_sa…
metdyn Nov 8, 2024
f5776af
more addition
metdyn Nov 8, 2024
1e078a4
add items in CHANGELOG.md
metdyn Nov 8, 2024
bc5f383
clean up
metdyn Nov 9, 2024
18567fa
Merge pull request #3168 from GEOS-ESM/feature/ygyu/test_sampler_Nov_8
tclune Nov 12, 2024
fe648c2
Fixes #2845. Allow ESMF_CONFIG_FILE to specify ESMF control file
mathomp4 Nov 12, 2024
8256274
Fix typo
mathomp4 Nov 12, 2024
9566458
Fix typo 2. Jeesh
mathomp4 Nov 12, 2024
c11a8be
Fix up problems with environment variable getting
mathomp4 Nov 12, 2024
a4abe8d
Add a logger message if using a file
mathomp4 Nov 12, 2024
a8d73cf
Merge branch 'develop' into feature/sbasu1/verbose_print
mathomp4 Nov 13, 2024
8356384
Update changelog
mathomp4 Nov 13, 2024
cf60fdb
check tableEnd efficiently
weiyuan-jiang Nov 13, 2024
25c8a5c
Added return to fetch_data
weiyuan-jiang Nov 13, 2024
84c6832
rename cap_import to more generic name
weiyuan-jiang Nov 14, 2024
ce10328
Update gridcomps/Cap/MAPL_CapGridComp.F90
tclune Nov 14, 2024
ad0a569
Merge pull request #3178 from GEOS-ESM/feature/wjiang/tableEnd
mathomp4 Nov 14, 2024
9e214b2
Merge branch 'develop' into feature/mathomp4/2845-esmf-env-var
mathomp4 Nov 15, 2024
c76374a
Workaround for ifx bug
mathomp4 Nov 18, 2024
8027a89
Turn on ifx builds
mathomp4 Nov 19, 2024
203a96e
Turn on ifx for GEOSgcm
mathomp4 Nov 19, 2024
9682500
Welp, turn off ifx for GEOSgcm
mathomp4 Nov 20, 2024
87695c3
updates
bena-nasa Nov 21, 2024
9153589
more updates
bena-nasa Nov 22, 2024
ded9a8f
more updates
bena-nasa Nov 22, 2024
935a4b8
update changelog
bena-nasa Nov 22, 2024
8ce9c6a
comments
bena-nasa Nov 25, 2024
bf45bea
Maybe ifx needs more memory?
mathomp4 Nov 26, 2024
232f08b
Circleci orb should default to xlarge
mathomp4 Nov 26, 2024
2065c98
Try release build for GEOSadas
mathomp4 Nov 26, 2024
2c7a8df
Fixes for GEOSadas CI
mathomp4 Nov 27, 2024
f05d7af
CI changes for GEOSadas
mathomp4 Nov 27, 2024
dedb09b
Remove ifx from coupled run
mathomp4 Nov 27, 2024
fc85e4c
Merge pull request #3197 from GEOS-ESM/bugfix/mathomp4/adas-ci-fix
mathomp4 Nov 27, 2024
e0fc601
Merge branch 'develop' into feature/mathomp4/2845-esmf-env-var
mathomp4 Nov 27, 2024
89e5348
Update for f2py-meson support
mathomp4 Dec 2, 2024
3ae25f3
Clarify changelog
mathomp4 Dec 2, 2024
6efaf44
Merge pull request #3202 from GEOS-ESM/feature/mathomp4/support-meson…
mathomp4 Dec 3, 2024
d4ff7d1
Merge branch 'main' into develop
mathomp4 Dec 3, 2024
d9b2fbf
fixes #3210
bena-nasa Dec 3, 2024
daab7d7
oops
bena-nasa Dec 3, 2024
5ad02a1
update changelog
bena-nasa Dec 3, 2024
d1b0f0d
more updates
bena-nasa Dec 3, 2024
9778fd3
Merge branch 'develop' into feature/fixes-#3175
bena-nasa Dec 3, 2024
baf3109
Merge branch 'develop' into feature/bmauer/fixes-#3210
bena-nasa Dec 3, 2024
58ddb04
Merge pull request #3211 from GEOS-ESM/feature/bmauer/fixes-#3210
mathomp4 Dec 3, 2024
6a3ea1b
Merge branch 'develop' into feature/fixes-#3175
mathomp4 Dec 3, 2024
8bd06f0
Merge branch 'develop' into feature/mathomp4/fixes-for-ifx
mathomp4 Dec 3, 2024
9de255b
Fix up CI image code
mathomp4 Dec 3, 2024
f26012f
Merge branch 'develop' into feature/sbasu1/verbose_print
mathomp4 Dec 4, 2024
b4be92e
Merge branch 'develop' into feture/wjiang/fetch_data_return
mathomp4 Dec 4, 2024
9a2fee5
Update base/MAPL_LatLonGridFactory.F90
tclune Dec 4, 2024
6f84fdb
Merge pull request #3212 from GEOS-ESM/feature/fixes-#3175
mathomp4 Dec 4, 2024
5176304
Merge branch 'develop' into bugfix/mathomp4/ci-image-fix
mathomp4 Dec 4, 2024
c7a38da
Merge pull request #3214 from GEOS-ESM/bugfix/mathomp4/ci-image-fix
mathomp4 Dec 4, 2024
5eb37d5
Merge branch 'develop' into feature/mathomp4/fixes-for-ifx
mathomp4 Dec 4, 2024
b539f69
Merge branch 'develop' into feture/wjiang/fetch_data_return
mathomp4 Dec 4, 2024
3e2645a
Merge branch 'develop' into feature/mathomp4/2845-esmf-env-var
mathomp4 Dec 4, 2024
70b40cd
Merge branch 'develop' into feature/sbasu1/verbose_print
mathomp4 Dec 4, 2024
194323c
Merge branch 'develop' into feature/sbasu1/verbose_print
mathomp4 Dec 5, 2024
8d46f50
Merge branch 'develop' into feature/mathomp4/2845-esmf-env-var
mathomp4 Dec 5, 2024
a30794e
Merge branch 'develop' into feature/mathomp4/fixes-for-ifx
mathomp4 Dec 5, 2024
7005c9d
Fix bad merge
mathomp4 Dec 5, 2024
e9b9476
Add a _VERIFY
mathomp4 Dec 5, 2024
f9b8421
Merge pull request #3174 from GEOS-ESM/feature/mathomp4/2845-esmf-env…
tclune Dec 5, 2024
9691cc6
Merge branch 'develop' into feature/mathomp4/fixes-for-ifx
mathomp4 Dec 5, 2024
aa313a0
Clarify comment
mathomp4 Dec 5, 2024
69d34a2
WIP: Fixes needed for flang (#3176)
mathomp4 Dec 5, 2024
f22ece9
Merge branch 'develop' into feature/mathomp4/fixes-for-ifx
mathomp4 Dec 5, 2024
be39cab
Merge pull request #3185 from GEOS-ESM/feature/mathomp4/fixes-for-ifx
tclune Dec 6, 2024
ac78edc
Merge branch 'develop' into feature/zhaobin74/support-cice6-rewind
mathomp4 Dec 6, 2024
c304f5f
Update generic/MAPL_Generic.F90
atrayano Dec 6, 2024
4830949
Added I_run to the decaration of customRefresh.
atrayano Dec 6, 2024
ee08198
Merge pull request #2982 from GEOS-ESM/feature/zhaobin74/support-cice…
atrayano Dec 6, 2024
4a0b7e1
Prepare for 2.51.0 Release (#3224)
mathomp4 Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading