Skip to content

Commit

Permalink
Fix MPAS with PIO1
Browse files Browse the repository at this point in the history
  • Loading branch information
jgfouca committed Nov 16, 2023
1 parent 1db00b4 commit 11fc34c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
9 changes: 8 additions & 1 deletion components/mpas-framework/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ set(FILE_OFFSET "-DOFFSET64BIT")
if (CPPDEFS)
separate_arguments(CPPDEFS UNIX_COMMAND "${CPPDEFS}")
endif()
list(APPEND CPPDEFS "-DMPAS_NO_LOG_REDIRECT" "-DUSE_PIO2" "-DHAVE_ADIOS" "-DMPAS_NO_ESMF_INIT" "-DMPAS_ESM_SHR_CONST" "-DMPAS_PERF_MOD_TIMERS" "${MODEL_FORMULATION}" "${FILE_OFFSET}" "${ZOLTAN_DEFINE}" "-D_MPI" "-DMPAS_NAMELIST_SUFFIX=${NAMELIST_SUFFIX}" "-DMPAS_EXE_NAME=${EXE_NAME}")
list(APPEND CPPDEFS "-DMPAS_NO_LOG_REDIRECT" "-DMPAS_NO_ESMF_INIT" "-DMPAS_ESM_SHR_CONST" "-DMPAS_PERF_MOD_TIMERS" "${MODEL_FORMULATION}" "${FILE_OFFSET}" "${ZOLTAN_DEFINE}" "-D_MPI" "-DMPAS_NAMELIST_SUFFIX=${NAMELIST_SUFFIX}" "-DMPAS_EXE_NAME=${EXE_NAME}")
if (PIO_VERSION STREQUAL "2")
list(APPEND CPPDEFS "-DUSE_PIO2")
if (TARGET adios2::adios2)
list(APPEND CPPDEFS "-DHAVE_ADIOS")
endif()
endif()

if (DEBUG)
list(APPEND CPPDEFS "-DMPAS_DEBUG")
endif()
Expand Down
15 changes: 1 addition & 14 deletions components/mpas-framework/src/framework/mpas_io.F
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,13 @@ module mpas_io
integer, parameter :: PIO_REALKIND = PIO_DOUBLE
#endif

#ifdef USE_PIO2
integer, parameter :: MPAS_INT_FILLVAL = PIO_FILL_INT
character, parameter :: MPAS_CHAR_FILLVAL = achar(0) ! TODO: To be replaced with PIO_FILL_CHAR once PIO2 provides this variable
#else
integer, parameter :: MPAS_INT_FILLVAL = NF_FILL_INT
character, parameter :: MPAS_CHAR_FILLVAL = achar(NF_FILL_CHAR)
#endif
character, parameter :: MPAS_CHAR_FILLVAL = achar(PIO_FILL_CHAR)

#ifdef USE_PIO2
#ifdef SINGLE_PRECISION
real (kind=RKIND), parameter :: MPAS_REAL_FILLVAL = PIO_FILL_FLOAT
#else
real (kind=RKIND), parameter :: MPAS_REAL_FILLVAL = PIO_FILL_DOUBLE
#endif
#else
#ifdef SINGLE_PRECISION
real (kind=RKIND), parameter :: MPAS_REAL_FILLVAL = NF_FILL_FLOAT
#else
real (kind=RKIND), parameter :: MPAS_REAL_FILLVAL = NF_FILL_DOUBLE
#endif
#endif

interface MPAS_io_get_var
Expand Down

0 comments on commit 11fc34c

Please sign in to comment.