Skip to content

Commit

Permalink
Merge branch 'framework/nag_build_target' into develop (PR #722)
Browse files Browse the repository at this point in the history
This merge adds a build target for the NAG compilers to the top-level Makefile,
and it also fixes several compilation issues with the NAG compilers in shared
code.

Although the 'test' core can now be compiled with the NAG compilers, other cores
contain issues in their core-specific code that prevent compilation, and this
merge does not address those issues.

* framework/nag_build_target:
  For NAG only, don't rewind the namelist file before reading each namelist group
  Correct order of argument declarations in mpas_spline_interpolation
  Remove FFLAGS from definition of FC provided to esmf_time build
  Add 'nag' build target in the top-level Makefile

Conflicts:
	Makefile
  • Loading branch information
mgduda committed Nov 30, 2020
2 parents 134b925 + b43584c commit c8ca8fa
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 9 deletions.
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,31 @@ llvm:
"OPENMP = $(OPENMP)" \
"CPPFLAGS = $(MODEL_FORMULATION) -D_MPI" )

nag:
( $(MAKE) all \
"FC_PARALLEL = mpifort" \
"CC_PARALLEL = mpicc" \
"CXX_PARALLEL = mpic++" \
"FC_SERIAL = nagfor" \
"CC_SERIAL = gcc" \
"CXX_SERIAL = g++" \
"FFLAGS_PROMOTION = -r8" \
"FFLAGS_OPT = -free -mismatch -O3 -convert=big_ieee" \
"CFLAGS_OPT = -O3" \
"CXXFLAGS_OPT = -O3" \
"LDFLAGS_OPT = -O3" \
"FFLAGS_DEBUG = -free -mismatch -O0 -g -C -convert=big_ieee" \
"CFLAGS_DEBUG = -O0 -g -Wall -pedantic" \
"CXXFLAGS_DEBUG = -O0 -g -Wall -pedantic" \
"LDFLAGS_DEBUG = -O0 -g -C" \
"FFLAGS_OMP = -qsmp=omp" \
"CFLAGS_OMP = -qsmp=omp" \
"CORE = $(CORE)" \
"DEBUG = $(DEBUG)" \
"USE_PAPI = $(USE_PAPI)" \
"OPENMP = $(OPENMP)" \
"CPPFLAGS = $(MODEL_FORMULATION) -D_MPI -DUNDERSCORE -DNAG_COMPILER" )

CPPINCLUDES =
FCINCLUDES =
LIBS =
Expand Down
2 changes: 1 addition & 1 deletion src/external/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
all: esmf_time ezxml-lib

esmf_time:
( cd esmf_time_f90; $(MAKE) FC="$(FC) $(FFLAGS)" CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS) -DHIDE_MPI" GEN_F90=$(GEN_F90) )
( cd esmf_time_f90; $(MAKE) FC="$(FC)" FFLAGS="$(FFLAGS)" CPP="$(CPP)" CPPFLAGS="$(CPPFLAGS) -DHIDE_MPI" GEN_F90=$(GEN_F90) )

ezxml-lib:
( cd ezxml; $(MAKE) )
Expand Down
16 changes: 8 additions & 8 deletions src/operators/mpas_spline_interpolation.F
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ subroutine mpas_interpolate_cubic_spline( &!{{{

! INPUT PARAMETERS:

integer, intent(in) :: &
n, &!< Input: number of nodes, input grid
nOut !< Input: number of nodes, output grid

real (kind=RKIND), dimension(n), intent(in) :: &
x, &!< Input: node location, input grid
y, &!< Input: interpolation variable, input grid
Expand All @@ -123,10 +127,6 @@ subroutine mpas_interpolate_cubic_spline( &!{{{
real (kind=RKIND), dimension(nOut), intent(in) :: &
xOut !< Input: node location, output grid

integer, intent(in) :: &
n, &!< Input: number of nodes, input grid
nOut !< Input: number of nodes, output grid

! OUTPUT PARAMETERS:

real (kind=RKIND), dimension(nOut), intent(out) :: &
Expand Down Expand Up @@ -359,17 +359,17 @@ subroutine mpas_interpolate_linear( &!{{{

! !INPUT PARAMETERS:

integer, intent(in) :: &
N, &!< Input: number of nodes, input grid
NOut !< Input: number of nodes, output grid

real (kind=RKIND), dimension(n), intent(in) :: &
x, &!< Input: node location, input grid
y !< Input: interpolation variable, input grid

real (kind=RKIND), dimension(nOut), intent(in) :: &
xOut !< Input: node location, output grid

integer, intent(in) :: &
N, &!< Input: number of nodes, input grid
NOut !< Input: number of nodes, output grid

! !OUTPUT PARAMETERS:

real (kind=RKIND), dimension(nOut), intent(out) :: &
Expand Down
4 changes: 4 additions & 0 deletions src/tools/registry/gen_inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,11 @@ int parse_namelist_records_from_registry(ezxml_t registry)/*{{{*/
}

fortprintf(fd, " if (dminfo %% my_proc_id == IO_NODE) then\n");
fortprintf(fd, "! Rewinding before each read leads to errors when the code is built with\n");
fortprintf(fd, "! the NAG Fortran compiler. If building with NAG, be kind and don't rewind.\n");
fortprintf(fd, "#ifndef NAG_COMPILER\n");
fortprintf(fd, " rewind(unitNumber)\n");
fortprintf(fd, "#endif\n");
fortprintf(fd, " read(unitNumber, %s, iostat=ierr)\n", nmlrecname);
fortprintf(fd, " end if\n");

Expand Down

0 comments on commit c8ca8fa

Please sign in to comment.