Skip to content

Commit

Permalink
removing bacio depedency
Browse files Browse the repository at this point in the history
  • Loading branch information
scrasmussen committed May 20, 2024
1 parent bd3128c commit 751cd29
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 106 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/ci_build_scm_ubuntu_22.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
env:
NFHOME: /home/runner/netcdf-fortran
NFVERSION: v4.5.3
bacio_ROOT: /home/runner/bacio
sp_ROOT: /home/runner/NCEPLIBS-sp
w3emc_ROOT: /home/runner/myw3emc
SCM_ROOT: /home/runner/work/ccpp-scm/ccpp-scm
Expand Down Expand Up @@ -85,23 +84,6 @@ jobs:
sudo apt-get install intel-hpckit-getting-started intel-oneapi-clck intel-oneapi-common-licensing intel-oneapi-common-vars
sudo apt-get install intel-oneapi-dev-utilities intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic intel-oneapi-compiler-fortran intel-oneapi-itac
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
uses: actions/cache@v3
with:
path: /home/runner/bacio
key: cache-bacio-fortran-${{matrix.fortran-compiler}}-key

- name: Install bacio library v2.4.1
if: steps.cache-bacio-fortran.outputs.cache-hit != 'true'
run: |
git clone --branch v2.4.1 https://github.com/NOAA-EMC/NCEPLIBS-bacio.git bacio
cd bacio && mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${bacio_ROOT} ../
make -j2
make install
echo "bacio_DIR=/home/runner/bacio/lib/cmake/bacio" >> $GITHUB_ENV
- name: Cache SP-library v2.3.3
id: cache-sp-fortran
uses: actions/cache@v3
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/ci_build_scm_ubuntu_22.04_nvidia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
# Environmental variables
env:
NETCDF: /home/runner/netcdf
bacio_ROOT: /home/runner/bacio
sp_ROOT: /home/runner/NCEPLIBS-sp
w3emc_ROOT: /home/runner/myw3emc
SCM_ROOT: /home/runner/work/ccpp-scm/ccpp-scm
Expand Down Expand Up @@ -185,23 +184,6 @@ jobs:
make
make install
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
uses: actions/cache@v3
with:
path: /home/runner/bacio
key: cache-bacio-fortran-${{matrix.fortran-compiler}}-key

- name: Install bacio library v2.4.1
if: steps.cache-bacio-fortran.outputs.cache-hit != 'true'
run: |
git clone --branch v2.4.1 https://github.com/NOAA-EMC/NCEPLIBS-bacio.git bacio
cd bacio && mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${bacio_ROOT} ../
make -j2
make install
echo "bacio_DIR=/home/runner/bacio/lib/cmake/bacio" >> $GITHUB_ENV
- name: Cache SP-library v2.3.3
id: cache-sp-fortran
uses: actions/cache@v3
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/ci_run_scm_DEPHY.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
env:
NFHOME: /home/runner/netcdf-fortran
NFVERSION: v4.5.3
bacio_ROOT: /home/runner/bacio
sp_ROOT: /home/runner/NCEPLIBS-sp
w3emc_ROOT: /home/runner/myw3emc
SCM_ROOT: /home/runner/work/ccpp-scm/ccpp-scm
Expand Down Expand Up @@ -54,23 +53,6 @@ jobs:
#######################################################################################
# Install FORTRAN dependencies
#######################################################################################
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
uses: actions/cache@v3
with:
path: /home/runner/bacio
key: cache-bacio-fortran-${{matrix.fortran-compiler}}-key

- name: Install bacio library v2.4.1
if: steps.cache-bacio-fortran.outputs.cache-hit != 'true'
run: |
git clone --branch v2.4.1 https://github.com/NOAA-EMC/NCEPLIBS-bacio.git bacio
cd bacio && mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${bacio_ROOT} ../
make -j2
make install
echo "bacio_DIR=/home/runner/bacio/lib/cmake/bacio" >> $GITHUB_ENV
- name: Cache SP-library v2.3.3
id: cache-sp-fortran
uses: actions/cache@v3
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/ci_run_scm_rts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
env:
NFHOME: /home/runner/netcdf-fortran
NFVERSION: v4.5.3
bacio_ROOT: /home/runner/bacio
sp_ROOT: /home/runner/NCEPLIBS-sp
w3emc_ROOT: /home/runner/myw3emc
SCM_ROOT: /home/runner/work/ccpp-scm/ccpp-scm
Expand Down Expand Up @@ -71,23 +70,6 @@ jobs:
echo "CC=icx" >> $GITHUB_ENV
echo "FC=ifort" >> $GITHUB_ENV
- name: Cache bacio library v2.4.1
id: cache-bacio-fortran
uses: actions/cache@v3
with:
path: /home/runner/bacio
key: cache-bacio-fortran-${{matrix.fortran-compiler}}-key

- name: Install bacio library v2.4.1
if: steps.cache-bacio-fortran.outputs.cache-hit != 'true'
run: |
git clone --branch v2.4.1 https://github.com/NOAA-EMC/NCEPLIBS-bacio.git bacio
cd bacio && mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${bacio_ROOT} ../
make -j2
make install
echo "bacio_DIR=/home/runner/bacio/lib/cmake/bacio" >> $GITHUB_ENV
- name: Cache SP-library v2.3.3
id: cache-sp-fortran
uses: actions/cache@v3
Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN cd /comsoftware/ccpp-scm/ \
# Obtain the pre-computed look-up tables for running with Thompson microphysics
RUN cd /comsoftware/ccpp-scm/ \
&& . contrib/get_thompson_tables.sh

# Run the machine setup script to set environment variables
ENV CC=/opt/rh/devtoolset-9/root/usr/bin/gcc
ENV CXX=/opt/rh/devtoolset-9/root/usr/bin/g++
Expand All @@ -37,11 +37,10 @@ RUN cd /comsoftware/ccpp-scm/contrib \
&& cd .. \
&& ./contrib/build_nceplibs.sh $PWD/nceplibs

ENV bacio_ROOT /comsoftware/ccpp-scm/nceplibs
ENV sp_ROOT /comsoftware/ccpp-scm/nceplibs
ENV w3nco_ROOT /comsoftware/ccpp-scm/nceplibs

# Create your own link from python -> python3
# Create your own link from python -> python3
# This works without setting the system PATH env var
# since /usr/local/bin is before /usr/bin in the search path.
USER root
Expand All @@ -56,7 +55,7 @@ RUN cd /comsoftware/ccpp-scm/scm \
&& make -j4

# The analysis scripts have options for using LaTeX when making figure labels.
# If you would like to install LaTeK, uncomment the section below.
# If you would like to install LaTeK, uncomment the section below.
# Note: This will increase the image size by 1 GB.
#USER root
#RUN yum -y update \
Expand Down
16 changes: 7 additions & 9 deletions scm/doc/TechGuide/chap_quick.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Obtaining Code
The source code for the SCM, CCPP, and their required components are provided through GitHub.
The latest release branch contains the tested and supported version for
general use, while the development branch (``main``) contains the latest
developer code, but may not be as stable or consistent with existing documentation.
developer code, but may not be as stable or consistent with existing documentation.
Instructions for using either option are discussed here.

Release Code
Expand Down Expand Up @@ -127,7 +127,7 @@ System Requirements, Libraries, and Tools
-----------------------------------------

The source code for the SCM and CCPP components is in the form of
programs written in FORTRAN 90 (with some required features from the
programs written in FORTRAN 90 (with some required features from the
FORTRAN 2008 standard), and C. In addition, the model I/O
relies on the NetCDF libraries. Beyond the standard scripts, the build
system relies on use of the Python scripting language, along with cmake,
Expand Down Expand Up @@ -158,14 +158,12 @@ Further, there are several utility libraries as part of the hpc-stack
package that must be installed with environment variables pointing to
their locations prior to building the SCM.

- bacio - Binary I/O Library

- sp - Spectral Transformation Library

- w3emc - GRIB decoder and encoder library

The following environment variables are used by the build system to
properly link these libraries: ``bacio_ROOT``, ``sp_ROOT``, and ``w3emc_ROOT`` Computational platforms on
properly link these libraries: ``sp_ROOT``, and ``w3emc_ROOT`` Computational platforms on
which these libraries are prebuilt and installed in a central location
are referred to as *preconfigured* platforms. Examples of preconfigured
platforms are most NOAA high-performance computing machines (using the
Expand Down Expand Up @@ -231,8 +229,8 @@ installing prerequisite libraries. Visit
https://github.com/NOAA-EMC/hpc-stack for instructions for installing
prerequisite libraries via *hpc-stack* in their docs directory. UFS users who
already installed libraries via the *hpc-stack* package only need to set the
compiler (``CC``, ``CXX``, ``FC``), NetCDF (``NetCDF_ROOT``), and ``bacio``,
``sp`` and ``w3emc`` (``bacio_ROOT``, ``sp_ROOT``, ``w3emc_ROOT``) environment variables to point
compiler (``CC``, ``CXX``, ``FC``), NetCDF (``NetCDF_ROOT``),
``sp`` and ``w3emc`` (``sp_ROOT``, ``w3emc_ROOT``) environment variables to point
to their installation paths in order to compile the SCM.

The SCM uses only a small part of the UFS *hpc-stack* package and has fewer
Expand Down Expand Up @@ -301,7 +299,7 @@ If the download step fails, make sure that your system’s firewall does
not block access to GitHub. If it does, download the files ``comparison_data.tar.gz``,
``physics_input_data.tar.gz``, ``processed_case_input.tar.gz``, and ``raw_case_input.tar.gz``
from the GitHub release website using your browser and manually extract its
contents in the directory ``scm/data``. Similarly, do the same for
contents in the directory ``scm/data``. Similarly, do the same for
``thompson_tables.tar.gz`` and ``MG_INCCN_data.tar.gz`` and extract
to ``scm/data/physics_input_data/``.

Expand Down Expand Up @@ -756,7 +754,7 @@ GNU-based Docker image:

- Python - 3

- NCEPLIBS subset: bacio v2.4.1_4, sp v2.3.3_d, w3emc v2.9.2_d
- NCEPLIBS subset: sp v2.3.3_d, w3emc v2.9.2_d

A Docker image containing the SCM, CCPP, and its software prerequisites
can be generated from the code in the software repository obtained by
Expand Down
1 change: 0 additions & 1 deletion scm/etc/modules/derecho_gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ load("py-netcdf4/1.5.8")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")

Expand Down
1 change: 0 additions & 1 deletion scm/etc/modules/derecho_intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ load("py-netcdf4/1.5.8")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")

Expand Down
1 change: 0 additions & 1 deletion scm/etc/modules/hera_gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ load("py-netcdf4/1.5.8")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")

Expand Down
1 change: 0 additions & 1 deletion scm/etc/modules/hera_intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ load("py-netcdf4/1.5.8")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")

Expand Down
1 change: 0 additions & 1 deletion scm/etc/modules/jet_gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ load("py-netcdf4/1.5.8")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")

Expand Down
1 change: 0 additions & 1 deletion scm/etc/modules/jet_intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ load("py-netcdf4/1.5.8")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")

Expand Down
1 change: 0 additions & 1 deletion scm/etc/modules/orion_gnu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ load("py-netcdf4/1.5.8")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")

Expand Down
1 change: 0 additions & 1 deletion scm/etc/modules/orion_intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ load("py-netcdf4/1.5.8")

load("netcdf-c/4.9.2")
load("netcdf-fortran/4.6.0")
load("bacio/2.4.1")
load("sp/2.3.3")
load("w3emc")

Expand Down
23 changes: 10 additions & 13 deletions scm/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ else()
RESULT_VARIABLE return_code
)
endif()

# Check return code from CCPP prebuild.py
if(return_code EQUAL 0)
message (STATUS "CCPP prebuild step completed successfully")
Expand All @@ -68,7 +68,6 @@ include(CMakeForceCompiler)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/../../CMakeModules/Modules)

find_package(NetCDF REQUIRED COMPONENTS C Fortran)
find_package(bacio REQUIRED)
find_package(sp REQUIRED)
find_package(w3emc REQUIRED)

Expand Down Expand Up @@ -130,35 +129,35 @@ set(SIMDMULTIARCH OFF CACHE BOOL "Enable multi-target SIMD instruction sets")
# Set compile options
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ggdb -fbacktrace -cpp -fcray-pointer -ffree-line-length-none -fno-range-check")

if(${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch -fallow-invalid-boz")
endif()

if(NOT 32BIT)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8 -fdefault-double-8")
endif()

if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -O2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2")
endif()

set(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback -fpp -fno-alias -auto -safe-cray-ptr -ftz -assume byterecl -nowarn -sox -align array64byte -qno-opt-dynamic-align")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qno-opt-dynamic-align -sox -fp-model source")

if(NOT 32BIT)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -real-size 64")
endif()

if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -check -check noarg_temp_created -check nopointer -warn -warn noerrors -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv -init=snan,arrays")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -ftrapuv")
Expand All @@ -181,7 +180,7 @@ elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=core-avx-i")
endif()
endif()

set(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
Expand All @@ -199,7 +198,7 @@ elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "NVHPC")
if(NOT 32BIT)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8")
endif()

if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g")
Expand All @@ -211,7 +210,7 @@ elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "NVHPC")
set(MPI_C_COMPILER mpicc)
set(MPI_CXX_COMPILER mpicxx)
set(MPI_Fortran_COMPILER mpif90)

set(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_Fortran_FLAGS_RELEASE "-O2 -fPIC" CACHE STRING "" FORCE)
set(CMAKE_C_FLAGS_BITFORBIT "-O2 -fPIC" CACHE STRING "" FORCE)
Expand Down Expand Up @@ -277,7 +276,6 @@ if(OPENMP)
TARGET_LINK_LIBRARIES(scm PUBLIC OpenMP::OpenMP_Fortran)
endif()
TARGET_LINK_LIBRARIES(scm NetCDF::NetCDF_Fortran)
TARGET_LINK_LIBRARIES(scm bacio::bacio_4)
TARGET_LINK_LIBRARIES(scm sp::sp_d)
TARGET_LINK_LIBRARIES(scm w3emc::w3emc_d)
TARGET_LINK_LIBRARIES(scm ccpp_framework)
Expand All @@ -292,4 +290,3 @@ ADD_CUSTOM_COMMAND(
COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_SOURCE_DIR}/run_scm.py
${CMAKE_CURRENT_BINARY_DIR}/run_scm.py)

0 comments on commit 751cd29

Please sign in to comment.