Skip to content

Commit

Permalink
cmake in the FV3 dycore (ufs-community#812)
Browse files Browse the repository at this point in the history
* Move the CMake build of the dycore from fv3atm into GFDL_atmos_cubed_sphere.
* Updates for S4.

Co-authored-by: David Huber <[email protected]>
  • Loading branch information
aerorahul and DavidHuber-NOAA authored Sep 23, 2021
1 parent 814470c commit f04a30c
Show file tree
Hide file tree
Showing 24 changed files with 1,909 additions and 1,741 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ message("CMEPS ............ ${CMEPS}")
###############################################################################
set(32BIT OFF CACHE BOOL "Enable 32BIT (single precision arithmetic in dycore)")
set(AVX2 ON CACHE BOOL "Enable AVX2 instruction set")
set(AVX OFF CACHE BOOL "Enable AVX-I instruction set")
set(SIMDMULTIARCH OFF CACHE BOOL "Enable multi-target SIMD instruction sets")
set(DEBUG OFF CACHE BOOL "Enable DEBUG mode")
set(DEBUG_LINKMPI ON CACHE BOOL "Enable linkmpi option when DEBUG mode is on")
Expand Down
2 changes: 1 addition & 1 deletion FV3
4 changes: 4 additions & 0 deletions cmake/Intel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ else()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -axSSE4.2,CORE-AVX2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -axSSE4.2,CORE-AVX2")
set(CMAKE_Fortran_FLAGS_OPT "-no-prec-div -no-prec-sqrt -axSSE4.2,CORE-AVX2")
elseif(AVX)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -march=core-avx-i")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=core-avx-i")
set(CMAKE_Fortran_FLAGS_OPT "-no-prec-div -no-prec-sqrt -xCORE-AVX-I")
endif()
endif()

Expand Down
4 changes: 4 additions & 0 deletions cmake/configure_s4.intel.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(INLINE_POST ON CACHE BOOL "Enable inline post" FORCE)
set(AVX2 OFF CACHE BOOL "Enable AVX2 instruction set" FORCE)
set(AVX ON CACHE BOOL "Enable AVX2 instruction set" FORCE)
set(PARALLEL_NETCDF ON CACHE BOOL "Enable parallel NetCDF" FORCE)
45 changes: 12 additions & 33 deletions modulefiles/ufs_s4.intel
Original file line number Diff line number Diff line change
@@ -1,41 +1,20 @@
#%Module######################################################################
##
## NEMS FV3 Prerequisites: S4
#%Module

proc ModulesHelp {} {
puts stderr "\tcit - loads modules required for building and running FV3 under NEMS on S4"
puts stderr "\tcit - loads modules required for building and running UFS Model on S4"
}

module-whatis "loads NEMS FV3 prerequisites for S4"
module-whatis "loads UFS Model prerequisites for S4"

# NOTE: the "module purge" and loading of the module command are
# handled by the module-setup.sh (or .csh) script.

##
## load programming environment
## this typically includes compiler, MPI and job scheduler
##
module load license_intel/S4
module load intel/18.0.3
module load hdf/4.2.14
module load hdf5/1.8.21
module load netcdf4/4.6.2
module use /data/prod/hpc-stack/modulefiles/stack
module load hpc/1.1.0
module load hpc-intel/18.0.4
module load hpc-impi/18.0.4

##
## load nwprod libraries
##
module use -a /data/prod/ncep_libs/intel/18.0.3/modulefiles
module load bacio/v2.0.2
module load sp/v2.0.2
module load ip/v3.0.0
module load w3nco/v2.0.6
module load w3emc/v2.3.0
module load nemsio/v2.2.3
module load g2/v3.1.0
module load g2tmpl/v1.5.0
module load crtm/v2.3.0
module load jasper/v1.900.1
module load png/v1.2.44
module load z/v1.2.6
module load ufs_common

module load esmf/v8.0.0
setenv CC mpiicc
setenv CXX mpiicpc
setenv FC mpiifort
setenv CMAKE_Platform s4.intel
21 changes: 21 additions & 0 deletions modulefiles/ufs_s4.intel_debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#%Module

proc ModulesHelp {} {
puts stderr "\tcit - loads modules required for building and running UFS Model on S4"
}

module-whatis "loads UFS Model prerequisites for S4"


module load license_intel/S4
module use /data/prod/hpc-stack/modulefiles/stack
module load hpc/1.1.0
module load hpc-intel/18.0.4
module load hpc-impi/18.0.4

module load ufs_common_debug

setenv CC mpiicc
setenv CXX mpiicpc
setenv FC mpiifort
setenv CMAKE_Platform s4.intel
Loading

0 comments on commit f04a30c

Please sign in to comment.