From cc8bf5d0327979e45cdbb051b6490ddd40dd565b Mon Sep 17 00:00:00 2001 From: dqwu Date: Thu, 10 Jul 2025 11:00:13 -0500 Subject: [PATCH 1/4] Set io_type in MPAS streams based on the CIME settings Replace hard-coded pnetcdf or netcdf values in streams.ocean and streams.seaice with ocn_pio_typename or ice_pio_typename from the CIME settings. --- components/mpas-ocean/cime_config/buildnml | 72 ++++----------------- components/mpas-seaice/cime_config/buildnml | 26 ++------ 2 files changed, 19 insertions(+), 79 deletions(-) diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index 30682163e965..06ca8ae479f6 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -568,21 +568,13 @@ def buildnml(case, caseroot, compname): lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append(' Date: Fri, 11 Jul 2025 11:50:10 -0500 Subject: [PATCH 2/4] Handle ADIOS mesh I/O types in MPAS framework Add support for adios and adiosc mesh I/O types to ensure they are recognized correctly instead of defaulting to pnetcdf. --- components/mpas-albany-landice/driver/glc_comp_mct.F | 4 ++++ components/mpas-framework/src/driver/mpas_subdriver.F | 4 ++++ components/mpas-ocean/driver/ocn_comp_mct.F | 4 ++++ components/mpas-seaice/driver/ice_comp_mct.F | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/components/mpas-albany-landice/driver/glc_comp_mct.F b/components/mpas-albany-landice/driver/glc_comp_mct.F index b26e79712a44..6f014b793e61 100644 --- a/components/mpas-albany-landice/driver/glc_comp_mct.F +++ b/components/mpas-albany-landice/driver/glc_comp_mct.F @@ -475,6 +475,10 @@ end subroutine xml_stream_get_attributes mesh_iotype = MPAS_IO_NETCDF else if (trim(iotype) == 'netcdf4') then mesh_iotype = MPAS_IO_NETCDF4 + else if (trim(iotype) == 'adios') then + mesh_iotype = MPAS_IO_ADIOS + else if (trim(iotype) == 'adiosc') then + mesh_iotype = MPAS_IO_ADIOSC else mesh_iotype = MPAS_IO_PNETCDF end if diff --git a/components/mpas-framework/src/driver/mpas_subdriver.F b/components/mpas-framework/src/driver/mpas_subdriver.F index 6db64e7dcf3d..11863a06c168 100644 --- a/components/mpas-framework/src/driver/mpas_subdriver.F +++ b/components/mpas-framework/src/driver/mpas_subdriver.F @@ -285,6 +285,10 @@ end subroutine xml_stream_get_attributes mesh_iotype = MPAS_IO_NETCDF else if (trim(iotype) == 'netcdf4') then mesh_iotype = MPAS_IO_NETCDF4 + else if (trim(iotype) == 'adios') then + mesh_iotype = MPAS_IO_ADIOS + else if (trim(iotype) == 'adiosc') then + mesh_iotype = MPAS_IO_ADIOSC else mesh_iotype = MPAS_IO_PNETCDF end if diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index 1187d2a26a23..dfa14b009940 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -539,6 +539,10 @@ end subroutine xml_stream_get_attributes mesh_iotype = MPAS_IO_NETCDF else if (trim(iotype) == 'netcdf4') then mesh_iotype = MPAS_IO_NETCDF4 + else if (trim(iotype) == 'adios') then + mesh_iotype = MPAS_IO_ADIOS + else if (trim(iotype) == 'adiosc') then + mesh_iotype = MPAS_IO_ADIOSC else mesh_iotype = MPAS_IO_PNETCDF end if diff --git a/components/mpas-seaice/driver/ice_comp_mct.F b/components/mpas-seaice/driver/ice_comp_mct.F index 0948e8e3526c..ae9aae4b2186 100644 --- a/components/mpas-seaice/driver/ice_comp_mct.F +++ b/components/mpas-seaice/driver/ice_comp_mct.F @@ -552,6 +552,10 @@ end subroutine xml_stream_get_attributes mesh_iotype = MPAS_IO_NETCDF else if (trim(iotype) == 'netcdf4') then mesh_iotype = MPAS_IO_NETCDF4 + else if (trim(iotype) == 'adios') then + mesh_iotype = MPAS_IO_ADIOS + else if (trim(iotype) == 'adiosc') then + mesh_iotype = MPAS_IO_ADIOSC else mesh_iotype = MPAS_IO_PNETCDF end if From fa61a1db0d875813c5e3b09a4959ee41cf7a45f3 Mon Sep 17 00:00:00 2001 From: dqwu Date: Sun, 13 Jul 2025 10:52:12 -0500 Subject: [PATCH 3/4] Use CDF-5 format for pnetcdf via PIO_NETCDF_FORMAT in MPAS streams Set io_type to 'pnetcdf,cdf5' when PIO_TYPENAME is 'pnetcdf' and PIO_NETCDF_FORMAT is '64bit_data'. Otherwise, use the standard PIO_TYPENAME value. --- components/mpas-ocean/cime_config/buildnml | 95 +++++++++++---------- components/mpas-seaice/cime_config/buildnml | 67 ++++++++------- 2 files changed, 88 insertions(+), 74 deletions(-) diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index 06ca8ae479f6..6a127b22c6dd 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -44,6 +44,7 @@ def buildnml(case, caseroot, compname): atm_co2_const_val = case.get_value("CCSM_CO2_PPMV") ice_bgc = case.get_value("MPASI_BGC") ocn_pio_typename = case.get_value("OCN_PIO_TYPENAME") + ocn_pio_netcdf_format = case.get_value("OCN_PIO_NETCDF_FORMAT") ninst_ocn = case.get_value("NINST_OCN") nthrds_ocn = case.get_value("NTHRDS_OCN") ntasks_ocn = case.get_value("NTASKS_PER_INST_OCN") @@ -54,6 +55,12 @@ def buildnml(case, caseroot, compname): run_reftod = case.get_value("RUN_REFTOD") stream_name = 'streams.ocean' + # Use 'pnetcdf,cdf5' when OCN_PIO_NETCDF_FORMAT requests 64-bit data, else use the standard type + if ocn_pio_typename.lower() == 'pnetcdf' and ocn_pio_netcdf_format.lower() == '64bit_data': + io_type_str = 'pnetcdf,cdf5' + else: + io_type_str = ocn_pio_typename + mpasoconf_dir = os.path.join(casebuild, "mpasoconf") if not os.path.isdir(mpasoconf_dir): os.mkdir(mpasoconf_dir) @@ -568,13 +575,13 @@ def buildnml(case, caseroot, compname): lines.append('') lines.append('') lines.append('') lines.append('') @@ -718,7 +725,7 @@ def buildnml(case, caseroot, compname): if u_tidal_rms_file != '': lines.append('') @@ -730,7 +737,7 @@ def buildnml(case, caseroot, compname): if data_sgr_file != '': lines.append('') lines.append('') @@ -757,7 +764,7 @@ def buildnml(case, caseroot, compname): lines.append('') lines.append('') lines.append('') @@ -771,7 +778,7 @@ def buildnml(case, caseroot, compname): lines.append('') @@ -1783,7 +1790,7 @@ def buildnml(case, caseroot, compname): if data_ismf_file != '': lines.append('') @@ -1802,7 +1809,7 @@ def buildnml(case, caseroot, compname): lines.append('') lines.append('') diff --git a/components/mpas-seaice/cime_config/buildnml b/components/mpas-seaice/cime_config/buildnml index 5498d5173fbc..4dc604d30b2b 100755 --- a/components/mpas-seaice/cime_config/buildnml +++ b/components/mpas-seaice/cime_config/buildnml @@ -38,6 +38,7 @@ def buildnml(case, caseroot, compname): prognostic_mode = case.get_value("MPASSI_PROGNOSTIC_MODE") column_mode = case.get_value("MPASSI_COLUMN_MODE") ice_pio_typename = case.get_value("ICE_PIO_TYPENAME") + ice_pio_netcdf_format = case.get_value("ICE_PIO_NETCDF_FORMAT") ninst_ice = case.get_value("NINST_ICE") ntasks_ice = case.get_value("NTASKS_PER_INST_ICE") rundir = case.get_value("RUNDIR") @@ -49,6 +50,12 @@ def buildnml(case, caseroot, compname): atm_ncpl = case.get_value("ATM_NCPL") stream_name = 'streams.seaice' + # Use 'pnetcdf,cdf5' when ICE_PIO_NETCDF_FORMAT requests 64-bit data, else use the standard type + if ice_pio_typename.lower() == 'pnetcdf' and ice_pio_netcdf_format.lower() == '64bit_data': + io_type_str = 'pnetcdf,cdf5' + else: + io_type_str = ice_pio_typename + mpassiconf_dir = os.path.join(casebuild, "mpassiconf") if not os.path.isdir(mpassiconf_dir): os.mkdir(mpassiconf_dir) @@ -487,13 +494,13 @@ def buildnml(case, caseroot, compname): lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') lines.append('') @@ -619,7 +626,7 @@ def buildnml(case, caseroot, compname): if dust_iron_file != '': lines.append('') @@ -658,7 +665,7 @@ def buildnml(case, caseroot, compname): if iceberg_mode == 'data': lines.append('') @@ -671,7 +678,7 @@ def buildnml(case, caseroot, compname): lines.append(''.format(din_loc_root, ice_mask, grid_prefix, grid_date)) lines.append('') From e73d967316bb648d8568e732370bbaa5abf5dff6 Mon Sep 17 00:00:00 2001 From: Jon Wolfe Date: Thu, 4 Sep 2025 18:16:08 -0500 Subject: [PATCH 4/4] Extend this to include MALI streams --- .../mpas-albany-landice/cime_config/buildnml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/mpas-albany-landice/cime_config/buildnml b/components/mpas-albany-landice/cime_config/buildnml index 9cf26ba743f0..f80685eb7064 100755 --- a/components/mpas-albany-landice/cime_config/buildnml +++ b/components/mpas-albany-landice/cime_config/buildnml @@ -30,6 +30,8 @@ def buildnml(case, caseroot, compname): srcroot = case.get_value("SRCROOT") din_loc_root = case.get_value("DIN_LOC_ROOT") glc_grid = case.get_value("GLC_GRID") + glc_pio_typename = case.get_value("GLC_PIO_TYPENAME") + glc_pio_netcdf_format = case.get_value("GLC_PIO_NETCDF_FORMAT") #ninst_glc = case.get_value("NINST_GLC") ninst_glc = 1 # Change if you want multiple instances... though this isn't coded yet. ninst_glc_real = case.get_value("NINST_GLC") @@ -46,6 +48,12 @@ def buildnml(case, caseroot, compname): stream_name = 'streams.landice' albany_input_name = 'albany_input.yaml' + # Use 'pnetcdf,cdf5' when GLC_PIO_NETCDF_FORMAT requests 64-bit data, else use the standard type + if glc_pio_typename.lower() == 'pnetcdf' and glc_pio_netcdf_format.lower() == '64bit_data': + io_type_str = 'pnetcdf,cdf5' + else: + io_type_str = glc_pio_typename + maliconf_dir = os.path.join(casebuild, "maliconf") if not os.path.isdir(maliconf_dir): os.mkdir(maliconf_dir) @@ -203,11 +211,13 @@ def buildnml(case, caseroot, compname): lines.append('') lines.append(' ') lines.append('') lines.append(' ') lines.append('') @@ -223,6 +233,7 @@ def buildnml(case, caseroot, compname): lines.append(' -->') lines.append(' ')