-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from kgerheiser/master
Release 2.4.0
- Loading branch information
Showing
23 changed files
with
1,556 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Build and Test | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
env: | ||
FC: gfortran-9 | ||
CC: gcc-9 | ||
|
||
steps: | ||
|
||
- name: install-mpi | ||
run: | | ||
sudo apt-get install libmpich-dev | ||
- name: checkout-pfunit | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: Goddard-Fortran-Ecosystem/pFUnit | ||
path: pfunit | ||
|
||
- name: cache-pfunit | ||
id: cache-pfunit | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/pfunit | ||
key: pfunit-${{ runner.os }}-${{ hashFiles('pfunit/VERSION') }} | ||
|
||
- name: build-pfunit | ||
if: steps.cache-pfunit.outputs.cache-hit != 'true' | ||
run: | | ||
cd pfunit | ||
mkdir build | ||
cd build | ||
cmake .. -DSKIP_MPI=YES -DSKIP_ESMF=YES -DSKIP_FHAMCREST=YES -DCMAKE_INSTALL_PREFIX=~/pfunit | ||
make -j2 | ||
make install | ||
- name: checkout-bacio | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: NOAA-EMC/NCEPLIBS-bacio | ||
path: bacio | ||
ref: develop | ||
|
||
- name: build-bacio | ||
run: | | ||
cd bacio | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_INSTALL_PREFIX=~/bacio | ||
make -j2 | ||
make install | ||
- name: checkout-w3nco | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: NOAA-EMC/NCEPLIBS-w3nco | ||
path: w3nco | ||
ref: develop | ||
|
||
- name: build-w3nco | ||
run: | | ||
cd w3nco | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_INSTALL_PREFIX=~/w3nco | ||
make -j2 | ||
make install | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
path: nemsio | ||
submodules: true | ||
|
||
- name: build | ||
run: | | ||
cd nemsio | ||
mkdir build | ||
cd build | ||
cmake .. -DENABLE_TESTS=ON -DCMAKE_PREFIX_PATH="~/pfunit;~/" | ||
make -j2 | ||
- name: test | ||
run: | | ||
cd $GITHUB_WORKSPACE/nemsio/build | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
build/ | ||
install/ | ||
|
||
*.[ao] | ||
*.mod | ||
*.so | ||
|
||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,39 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(nemsio VERSION 2.2.3) | ||
set(${PROJECT_NAME}_VERSION ${PROJECT_VERSION} CACHE INTERNAL "${PROJECT_NAME} version number") | ||
enable_language (Fortran) | ||
|
||
if (NOT CMAKE_BUILD_TYPE) | ||
set (CMAKE_BUILD_TYPE RELEASE CACHE STRING | ||
"Choose the type of build, options are: PRODUCTION Debug Release." | ||
FORCE) | ||
endif() | ||
file(STRINGS "VERSION" pVersion) | ||
|
||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") | ||
set(IntelComp true ) | ||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU*" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang*") | ||
set(GNUComp true ) | ||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "pgc*") | ||
set(PGIComp true ) | ||
endif() | ||
project( | ||
nemsio | ||
VERSION ${pVersion} | ||
LANGUAGES Fortran) | ||
|
||
find_package(MPI REQUIRED) | ||
include(GNUInstallDirs) | ||
|
||
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "RelWithDebInfo" BUILD_RELEASE) | ||
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "RELEASE" BUILD_RELEASE) | ||
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "PRODUCTION" BUILD_PRODUCTION) | ||
STRING(COMPARE EQUAL ${CMAKE_BUILD_TYPE} "DEBUG" BUILD_DEBUG) | ||
option(ENABLE_TESTS "Build pfunit tests?" OFF) | ||
|
||
if( (BUILD_RELEASE) OR (BUILD_PRODUCTION) ) | ||
if(IntelComp) | ||
include_directories(${MPI_INCLUDE_PATH} ) | ||
set(fortran_flags "-O2" "-convert" "big_endian" "-free" "-assume" "byterecl" | ||
"-fp-model" "strict" "-traceback" "-g" "-mkl" "-qopenmp") | ||
elseif(GNUComp) | ||
set(fortran_flags "-O2" "-ffree-form") | ||
else() | ||
message("unknown compiler!") | ||
exit() | ||
endif() | ||
if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") | ||
message(STATUS "Setting build type to 'Release' as none was specified.") | ||
set(CMAKE_BUILD_TYPE | ||
"Release" | ||
CACHE STRING "Choose the type of build." FORCE) | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") | ||
endif() | ||
|
||
if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|GNU|Clang|AppleClang)$") | ||
message( | ||
WARNING "Compiler not officially supported: ${CMAKE_Fortran_COMPILER_ID}") | ||
endif() | ||
|
||
file(GLOB fortran_src ${CMAKE_CURRENT_SOURCE_DIR}/src/*.f90 ) | ||
|
||
set(lib_name ${PROJECT_NAME}) | ||
set(versioned_lib_name ${PROJECT_NAME}_v${PROJECT_VERSION}) | ||
|
||
add_library(${lib_name} STATIC ${fortran_src}) | ||
set_target_properties(${lib_name} PROPERTIES OUTPUT_NAME "${versioned_lib_name}") | ||
|
||
set(module_dir "${CMAKE_CURRENT_BINARY_DIR}/include") | ||
set_target_properties(${lib_name} PROPERTIES Fortran_MODULE_DIRECTORY "${module_dir}") | ||
find_package(MPI REQUIRED COMPONENTS Fortran) | ||
|
||
target_include_directories(${lib_name} PRIVATE ${MPI_Fortran_INCLUDE_DIRS}) | ||
find_package(bacio REQUIRED) | ||
find_package(w3nco REQUIRED) | ||
|
||
target_include_directories(${lib_name} PUBLIC | ||
$<BUILD_INTERFACE:${module_dir}> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>) | ||
add_subdirectory(src) | ||
add_subdirectory(utils) | ||
|
||
install(TARGETS ${lib_name} | ||
EXPORT ${PROJECT_NAME}-config | ||
RUNTIME DESTINATION bin | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib) | ||
install(DIRECTORY ${module_dir} DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
install(EXPORT ${PROJECT_NAME}-config DESTINATION ${CMAKE_INSTALL_PREFIX}) | ||
if(ENABLE_TESTS) | ||
find_package(PFUNIT REQUIRED) | ||
enable_testing() | ||
add_subdirectory(tests) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# NEMSIO | ||
|
||
Performs I/O for the NCEP models using NEMS. | ||
|
||
Code manager: Hang Lei | ||
|
||
|
||
### Prerequisites | ||
|
||
Compilers: GNU | Intel | Clang | AppleClang | ||
with MPI | ||
|
||
|
||
### Installing | ||
|
||
``` | ||
mkdir build | ||
cd build | ||
cmake -DCMAKE_INSTALL_PREFIX=/path/to/install /path/to/NCEPLIBS-nemsio | ||
make -j2 | ||
make install | ||
``` | ||
|
||
### Utilities | ||
- `nemsio_get` - get the value of a variable in the file | ||
- `nemsio_read` - read a nemsio file and print statistics to screen | ||
- `nemsio_chgdate` - change datetime stamp in the nemsio file | ||
- `mkgfsnemsioctl` - create GrADS ctl file to read nemsio data in GrADS | ||
|
||
### Testing | ||
`ctest` is used to read a test file. More tests will be added as needed | ||
|
||
|
||
### Version | ||
|
||
2.4.0 | ||
|
||
|
||
### Authors | ||
|
||
* **[NCEP/EMC](mailto:NCEP.List.EMC.nceplibs.Developers@noaa.gov)** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@PACKAGE_INIT@ | ||
|
||
#@PROJECT_NAME@-config.cmake | ||
# | ||
# Output variables set: | ||
# * @PROJECT_NAME@_FOUND | ||
# | ||
# Imported interface targets provided: | ||
# * @PROJECT_NAME@::@PROJECT_NAME@ | ||
|
||
# Include targets file. This will create IMPORTED target @PROJECT_NAME@ | ||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") | ||
|
||
include(CMakeFindDependencyMacro) | ||
|
||
find_dependency(bacio CONFIG) | ||
find_dependency(w3nco CONFIG) | ||
find_dependency(MPI COMPONENTS Fortran) | ||
|
||
get_target_property(@PROJECT_NAME@_BUILD_TYPES @PROJECT_NAME@::@PROJECT_NAME@ IMPORTED_CONFIGURATIONS) | ||
|
||
check_required_components("@PROJECT_NAME@") | ||
|
||
get_target_property(location @PROJECT_NAME@::@PROJECT_NAME@ LOCATION) | ||
message(STATUS "Found @PROJECT_NAME@: ${location} (found version \"@PROJECT_VERSION@\")") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.