Skip to content

Commit 7a60e92

Browse files
committed
Merge branch 'dqwu/mpas/streams-use-pio_typename' (PR #7502)
Set io_type in MPAS streams based on PIO_TYPENAME from the CIME settings Update the build scripts for streams.ocean, streams.seaice and streams.landice to set the io_type using ocn_pio_typename, ice_pio_typename, or glc_pio_typename, respectively. This resolves an issue where MPAS output files did not always follow the PIO_TYPENAME specified in the CIME settings. Also handle ADIOS mesh I/O types in MPAS framework. Fixes #7494 [BFB]
2 parents 44809ac + e73d967 commit 7a60e92

File tree

7 files changed

+118
-134
lines changed

7 files changed

+118
-134
lines changed

components/mpas-albany-landice/cime_config/buildnml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def buildnml(case, caseroot, compname):
3030
srcroot = case.get_value("SRCROOT")
3131
din_loc_root = case.get_value("DIN_LOC_ROOT")
3232
glc_grid = case.get_value("GLC_GRID")
33+
glc_pio_typename = case.get_value("GLC_PIO_TYPENAME")
34+
glc_pio_netcdf_format = case.get_value("GLC_PIO_NETCDF_FORMAT")
3335
#ninst_glc = case.get_value("NINST_GLC")
3436
ninst_glc = 1 # Change if you want multiple instances... though this isn't coded yet.
3537
ninst_glc_real = case.get_value("NINST_GLC")
@@ -47,6 +49,12 @@ def buildnml(case, caseroot, compname):
4749
stream_name = 'streams.landice'
4850
albany_input_name = 'albany_input.yaml'
4951

52+
# Use 'pnetcdf,cdf5' when GLC_PIO_NETCDF_FORMAT requests 64-bit data, else use the standard type
53+
if glc_pio_typename.lower() == 'pnetcdf' and glc_pio_netcdf_format.lower() == '64bit_data':
54+
io_type_str = 'pnetcdf,cdf5'
55+
else:
56+
io_type_str = glc_pio_typename
57+
5058
maliconf_dir = os.path.join(casebuild, "maliconf")
5159

5260
if not os.path.isdir(maliconf_dir): os.mkdir(maliconf_dir)
@@ -240,11 +248,13 @@ def buildnml(case, caseroot, compname):
240248
lines.append('')
241249
lines.append(' <immutable_stream name="basicmesh"')
242250
lines.append(' type="none"')
251+
lines.append(' io_type="{}"'.format(io_type_str))
243252
lines.append(' filename_template="not-to-be-used.nc"')
244253
lines.append(' />')
245254
lines.append('')
246255
lines.append(' <immutable_stream name="input"')
247256
lines.append(' type="input"')
257+
lines.append(' io_type="{}"'.format(io_type_str))
248258
lines.append(' filename_template="{}"'.format(input_file))
249259
lines.append(' input_interval="initial_only"/>')
250260
lines.append('')
@@ -260,6 +270,7 @@ def buildnml(case, caseroot, compname):
260270
lines.append(' -->')
261271
lines.append(' <immutable_stream name="restart"')
262272
lines.append(' type="input;output"')
273+
lines.append(' io_type="{}"'.format(io_type_str))
263274
lines.append(' filename_template="{}.mali.rst.$Y-$M-$D_$S.nc"'.format(casename))
264275
lines.append(' filename_interval="output_interval"')
265276
lines.append(' clobber_mode="truncate"')
@@ -291,6 +302,7 @@ def buildnml(case, caseroot, compname):
291302
lines.append('')
292303
lines.append(' <stream name="output"')
293304
lines.append(' type="output"')
305+
lines.append(' io_type="{}"'.format(io_type_str))
294306
lines.append(' filename_template="{}.mali.hist.$Y-$M-$D_$S.nc"'.format(casename))
295307
lines.append(' filename_interval="0001-00-00_00:00:00"')
296308
lines.append(' clobber_mode="truncate"')
@@ -325,6 +337,7 @@ def buildnml(case, caseroot, compname):
325337
lines.append('')
326338
lines.append('<stream name="globalStatsOutput"')
327339
lines.append(' type="output"')
340+
lines.append(' io_type="{}"'.format(io_type_str))
328341
lines.append(' filename_template="{}.mali.hist.am.globalStats.$Y-$M-$D_$S.nc"'.format(casename))
329342
lines.append(' filename_interval="5000-00-00_00:00:00"')
330343
lines.append(' reference_time ="0001-01-01_00:00:00"')
@@ -370,6 +383,7 @@ def buildnml(case, caseroot, compname):
370383
# in MALI data mode, read an input stream with ice thickness monthly
371384
lines.append(' <stream name="data-mode-input"')
372385
lines.append(' type="input"')
386+
lines.append(' io_type="{}"'.format(io_type_str))
373387
lines.append(f' filename_template="{datamode_file}"')
374388
lines.append(' reference_time="2000-01-01_00:00:00"')
375389
lines.append(' input_interval="0000-01-00_00:00:00">')

components/mpas-albany-landice/driver/glc_comp_mct.F

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ end subroutine xml_stream_get_attributes
475475
mesh_iotype = MPAS_IO_NETCDF
476476
else if (trim(iotype) == 'netcdf4') then
477477
mesh_iotype = MPAS_IO_NETCDF4
478+
else if (trim(iotype) == 'adios') then
479+
mesh_iotype = MPAS_IO_ADIOS
480+
else if (trim(iotype) == 'adiosc') then
481+
mesh_iotype = MPAS_IO_ADIOSC
478482
else
479483
mesh_iotype = MPAS_IO_PNETCDF
480484
end if

components/mpas-framework/src/driver/mpas_subdriver.F

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ end subroutine xml_stream_get_attributes
285285
mesh_iotype = MPAS_IO_NETCDF
286286
else if (trim(iotype) == 'netcdf4') then
287287
mesh_iotype = MPAS_IO_NETCDF4
288+
else if (trim(iotype) == 'adios') then
289+
mesh_iotype = MPAS_IO_ADIOS
290+
else if (trim(iotype) == 'adiosc') then
291+
mesh_iotype = MPAS_IO_ADIOSC
288292
else
289293
mesh_iotype = MPAS_IO_PNETCDF
290294
end if

0 commit comments

Comments
 (0)