Skip to content

Commit d1e4786

Browse files
committed
Merge branch 'dqwu/add_hdf5_iotype' into master (PR E3SM-Project#6046)
Adding support for the HDF5 I/O format which is already available in SCORPIO. Also using HDF5_ROOT in buildlib.spio to turn on HDF5 support. [BFB]
2 parents e9c6718 + 34b0875 commit d1e4786

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

driver-mct/cime_config/config_component.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2629,7 +2629,7 @@
26292629

26302630
<entry id="PIO_TYPENAME">
26312631
<type>char</type>
2632-
<valid_values>netcdf,pnetcdf,netcdf4p,netcdf4c,adios,default</valid_values>
2632+
<valid_values>netcdf,pnetcdf,netcdf4p,netcdf4c,adios,hdf5,default</valid_values>
26332633
<group>run_pio</group>
26342634
<file>env_run.xml</file>
26352635
<desc>pio io type</desc>

driver-moab/cime_config/config_component.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2480,7 +2480,7 @@
24802480

24812481
<entry id="PIO_TYPENAME">
24822482
<type>char</type>
2483-
<valid_values>netcdf,pnetcdf,netcdf4p,netcdf4c,adios,default</valid_values>
2483+
<valid_values>netcdf,pnetcdf,netcdf4p,netcdf4c,adios,hdf5,default</valid_values>
24842484
<group>run_pio</group>
24852485
<file>env_run.xml</file>
24862486
<desc>pio io type</desc>

share/build/buildlib.spio

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,10 @@ def buildlib(bldroot, installpath, case):
132132
# elif which_h5dump is not None:
133133
# os.environ["HDF5"] = os.path.dirname(os.path.dirname(which_h5dump))
134134

135-
if "WITH_HDF5_SCORPIO" in os.environ:
136-
cmake_opts += "-DWITH_HDF5:BOOL=ON "
135+
# Before E3SM upgrades scorpio submodule to 1.5.0 or higher, keep WITH_HDF5
136+
# CMake option OFF by default.
137+
# if "HDF5_ROOT" in os.environ:
138+
# cmake_opts += "-DWITH_HDF5:BOOL=ON "
137139

138140
# Same deal with libz and szip
139141
if "ZLIB_ROOT" in os.environ:
@@ -197,10 +199,12 @@ def buildlib(bldroot, installpath, case):
197199
netcdf4_string = "NetCDF_C_HAS_PARALLEL:BOOL=TRUE"
198200

199201
adios_string = "WITH_ADIOS2:BOOL=ON"
202+
hdf5_string = "WITH_HDF5:BOOL=ON"
200203
expect_string_found = False
201204
pnetcdf_found = False
202205
netcdf4_parallel_found = False
203206
adios_found = False
207+
hdf5_found = False
204208

205209
cache_file = open(os.path.join(pio_bld_dir,"CMakeCache.txt"), "r")
206210
for line in cache_file:
@@ -212,6 +216,8 @@ def buildlib(bldroot, installpath, case):
212216
netcdf4_parallel_found = True
213217
if re.search(adios_string, line):
214218
adios_found = True
219+
if re.search(hdf5_string, line):
220+
hdf5_found = True
215221

216222
if pio_version == 1:
217223
installed_lib = os.path.join(installpath, "lib", "libpio.a")
@@ -268,6 +274,8 @@ def buildlib(bldroot, installpath, case):
268274
valid_values += ",netcdf4p,netcdf4c"
269275
if adios_found:
270276
valid_values += ",adios"
277+
if hdf5_found:
278+
valid_values += ",hdf5"
271279

272280
_set_pio_valid_values(case, valid_values)
273281

share/util/shr_pio_mod.F90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,8 @@ subroutine shr_pio_getiotypefromname(typename, iotype, defaulttype)
672672
#ifndef PIO1
673673
else if ( typename .eq. 'ADIOS') then
674674
iotype = pio_iotype_adios
675+
else if ( typename .eq. 'HDF5') then
676+
iotype = pio_iotype_hdf5
675677
#endif
676678
else if ( typename .eq. 'NOTHING') then
677679
iotype = defaulttype

0 commit comments

Comments
 (0)