Skip to content

Commit

Permalink
Merge branch 'hotfix-v5.2'
Browse files Browse the repository at this point in the history
This merge corrects issues when building MPAS with PIO 2.x library versions.

* hotfix-v5.2:
  Check for GPTL library when building with PIO2
  For PIO2, set 'pio_mode' to zero when creating netCDF-4 files
  Obtain MPI_COMM_SELF from mpas_dmpar in MPAS_stream_mgr_block_write
  Export MPI_COMM_SELF from mpas_dmpar module
  Fix MPAS fillvalue usage when using PIO2
  Update version number to v5.2
  • Loading branch information
mgduda committed Aug 1, 2017
2 parents e7bbfd3 + 57219a6 commit a74c8d1
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 8 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ ifeq "$(USE_PIO2)" "true"
CPPINCLUDES = -DUSE_PIO2 -I$(PIO)/include
FCINCLUDES = -DUSE_PIO2 -I$(PIO)/include
LIBS = -L$(PIO)/lib -lpiof -lpioc
ifneq ($(wildcard $(PIO)/lib/libgptl.a), ) # Check for GPTL library for PIO2
LIBS += -lgptl
endif
else
CPPINCLUDES = -I$(PIO)/include
FCINCLUDES = -I$(PIO)/include
Expand All @@ -414,6 +417,9 @@ ifeq "$(USE_PIO2)" "true"
CPPINCLUDES = -DUSE_PIO2 -I$(PIO)/include
FCINCLUDES = -DUSE_PIO2 -I$(PIO)/include
LIBS = -L$(PIO) -lpiof -lpioc
ifneq ($(wildcard $(PIO)/libgptl.a), ) # Check for GPTL library for PIO2
LIBS += -lgptl
endif
else
CPPINCLUDES = -I$(PIO)
FCINCLUDES = -I$(PIO)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MPAS-v5.1
MPAS-v5.2
====

The Model for Prediction Across Scales (MPAS) is a collaborative project for
Expand Down
2 changes: 1 addition & 1 deletion src/core_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="5.1">
<registry model="mpas" core="atmosphere" core_abbrev="atm" version="5.2">

<!-- **************************************************************************************** -->
<!-- ************************************** Dimensions ************************************** -->
Expand Down
2 changes: 1 addition & 1 deletion src/core_init_atmosphere/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="5.1">
<registry model="mpas" core="init_atmosphere" core_abbrev="init_atm" version="5.2">

<!-- **************************************************************************************** -->
<!-- ************************************** Dimensions ************************************** -->
Expand Down
2 changes: 1 addition & 1 deletion src/core_landice/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="landice" core_abbrev="li" version="5.1">
<registry model="mpas" core="landice" core_abbrev="li" version="5.2">


<!-- ======================================================================= -->
Expand Down
2 changes: 1 addition & 1 deletion src/core_ocean/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="ocean" core_abbrev="ocn" version="5.1">
<registry model="mpas" core="ocean" core_abbrev="ocn" version="5.2">

<dims>
<dim name="nCells" units="unitless"
Expand Down
2 changes: 1 addition & 1 deletion src/core_sw/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="sw" core_abbrev="sw" version="5.1">
<registry model="mpas" core="sw" core_abbrev="sw" version="5.2">
<dims>
<dim name="nCells"/>
<dim name="nEdges"/>
Expand Down
2 changes: 1 addition & 1 deletion src/core_test/Registry.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<registry model="mpas" core="test" core_abbrev="test" version="5.1">
<registry model="mpas" core="test" core_abbrev="test" version="5.2">
<dims>
<dim name="nCells"/>
<dim name="nEdges"/>
Expand Down
6 changes: 6 additions & 0 deletions src/framework/mpas_dmpar.F
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ module mpas_dmpar
integer, parameter, public :: IO_NODE = 0
integer, parameter, public :: BUFSIZE = 6000

#ifdef _MPI
public :: MPI_COMM_SELF
#else
integer, parameter, public :: MPI_COMM_SELF = 0
#endif

public :: mpas_dmpar_init
public :: mpas_dmpar_finalize
public :: mpas_dmpar_abort
Expand Down
20 changes: 19 additions & 1 deletion src/framework/mpas_io.F
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,28 @@ 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

#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
module procedure MPAS_io_get_var_int0d
module procedure MPAS_io_get_var_int1d
Expand Down Expand Up @@ -267,7 +281,11 @@ type (MPAS_IO_Handle_type) function MPAS_io_open(filename, mode, ioformat, ioCon
pio_mode = PIO_64BIT_OFFSET
else if (ioformat == MPAS_IO_NETCDF4) then
pio_iotype = PIO_iotype_netcdf4p
#ifdef USE_PIO2
pio_mode = 0
#else
pio_mode = PIO_64BIT_OFFSET
#endif
end if
end if
Expand Down
2 changes: 2 additions & 0 deletions src/framework/mpas_stream_manager.F
Original file line number Diff line number Diff line change
Expand Up @@ -2675,6 +2675,8 @@ end subroutine MPAS_stream_mgr_write !}}}
!-----------------------------------------------------------------------
subroutine MPAS_stream_mgr_block_write(manager, writeBlock, streamID, timeLevel, mgLevel, forceWriteNow, writeTime, ierr) !{{{
use mpas_dmpar, only : MPI_COMM_SELF
implicit none
type (MPAS_streamManager_type), intent(inout) :: manager
Expand Down

0 comments on commit a74c8d1

Please sign in to comment.