Skip to content

Commit

Permalink
Merge pull request #7 from CESM-Development/master
Browse files Browse the repository at this point in the history
update to cime0_3_20 from CESM svn
  • Loading branch information
jedwards4b committed May 1, 2015
2 parents f020e79 + 9abba38 commit 31444ce
Show file tree
Hide file tree
Showing 606 changed files with 200,290 additions and 377 deletions.
7 changes: 6 additions & 1 deletion driver_cpl/cimetest/testlist_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
<machine compiler="intel" testtype="prebeta">yellowstone</machine>
<machine compiler="pgi" testtype="prebeta">yellowstone</machine>
</test>
<test name="PEM">
<machine compiler="intel" testtype="prealpha">yellowstone</machine>
</test>
</grid>
<grid name="f45_g37_rx1">
<test name="CME_Ld3">
Expand Down Expand Up @@ -147,6 +150,9 @@
<machine compiler="intel" testtype="prealpha">yellowstone</machine>
<machine compiler="pgi" testtype="prealpha">yellowstone</machine>
</test>
<test name="PET_D_E_CG">
<machine compiler="intel" testtype="prealpha">yellowstone</machine>
</test>
<test name="PET_PT_Ld3">
<machine compiler="pgi" testtype="prebeta">goldbach</machine>
<machine compiler="intel" testtype="prebeta">janus</machine>
Expand All @@ -155,7 +161,6 @@
<machine compiler="pgi" testtype="prebeta">yellowstone</machine>
</test>
<test name="SEQ_IOP_PFC_Ld3">
<machine compiler="intel" testtype="prebeta">goldbach</machine>
<machine compiler="pgi" testtype="prebeta">goldbach</machine>
<machine compiler="intel" testtype="prebeta">janus</machine>
<machine compiler="gnu" testtype="prebeta">yellowstone</machine>
Expand Down
5 changes: 5 additions & 0 deletions externals/CMake/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
install_manifest.txt
73 changes: 73 additions & 0 deletions externals/CMake/CESM_utils.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Module used for CESM testing.
#
# This module contains statements that would otherwise be boilerplate in
# most CESM tests. It enables CTest testing, handles the USE_COLOR and
# ENABLE_GENF90 arguments, and includes several other modules.

#==========================================================================
# Copyright (c) 2013-2014, University Corporation for Atmospheric Research
#
# This software is distributed under a two-clause BSD license, with no
# warranties, express or implied. See the accompanying LICENSE file for
# details.
#==========================================================================

#=================================================
# Enable CTest tests.
#=================================================

enable_testing()

#=================================================
# Color output
#=================================================

option(USE_COLOR "Allow color from the build output." ON)

set(CMAKE_COLOR_MAKEFILE "${USE_COLOR}")

#=================================================
# Compiler info
#=================================================

if("${CMAKE_BUILD_TYPE}" MATCHES CESM)
include(${CMAKE_BINARY_DIR}/CESM_Macros.cmake)
else()
include(Compilers)
endif()

#=================================================
# GenF90
#=================================================

option(ENABLE_GENF90
"Use genf90.pl to regenerate out-of-date Fortran files from .in files."
OFF)

if(ENABLE_GENF90)
find_program(GENF90 genf90.pl)

if(NOT GENF90)
message(FATAL_ERROR "ENABLE_GENF90 enabled, but genf90.pl not found!")
endif()

endif()

# Preprocessing utility functions.
include(genf90_utils)

#=================================================
# pFUnit
#=================================================

# pFUnit and its preprocessor
find_package(pFUnit)

# Preprocessor and driver handling.
include(pFUnit_utils)

#=================================================
# Source list and path utilities.
#=================================================

include(Sourcelist_utils)
8 changes: 8 additions & 0 deletions externals/CMake/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This repository tracks changes using the Git log.

For small changes, e.g. fixing typos, use a one line, 50 character summary.

For larger changes, this summary should be followed by a blank line and a
longer description. The following link gives good advice:

http://justinhileman.info/article/changing-history/#make-the-most-of-your-commit-message
138 changes: 138 additions & 0 deletions externals/CMake/Compilers.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Flags for builds with different machines/compilers.
#
# This module is currently a catch-all for compiler-specific functionality
# needed by CESM. It defines OS and compiler CPP macros and CESM build
# types, as well as including the file containing CESM compiler flags, if
# necessary.
#
# There is also one function intended for CTest test writers, described
# below.
#
#==========================================================================
#
# define_Fortran_stop_failure
#
# Arguments:
# test_name - Name of a CTest test.
#
# Ensures that if the named test uses "STOP 1" to signal failure, that this
# is detected by CTest. Currently this is only necessary for NAG, which
# prints the stop code rather than using it as an error code.
#
#==========================================================================

#==========================================================================
# Copyright (c) 2013-2014, University Corporation for Atmospheric Research
#
# This software is distributed under a two-clause BSD license, with no
# warranties, express or implied. See the accompanying LICENSE file for
# details.
#==========================================================================

#=================================================
# Define OS and compiler macros.
#=================================================

# Define OS.
string(TOUPPER ${CMAKE_SYSTEM_NAME} os)
add_definitions(-D${os})

# Define CESM-compatible compiler names.
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL NAG)
set(compiler_name nag)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU)
set(compiler_name gnu)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL XL)
set(compiler_name ibm)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL Intel)
set(compiler_name intel)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL PGI)
set(compiler_name pgi)
endif()

# Define CPP macro for the compiler.
string(TOUPPER -DCPR${compiler_name} compiler_cppdef)
add_definitions(${compiler_cppdef})

#=================================================
# Utility functions.
#=================================================

# Add flags to space-separated list rather than normal CMake list.
function(add_flags list)
string(REPLACE ";" " " flags "${ARGN}")
set(${list} "${${list}} ${flags}" PARENT_SCOPE)
endfunction()


# Add configuration-specific preprocessor definitions.
function(add_config_definitions configuration)
get_directory_property(cppdefs COMPILE_DEFINITIONS_${configuration})
foreach(flag IN LISTS ARGN)
string(REPLACE "-D" "" def "${flag}")
list(APPEND cppdefs ${def})
endforeach()
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_${configuration}
"${cppdefs}")
endfunction()


#=================================================
# Build flags required to use pFUnit.
#=================================================

if(${CMAKE_Fortran_COMPILER_ID} STREQUAL Intel)
add_flags(CMAKE_Fortran_FLAGS -assume realloc_lhs)
endif()

#=================================================
# Add flags for debugging output.
#=================================================

# Define Fortran compiler flags.

# Add pretty output and extra warnings regardless of build type. However,
# don't set any options in the generic flags that would affect the
# generated binary, because we want to be able to get binaries that
# resemble what you get from the CESM flags.

if(${CMAKE_Fortran_COMPILER_ID} STREQUAL NAG)
add_flags(CMAKE_Fortran_FLAGS -strict95)
if(USE_COLOR)
add_flags(CMAKE_Fortran_FLAGS -colour)
endif()

elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU)
# Turn on warnings, but leave out uninitialized check as it was producing
# a lot of false positives.
add_flags(CMAKE_Fortran_FLAGS -Wall -Wextra -Wno-uninitialized)

elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL XL)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL Intel)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL PGI)
endif()

# Define C flags, analogous to the above Fortran block.
if(CMAKE_C_COMPILER_LOADED)
if(${CMAKE_C_COMPILER_ID} STREQUAL GNU)
add_flags(CMAKE_C_FLAGS -Wall -Wextra -pedantic)
endif()
endif()

#=================================================
# Help CTest tests recognize when "stop X" is called with non-zero X.
#=================================================

# Detect "STOP" for CTest.
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL NAG)
# NAG prints the stop code instead of yielding a non-zero return, so we
# have to use a regex to catch that.
function(define_Fortran_stop_failure test_name)
set_tests_properties(${test_name} PROPERTIES
FAIL_REGULAR_EXPRESSION "STOP: [1-9]")
endfunction(define_Fortran_stop_failure)
else()
# Usually, stop /= 0 is already detected with the return code.
function(define_Fortran_stop_failure test_name)
endfunction(define_Fortran_stop_failure)
endif()
63 changes: 63 additions & 0 deletions externals/CMake/FindNETCDF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# - Try to find Netcdf
# Once done this will define
# NETCDF_FOUND - System has Netcdf
# NETCDF_INCLUDE_DIRS - The Netcdf include directories
# NETCDF_C_LIBRARIES - The C libraries needed to use Netcdf
# NETCDF_Fortran_LIBRARIES - The Fortran libraries needed to use Netcdf
# NETCDF_LIBRARIES - All the libraries needed to use Netcdf
# NETCDF_DEFINITIONS - Compiler switches required for using Netcdf

find_path(NETCDF_INCLUDE_DIR netcdf.h
HINTS ${NETCDF_DIR}/include )

find_path(NETCDF_LIB_DIR NAMES libnetcdf.a libnetcdf.so
HINTS ${NETCDF_DIR}/lib ${NETCDF_DIR}/lib64 )

find_path(NETCDF_FORTRAN_LIB_DIR NAMES libnetcdff.a libnetcdff.so
HINTS ${NETCDF_DIR}/lib ${NETCDF_DIR}/lib64 )


find_file(NETCDF4_PAR_H netcdf_par.h
HINTS ${NETCDF_INCLUDE_DIR}
NO_DEFAULT_PATH )

#MESSAGE("PAR_H: ${NETCDF4_PAR_H}")
find_library(NETCDF_C_LIBRARY NAMES libnetcdf.a netcdf HINTS ${NETCDF_LIB_DIR})

if(NOT NETCDF_FORTRAN_LIB_DIR)
MESSAGE("WARNING: did not find netcdf fortran library")
else()
find_library(NETCDF_Fortran_LIBRARY NAMES libnetcdff.a netcdff HINTS ${NETCDF_FORTRAN_LIB_DIR})
endif()
set(NETCDF_LIBRARIES ${NETCDF_Fortran_LIBRARY} ${NETCDF_C_LIBRARY})
if(NOT NETCDF4_PAR_H)
set(NETCDF4_PARALLEL "no")
MESSAGE("NETCDF built without MPIIO")
else()
set(NETCDF4_PARALLEL "yes")
MESSAGE("NETCDF built with hdf5 MPIIO support")
endif()

set(NETCDF_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR} )

FIND_PACKAGE(HDF5 COMPONENTS C HL)

if(${HDF5_FOUND})
MESSAGE(STATUS "Adding hdf5 libraries ")
set(NETCDF_C_LIBRARY ${NETCDF_C_LIBRARY} ${HDF5_LIBRARIES})
endif()

# Export variables so other projects can use them as well
# ie. if pio is added with add_subdirectory
SET(NETCDF_INCLUDE_DIR ${NETCDF_INCLUDE_DIR} CACHE STRING "Location of NetCDF include files.")
SET(NETCDF_LIBRARIES ${NETCDF_LIBRARIES} CACHE STRING "Link line for NetCDF.")

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set NETCDF_FOUND to TRUE
# if all listed variables are TRUE
# (Note that the Fortran interface is not always a separate library, so
# don't require it to be found.)
find_package_handle_standard_args(NETCDF DEFAULT_MSG NETCDF_LIBRARIES
NETCDF_C_LIBRARY NETCDF_INCLUDE_DIR)

mark_as_advanced(NETCDF_INCLUDE_DIR NETCDF_LIBRARIES NETCDF_C_LIBRARY NETCDF_Fortran_LIBRARY NETCDF4_PARALLEL )
38 changes: 38 additions & 0 deletions externals/CMake/FindNETCDF_C.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# - Try to find Netcdf
# Once done this will define
# NETCDF_C_FOUND - System has Netcdf
# NETCDF_C_INCLUDE_DIRS - The Netcdf include directories
# NETCDF_C_LIBRARY - The C libraries needed to use Netcdf
# NETCDF_C_LIBRARIES - All the libraries needed to use Netcdf
# NETCDF_C_DEFINITIONS - Compiler switches required for using Netcdf
#
include(LibFindMacros)
set(NETCDF_C_PARALLEL FALSE)
find_path(NETCDF_C_INCLUDE_DIR
NAMES netcdf.h
PATHS ${NETCDF_C_PKGCONF_INCLUDE_DIRS}
HINTS ${NETCDF_DIR}/include ${NETCDF_C_DIR}/include)

# See if netcdf includes parallel support
find_path(NETCDF_C_PAR_INCLUDE_DIR
NAMES netcdf_par.h
PATHS ${NETCDF_C_PKGCONF_INCLUDE_DIRS}
HINTS ${NETCDF_DIR}/include ${NETCDF_C_DIR}/include)

set(NETCDF_C_DEFINITIONS "-D_NETCDF")
if(${NETCDF_C_PAR_INCLUDE_DIR} STREQUAL "NETCDF_C_PAR_INCLUDE_DIR-NOTFOUND")
MESSAGE("Netcdf library does not appear to have parallel IO support")
else()
MESSAGE("Netcdf library includes HDF5 parallel support")
LIST(APPEND NETCDF_C_DEFINITIONS "-D_NETCDF4")
endif()
find_library(NETCDF_C_LIBRARY
NAMES libnetcdf.a netcdf
PATHS ${NETCDF_C_PKGCONF_LIBRARY_DIRS}
HINTS ${NETCDF_DIR}/lib ${NETCDF_C_DIR}/lib)

set(NETCDF_C_PROCESS_INCLUDES NETCDF_C_INCLUDE_DIR)

set(NETCDF_C_PROCESS_LIBS NETCDF_C_LIBRARY)

libfind_process(NETCDF_C)
25 changes: 25 additions & 0 deletions externals/CMake/FindNETCDF_Fortran.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# - Try to find Netcdf
# Once done this will define
# NETCDF_Fortran_FOUND - System has Netcdf
# NETCDF_Fortran_INCLUDE_DIRS - The Netcdf include directories
# NETCDF_Fortran_LIBRARY - The C libraries needed to use Netcdf
# NETCDF_Fortran_LIBRARIES - All the libraries needed to use Netcdf
# NETCDF_Fortran_DEFINITIONS - Compiler switches required for using Netcdf
#
include(LibFindMacros)

find_path(NETCDF_Fortran_INCLUDE_DIR
NAMES netcdf.inc
PATHS ${NETCDF_Fortran_PKGCONF_INCLUDE_DIRS}
HINTS ${NETCDF_DIR}/include ${NETCDF_Fortran_DIR}/include)
libfind_package(NETCDF_Fortran NETCDF_C)
find_library(NETCDF_Fortran_LIBRARY
NAMES libnetcdff.a netcdff
PATHS ${NETCDF_Fortran_PKGCONF_LIBRARY_DIRS}
HINTS ${NETCDF_DIR}/lib ${NETCDF_Fortran_DIR}/lib)

set(NETCDF_Fortran_PROCESS_INCLUDES NETCDF_Fortran_INCLUDE_DIR)

set(NETCDF_Fortran_PROCESS_LIBS NETCDF_Fortran_LIBRARY)

libfind_process(NETCDF_Fortran)
Loading

0 comments on commit 31444ce

Please sign in to comment.