Skip to content

Commit

Permalink
feature/gdas_init.v16 This commit references ufs-community#102.
Browse files Browse the repository at this point in the history
Merge branch 'develop' into feature/gdas_init.v16
  • Loading branch information
GeorgeGayno-NOAA committed Jun 16, 2020
2 parents 0a5e257 + 10426d4 commit 8f18239
Show file tree
Hide file tree
Showing 266 changed files with 1,342 additions and 4,825 deletions.
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "cmake"]
path = cmake
url = https://github.com/NOAA-EMC/CMakeModules
branch = release/public-v1
117 changes: 117 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
cmake_minimum_required(VERSION 3.15)

file(STRINGS "VERSION" pVersion)

project(
ufs_util
VERSION ${pVersion}
LANGUAGES C Fortran)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")

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()

if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Intel|GNU)$")
message(WARNING "Compiler not officially supported: ${CMAKE_C_COMPILER_ID}")
endif()

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "-g -traceback")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 -fp-model precise")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -check -check noarg_temp_created -check nopointer -fp-stack-check -fstack-protector-all -fpe0 -debug -ftrapuv")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
set(CMAKE_Fortran_FLAGS "-g -fbacktrace")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS_DEBUG "-O0 -ggdb -fno-unsafe-math-optimizations -frounding-math -fsignaling-nans -ffpe-trap=invalid,zero,overflow -fbounds-check")
endif()

if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_C_FLAGS "-g -traceback")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0")
elseif(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
set(CMAKE_C_FLAGS " ")
set(CMAKE_C_FLAGS_RELEASE " ")
set(CMAKE_C_FLAGS_DEBUG " ")
endif()

find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
find_package(Jasper REQUIRED)
find_package(NetCDF REQUIRED C Fortran)
find_package(MPI REQUIRED )
find_package(ESMF MODULE REQUIRED)
find_package(WGRIB2 REQUIRED)

option(OPENMP "use OpenMP threading" ON)
if(OPENMP)
find_package(OpenMP REQUIRED COMPONENTS Fortran)
endif()

set(CMAKE_FIND_PACKAGE_PREFER_CONFIG true)

if(NOT TARGET gfsio_4)
find_package(gfsio REQUIRED)
endif()

if(NOT TARGET sfcio_4)
find_package(sfcio REQUIRED)
endif()

if(NOT TARGET w3nco_d)
find_package(w3nco REQUIRED)
endif()

if(NOT TARGET landsfcutil_d)
find_package(landsfcutil REQUIRED)
endif()

if(NOT TARGET bacio_4)
find_package(bacio REQUIRED)
endif()

if(NOT TARGET nemsio)
find_package(nemsio REQUIRED)
endif()

if(NOT TARGET nemsiogfs)
find_package(nemsiogfs REQUIRED)
endif()

if(NOT TARGET sigio_4)
find_package(sigio REQUIRED)
endif()

if(NOT TARGET sp_d)
find_package(sp REQUIRED)
endif()

if(NOT TARGET ip_d)
find_package(ip REQUIRED)
endif()

if(NOT TARGET w3emc_d)
find_package(w3emc REQUIRED)
endif()

if(NOT TARGET g2_d)
find_package(g2 REQUIRED)
endif()

# EMC requires executables in ./exec
set(exec_dir bin)
if(EMC_EXEC_DIR)
set(exec_dir exec)
endif()

add_subdirectory(sorc)
32 changes: 32 additions & 0 deletions build_all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#! /usr/bin/env bash
set -eux

target=${target:-"NULL"}

if [[ $target == "linux.gnu" || $target == "linux.intel" ]]; then
unset -f module
else
source ./sorc/machine-setup.sh > /dev/null 2>&1
fi

export MOD_PATH
source ./modulefiles/build.$target > /dev/null 2>&1

#
# --- Build all programs.
#

rm -fr ./build
mkdir ./build
cd ./build

if [[ $target == "wcoss_cray" ]]; then
cmake .. -DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON
else
cmake .. -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_C_COMPILER=icc -DCMAKE_INSTALL_PREFIX=../ -DEMC_EXEC_DIR=ON
fi

make -j 8 VERBOSE=1
make install

exit
1 change: 1 addition & 0 deletions cmake
Submodule cmake added at f38685
4 changes: 2 additions & 2 deletions driver_scripts/driver_grid.cray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
#
#-----------------------------------------------------------------------

. $MODULESHOME/init/sh
module load PrgEnv-intel cfp-intel-sandybridge/1.1.0
source ../sorc/machine-setup.sh > /dev/null 2>&1
source ../modulefiles/build.$target
module list

#-----------------------------------------------------------------------
Expand Down
9 changes: 2 additions & 7 deletions driver_scripts/driver_grid.dell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,8 @@
#
#-----------------------------------------------------------------------

module purge
module load EnvVars/1.0.2
module load lsf/10.1
module load ips/18.0.1.163
module load impi/18.0.1
module load NetCDF/4.5.0
module load HDF5-serial/1.10.1
source ../sorc/machine-setup.sh > /dev/null 2>&1
source ../modulefiles/build.$target
module list

#-----------------------------------------------------------------------
Expand Down
8 changes: 2 additions & 6 deletions driver_scripts/driver_grid.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,8 @@

set -x

. /apps/lmod/lmod/init/sh
module purge
module load intel/18.0.5.274
module load impi/2018.0.4
module load hdf5/1.10.5
module load netcdf/4.7.0
source ../sorc/machine-setup.sh > /dev/null 2>&1
source ../modulefiles/build.$target
module list

#-----------------------------------------------------------------------
Expand Down
13 changes: 4 additions & 9 deletions driver_scripts/driver_grid.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,8 @@

set -x

. /apps/lmod/lmod/init/sh
module purge
module load intel/18.0.5.274
module load impi/2018.4.274
module load szip
module load hdf5
module load netcdf/4.2.1.1
source ../sorc/machine-setup.sh > /dev/null 2>&1
source ../modulefiles/build.$target
module list

#-----------------------------------------------------------------------
Expand Down Expand Up @@ -92,8 +87,8 @@ fi
#-----------------------------------------------------------------------

export home_dir=$SLURM_SUBMIT_DIR/..
export TMPDIR=/mnt/lfs3/projects/emcda/$LOGNAME/stmp/fv3_grid.$gtype
export out_dir=/mnt/lfs3/projects/emcda/$LOGNAME/stmp/C${res}
export TMPDIR=/lfs4/HFIP/emcda/$LOGNAME/stmp/fv3_grid.$gtype
export out_dir=/lfs4/HFIP/emcda/$LOGNAME/stmp/C${res}

#-----------------------------------------------------------------------
# Should not need to change anything below here.
Expand Down
3 changes: 1 addition & 2 deletions sorc/link_fixdirs.sh → fix/link_fixdirs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ elif [ $machine = "dell" ]; then
elif [ $machine = "hera" ]; then
FIX_DIR="/scratch1/NCEPDEV/global/glopara/fix"
elif [ $machine = "jet" ]; then
FIX_DIR="/lfs3/projects/hfv3gfs/glopara/git/fv3gfs/fix"
FIX_DIR="/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix"
fi
cd ${pwd}/../fix ||exit 8
for dir in fix_am fix_fv3 fix_orog fix_fv3_gmted2010 fix_sfc_climo; do
[[ -d $dir ]] && rm -rf $dir
$LINK $FIX_DIR/$dir .
Expand Down
22 changes: 13 additions & 9 deletions modulefiles/fv3gfs/global_chgres.hera → modulefiles/build.hera
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
#%Module#####################################################
## global_chgres component - hera
## Build and run module for Hera
#############################################################

# Loading Intel Compiler Suite
module load hpss
module load cmake/3.16.1
module load intel/18.0.5.274
module load impi/2018.0.4

# Loding nceplibs modules
module use -a $MOD_PATH
module load sigio/2.1.0
module use -a /scratch2/NCEPDEV/nwprod/NCEPLIBS/modulefiles
module load prod_util/1.1.0
module load w3nco/2.0.6
module load w3emc/2.3.0
module load sp/2.0.2
module load bacio/2.0.2
module load nemsio/2.2.3
module load nemsiogfs/2.2.0
module load bacio/2.0.2
module load sp/2.0.2
module load ip/3.0.1
module load sfcio/1.1.0
module load sigio/2.1.0
module load gfsio/1.1.0
module load nemsiogfs/2.2.0
module load landsfcutil/2.1.0
module load g2/2.5.0

module load netcdf_parallel/4.7.4
module load esmf/8.0.0_ParallelNetCDF

set FCMP ifort
export WGRIB2_ROOT="/scratch1/NCEPDEV/da/George.Gayno/noscrub/wgrib2"
30 changes: 30 additions & 0 deletions modulefiles/build.jet
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#%Module#####################################################
## Build and run module for Jet
#############################################################

module use /lfs4/HFIP/hfv3gfs/nwprod/NCEPLIBS/modulefiles
module load cmake/3.16.1
module load intel/18.0.5.274
module load impi/2018.4.274
module load szip/2.1
module load hdf5/1.10.4
module load netcdf/4.6.1
export NETCDF="/apps/netcdf/4.6.1/intel/18.0.5.274"
module load w3nco/v2.0.6
module load w3emc/v2.2.0
module load sp/v2.0.2
module load ip/v3.0.0
module load bacio/v2.0.2
module load sigio/v2.1.0
module load sfcio/v1.0.0
module load nemsio/v2.2.3
module load nemsiogfs/v2.0.1
module load gfsio/v1.1.0
module load landsfcutil/v2.1.0
module load g2/v3.1.0

# Use DTCs version of esmf v8. POC Dom H.
module use -a /lfs4/HFIP/hfv3gfs/software/modulefiles/intel-18.0.5.274/impi-2018.4.274
module load esmf/8.0.0

export WGRIB2_ROOT="/lfs4/HFIP/hwrfv3/Jili.Dong/wgrib2-2.0.8/grib2/lib"
31 changes: 31 additions & 0 deletions modulefiles/build.orion
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#############################################################
## Build module for Orion
#############################################################

module load cmake/3.15.4
module load intel/2020
module load impi/2020

module use -a /apps/contrib/NCEPLIBS/orion/modulefiles
module load w3nco/2.1.0
module load nemsio/2.3.0
module load bacio/2.2.0
module load sp/2.1.0
module load sfcio/1.2.0
module load sigio/2.2.0
module load gfsio/1.2.0
module load w3emc/2.5.0
module load ip/3.1.0
module load nemsiogfs/2.3.0
module load landsfcutil/2.2.0

# George V's version.
module use -a /apps/contrib/NCEPLIBS/lib/modulefiles
module load g2-intel-sandybridge/2.5.0

export Jasper_ROOT="/apps/jasper-1.900.1"

module load netcdf/4.7.2-parallel
module load esmf/8.0.0_ParallelNetCDF

export WGRIB2_ROOT="/work/noaa/da/ggayno/save/wgrib2"
40 changes: 40 additions & 0 deletions modulefiles/build.wcoss_cray
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#%Module#####################################################
## Build and run module for WCOSS-Cray
#############################################################

module load prod_util/1.1.0
module load hpss/4.1.0.3
module load xt-lsfhpc/9.1.3
module load cfp-intel-sandybridge/1.1.0
module load cmake/3.16.2
module load PrgEnv-intel/5.2.56
module rm intel
module load intel/16.3.210
module load cray-mpich/7.2.0
module load craype-haswell
module load alps/5.2.4-2.0502.9822.32.1.ari
module load cray-netcdf/4.3.3.1
module load cray-hdf5/1.8.14
module load w3nco-intel/2.0.6
module load nemsio-intel/2.2.3
module load bacio-intel/2.0.2
module load sp-intel/2.0.2
module load ip-intel/3.0.0
module load sigio-intel/2.1.0
module load sfcio-intel/1.0.0
module load landsfcutil-intel/2.1.0
module load gfsio-intel/1.1.0
module load w3emc-intel/2.2.0
module load nemsiogfs-intel/2.0.1
module load g2-intel/2.5.0
export ZLIB_ROOT=/usrx/local/prod/zlib/1.2.7/intel/haswell
export PNG_ROOT=/usrx/local/prod//png/1.2.49/intel/haswell
export Jasper_ROOT=/usrx/local/prod/jasper/1.900.1/intel/haswell

module use /gpfs/hps3/emc/nems/noscrub/emc.nemspara/soft/modulefiles
module load esmf/8.0.0
export NETCDF=/opt/cray/netcdf/4.3.3.1/INTEL/14.0
module rm gcc
module load gcc/6.3.0

export WGRIB2_ROOT=/gpfs/hps3/emc/global/noscrub/George.Gayno/wgrib2
Loading

0 comments on commit 8f18239

Please sign in to comment.