diff --git a/CMakeLists.txt b/CMakeLists.txt index 762f296b..10188840 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15) file(STRINGS "VERSION" pVersion) -project(grib_util VERSION ${pVersion} LANGUAGES C Fortran) +project(gributil VERSION ${pVersion} LANGUAGES C Fortran) option(OPENMP "use OpenMP threading" OFF) @@ -19,6 +19,12 @@ if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Intel|GNU|Clang|AppleClang)$") message(WARNING "Compiler not officially supported: ${CMAKE_C_COMPILER_ID}") endif() +if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel|GNU)$") + message(WARNING "Compiler not officially supported: ${CMAKE_Fortran_COMPILER_ID}") +endif() + +include(GNUInstallDirs) + if(OPENMP) find_package(OpenMP REQUIRED COMPONENTS Fortran) endif() @@ -27,10 +33,10 @@ find_package(Jasper REQUIRED) find_package(PNG REQUIRED) find_package(ZLIB REQUIRED) -find_package(w3nco CONFIG REQUIRED) -find_package(g2 CONFIG REQUIRED) -find_package(bacio CONFIG REQUIRED) -find_package(ip CONFIG REQUIRED) -find_package(sp CONFIG REQUIRED) +find_package(w3nco REQUIRED) +find_package(g2 REQUIRED) +find_package(bacio REQUIRED) +find_package(ip REQUIRED) +find_package(sp REQUIRED) add_subdirectory(sorc) diff --git a/README.install b/README.install old mode 100755 new mode 100644 diff --git a/modulefiles/build_grib_util/cray/1.1.0 b/modulefiles/build_grib_util/cray/1.1.0 deleted file mode 100755 index 84148e92..00000000 --- a/modulefiles/build_grib_util/cray/1.1.0 +++ /dev/null @@ -1,35 +0,0 @@ -#%Module###################################################################### -proc ModulesHelp { } { - puts stderr "Load modules for building GRIB utilities" -} -module-whatis "This module loads the modules and libraries for building\ - the GRIB utilities, including jasper, png, zlib, bacio, g2,\ - w3emc, w3nco, ip, sp, and iobuf." - -conflict build_grib_util - -# -# Loading required Cray system modules -# - module unload craype-haswell - module load craype-sandybridge - module load jasper-gnu-sandybridge/1.900.1 - module load png-intel-sandybridge/1.2.49 - module load zlib-intel-sandybridge/1.2.7 - -# -# MAKE SURE TO UNLOAD ALL MOUDLES IOBUF -# - module unload iobuf - -# Loading Intel-Compiled NCEP Libraries - module unload PrgEnv-cray - - module load PrgEnv-intel/5.2.56 - module switch intel/15.0.6.233 - module load bacio-intel/2.0.1 - module load w3emc-intel/2.2.0 - module load w3nco-intel/2.0.6 - module load ip-intel/3.0.0 - module load sp-intel/2.0.2 - module load g2-intel/3.1.0 diff --git a/modulefiles/build_grib_util/dell/1.1.0 b/modulefiles/build_grib_util/dell/1.1.0 deleted file mode 100755 index 27a4d1de..00000000 --- a/modulefiles/build_grib_util/dell/1.1.0 +++ /dev/null @@ -1,27 +0,0 @@ -#%Module###################################################################### -proc ModulesHelp { } { - puts stderr "Load modules for building GRIB utilities" -} -module-whatis "This module loads the modules and libraries for building\ - the GRIB utilities, including jasper, png, zlib, bacio, g2,\ - w3emc, w3nco, ip, sp, and iobuf." - -conflict build_grib_util - -# -# Loading required system modules -# - module load ips/18.0.1.163 - module load impi/18.0.1 - module load jasper/1.900.29 - module load libpng/1.2.59 - module load zlib/1.2.11 - -# Loading Intel-Compiled NCEP Libraries - module load bacio/2.0.2 - module load w3emc/2.3.0 - module load w3nco/2.0.6 - module load ip/3.0.1 - module load sp/2.0.2 - module load g2/3.1.0 - diff --git a/modulefiles/build_grib_util/ibm/1.1.0 b/modulefiles/build_grib_util/ibm/1.1.0 deleted file mode 100644 index b50cd3c1..00000000 --- a/modulefiles/build_grib_util/ibm/1.1.0 +++ /dev/null @@ -1,27 +0,0 @@ -#%Module###################################################################### -proc ModulesHelp { } { - puts stderr "Load modules for building GRIB utilities" -} -module-whatis "This module loads the modules and libraries for building\ - the GRIB utilities, including jasper, png, zlib, bacio, g2,\ - w3emc, w3nco, ip, sp, and iobuf." - -conflict build_grib_util - -# -# Loading required system modules -# - module load ics - module switch ics/15.0.6 - module load jasper/v1.900.1 - module load png/v1.2.44 - module load z/v1.2.6 - -# Loading Intel-Compiled NCEP Libraries - module load bacio/v2.0.1 - module load w3emc/v2.2.0 - module load w3nco/v2.0.6 - module load ip/v3.0.0 - module load sp/v2.0.2 - module load g2/v3.1.0 - diff --git a/modulefiles/build_grib_util/theia/1.1.0 b/modulefiles/build_grib_util/theia/1.1.0 deleted file mode 100755 index ca31803f..00000000 --- a/modulefiles/build_grib_util/theia/1.1.0 +++ /dev/null @@ -1,27 +0,0 @@ -#%Module###################################################################### -proc ModulesHelp { } { - puts stderr "Load modules for building GRIB utilities" -} -module-whatis "This module loads the modules and libraries for building\ - the GRIB utilities, including jasper, png, zlib, bacio, g2,\ - w3emc, w3nco, ip, sp, and iobuf." - -conflict build_grib_util - -# -# Loading required system modules -# -module use -a /scratch3/NCEPDEV/nwprod/lib/modulefiles - - module load intel/18.1.163 - module load jasper/v1.900.1 - module load png/v1.2.44 - module load z/v1.2.6 - -# Loading Intel-Compiled NCEP Libraries on THEIA - module load bacio/v2.0.2 - module load w3emc/v2.2.0 - module load w3nco/v2.0.6 - module load ip/v3.0.0 - module load sp/v2.0.2 - module load g2/v3.1.0 diff --git a/modulefiles/build_wgrib2/cray/2.0.7 b/modulefiles/build_wgrib2/cray/2.0.7 deleted file mode 100755 index 17dbadef..00000000 --- a/modulefiles/build_wgrib2/cray/2.0.7 +++ /dev/null @@ -1,41 +0,0 @@ -#%Module###################################################################### - -proc ModulesHelp { } { - puts stderr "Set environment veriables for wgrib2" - puts stderr "This module initializes the users environment" - puts stderr "to build the wgrib2 for WCOSS production.\n" -} -module-whatis "wgrib2" - -setenv CC gcc -setenv FC gfortran - -# -# Loading required Cray system modules -# - module unload craype-haswell - module load craype-sandybridge - module load jasper-gnu-sandybridge/1.900.1 - module load png-intel-sandybridge/1.2.49 - module load zlib-intel-sandybridge/1.2.7 - module unload NetCDF-intel-haswell/3.6.3 - module load NetCDF-gnu-sandybridge/4.2 - module load HDF5-serial-gnu-sandybridge/1.8.9 - -# -# MAKE SURE TO UNLOAD ALL MOUDLES IOBUF -# - module unload iobuf - -# Loading Intel-Compiled NCEP Libraries - module unload PrgEnv-cray - - module load PrgEnv-intel/5.2.56 - module switch intel/15.0.6.233 - module load gcc/6.3.0 - module load bacio-intel/2.0.1 - module load w3emc-intel/2.2.0 - module load w3nco-intel/2.0.6 - module load ip-intel/3.0.0 - module load sp-intel/2.0.2 - module load g2c-intel/1.5.0 diff --git a/modulefiles/build_wgrib2/dell/2.0.7 b/modulefiles/build_wgrib2/dell/2.0.7 deleted file mode 100755 index 65024bdd..00000000 --- a/modulefiles/build_wgrib2/dell/2.0.7 +++ /dev/null @@ -1,23 +0,0 @@ -#%Module###################################################################### - -proc ModulesHelp { } { - puts stderr "Set environment veriables for wgrib2" - puts stderr "This module initializes the users environment" - puts stderr "to build the wgrib2 for WCOSS production.\n" -} -module-whatis "wgrib2" - -setenv CC icc -setenv FC ifort -setenv COMP_SYS intel_linux - -module load ips/18.0.1.163 -module load HDF5-serial/1.8.20 -module load NetCDF/4.5.0 -module load jasper/1.900.1 -module load libpng/1.2.59 -module load zlib/1.2.11 -module load ip/3.0.1 -module load sp/2.0.2 -module load g2c/1.5.0 - diff --git a/modulefiles/build_wgrib2/ibm/2.0.7 b/modulefiles/build_wgrib2/ibm/2.0.7 deleted file mode 100755 index 7ffc723b..00000000 --- a/modulefiles/build_wgrib2/ibm/2.0.7 +++ /dev/null @@ -1,28 +0,0 @@ -#%Module###################################################################### - -proc ModulesHelp { } { - puts stderr "Set environment veriables for wgrib2" - puts stderr "This module initializes the users environment" - puts stderr "to build the wgrib2 for WCOSS production.\n" -} -module-whatis "wgrib2" - -setenv CC gcc -setenv FC gfortran - -# -# Loading required system modules -# - module load ics - module switch ics/15.0.6 - module load jasper/v1.900.1 - module load png/v1.2.44 - module load z/v1.2.6 - -# Loading Intel-Compiled NCEP Libraries - module load bacio/v2.0.1 - module load w3emc/v2.2.0 - module load w3nco/v2.0.6 - module load ip/v3.0.0 - module load sp/v2.0.2 - module load g2c/v1.5.0 diff --git a/modulefiles/build_wgrib2/theia/2.0.7 b/modulefiles/build_wgrib2/theia/2.0.7 deleted file mode 100644 index 5bf8059e..00000000 --- a/modulefiles/build_wgrib2/theia/2.0.7 +++ /dev/null @@ -1,27 +0,0 @@ -#%Module###################################################################### - -proc ModulesHelp { } { - puts stderr "Set environment veriables for wgrib2" - puts stderr "This module initializes the users environment" - puts stderr "to build the wgrib2 for WCOSS production.\n" -} -module-whatis "wgrib2" - - setenv CC gcc - setenv FC gfortran - - module use -a /scratch3/NCEPDEV/nwprod/lib/modulefiles - - module load gcc/6.2.0 - module load jasper/v1.900.1 - module load png/v1.2.44 - module load z/v1.2.6 - -## module load hdf5/1.8.14 -## module load netcdf/4.4.0 - module load bacio/v2.0.2 - module load w3emc/v2.2.0 - module load w3nco/v2.0.6 - module load ip/v3.0.0 - module load sp/v2.0.2 - module load g2c/v1.5.0 diff --git a/modulefiles/grib_util/cray/1.1.1 b/modulefiles/grib_util/cray/1.1.1 deleted file mode 100755 index e1d02a33..00000000 --- a/modulefiles/grib_util/cray/1.1.1 +++ /dev/null @@ -1,34 +0,0 @@ -#%Module###################################################################### -############################################################# -## First.Last@noaa.gov -## ORGANIZATION -## Grib utilities -############################################################# -proc ModulesHelp { } { -puts stderr "Set environment veriables for GRIB utilities" -} -module-whatis "This module sets the environment variables for \ - nco production grib utilities: cnvgrib, copygb \ - copygb2, degrib2, grb2index, grbindex, grib2grib \ - tocgrib, tocgrib2, tocgrib2super, wgrib, wgrib2" - -conflict grib_util - -set ver v1.1.1 -set envir prod - -set HOMEgrib /gpfs/hps/nco/ops/nw${envir}/grib_util.$ver -set EXECgrib ${HOMEgrib}/exec - -setenv CNVGRIB $EXECgrib/cnvgrib -setenv COPYGB $EXECgrib/copygb -setenv COPYGB2 $EXECgrib/copygb2 -setenv DEGRIB2 $EXECgrib/degrib2 -setenv GRB2INDEX $EXECgrib/grb2index -setenv GRBINDEX $EXECgrib/grbindex -setenv GRIB2GRIB $EXECgrib/grib2grib -setenv TOCGRIB $EXECgrib/tocgrib -setenv TOCGRIB2 $EXECgrib/tocgrib2 -setenv TOCGRIB2SUPER $EXECgrib/tocgrib2super -setenv WGRIB $EXECgrib/wgrib -setenv WGRIB2 $EXECgrib/wgrib2 diff --git a/modulefiles/grib_util/cray/1.1.1_nceplibs b/modulefiles/grib_util/cray/1.1.1_nceplibs deleted file mode 100755 index b0ba691c..00000000 --- a/modulefiles/grib_util/cray/1.1.1_nceplibs +++ /dev/null @@ -1,35 +0,0 @@ -#%Module###################################################################### -############################################################# -## First.Last@noaa.gov -## ORGANIZATION -## Grib utilities -############################################################# -proc ModulesHelp { } { -puts stderr "Set environment veriables for GRIB utilities" -} -module-whatis "This module sets the environment variables for \ - nco production grib utilities: cnvgrib, copygb \ - copygb2, degrib2, grb2index, grbindex, grib2grib \ - tocgrib, tocgrib2, tocgrib2super, wgrib, wgrib2" - -conflict grib_util - -set ver v1.1.1 -set envir prod - -# set HOMEgrib /gpfs/hps/nco/ops/nw${envir}/grib_util.$ver -set HOMEgrib /usrx/local/nceplibs/grib_util.$ver -set EXECgrib ${HOMEgrib}/exec - -setenv CNVGRIB $EXECgrib/cnvgrib -setenv COPYGB $EXECgrib/copygb -setenv COPYGB2 $EXECgrib/copygb2 -setenv DEGRIB2 $EXECgrib/degrib2 -setenv GRB2INDEX $EXECgrib/grb2index -setenv GRBINDEX $EXECgrib/grbindex -setenv GRIB2GRIB $EXECgrib/grib2grib -setenv TOCGRIB $EXECgrib/tocgrib -setenv TOCGRIB2 $EXECgrib/tocgrib2 -setenv TOCGRIB2SUPER $EXECgrib/tocgrib2super -setenv WGRIB $EXECgrib/wgrib -setenv WGRIB2 $EXECgrib/wgrib2 diff --git a/modulefiles/grib_util/dell/1.1.1 b/modulefiles/grib_util/dell/1.1.1 deleted file mode 100644 index 55705253..00000000 --- a/modulefiles/grib_util/dell/1.1.1 +++ /dev/null @@ -1,36 +0,0 @@ -#%Module###################################################################### -############################################################# -## First.Last@noaa.gov -## ORGANIZATION -## Grib utilities -############################################################# -proc ModulesHelp { } { -puts stderr "Set environment veriables for GRIB utilities" -} -module-whatis "This module sets the environment variables for \ - nco production grib utilities: cnvgrib, copygb \ - copygb2, degrib2, grb2index, grbindex, grib2grib \ - tocgrib, tocgrib2, tocgrib2super, wgrib, wgrib2" - -conflict grib_util - -set ver v1.1.1 -set envir prod - -set HOMEgrib /gpfs/dell1/nco/ops/nw${envir}/grib_util.$ver -set EXECgrib ${HOMEgrib}/exec - -module prereq ips/18.0.1.163 - -setenv CNVGRIB $EXECgrib/cnvgrib -setenv COPYGB $EXECgrib/copygb -setenv COPYGB2 $EXECgrib/copygb2 -setenv DEGRIB2 $EXECgrib/degrib2 -setenv GRB2INDEX $EXECgrib/grb2index -setenv GRBINDEX $EXECgrib/grbindex -setenv GRIB2GRIB $EXECgrib/grib2grib -setenv TOCGRIB $EXECgrib/tocgrib -setenv TOCGRIB2 $EXECgrib/tocgrib2 -setenv TOCGRIB2SUPER $EXECgrib/tocgrib2super -setenv WGRIB $EXECgrib/wgrib -setenv WGRIB2 $EXECgrib/wgrib2 diff --git a/modulefiles/grib_util/dell/1.1.1_nceplibs b/modulefiles/grib_util/dell/1.1.1_nceplibs deleted file mode 100755 index b9d6c8ac..00000000 --- a/modulefiles/grib_util/dell/1.1.1_nceplibs +++ /dev/null @@ -1,44 +0,0 @@ -#%Module###################################################################### -############################################################# -## First.Last@noaa.gov -## ORGANIZATION -## Grib utilities -############################################################# -proc ModulesHelp { } { -puts stderr "Set environment veriables for GRIB utilities" -} -module-whatis "This module sets the environment variables for \ - nco production grib utilities: cnvgrib, copygb \ - copygb2, degrib2, grb2index, grbindex, grib2grib \ - tocgrib, tocgrib2, tocgrib2super, wgrib, wgrib2" - -conflict grib_util - -set ver v1.1.1 -set envir prod - -global ModulesCurrentModulefile -if { [ regexp {^(.*)/modulefiles/.*$} $ModulesCurrentModulefile -> NCEPLIBS ] != 1 } { - puts stderr "Error: unable to determine library's root directory" - break -} - -# set HOMEgrib /gpfs/dell1/nco/ops/nw${envir}/grib_util.$ver -set HOMEgrib $NCEPLIBS/lib/grib_util/$ver - -set EXECgrib ${HOMEgrib}/exec - -module prereq ips/18.0.1.163 - -setenv CNVGRIB $EXECgrib/cnvgrib -setenv COPYGB $EXECgrib/copygb -setenv COPYGB2 $EXECgrib/copygb2 -setenv DEGRIB2 $EXECgrib/degrib2 -setenv GRB2INDEX $EXECgrib/grb2index -setenv GRBINDEX $EXECgrib/grbindex -setenv GRIB2GRIB $EXECgrib/grib2grib -setenv TOCGRIB $EXECgrib/tocgrib -setenv TOCGRIB2 $EXECgrib/tocgrib2 -setenv TOCGRIB2SUPER $EXECgrib/tocgrib2super -setenv WGRIB $EXECgrib/wgrib -setenv WGRIB2 $EXECgrib/wgrib2 diff --git a/modulefiles/grib_util/ibm/v1.1.0 b/modulefiles/grib_util/ibm/v1.1.0 deleted file mode 100644 index df97e047..00000000 --- a/modulefiles/grib_util/ibm/v1.1.0 +++ /dev/null @@ -1,37 +0,0 @@ -#%Module###################################################################### -############################################################# -## First.Last@noaa.gov -## ORGANIZATION -## Grib utilities -############################################################# -proc ModulesHelp { } { -puts stderr "Set environment veriables for GRIB utilities" -} -module-whatis "This module sets the environment variables for \ - nco production grib utilities: cnvgrib, copygb \ - copygb2, degrib2, grb2index, grbindex, grib2grib \ - tocgrib, tocgrib2, tocgrib2super, wgrib, wgrib2" - -conflict grib_util - -set ver v1.1.0 -set envir prod - -set HOMEgrib /nw${envir}2/grib_util.$ver -set EXECgrib ${HOMEgrib}/exec - -module load ics/15.0.6 -module load NetCDF/4.2/serial - -setenv CNVGRIB $EXECgrib/cnvgrib -setenv COPYGB $EXECgrib/copygb -setenv COPYGB2 $EXECgrib/copygb2 -setenv DEGRIB2 $EXECgrib/degrib2 -setenv GRB2INDEX $EXECgrib/grb2index -setenv GRBINDEX $EXECgrib/grbindex -setenv GRIB2GRIB $EXECgrib/grib2grib -setenv TOCGRIB $EXECgrib/tocgrib -setenv TOCGRIB2 $EXECgrib/tocgrib2 -setenv TOCGRIB2SUPER $EXECgrib/tocgrib2super -setenv WGRIB $EXECgrib/wgrib -setenv WGRIB2 $EXECgrib/wgrib2 diff --git a/modulefiles/grib_util/ibm/v1.1.1 b/modulefiles/grib_util/ibm/v1.1.1 deleted file mode 100644 index 35f6d511..00000000 --- a/modulefiles/grib_util/ibm/v1.1.1 +++ /dev/null @@ -1,37 +0,0 @@ -#%Module###################################################################### -############################################################# -## First.Last@noaa.gov -## ORGANIZATION -## Grib utilities -############################################################# -proc ModulesHelp { } { -puts stderr "Set environment veriables for GRIB utilities" -} -module-whatis "This module sets the environment variables for \ - nco production grib utilities: cnvgrib, copygb \ - copygb2, degrib2, grb2index, grbindex, grib2grib \ - tocgrib, tocgrib2, tocgrib2super, wgrib, wgrib2" - -conflict grib_util - -set ver v1.1.1 -set envir prod - -set HOMEgrib /nw${envir}2/grib_util.$ver -set EXECgrib ${HOMEgrib}/exec - -module load ics/15.0.6 -module load NetCDF/4.2/serial - -setenv CNVGRIB $EXECgrib/cnvgrib -setenv COPYGB $EXECgrib/copygb -setenv COPYGB2 $EXECgrib/copygb2 -setenv DEGRIB2 $EXECgrib/degrib2 -setenv GRB2INDEX $EXECgrib/grb2index -setenv GRBINDEX $EXECgrib/grbindex -setenv GRIB2GRIB $EXECgrib/grib2grib -setenv TOCGRIB $EXECgrib/tocgrib -setenv TOCGRIB2 $EXECgrib/tocgrib2 -setenv TOCGRIB2SUPER $EXECgrib/tocgrib2super -setenv WGRIB $EXECgrib/wgrib -setenv WGRIB2 $EXECgrib/wgrib2 diff --git a/modulefiles/grib_util/theia/v1.1.1 b/modulefiles/grib_util/theia/v1.1.1 deleted file mode 100755 index e4943c6a..00000000 --- a/modulefiles/grib_util/theia/v1.1.1 +++ /dev/null @@ -1,35 +0,0 @@ -#%Module###################################################################### -############################################################# -## First.Last@noaa.gov -## ORGANIZATION -## Grib utilities -############################################################# -proc ModulesHelp { } { -puts stderr "Set environment veriables for GRIB utilities" -} -module-whatis "This module sets the environment variables for \ - nco production grib utilities: cnvgrib, copygb \ - copygb2, degrib2, grb2index, grbindex, grib2grib \ - tocgrib, tocgrib2, tocgrib2super, wgrib, wgrib2" - -conflict grib_util -conflict grib_util/v1.1.1 - -set ver v1.1.1 -set envir prod - -set HOMEgrib /scratch3/NCEPDEV/nw${envir}/grib_util.$ver -set EXECgrib ${HOMEgrib}/exec - -setenv CNVGRIB $EXECgrib/cnvgrib -setenv COPYGB $EXECgrib/copygb -setenv COPYGB2 $EXECgrib/copygb2 -setenv DEGRIB2 $EXECgrib/degrib2 -setenv GRB2INDEX $EXECgrib/grb2index -setenv GRBINDEX $EXECgrib/grbindex -setenv GRIB2GRIB $EXECgrib/grib2grib -setenv TOCGRIB $EXECgrib/tocgrib -setenv TOCGRIB2 $EXECgrib/tocgrib2 -setenv TOCGRIB2SUPER $EXECgrib/tocgrib2super -setenv WGRIB $EXECgrib/wgrib -setenv WGRIB2 $EXECgrib/wgrib2 diff --git a/sorc/cnvgrib.fd/CMakeLists.txt b/sorc/cnvgrib.fd/CMakeLists.txt index 168d6ebf..6e2b23aa 100644 --- a/sorc/cnvgrib.fd/CMakeLists.txt +++ b/sorc/cnvgrib.fd/CMakeLists.txt @@ -1,7 +1,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") endif() diff --git a/sorc/copygb.fd/CMakeLists.txt b/sorc/copygb.fd/CMakeLists.txt index fab4476b..f035bb45 100644 --- a/sorc/copygb.fd/CMakeLists.txt +++ b/sorc/copygb.fd/CMakeLists.txt @@ -1,7 +1,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g -r8 -auto") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g -fdefault-real-8") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") endif() @@ -10,12 +10,10 @@ set(fortran_src copygb.F) set(exe_name copygb) add_executable(${exe_name} ${fortran_src}) - +target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 w3nco::w3nco_4 ip::ip_4 sp::sp_4) if(OpenMP_Fortran_FOUND) target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) endif() -target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 w3nco::w3nco_4 ip::ip_4 sp::sp_4) - install(TARGETS ${exe_name} RUNTIME DESTINATION bin) diff --git a/sorc/copygb2.fd/CMakeLists.txt b/sorc/copygb2.fd/CMakeLists.txt index cdaf89e5..eefd37a7 100644 --- a/sorc/copygb2.fd/CMakeLists.txt +++ b/sorc/copygb2.fd/CMakeLists.txt @@ -1,7 +1,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g -r8 -auto -convert big_endian -fpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g -fdefault-real-8 -fconvert=big-endian -cpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") endif() @@ -20,14 +20,7 @@ set(fortran_src polatev3.f90) set(exe_name copygb2) - add_executable(${exe_name} ${fortran_src}) - -if(OpenMP_Fortran_FOUND) - target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) -endif() - - target_link_libraries( ${exe_name} g2::g2_d @@ -38,4 +31,8 @@ target_link_libraries( ip::ip_d sp::sp_d) +if(OpenMP_Fortran_FOUND) + target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) +endif() + install(TARGETS ${exe_name} RUNTIME DESTINATION bin) diff --git a/sorc/degrib2.fd/CMakeLists.txt b/sorc/degrib2.fd/CMakeLists.txt index cb08dc4a..a05158bb 100644 --- a/sorc/degrib2.fd/CMakeLists.txt +++ b/sorc/degrib2.fd/CMakeLists.txt @@ -1,7 +1,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g -convert big_endian -axCORE-AVX2 -fpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g -fconvert=big-endian -cpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") endif() diff --git a/sorc/grb2index.fd/CMakeLists.txt b/sorc/grb2index.fd/CMakeLists.txt index 74b8432a..1b04c846 100644 --- a/sorc/grb2index.fd/CMakeLists.txt +++ b/sorc/grb2index.fd/CMakeLists.txt @@ -1,7 +1,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g -convert big_endian -axCORE-AVX2 -fpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g -fconvert=big-endian -cpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") endif() diff --git a/sorc/grbindex.fd/CMakeLists.txt b/sorc/grbindex.fd/CMakeLists.txt index 23744b9b..c06086f6 100644 --- a/sorc/grbindex.fd/CMakeLists.txt +++ b/sorc/grbindex.fd/CMakeLists.txt @@ -2,7 +2,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g -assume noold_ldout_format -convert big_endian -axCORE-AVX2 -fpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g -fconvert=big-endian -cpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") endif() diff --git a/sorc/grib2grib.fd/CMakeLists.txt b/sorc/grib2grib.fd/CMakeLists.txt index 751f901c..ea8c0c2f 100644 --- a/sorc/grib2grib.fd/CMakeLists.txt +++ b/sorc/grib2grib.fd/CMakeLists.txt @@ -2,7 +2,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g -i8 -r8 -assume noold_ldout_format -axCORE-AVX2 -fpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g -fdefault-integer-8 -fdefault-real-8 -cpp") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") endif() diff --git a/sorc/tocgrib.fd/CMakeLists.txt b/sorc/tocgrib.fd/CMakeLists.txt index 27b56e19..6f84b105 100644 --- a/sorc/tocgrib.fd/CMakeLists.txt +++ b/sorc/tocgrib.fd/CMakeLists.txt @@ -1,7 +1,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g -assume noold_ldout_format -axCORE-AVX2") set(CMAKE_Fortran_FLAGS_RELEASE "-O2") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g") set(CMAKE_Fortran_FLAGS_RELEASE "-O2") endif() diff --git a/sorc/tocgrib2.fd/CMakeLists.txt b/sorc/tocgrib2.fd/CMakeLists.txt index 2354233a..12658dc9 100644 --- a/sorc/tocgrib2.fd/CMakeLists.txt +++ b/sorc/tocgrib2.fd/CMakeLists.txt @@ -1,7 +1,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g -axCORE-AVX2") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") endif() diff --git a/sorc/tocgrib2super.fd/CMakeLists.txt b/sorc/tocgrib2super.fd/CMakeLists.txt index 9cf39165..3ad6dc62 100644 --- a/sorc/tocgrib2super.fd/CMakeLists.txt +++ b/sorc/tocgrib2super.fd/CMakeLists.txt @@ -1,7 +1,7 @@ if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g -assume noold_ldout_format -axCORE-AVX2") set(CMAKE_Fortran_FLAGS_RELEASE "-O2") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-g") set(CMAKE_Fortran_FLAGS_RELEASE "-O2") endif()