diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..1c804e35 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +build/ +exec/ +install/ +log* + +*.mod +*.[aox] + +*.sw[a-p] +~ +.DS_Store + diff --git a/sorc/CMakeLists.txt b/CMakeLists.txt similarity index 64% rename from sorc/CMakeLists.txt rename to CMakeLists.txt index c684722a..3ecee197 100644 --- a/sorc/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,20 +1,14 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.19) -# Get the version from the VERSION file. -#file(STRINGS "VERSION" pVersion) -set(pVersion 1.0.0) +project(gfsutils + VERSION 1.0.0 + LANGUAGES Fortran) -project( - workflow_utils - VERSION ${pVersion} - LANGUAGES Fortran) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +set(CMAKE_DIRECTORY_LABELS ${PROJECT_NAME}) include(GNUInstallDirs) -# User options. -option(OPENMP "use OpenMP threading" ON) - # Build type if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") message(STATUS "Setting build type to 'Release' as none was specified.") @@ -25,27 +19,22 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)$") "MinSizeRel" "RelWithDebInfo") endif() -# Set compiler flags. -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback") - set(CMAKE_Fortran_FLAGS_RELEASE "-O3") - 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)$") - set(CMAKE_Fortran_FLAGS "${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") +if(NOT CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Intel)$") + message(WARNING "${CMAKE_Fortran_COMPILER_ID} is not supported.") endif() +# User options. +option(OPENMP "use OpenMP threading" ON) + # Find packages. find_package(MPI REQUIRED) find_package(NetCDF REQUIRED Fortran) - if(OPENMP) find_package(OpenMP REQUIRED COMPONENTS Fortran) endif() +# NCEPLibs dependencies. find_package(bacio REQUIRED) -find_package(w3nco REQUIRED) find_package(w3emc REQUIRED) find_package(sp REQUIRED) find_package(ip REQUIRED) @@ -56,26 +45,29 @@ find_package(g2 REQUIRED) find_package(bufr REQUIRED) find_package(landsfcutil REQUIRED) find_package(wgrib2 REQUIRED) -find_package(gempak REQUIRED) -# find_package(gfortran REQUIRED) +#rdbfmsua.fd needs gempak and gfortran +#but gempak is so old, any hopes of a find_package(gempak) is null +#some things ought to wither and die +#find_package(gempak REQUIRED) +#find_package(gfortran REQUIRED) + +# See https://github.com/NOAA-EMC/NCEPLIBS-nemsio/pull/22 +target_link_libraries(nemsio::nemsio INTERFACE w3emc::w3emc_d bacio::bacio_4) + +# Set compiler flags. +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -traceback") + set(CMAKE_Fortran_FLAGS_RELEASE "-O3") + 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)$") + set(CMAKE_Fortran_FLAGS "${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() + +# Build and install code. +add_subdirectory(src) -add_subdirectory(enkf_chgres_recenter.fd) -add_subdirectory(enkf_chgres_recenter_nc.fd) -add_subdirectory(fv3nc2nemsio.fd) -add_subdirectory(regrid_nemsio.fd) -add_subdirectory(gaussian_sfcanl.fd) -add_subdirectory(gfs_bufr.fd) -add_subdirectory(reg2grb2.fd) -add_subdirectory(tocsbufr.fd) -add_subdirectory(fbwndgfs.fd) -add_subdirectory(vint.fd) -add_subdirectory(tave.fd) -add_subdirectory(syndat_qctropcy.fd) -add_subdirectory(syndat_maksynrc.fd) -add_subdirectory(syndat_getjtbul.fd) -add_subdirectory(supvit.fd) +# Install utility scripts. +add_subdirectory(ush) -add_subdirectory(mkgfsawps.fd) -add_subdirectory(overgridid.fd) -# add_subdirectory(rdbfmsua.fd) -add_subdirectory(webtitle.fd) diff --git a/sorc/cmake/FindNetCDF.cmake b/cmake/FindNetCDF.cmake similarity index 100% rename from sorc/cmake/FindNetCDF.cmake rename to cmake/FindNetCDF.cmake diff --git a/sorc/cmake/Findgempak.cmake b/cmake/Findgempak.cmake similarity index 100% rename from sorc/cmake/Findgempak.cmake rename to cmake/Findgempak.cmake diff --git a/sorc/cmake/Findgfortran.cmake b/cmake/Findgfortran.cmake similarity index 100% rename from sorc/cmake/Findgfortran.cmake rename to cmake/Findgfortran.cmake diff --git a/sorc/cmake/Findwgrib2.cmake b/cmake/Findwgrib2.cmake similarity index 100% rename from sorc/cmake/Findwgrib2.cmake rename to cmake/Findwgrib2.cmake diff --git a/modulefiles/gfsutils_common.lua b/modulefiles/gfsutils_common.lua new file mode 100644 index 00000000..0c36dbbd --- /dev/null +++ b/modulefiles/gfsutils_common.lua @@ -0,0 +1,37 @@ +help([[ +Load common modules to build GFS utilities on all machines +]]) + +local netcdf_ver=os.getenv("netcdf_ver") or "4.7.4" + +local bufr_ver=os.getenv("bufr_ver") or "11.7.0" +local bacio_ver=os.getenv("bacio_ver") or "2.4.1" +local w3emc_ver=os.getenv("w3emc_ver") or "2.9.2" +local sp_ver=os.getenv("sp_ver") or "2.3.3" +local ip_ver=os.getenv("ip_ver") or "3.3.3" +local sigio_ver=os.getenv("sigio_ver") or "2.3.2" +local nemsio_ver=os.getenv("nemsio_ver") or "2.5.2" +local nemsiogfs_ver=os.getenv("nemsiogfs_ver") or "2.5.3" +local wrf_io_ver=os.getenv("wrf_io_ver") or "1.2.0" +local ncio_ver=os.getenv("ncio_ver") or "1.1.2" +local g2_ver=os.getenv("g2_ver") or "3.4.5" +local landsfcutil_ver=os.getenv("landsfcutil_ver") or "2.4.1" +local gempak_ver=os.getenv("gempak_ver") or "7.14.1" +local wgrib2_ver=os.getenv("wgrib2_ver") or "2.0.8" + +load(pathJoin("netcdf", netcdf_ver)) + +load(pathJoin("bufr", bufr_ver)) +load(pathJoin("bacio", bacio_ver)) +load(pathJoin("w3emc", w3emc_ver)) +load(pathJoin("sp", sp_ver)) +load(pathJoin("ip", ip_ver)) +load(pathJoin("sigio", sigio_ver)) +load(pathJoin("sfcio", sfcio_ver)) +load(pathJoin("nemsio", nemsio_ver)) +load(pathJoin("wrf_io", wrf_io_ver)) +load(pathJoin("ncio", ncio_ver)) +load(pathJoin("g2", g2_ver)) +load(pathJoin("landsfcutil", landsfcutil_ver)) +--load(pathJoin("gempak", gempak_ver)) +load(pathJoin("wgrib2", wgrib2_ver)) diff --git a/modulefiles/gfsutils_hera.intel.lua b/modulefiles/gfsutils_hera.intel.lua new file mode 100644 index 00000000..37699aea --- /dev/null +++ b/modulefiles/gfsutils_hera.intel.lua @@ -0,0 +1,27 @@ +help([[ +Build environment for GFS utilities on Hera +]]) + +prepend_path("MODULEPATH", "/scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/modulefiles/stack") + +local hpc_ver=os.getenv("hpc_ver") or "1.1.0" +local hpc_intel_ver=os.getenv("hpc_intel_ver") or "18.0.5.274" +local hpc_impi_ver=os.getenv("hpc_impi_ver") or "2018.0.4" +local cmake_ver=os.getenv("cmake_ver") or "3.20.1" + +local jasper_ver=os.getenv("jasper_ver") or "2.0.25" +local zlib_ver=os.getenv("zlib_ver") or "1.2.11" +local libpng_ver=os.getenv("libpng_ver") or "1.6.35" + +load(pathJoin("hpc", hpc_ver)) +load(pathJoin("hpc-intel", hpc_intel_ver)) +load(pathJoin("hpc-impi", hpc_impi_ver)) +load(pathJoin("cmake", cmake_ver)) + +load(pathJoin("jasper", jasper_ver)) +load(pathJoin("zlib", zlib_ver)) +load(pathJoin("png", libpng_ver)) + +load("gfsutils_common") + +whatis("Description: GFS utilities environment on Hera with Intel Compilers") diff --git a/modulefiles/gfsutils_jet.lua b/modulefiles/gfsutils_jet.lua new file mode 100644 index 00000000..95fe31e5 --- /dev/null +++ b/modulefiles/gfsutils_jet.lua @@ -0,0 +1,27 @@ +help([[ +Build environment for S4 utilities on Jet +]]) + +prepend_path("MODULEPATH", "/lfs4/HFIP/hfv3gfs/nwprod/hpc-stack/libs/modulefiles/stack") + +local hpc_ver=os.getenv("hpc_ver") or "1.1.0" +local hpc_intel_ver=os.getenv("hpc_intel_ver") or "18.0.5.274" +local hpc_impi_ver=os.getenv("hpc_impi_ver") or "2018.4.274" +local cmake_ver=os.getenv("cmake_ver") or "3.20.1" + +local jasper_ver=os.getenv("jasper_ver") or "2.0.25" +local zlib_ver=os.getenv("zlib_ver") or "1.2.11" +local libpng_ver=os.getenv("libpng_ver") or "1.6.35" + +load(pathJoin("hpc", hpc_ver)) +load(pathJoin("hpc-intel", hpc_intel_ver)) +load(pathJoin("hpc-impi", hpc_impi_ver)) +load(pathJoin("cmake", cmake_ver)) + +load(pathJoin("jasper", jasper_ver)) +load(pathJoin("zlib", zlib_ver)) +load(pathJoin("png", libpng_ver)) + +load("gfsutils_common") + +whatis("Description: GFS utilities environment on Jet with Intel Compilers") diff --git a/modulefiles/gfsutils_orion.lua b/modulefiles/gfsutils_orion.lua new file mode 100644 index 00000000..d7054857 --- /dev/null +++ b/modulefiles/gfsutils_orion.lua @@ -0,0 +1,27 @@ +help([[ +Build environment for GFS utilities on Orion +]]) + +prepend_path("MODULEPATH", "/apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack") + +local hpc_ver=os.getenv("hpc_ver") or "1.1.0" +local hpc_intel_ver=os.getenv("hpc_intel_ver") or "2018.4" +local hpc_impi_ver=os.getenv("hpc_impi_ver") or "2018.4" +local cmake_ver=os.getenv("cmake_ver") or "3.22.1" + +local jasper_ver=os.getenv("jasper_ver") or "2.0.25" +local zlib_ver=os.getenv("zlib_ver") or "1.2.11" +local libpng_ver=os.getenv("libpng_ver") or "1.6.35" + +load(pathJoin("hpc", hpc_ver)) +load(pathJoin("hpc-intel", hpc_intel_ver)) +load(pathJoin("hpc-impi", hpc_impi_ver)) +load(pathJoin("cmake", cmake_ver)) + +load(pathJoin("jasper", jasper_ver)) +load(pathJoin("zlib", zlib_ver)) +load(pathJoin("png", libpng_ver)) + +load("gfsutils_common") + +whatis("Description: GFS utilities environment on Orion with Intel Compilers") diff --git a/modulefiles/gfsutils_s4.lua b/modulefiles/gfsutils_s4.lua new file mode 100644 index 00000000..a0395976 --- /dev/null +++ b/modulefiles/gfsutils_s4.lua @@ -0,0 +1,29 @@ +help([[ +Build environment for GFS utilities on S4 +]]) + +prepend_path("MODULEPATH", "/data/prod/hpc-stack/modulefiles/stack") + +load("license_intel") + +local hpc_ver=os.getenv("hpc_ver") or "1.1.0" +local hpc_intel_ver=os.getenv("hpc_intel_ver") or "18.0.4" +local hpc_impi_ver=os.getenv("hpc_impi_ver") or "18.0.4" +local cmake_ver=os.getenv("cmake_ver") or "3.20.1" + +local jasper_ver=os.getenv("jasper_ver") or "2.0.25" +local zlib_ver=os.getenv("zlib_ver") or "1.2.11" +local libpng_ver=os.getenv("libpng_ver") or "1.6.35" + +load(pathJoin("hpc", hpc_ver)) +load(pathJoin("hpc-intel", hpc_intel_ver)) +load(pathJoin("hpc-impi", hpc_impi_ver)) +load(pathJoin("cmake", cmake_ver)) + +load(pathJoin("jasper", jasper_ver)) +load(pathJoin("zlib", zlib_ver)) +load(pathJoin("png", libpng_ver)) + +load("gfsutils_common") + +whatis("Description: GFS utilities environment on S4 with Intel Compilers") diff --git a/modulefiles/gfsutils_wcoss2.lua b/modulefiles/gfsutils_wcoss2.lua new file mode 100644 index 00000000..e18536f4 --- /dev/null +++ b/modulefiles/gfsutils_wcoss2.lua @@ -0,0 +1,34 @@ +help([[ +Build environment for GFS utilities on WCOSS2 +]]) + +local PrgEnv_intel_ver=os.getenv("PrgEnv_intel_ver") or "8.1.0" +local intel_ver=os.getenv("intel_ver") or "19.1.3.304" +local craype_ver=os.getenv("craype_ver") or "2.7.10" +local cray_mpich_ver=os.getenv("cray_mpich_ver") or "8.1.9" +local cmake_ver= os.getenv("cmake_ver") or "3.20.2" + +local jasper_ver=os.getenv("jasper_ver") or "2.0.25" +local zlib_ver=os.getenv("zlib_ver") or "1.2.11" +local libpng_ver=os.getenv("libpng_ver") or "1.6.37" + +load(pathJoin("PrgEnv-intel", PrgEnv_intel_ver)) +load(pathJoin("intel", intel_ver)) +load(pathJoin("craype", craype_ver)) +load(pathJoin("cray-mpich", cray_mpich_ver)) +load(pathJoin("cmake", cmake_ver)) + +load(pathJoin("jasper", jasper_ver)) +load(pathJoin("zlib", zlib_ver)) +load(pathJoin("libpng", libpng_ver)) + +load("gfsutils_common") +unload("ncio") + +pushenv("HPC_OPT", "/apps/ops/para/libs") +prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/compiler/intel/19.1.3.304") +prepend_path("MODULEPATH", "/apps/ops/para/libs/modulefiles/mpi/intel/19.1.3.304/cray-mpich/8.1.7") + +load("ncio/1.1.2") + +whatis("Description: GFS utilities environment on WCOSS2 with Intel Compilers") diff --git a/modulefiles/workflow_utils.hera.lua b/modulefiles/workflow_utils.hera.lua deleted file mode 100644 index 676d84bf..00000000 --- a/modulefiles/workflow_utils.hera.lua +++ /dev/null @@ -1,35 +0,0 @@ -help([[ -Build environment for workflow utilities on Hera -]]) - -prepend_path("MODULEPATH", "/scratch2/NCEPDEV/nwprod/hpc-stack/libs/hpc-stack/modulefiles/stack") - -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-intel", "18.0.5.274")) -load(pathJoin("hpc-impi", "2018.0.4")) - -load(pathJoin("cmake", "3.20.0")) - -load(pathJoin("jasper", "2.0.25")) -load(pathJoin("zlib", "1.2.11")) -load(pathJoin("png", "1.6.35")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("bacio", "2.4.1")) -load(pathJoin("g2", "3.4.1")) -load(pathJoin("ip", "3.3.3")) -load(pathJoin("nemsio", "2.5.2")) -load(pathJoin("sp", "2.3.3")) -load(pathJoin("w3emc", "2.7.3")) -load(pathJoin("w3nco", "2.4.1")) -load(pathJoin("nemsiogfs", "2.5.3")) -load(pathJoin("ncio", "1.0.0")) -load(pathJoin("landsfcutil", "2.4.1")) -load(pathJoin("sigio", "2.3.2")) -load(pathJoin("bufr", "11.4.0")) -load(pathJoin("gempak", "7.4.2")) - -load(pathJoin("wgrib2", "2.0.8")) -setenv("WGRIB2","wgrib2") diff --git a/modulefiles/workflow_utils.jet.lua b/modulefiles/workflow_utils.jet.lua deleted file mode 100644 index 9039d021..00000000 --- a/modulefiles/workflow_utils.jet.lua +++ /dev/null @@ -1,35 +0,0 @@ -help([[ -Build environment for workflow utilities on Jet -]]) - -prepend_path("MODULEPATH", "/lfs4/HFIP/hfv3gfs/nwprod/hpc-stack/libs/modulefiles/stack") - -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-intel", "18.0.5.274")) -load(pathJoin("hpc-impi", "2018.4.274")) - -load(pathJoin("cmake", "3.16.1")) - -load(pathJoin("jasper", "2.0.25")) -load(pathJoin("zlib", "1.2.11")) -load(pathJoin("png", "1.6.35")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("bacio", "2.4.1")) -load(pathJoin("g2", "3.4.1")) -load(pathJoin("w3nco", "2.4.1")) -load(pathJoin("w3emc", "2.7.3")) -load(pathJoin("sp", "2.3.3")) -load(pathJoin("ip", "3.3.3")) -load(pathJoin("nemsio", "2.5.2")) -load(pathJoin("nemsiogfs", "2.5.3")) -load(pathJoin("ncio", "1.0.0")) -load(pathJoin("landsfcutil", "2.4.1")) -load(pathJoin("sigio", "2.3.2")) -load(pathJoin("bufr", "11.4.0")) -load(pathJoin("gempak", "7.4.2")) - -load(pathJoin("wgrib2", "2.0.8")) -setenv("WGRIB2","wgrib2") diff --git a/modulefiles/workflow_utils.orion.lua b/modulefiles/workflow_utils.orion.lua deleted file mode 100644 index 6ff4346f..00000000 --- a/modulefiles/workflow_utils.orion.lua +++ /dev/null @@ -1,35 +0,0 @@ -help([[ -Build environment for workflow utilities on Orion -]]) - -prepend_path("MODULEPATH", "/apps/contrib/NCEP/libs/hpc-stack/modulefiles/stack") - -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-intel", "2018.4")) -load(pathJoin("hpc-impi", "2018.4")) - -load(pathJoin("cmake", "3.17.3")) - -load(pathJoin("jasper", "2.0.25")) -load(pathJoin("zlib", "1.2.11")) -load(pathJoin("png", "1.6.35")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("bacio", "2.4.1")) -load(pathJoin("g2", "3.4.1")) -load(pathJoin("w3nco", "2.4.1")) -load(pathJoin("w3emc", "2.7.3")) -load(pathJoin("sp", "2.3.3")) -load(pathJoin("ip", "3.3.3")) -load(pathJoin("nemsio", "2.5.2")) -load(pathJoin("nemsiogfs", "2.5.3")) -load(pathJoin("ncio", "1.0.0")) -load(pathJoin("landsfcutil", "2.4.1")) -load(pathJoin("sigio", "2.3.2")) -load(pathJoin("bufr", "11.4.0")) -load(pathJoin("gempak", "7.5.1")) - -load(pathJoin("wgrib2", "2.0.8")) -setenv("WGRIB2","wgrib2") diff --git a/modulefiles/workflow_utils.s4.lua b/modulefiles/workflow_utils.s4.lua deleted file mode 100644 index 2295a313..00000000 --- a/modulefiles/workflow_utils.s4.lua +++ /dev/null @@ -1,34 +0,0 @@ -help([[ -Build environment for workflow utilities on S4 -]]) - -prepend_path("MODULEPATH", "/data/prod/hpc-stack/modulefiles/stack") - -load("license_intel") -load(pathJoin("hpc", "1.1.0")) -load(pathJoin("hpc-intel", "18.0.4")) -load(pathJoin("hpc-impi", "18.0.4")) - -load(pathJoin("jasper", "2.0.25")) -load(pathJoin("zlib", "1.2.11")) -load(pathJoin("png", "1.6.35")) - -load(pathJoin("gempak", "7.5.1")) -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("bacio", "2.4.1")) -load(pathJoin("g2", "3.4.1")) -load(pathJoin("ip", "3.3.3")) -load(pathJoin("nemsio", "2.5.2")) -load(pathJoin("sp", "2.3.3")) -load(pathJoin("w3emc", "2.7.3")) -load(pathJoin("w3nco", "2.4.1")) -load(pathJoin("nemsiogfs", "2.5.3")) -load(pathJoin("ncio", "1.0.0")) -load(pathJoin("landsfcutil", "2.4.1")) -load(pathJoin("sigio", "2.3.2")) -load(pathJoin("bufr", "11.4.0")) - -load(pathJoin("wgrib2", "2.0.8")) -setenv("WGRIB2","wgrib2") diff --git a/modulefiles/workflow_utils.wcoss2.lua b/modulefiles/workflow_utils.wcoss2.lua deleted file mode 100644 index 7c96ad90..00000000 --- a/modulefiles/workflow_utils.wcoss2.lua +++ /dev/null @@ -1,33 +0,0 @@ -help([[ -Build environment for workflow utilities on WCOSS2 -]]) - -load(pathJoin("PrgEnv-intel", "8.1.0")) -load(pathJoin("craype", "2.7.10")) -load(pathJoin("intel", "19.1.3.304")) -load(pathJoin("cray-mpich", "8.1.9")) - -load(pathJoin("cmake", "3.20.2")) - -load(pathJoin("jasper", "2.0.25")) -load(pathJoin("zlib", "1.2.11")) -load(pathJoin("libpng", "1.6.37")) - -load(pathJoin("hdf5", "1.10.6")) -load(pathJoin("netcdf", "4.7.4")) - -load(pathJoin("bacio", "2.4.1")) -load(pathJoin("g2", "3.4.5")) -load(pathJoin("ip", "3.3.3")) -load(pathJoin("nemsio", "2.5.2")) -load(pathJoin("sp", "2.3.3")) -load(pathJoin("w3emc", "2.9.2")) -load(pathJoin("w3nco", "2.4.1")) -load(pathJoin("nemsiogfs", "2.5.3")) -load(pathJoin("ncio", "1.0.0")) -load(pathJoin("landsfcutil", "2.4.1")) -load(pathJoin("sigio", "2.3.2")) -load(pathJoin("bufr", "11.5.0")) -load(pathJoin("gempak", "7.14.1")) - -load(pathJoin("wgrib2", "2.0.8")) diff --git a/sorc/build_gfs_utils.sh b/sorc/build_gfs_utils.sh deleted file mode 100755 index 243f6839..00000000 --- a/sorc/build_gfs_utils.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -set -eux - -[[ $(uname -s) == Darwin ]] && cmd=$(which greadlink) || cmd=$(which readlink) -readonly UTILS_DIR=$(cd "$(dirname "$($cmd -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P) - -# Adapt for global-workflow structure. -source ${UTILS_DIR}/../ush/machine-setup.sh > /dev/null 2>&1 -module use ${UTILS_DIR}/../modulefiles -modulefile=${UTILS_DIR}/../modulefiles/workflow_utils.${target} -if [[ -f ${modulefile}.lua ]]; then - set +x - module load workflow_utils.$target - module list - set -x -else - echo "FATAL: modulefile ${modulefile}.lua not found!" - exit 1 -fi -# End adaptation - -BUILD_DIR=${BUILD_DIR:-${UTILS_DIR}/build} -[[ -d $BUILD_DIR ]] && rm -rf $BUILD_DIR -mkdir -p ${BUILD_DIR} -cd $BUILD_DIR - -INSTALL_DIR=${INSTALL_DIR:-${UTILS_DIR}/install} - -CMAKE_FLAGS+=" -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR" - -cmake ${UTILS_DIR} ${CMAKE_FLAGS} -make -j ${BUILD_JOBS:-4} VERBOSE=${BUILD_VERBOSE:-} -make install diff --git a/sorc/enkf_chgres_recenter.fd/makefile b/sorc/enkf_chgres_recenter.fd/makefile deleted file mode 100755 index 2a5f36b3..00000000 --- a/sorc/enkf_chgres_recenter.fd/makefile +++ /dev/null @@ -1,27 +0,0 @@ -SHELL= /bin/sh - -LIBS= $(NEMSIO_LIB) $(BACIO_LIB4) $(W3NCO_LIBd) $(IP_LIBd) $(SP_LIBd) - -CMD= enkf_chgres_recenter.x - -OBJS = driver.o input_data.o interp.o output_data.o utils.o setup.o - -$(CMD): $(OBJS) - $(FC) $(FFLAGS) -o $(CMD) $(OBJS) $(LIBS) - -driver.o: setup.o output_data.o interp.o input_data.o driver.f90 - $(FC) $(FFLAGS) -I$(NEMSIO_INC) -c driver.f90 -interp.o: setup.o utils.o output_data.o input_data.o interp.f90 - $(FC) $(FFLAGS) -I$(NEMSIO_INC) -c interp.f90 -input_data.o: setup.o utils.o input_data.f90 - $(FC) $(FFLAGS) -I$(NEMSIO_INC) -c input_data.f90 -output_data.o: setup.o utils.o input_data.o output_data.f90 - $(FC) $(FFLAGS) -I$(NEMSIO_INC) -c output_data.f90 -setup.o: setup.f90 - $(FC) $(FFLAGS) -I$(NEMSIO_INC) -c setup.f90 -utils.o: utils.f90 - $(FC) $(FFLAGS) -I$(NEMSIO_INC) -c utils.f90 -clean: - rm -f *.o *.mod ${CMD} -install: - -cp $(CMD) ../../exec/. diff --git a/sorc/enkf_chgres_recenter_nc.fd/makefile b/sorc/enkf_chgres_recenter_nc.fd/makefile deleted file mode 100644 index c9f4c7be..00000000 --- a/sorc/enkf_chgres_recenter_nc.fd/makefile +++ /dev/null @@ -1,28 +0,0 @@ -SHELL= /bin/sh - -LIBS= $(FV3GFS_NCIO_LIB) $(BACIO_LIB4) $(W3NCO_LIB4) $(IP_LIB4) $(SP_LIB4) -L$(NETCDF)/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz - -CMD= enkf_chgres_recenter_nc.x - -OBJS = driver.o input_data.o interp.o output_data.o utils.o setup.o - -$(CMD): $(OBJS) - $(FC) $(FFLAGS) -o $(CMD) $(OBJS) $(LIBS) - -driver.o: setup.o output_data.o interp.o input_data.o driver.f90 - $(FC) $(FFLAGS) -I$(FV3GFS_NCIO_INC) -I$(NETCDF)/include -c driver.f90 -interp.o: setup.o utils.o output_data.o input_data.o interp.f90 - $(FC) $(FFLAGS) -I$(FV3GFS_NCIO_INC) -I$(NETCDF)/include -c interp.f90 -input_data.o: setup.o utils.o input_data.f90 - $(FC) $(FFLAGS) -I$(FV3GFS_NCIO_INC) -I$(NETCDF)/include -c input_data.f90 -output_data.o: setup.o utils.o input_data.o output_data.f90 - $(FC) $(FFLAGS) -I$(FV3GFS_NCIO_INC) -I$(NETCDF)/include -c output_data.f90 -setup.o: setup.f90 - $(FC) $(FFLAGS) -I$(FV3GFS_NCIO_INC) -I$(NETCDF)/include -c setup.f90 -utils.o: utils.f90 - $(FC) $(FFLAGS) -I$(FV3GFS_NCIO_INC) -I$(NETCDF)/include -c utils.f90 -clean: - rm -f *.o *.mod ${CMD} -install: - -cp $(CMD) ../../exec/. - diff --git a/sorc/fv3nc2nemsio.fd/CMakeLists.txt b/sorc/fv3nc2nemsio.fd/CMakeLists.txt deleted file mode 100644 index 82778a10..00000000 --- a/sorc/fv3nc2nemsio.fd/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -list(APPEND fortran_src -constants.f90 -fv3_main.f90 -fv3_module.f90 -kinds.f90 -) - -set(exe_name fv3nc2nemsio.x) -add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - nemsio::nemsio - bacio::bacio_4 - w3nco::w3nco_d - NetCDF::NetCDF_Fortran) - -install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/fv3nc2nemsio.fd/makefile.sh b/sorc/fv3nc2nemsio.fd/makefile.sh deleted file mode 100755 index 94b9b253..00000000 --- a/sorc/fv3nc2nemsio.fd/makefile.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/ksh -set -x - -machine=${1:-"cray"} - -source ../../modulefiles/module-setup.sh.inc -module use ../../modulefiles -module load modulefile.fv3nc2nemsio.$machine - -LIBnetcdf=`$NETCDF/bin/nf-config --flibs` -INCnetcdf=`$NETCDF/bin/nf-config --fflags` -export NETCDF_LDFLAGS=$LIBnetcdf -export NETCDF_INCLUDE=$INCnetcdf - - -$FCMP $FFLAGS -c kinds.f90 -$FCMP $FFLAGS -c constants.f90 -$FCMP $FFLAGS $NETCDF_INCLUDE -I $NEMSIO_INC -c fv3_module.f90 -$FCMP $FFLAGS $NETCDF_INCLUDE -I $NEMSIO_INC -I. -o fv3nc2nemsio.x fv3_main.f90 fv3_module.o $NETCDF_LDFLAGS $NEMSIO_LIB $BACIO_LIB4 $W3NCO_LIBd - -mv fv3nc2nemsio.x ../../exec/. -rm -f *.o *.mod - -exit 0 diff --git a/sorc/gaussian_sfcanl.fd/Makefile b/sorc/gaussian_sfcanl.fd/Makefile deleted file mode 100755 index 69cd35f7..00000000 --- a/sorc/gaussian_sfcanl.fd/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -SHELL= /bin/sh - -CMD= gaussian_sfcanl.exe - -OBJS = gaussian_sfcanl.o - -build: $(CMD) - -$(CMD): $(OBJS) - $(FCOMP) $(FFLAGS) -I$(NEMSIO_INC) $(NETCDF_INCLUDE) -o $(CMD) $(OBJS) $(NETCDF_LDFLAGS_F) $(NEMSIO_LIB) $(BACIO_LIB4) $(W3NCO_LIBd) $(SP_LIB4) - -gaussian_sfcanl.o: gaussian_sfcanl.f90 - $(FCOMP) $(FFLAGS) -I$(NEMSIO_INC) $(NETCDF_INCLUDE) -c gaussian_sfcanl.f90 - -install: - cp ${CMD} ../../exec - -clean: - rm -f *.o *.mod ${CMD} ../../exec/${CMD} - -test: - @echo NO TESTS YET diff --git a/sorc/gaussian_sfcanl.fd/makefile.sh b/sorc/gaussian_sfcanl.fd/makefile.sh deleted file mode 100755 index b1c5adef..00000000 --- a/sorc/gaussian_sfcanl.fd/makefile.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -export FFLAGS="-O3 -fp-model precise -g -r8 -i4" -# for debugging -#export FFLAGS="-g -r8 -i4 -warn unused -check bounds" - -export NETCDF_INCLUDE="-I${NETCDF}/include" -export NETCDF_LDFLAGS_F="-L${NETCDF}/lib -lnetcdf -lnetcdff -L${HDF5}/lib -lhdf5 " - -make clean -make build -err=$? -if [ $err -ne 0 ]; then - echo ERROR BUILDING GAUSSIAN_SFCANL - exit 2 -fi -make install - -exit diff --git a/sorc/gaussian_sfcanl.fd/weight_gen/CMakeLists.txt b/sorc/gaussian_sfcanl.fd/weight_gen/CMakeLists.txt deleted file mode 100644 index db3cbf17..00000000 --- a/sorc/gaussian_sfcanl.fd/weight_gen/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(scrip.fd) diff --git a/sorc/gaussian_sfcanl.fd/weight_gen/README b/sorc/gaussian_sfcanl.fd/weight_gen/README deleted file mode 100644 index 10294dfc..00000000 --- a/sorc/gaussian_sfcanl.fd/weight_gen/README +++ /dev/null @@ -1,23 +0,0 @@ -Creates the ESMF integration weight files to transform from cubed-sphere grids -to comparable (in resolution) global gaussian grids. - -First, compile the program that creates the 'scrip' files for the -global gaussian grids. For each resolution, two grids are created: -one normal grid and one grid with two extra rows for the N/S poles. -To compile, cd to ./scrip.fd and type 'make.sh'. Currently, only -compiles/runs on Theia. - -Then, run the 'run.theia.ksh' script for the resolution desired. -Script first calls the 'scrip' program, then calls ESMF utility -'RegridWeightGen' to create the interpolation weight files. - -Weight files for the following transforms are created: - -C48 => 192x94 and 192x96 gaussian -C96 => 384x192 and 384x194 gaussian -C128 => 512x256 and 512x258 gaussian -C192 => 768x384 and 768x386 gaussian -C384 => 1536x768 and 1536x770 gaussian -C768 => 3072x1536 and 3072x1538 gaussian -C1152 => 4608x2304 and 4608x2406 gaussian -C3072 => 12288x6144 and 12288x6146 gaussian diff --git a/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/CMakeLists.txt b/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/CMakeLists.txt deleted file mode 100644 index 4534bb0a..00000000 --- a/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -list(APPEND fortran_src - scrip.f90 -) - -if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -i4 -convert big_endian") -elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-real-8") -endif() - -set(exe_name scrip.x) -add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - sp::sp_d - NetCDF::NetCDF_Fortran) - -install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/make.sh b/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/make.sh deleted file mode 100755 index 12ed3eef..00000000 --- a/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/make.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh - -set -x - -mac=$(hostname -f) - -case $mac in - -#--------------------------------------------------------------------------------- -# BUILD PROGRAM ON WCOSS Phase 1/2. -#--------------------------------------------------------------------------------- - -g????.ncep.noaa.gov | t????.ncep.noaa.gov) - - echo "WCOSS PHASE 1/2 BUILD NOT ADDED YET" - exit 1 ;; - -#--------------------------------------------------------------------------------- -# BUILD PROGRAM ON WCOSS CRAY. -#--------------------------------------------------------------------------------- - -llogin? | slogin?) - - echo "WCOSS CRAY BUILD NOT ADDED YET" - exit 1 ;; - -#--------------------------------------------------------------------------------- -# BUILD PROGRAM ON HERA. -#--------------------------------------------------------------------------------- - -hfe??) - - source /apps/lmod/lmod/init/sh - module purge - - module load intel/18.0.5.274 - - export FCOMP=ifort - export FFLAGS="-O0 -g -traceback -r8 -i4 -convert big_endian -check bounds" - - module load netcdf/4.7.0 - module load hdf5/1.10.5 - export NETCDF_INCLUDE="-I${NETCDF}/include" - export NETCDF_LDFLAGS_F="-L${NETCDF}/lib -lnetcdf -lnetcdff -L${HDF5}/lib -lhdf5 -lhdf5_fortran" - - module use -a /scratch2/NCEPDEV/nwprod/NCEPLIBS/modulefiles - module load sp/2.0.2 - - make clean - make - rc=$? ;; - -*) - - echo "DOES NOT BUILD ON THIS MACHINE." - exit 1 ;; - -esac - -exit diff --git a/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/makefile b/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/makefile deleted file mode 100755 index 74949b96..00000000 --- a/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/makefile +++ /dev/null @@ -1,14 +0,0 @@ -SHELL= /bin/sh - -CMD= scrip.exe - -OBJS = scrip.o - -$(CMD): $(OBJS) - $(FCOMP) $(FFLAGS) $(NETCDF_INCLUDE) -o $(CMD) $(OBJS) $(NETCDF_LDFLAGS_F) $(SP_LIBd) - -scrip.o: scrip.f90 - $(FCOMP) $(FFLAGS) $(NETCDF_INCLUDE) -c scrip.f90 - -clean: - rm -f *.o *.mod ${CMD} *.exe.* diff --git a/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/scrip.f90 b/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/scrip.f90 deleted file mode 100644 index 5c4d2a42..00000000 --- a/sorc/gaussian_sfcanl.fd/weight_gen/scrip.fd/scrip.f90 +++ /dev/null @@ -1,350 +0,0 @@ - program scrip - -!---------------------------------------------------------------------- -! Create "scrip" files that describes a gaussian grid. -! Two files are created: the normal gaussian grid and one with -! two extra rows for the N/S poles. -!---------------------------------------------------------------------- - - implicit none - - character(len=128) :: outfile - character(len=20) :: title - character(len=5) :: idim_ch, jdim_ch, jdimp_ch - character(len=6) :: cres - - integer :: header_buffer_val = 16384 - integer :: fsize=65536, inital = 0 - integer :: error, ncid - integer :: i, j, idim, jdim, ijdim - integer :: jdimp - integer :: dim_size, dim_corners, dim_rank - integer :: id_dims, id_center_lat, id_center_lon - integer :: id_imask, id_corner_lat, id_corner_lon - integer :: num_corners = 4 - integer :: rank = 2 - integer(kind=4), allocatable :: mask(:) - - real(kind=8) :: corner_lon_src - real(kind=8) :: dx_src, lat_edge - real(kind=8), allocatable :: lats(:,:), lons(:,:), dum1d(:) - real(kind=8), allocatable :: dum2d(:,:), latsp(:,:), lonsp(:,:) - real(kind=8), allocatable :: lats_corner(:,:,:), lons_corner(:,:,:) - real(kind=8), allocatable :: latsp_corner(:,:,:), lonsp_corner(:,:,:) - real(kind=8), allocatable :: slat(:), wlat(:) - - include "netcdf.inc" - - call getarg(1, cres) - - select case (trim(cres)) - case ("c48","C48") - idim = 192 ! cres * 4 - jdim = 94 ! cres * 2 - jdimp = 96 ! include two rows for the poles - idim_ch = "192" - jdim_ch = "94" - jdimp_ch = "96" - case ("c96","C96") - idim = 384 ! cres * 4 - jdim = 192 ! cres * 2 - jdimp = 194 ! include two rows for the poles - idim_ch = "384" - jdim_ch = "192" - jdimp_ch = "194" - case ("c128","C128") - idim = 512 ! cres * 4 - jdim = 256 ! cres * 2 - jdimp = 258 ! include two rows for the poles - idim_ch = "512" - jdim_ch = "256" - jdimp_ch = "258" - case ("c192","C192") - idim = 768 ! cres * 4 - jdim = 384 ! cres * 2 - jdimp = 386 ! include two rows for the poles - idim_ch = "768" - jdim_ch = "384" - jdimp_ch = "386" - case ("c384","C384") - idim = 1536 ! cres * 4 - jdim = 768 ! cres * 2 - jdimp = 770 ! include two rows for the poles - idim_ch = "1536" - jdim_ch = "768" - jdimp_ch = "770" - case ("c768","C768") - idim = 3072 ! cres * 4 - jdim = 1536 ! cres * 2 - jdimp = 1538 ! include two rows for the poles - idim_ch = "3072" - jdim_ch = "1536" - jdimp_ch = "1538" - case ("c1152","C1152") - idim = 4608 ! cres * 4 - jdim = 2304 ! cres * 2 - jdimp = 2306 ! include two rows for the poles - idim_ch = "4608" - jdim_ch = "2304" - jdimp_ch = "2306" - case ("c3072","C3072") - idim = 12288 ! cres * 4 - jdim = 6144 ! cres * 2 - jdimp = 6146 ! include two rows for the poles - idim_ch = "12288" - jdim_ch = "6144" - jdimp_ch = "6146" - case default - print*,'- Resolution not supported ', trim(cres) - stop 3 - end select - - corner_lon_src = 0.0 - dx_src = 360.0 / float(idim) - ijdim = idim*jdim - - allocate(slat(jdim)) - allocate(wlat(jdim)) - - call splat(4, jdim, slat, wlat) - - allocate(lats(idim,jdim)) - allocate(lats_corner(num_corners,idim,jdim)) - allocate(lons(idim,jdim)) - allocate(lons_corner(num_corners,idim,jdim)) - - do j = 1, jdim - lats(:,j) = 90.0 - (acos(slat(j))* 180.0 / (4.*atan(1.))) - enddo - - deallocate(slat, wlat) - -!---------------------------------------------------------------- -! First, output file without poles. -!---------------------------------------------------------------- - -!---------------------------------------------------------------- -! Set corners in counter-clockwise order -! -! 2 1 -! -! C -! -! 3 4 -!---------------------------------------------------------------- - - lats_corner(1,:,1) = 90.0 - lats_corner(2,:,1) = 90.0 - - lats_corner(3,:,jdim) = -90.0 - lats_corner(4,:,jdim) = -90.0 - - do j = 1, jdim - 1 - lat_edge = (lats(1,j) + lats(1,j+1)) / 2.0 - lats_corner(3,:,j) = lat_edge - lats_corner(4,:,j) = lat_edge - lats_corner(1,:,j+1) = lat_edge - lats_corner(2,:,j+1) = lat_edge - enddo - - do i = 1, idim - lons(i,:) = corner_lon_src + float(i-1)*dx_src - lons_corner(1,i,:) = lons(i,:) + (dx_src*0.5) - lons_corner(2,i,:) = lons(i,:) - (dx_src*0.5) - lons_corner(3,i,:) = lons(i,:) - (dx_src*0.5) - lons_corner(4,i,:) = lons(i,:) + (dx_src*0.5) - enddo - - i = 1 - j = 1 - print*,'center ',lats(i,j),lons(i,j) - print*,'corner 1 ',lats_corner(1,i,j),lons_corner(1,i,j) - print*,'corner 2 ',lats_corner(2,i,j),lons_corner(2,i,j) - print*,'corner 3 ',lats_corner(3,i,j),lons_corner(3,i,j) - print*,'corner 4 ',lats_corner(4,i,j),lons_corner(4,i,j) - - i = 1 - j = 2 - print*,'center ',lats(i,j),lons(i,j) - print*,'corner 1 ',lats_corner(1,i,j),lons_corner(1,i,j) - print*,'corner 2 ',lats_corner(2,i,j),lons_corner(2,i,j) - print*,'corner 3 ',lats_corner(3,i,j),lons_corner(3,i,j) - print*,'corner 4 ',lats_corner(4,i,j),lons_corner(4,i,j) - - i = 1 - j = jdim - print*,'center ',lats(i,j),lons(i,j) - print*,'corner 1 ',lats_corner(1,i,j),lons_corner(1,i,j) - print*,'corner 2 ',lats_corner(2,i,j),lons_corner(2,i,j) - print*,'corner 3 ',lats_corner(3,i,j),lons_corner(3,i,j) - print*,'corner 4 ',lats_corner(4,i,j),lons_corner(4,i,j) - - i = 1 - j = jdim-1 - print*,'center ',lats(i,j),lons(i,j) - print*,'corner 1 ',lats_corner(1,i,j),lons_corner(1,i,j) - print*,'corner 2 ',lats_corner(2,i,j),lons_corner(2,i,j) - print*,'corner 3 ',lats_corner(3,i,j),lons_corner(3,i,j) - print*,'corner 4 ',lats_corner(4,i,j),lons_corner(4,i,j) - - allocate(mask(ijdim)) - mask = 1 - -! output file without pole. - - outfile = " " - outfile = "./gaussian." // trim(idim_ch) // "." // trim(jdim_ch) // ".nc" - title = " " - title = "gaussian." // trim(idim_ch) // "." // trim(jdim_ch) - -!--- open the file - error = NF__CREATE(outfile, IOR(NF_NETCDF4,NF_CLASSIC_MODEL), inital, fsize, ncid) - print*, 'error after open ', error - -!--- define dimension - error = nf_def_dim(ncid, 'grid_size', ijdim, dim_size) - error = nf_def_dim(ncid, 'grid_corners', num_corners, dim_corners) - error = nf_def_dim(ncid, 'grid_rank', rank, dim_rank) - -!--- define field - error = nf_def_var(ncid, 'grid_dims', NF_INT, 1, (/dim_rank/), id_dims) - error = nf_def_var(ncid, 'grid_center_lat', NF_DOUBLE, 1, (/dim_size/), id_center_lat) - error = nf_put_att_text(ncid, id_center_lat, "units", 7, "degrees") - error = nf_def_var(ncid, 'grid_center_lon', NF_DOUBLE, 1, (/dim_size/), id_center_lon) - error = nf_put_att_text(ncid, id_center_lon, "units", 7, "degrees") - error = nf_def_var(ncid, 'grid_imask', NF_INT, 1, (/dim_size/), id_imask) - error = nf_put_att_text(ncid, id_imask, "units", 8, "unitless") - error = nf_def_var(ncid, 'grid_corner_lat', NF_DOUBLE, 2, (/dim_corners,dim_size/), id_corner_lat) - error = nf_put_att_text(ncid, id_corner_lat, "units", 7, "degrees") - error = nf_def_var(ncid, 'grid_corner_lon', NF_DOUBLE, 2, (/dim_corners,dim_size/), id_corner_lon) - error = nf_put_att_text(ncid, id_corner_lon, "units", 7, "degrees") - error = nf_put_att_text(ncid, NF_GLOBAL, "title", 20, trim(title)) - error = nf__enddef(ncid, header_buffer_val,4,0,4) - -!--- set fields - error = nf_put_var_int( ncid, id_dims, (/idim,jdim/)) - - allocate(dum1d(ijdim)) - dum1d = reshape(lats, (/ijdim/)) - error = nf_put_var_double( ncid, id_center_lat, dum1d) - dum1d = reshape(lons, (/ijdim/)) - error = nf_put_var_double( ncid, id_center_lon, dum1d) - deallocate(dum1d) - - error = nf_put_var_int( ncid, id_imask, mask) - deallocate(mask) - - allocate(dum2d(num_corners,ijdim)) - dum2d = reshape (lats_corner, (/num_corners,ijdim/)) - error = nf_put_var_double( ncid, id_corner_lat, dum2d) - - dum2d = reshape (lons_corner, (/num_corners,ijdim/)) - error = nf_put_var_double( ncid, id_corner_lon, dum2d) - deallocate(dum2d) - - error = nf_close(ncid) - -!---------------------------------------------------------------- -! output file with poles. -!---------------------------------------------------------------- - - outfile = " " - outfile = "./gaussian." // trim(idim_ch) // "." // trim(jdimp_ch) // ".nc" - title = " " - title = "gaussian." // trim(idim_ch) // "." // trim(jdimp_ch) - - ijdim = idim*jdimp - - allocate(latsp(idim,jdimp)) - allocate(lonsp(idim,jdimp)) - - do j = 2, jdim+1 - latsp(:,j) = lats(:,j-1) - lonsp(:,j) = lons(:,j-1) - enddo - - latsp(:,1) = 90.0_8 - lonsp(:,1) = 0.0_8 - - latsp(:,jdimp) = -90.0_8 - lonsp(:,jdimp) = 0.0_8 - - deallocate(lats, lons) - - allocate(latsp_corner(num_corners,idim,jdimp)) - allocate(lonsp_corner(num_corners,idim,jdimp)) - - latsp_corner(:,:,1) = 89.5_8 - latsp_corner(:,:,jdimp) = -89.5_8 - - lonsp_corner(1,:,1) = 0.0_8 - lonsp_corner(2,:,1) = 90.0_8 - lonsp_corner(3,:,1) = 180.0_8 - lonsp_corner(4,:,1) = 270.0_8 - - lonsp_corner(1,:,jdimp) = 0.0_8 - lonsp_corner(2,:,jdimp) = 90.0_8 - lonsp_corner(3,:,jdimp) = 180.0_8 - lonsp_corner(4,:,jdimp) = 270.0_8 - - do j = 2, jdim+1 - latsp_corner(:,:,j) = lats_corner(:,:,j-1) - lonsp_corner(:,:,j) = lons_corner(:,:,j-1) - enddo - - deallocate(lats_corner, lons_corner) - -!--- open the file - error = NF__CREATE(outfile, IOR(NF_NETCDF4,NF_CLASSIC_MODEL), inital, fsize, ncid) - print*, 'error after open ', error - -!--- define dimension - error = nf_def_dim(ncid, 'grid_size', ijdim, dim_size) - error = nf_def_dim(ncid, 'grid_corners', num_corners, dim_corners) - error = nf_def_dim(ncid, 'grid_rank', rank, dim_rank) - -!--- define field - error = nf_def_var(ncid, 'grid_dims', NF_INT, 1, (/dim_rank/), id_dims) - error = nf_def_var(ncid, 'grid_center_lat', NF_DOUBLE, 1, (/dim_size/), id_center_lat) - error = nf_put_att_text(ncid, id_center_lat, "units", 7, "degrees") - error = nf_def_var(ncid, 'grid_center_lon', NF_DOUBLE, 1, (/dim_size/), id_center_lon) - error = nf_put_att_text(ncid, id_center_lon, "units", 7, "degrees") - error = nf_def_var(ncid, 'grid_imask', NF_INT, 1, (/dim_size/), id_imask) - error = nf_put_att_text(ncid, id_imask, "units", 8, "unitless") - error = nf_def_var(ncid, 'grid_corner_lat', NF_DOUBLE, 2, (/dim_corners,dim_size/), id_corner_lat) - error = nf_put_att_text(ncid, id_corner_lat, "units", 7, "degrees") - error = nf_def_var(ncid, 'grid_corner_lon', NF_DOUBLE, 2, (/dim_corners,dim_size/), id_corner_lon) - error = nf_put_att_text(ncid, id_corner_lon, "units", 7, "degrees") - error = nf_put_att_text(ncid, NF_GLOBAL, "title", 20, trim(title)) - error = nf__enddef(ncid, header_buffer_val,4,0,4) - -!--- set fields - error = nf_put_var_int( ncid, id_dims, (/idim,jdimp/)) - - allocate(dum1d(ijdim)) - dum1d = reshape(latsp, (/ijdim/)) - error = nf_put_var_double( ncid, id_center_lat, dum1d) - dum1d = reshape(lonsp, (/ijdim/)) - error = nf_put_var_double( ncid, id_center_lon, dum1d) - deallocate(dum1d) - - allocate(mask(ijdim)) - mask = 1 - error = nf_put_var_int( ncid, id_imask, mask) - deallocate(mask) - - allocate(dum2d(num_corners,ijdim)) - dum2d = reshape (latsp_corner, (/num_corners,ijdim/)) - print*,'lat corner check ',maxval(dum2d),minval(dum2d) - error = nf_put_var_double( ncid, id_corner_lat, dum2d) - deallocate(latsp_corner) - - dum2d = reshape (lonsp_corner, (/num_corners,ijdim/)) - error = nf_put_var_double( ncid, id_corner_lon, dum2d) - deallocate(dum2d, lonsp_corner) - - error = nf_close(ncid) - - print*,'- DONE.' - - end program scrip diff --git a/sorc/gfs_bufr.fd/makefile_module b/sorc/gfs_bufr.fd/makefile_module deleted file mode 100755 index d9d5374a..00000000 --- a/sorc/gfs_bufr.fd/makefile_module +++ /dev/null @@ -1,79 +0,0 @@ -##################################################################################### -# gfs_bufr using module compile standard -# # 11/08/2019 guang.ping.lou@noaa.gov: Create NetCDF version -# ##################################################################################### -# set -eux -# - -FC = $(myFC) $(myFCFLAGS) -CPP = $(myCPP) $(myCPPFLAGS) - -FFLAGS = -I$(NETCDF_INCLUDES) \ - -I$(NEMSIO_INC) \ - -I$(SIGIO_INC) \ - -I$(W3EMC_INC4) - -LIBS = -L$(NETCDF_LIBRARIES) -lnetcdff -lnetcdf \ - -L$(HDF5_LIBRARIES) -lhdf5_hl -lhdf5 -lz \ - $(NEMSIO_LIB) \ - $(W3EMC_LIB4) \ - $(W3NCO_LIB4) \ - $(BUFR_LIB4) \ - $(BACIO_LIB4) \ - $(SP_LIB4) \ - $(SIGIO_LIB) - -SRCM = gfsbufr.f -OBJS = physcons.o funcphys.o meteorg.o bfrhdr.o newsig1.o terp3.o\ - bfrize.o vintg.o buff.o rsearch.o \ - svp.o calpreciptype.o lcl.o mstadb.o tdew.o\ - machine.o gslp.o modstuff1.o read_nemsio.o read_netcdf_p.o - -CMD = ../../exec/gfs_bufr - -$(CMD): $(SRCM) $(OBJS) - $(FC) $(FFLAGS) $(SRCM) $(OBJS) $(LIBS) -o $(CMD) - -machine.o: machine.f - $(FC) $(FFLAGS) -free -c machine.f -physcons.o: physcons.f machine.o - $(FC) $(FFLAGS) -free -c physcons.f -funcphys.o: funcphys.f physcons.o - $(FC) $(FFLAGS) -free -c funcphys.f -gslp.o: gslp.f - $(FC) $(FFLAGS) -free -c gslp.f -modstuff1.o: modstuff1.f - $(FC) $(INC) $(FFLAGS) -free -c modstuff1.f -meteorg.o: meteorg.f physcons.o funcphys.o - $(FC) $(INC) $(FFLAGS) -c meteorg.f -read_netcdf_p.o: read_netcdf_p.f - $(FC) $(INC) $(FFLAGS) -c read_netcdf_p.f -read_nemsio.o: read_nemsio.f - $(FC) $(INC) $(FFLAGS) -c read_nemsio.f -bfrhdr.o: bfrhdr.f - $(FC) $(FFLAGS) -c bfrhdr.f -newsig1.o: newsig1.f - $(FC) $(FFLAGS) -c newsig1.f -terp3.o: terp3.f - $(FC) $(FFLAGS) -c terp3.f -bfrize.o: bfrize.f - $(FC) $(FFLAGS) -c bfrize.f -vintg.o: vintg.f - $(FC) $(FFLAGS) -c vintg.f -buff.o: buff.f - $(FC) $(FFLAGS) -c buff.f -rsearch.o: rsearch.f - $(FC) $(FFLAGS) -c rsearch.f -svp.o: svp.f - $(FC) $(FFLAGS) -c svp.f -calpreciptype.o: calpreciptype.f physcons.o funcphys.o - $(FC) $(FFLAGS) -FR -c calpreciptype.f -lcl.o: lcl.f - $(FC) $(FFLAGS) -c lcl.f -mstadb.o: mstadb.f - $(FC) $(FFLAGS) -c mstadb.f -tdew.o: tdew.f - $(FC) $(FFLAGS) -c tdew.f - -clean: - /bin/rm -f $(OBJS) *.mod gfs_bufr diff --git a/sorc/mkgfsawps.fd/makefile b/sorc/mkgfsawps.fd/makefile deleted file mode 100755 index 86f3c417..00000000 --- a/sorc/mkgfsawps.fd/makefile +++ /dev/null @@ -1,53 +0,0 @@ -SHELL=/bin/sh -# -SRCS= mkgfsawps.f - -OBJS= mkgfsawps.o - -# Tunable parameters -# -# FC Name of the fortran compiling system to use -# LDFLAGS Flags to the loader -# LIBS List of libraries -# CMD Name of the executable -# PROFLIB Library needed for profiling -# -FC = ifort - -LDFLAGS = -IOMP5_LIB=/usrx/local/prod/intel/2018UP01/lib/intel64/libiomp5.a - -LIBS = -Xlinker --start-group ${W3NCO_LIBd} ${W3NCO_LIBd} ${IP_LIBd} ${SP_LIBd} ${BACIO_LIB4} ${IOMP5_LIB} - -CMD = mkgfsawps -PROFLIB = -lprof - -# To perform the default compilation, use the first line -# To compile with flowtracing turned on, use the second line -# To compile giving profile additonal information, use the third line -# WARNING: SIMULTANEOUSLY PROFILING AND FLOWTRACING IS NOT RECOMMENDED -FFLAGS = -O3 -g -convert big_endian -r8 -i4 -assume noold_ldout_format - -# Lines from here on down should not need to be changed. They are the -# actual rules which make uses to build a.out. -# -all: $(CMD) - -$(CMD): $(OBJS) - $(FC) -o $(LDFLAGS) $(@) $(OBJS) $(LIBS) - rm -f $(OBJS) - -# Make the profiled version of the command and call it a.out.prof -# -$(CMD).prof: $(OBJS) - $(FC) -o $(LDFLAGS) $(@) $(OBJS) $(LIBS) - -rm -f $(OBJS) - -clean: - -rm -f $(OBJS) - -clobber: clean - -rm -f $(CMD) $(CMD).prof - -void: clobber - -rm -f $(SRCS) makefile diff --git a/sorc/mkgfsawps.fd/makefile.hera b/sorc/mkgfsawps.fd/makefile.hera deleted file mode 100755 index 99052691..00000000 --- a/sorc/mkgfsawps.fd/makefile.hera +++ /dev/null @@ -1,53 +0,0 @@ -SHELL=/bin/sh -# -SRCS= mkgfsawps.f - -OBJS= mkgfsawps.o - -# Tunable parameters -# -# FC Name of the fortran compiling system to use -# LDFLAGS Flags to the loader -# LIBS List of libraries -# CMD Name of the executable -# PROFLIB Library needed for profiling -# -FC = ifort - -LDFLAGS = -# IOMP5_LIB=/usrx/local/prod/intel/2018UP01/lib/intel64/libiomp5.a - -LIBS = -qopenmp -Xlinker --start-group ${W3NCO_LIBd} ${W3NCO_LIBd} ${IP_LIBd} ${SP_LIBd} ${BACIO_LIB4} ${IOMP5_LIB} - -CMD = mkgfsawps -PROFLIB = -lprof - -# To perform the default compilation, use the first line -# To compile with flowtracing turned on, use the second line -# To compile giving profile additonal information, use the third line -# WARNING: SIMULTANEOUSLY PROFILING AND FLOWTRACING IS NOT RECOMMENDED -FFLAGS = -O3 -g -convert big_endian -r8 -i4 -assume noold_ldout_format - -# Lines from here on down should not need to be changed. They are the -# actual rules which make uses to build a.out. -# -all: $(CMD) - -$(CMD): $(OBJS) - $(FC) -o $(LDFLAGS) $(@) $(OBJS) $(LIBS) - rm -f $(OBJS) - -# Make the profiled version of the command and call it a.out.prof -# -$(CMD).prof: $(OBJS) - $(FC) -o $(LDFLAGS) $(@) $(OBJS) $(LIBS) - -rm -f $(OBJS) - -clean: - -rm -f $(OBJS) - -clobber: clean - -rm -f $(CMD) $(CMD).prof - -void: clobber - -rm -f $(SRCS) makefile diff --git a/sorc/mkgfsawps.fd/makefile.wcoss_cray b/sorc/mkgfsawps.fd/makefile.wcoss_cray deleted file mode 100755 index b1bd05f7..00000000 --- a/sorc/mkgfsawps.fd/makefile.wcoss_cray +++ /dev/null @@ -1,56 +0,0 @@ -SHELL=/bin/sh -# -SRCS= mkgfsawps.f - -OBJS= mkgfsawps.o - -# Tunable parameters -# -# FC Name of the fortran compiling system to use -# LDFLAGS Flags to the loader -# LIBS List of libraries -# CMD Name of the executable -# PROFLIB Library needed for profiling -# -FC = ifort - -LDFLAGS = -IOMP5_LIB=/opt/intel/composer_xe_2015.3.187/compiler/lib/intel64/libiomp5.a - -LIBS = -Xlinker --start-group ${W3NCO_LIBd} ${W3NCO_LIBd} ${IP_LIBd} ${SP_LIBd} ${BACIO_LIB4} ${IOMP5_LIB} - -CMD = mkgfsawps -PROFLIB = -lprof - -# To perform the default compilation, use the first line -# To compile with flowtracing turned on, use the second line -# To compile giving profile additonal information, use the third line -# WARNING: SIMULTANEOUSLY PROFILING AND FLOWTRACING IS NOT RECOMMENDED -FFLAGS = -O3 -g -convert big_endian -r8 -i4 -assume noold_ldout_format - -#FFLAGS = -F -#FFLAGS = -Wf"-ez" - -# Lines from here on down should not need to be changed. They are the -# actual rules which make uses to build a.out. -# -all: $(CMD) - -$(CMD): $(OBJS) - $(FC) -o $(LDFLAGS) $(@) $(OBJS) $(LIBS) - rm -f $(OBJS) - -# Make the profiled version of the command and call it a.out.prof -# -$(CMD).prof: $(OBJS) - $(FC) -o $(LDFLAGS) $(@) $(OBJS) $(LIBS) - -rm -f $(OBJS) - -clean: - -rm -f $(OBJS) - -clobber: clean - -rm -f $(CMD) $(CMD).prof - -void: clobber - -rm -f $(SRCS) makefile diff --git a/sorc/mkgfsawps.fd/makefile.wcoss_dell_p3 b/sorc/mkgfsawps.fd/makefile.wcoss_dell_p3 deleted file mode 100755 index 86f3c417..00000000 --- a/sorc/mkgfsawps.fd/makefile.wcoss_dell_p3 +++ /dev/null @@ -1,53 +0,0 @@ -SHELL=/bin/sh -# -SRCS= mkgfsawps.f - -OBJS= mkgfsawps.o - -# Tunable parameters -# -# FC Name of the fortran compiling system to use -# LDFLAGS Flags to the loader -# LIBS List of libraries -# CMD Name of the executable -# PROFLIB Library needed for profiling -# -FC = ifort - -LDFLAGS = -IOMP5_LIB=/usrx/local/prod/intel/2018UP01/lib/intel64/libiomp5.a - -LIBS = -Xlinker --start-group ${W3NCO_LIBd} ${W3NCO_LIBd} ${IP_LIBd} ${SP_LIBd} ${BACIO_LIB4} ${IOMP5_LIB} - -CMD = mkgfsawps -PROFLIB = -lprof - -# To perform the default compilation, use the first line -# To compile with flowtracing turned on, use the second line -# To compile giving profile additonal information, use the third line -# WARNING: SIMULTANEOUSLY PROFILING AND FLOWTRACING IS NOT RECOMMENDED -FFLAGS = -O3 -g -convert big_endian -r8 -i4 -assume noold_ldout_format - -# Lines from here on down should not need to be changed. They are the -# actual rules which make uses to build a.out. -# -all: $(CMD) - -$(CMD): $(OBJS) - $(FC) -o $(LDFLAGS) $(@) $(OBJS) $(LIBS) - rm -f $(OBJS) - -# Make the profiled version of the command and call it a.out.prof -# -$(CMD).prof: $(OBJS) - $(FC) -o $(LDFLAGS) $(@) $(OBJS) $(LIBS) - -rm -f $(OBJS) - -clean: - -rm -f $(OBJS) - -clobber: clean - -rm -f $(CMD) $(CMD).prof - -void: clobber - -rm -f $(SRCS) makefile diff --git a/sorc/regrid_nemsio.fd/Makefile b/sorc/regrid_nemsio.fd/Makefile deleted file mode 100644 index c5bfb0ed..00000000 --- a/sorc/regrid_nemsio.fd/Makefile +++ /dev/null @@ -1,159 +0,0 @@ -#============================================================================== -# -# REGRID_NEMSIO Makefile -# -#============================================================================== - -#----------------------------------------------------------------------------- -# -- Parent make (calls child make) -- -#----------------------------------------------------------------------------- - -# ------------- -# General Rules -# ------------- - -SHELL=/bin/sh - -RM = /bin/rm -f -MKDIR = /bin/mkdir -p - -#------------ -# Include machine dependent compile & load options -#------------ - -MAKE_CONF = -include $(MAKE_CONF) - -# ------------- -# This makefile -# ------------- - -MAKE_FILE = Makefile - -# ----------- -# Load module -# ----------- - -EXE_FILE = regrid_nemsio - -# -------------------- -# Installing directory -# -------------------- - -INSTALL_DIR = ../../exec/ - -# -------- -# Log file -# -------- - -LOG_FILE = log.make.$(EXE_FILE) - -# --------------- -# Call child make -# --------------- - -"" : - @$(MAKE) -f $(MAKE_FILE) all - -# ------------ -# Make install -# ------------ - -install: - @echo - @echo '==== INSTALL =================================================' - @if [ -e $(INSTALL_DIR) ]; then \ - if [ ! -d $(INSTALL_DIR) ]; then \ - echo '### Fail to create installing directory ###' ;\ - echo '### Stop the installation ###' ;\ - exit ;\ - fi ;\ - else \ - echo " mkdir -p $(INSTALL_DIR)" ;\ - mkdir -p $(INSTALL_DIR) ;\ - fi - cp $(EXE_FILE) $(INSTALL_DIR) - @cd $(INSTALL_DIR) ; ls -l `pwd`/$(EXE_FILE) - -#----------- -# Make clean -# ---------- - -clean: - @echo - @echo '==== CLEAN ===================================================' - - $(RM) $(EXE_FILE) *.o *.mod - - $(RM) log.make.$(EXE_FILE) - -#----------------------------------------------------------------------------- -# -- Child make -- -#----------------------------------------------------------------------------- - -# --------- -# Libraries -# --------- - -INCS = $(NETCDF_INCLUDE) -I$(NEMSIO_INC) -LIBS = $(NEMSIO_LIB) $(BACIO_LIB4) $(W3NCO_LIBd) $(SP_LIB4) $(NETCDF_LDFLAGS) - -# ------------ -# Source files -# ------------ - -SRCSF90 = \ - kinds.f90 \ - constants.f90 \ - physcons.f90 \ - mpi_interface.f90 \ - namelist_def.f90 \ - variable_interface.f90 \ - netcdfio_interface.f90 \ - interpolation_interface.f90 \ - gfs_nems_interface.f90 \ - fv3_interface.f90 - -SRCS = $(SRCSF77) $(SRCSF90) - -# ------------ -# Object files -# ------------ - -OBJS = ${SRCSF90:.f90=.o} ${SRCSF77:.f=.o} - -# ------------ -# Dependencies -# ------------ -MAKE_DEPEND = Makefile.dependency -include $(MAKE_DEPEND) - -# ----------------------- -# Default compiling rules -# ----------------------- - -.SUFFIXES : -.SUFFIXES : .F90 .f90 .f .c .o - -.f90.o : - @echo - @echo '---> Compiling $<' - $(F90) $(FCFFLAGS) $(INCS) $(OPTIMIZATION) $(DEBUG) -c $< - -.f.o : - @echo - @echo '---> Compiling $<' - $(F77) $(FCFFLAGS) $(OPTIMIZATION) $(DEBUG) -c $< - -# ------------------------ -# Call compiler and linker -# ------------------------ - -all: REGRID_NEMSIO - -REGRID_NEMSIO: $(OBJS) - $(LD) $(LDFLAGS) $(OBJS) $(INCS) main.f90 $(LIBS) -o $(EXE_FILE) > $(LOG_FILE) - -help: - @ echo "Available targets:" - @ echo " make creates executable" - @ echo " make install creates exec & places it in bin" - @ echo " make clean cleans objects, exec, and alien files" diff --git a/sorc/regrid_nemsio.fd/Makefile.dependency b/sorc/regrid_nemsio.fd/Makefile.dependency deleted file mode 100644 index 52f6e800..00000000 --- a/sorc/regrid_nemsio.fd/Makefile.dependency +++ /dev/null @@ -1,9 +0,0 @@ -kinds.o: kinds.f90 -constants.o: constants.f90 kinds.o -physcons.o: physcons.f90 kinds.o -variable_interface.o: variable_interface.f90 namelist_def.o physcons.o constants.o kinds.o -namelist_def.o: namelist_def.f90 mpi_interface.o kinds.o -netcdfio_interface.o: netcdfio_interface.f90 kinds.o -interpolation_interface.o: interpolation_interface.f90 constants.o kinds.o namelist_def.o netcdfio_interface.o -gfs_nems_interface.o: gfs_nems_interface.f90 variable_interface.o constants.o kinds.o mpi_interface.o namelist_def.o -fv3_interface.o: fv3_interface.f90 variable_interface.o interpolation_interface.o constants.o kinds.o mpi_interface.o namelist_def.o netcdfio_interface.o gfs_nems_interface.o diff --git a/sorc/supvit.fd/makefile b/sorc/supvit.fd/makefile deleted file mode 100644 index 288e42be..00000000 --- a/sorc/supvit.fd/makefile +++ /dev/null @@ -1,31 +0,0 @@ -SHELL= /bin/sh -ISIZE = 4 -RSIZE = 8 -COMP= ifort -##LIBS_SUP= -L/contrib/nceplibs/nwprod/lib -lw3emc_d -lw3nco_d -lg2_d -lbacio_4 -ljasper -lpng -lz -LDFLAGS= -##ccs FFLAGS= -O -qflttrap=ov:zero:inv:enable -qcheck -qextchk -qwarn64 -qintsize=$(ISIZE) -qrealsize=$(RSIZE) -# FFLAGS= -O2 -check bounds -check format -xHost -fpe0 -# DEBUG= -check bounds -check format -FFLAGS= -O2 -g -i$(ISIZE) -r$(RSIZE) - -supvit: supvit_main.f supvit_modules.o - @echo " " - @echo " Compiling program that sorts and updates vitals records...." - $(COMP) $(FFLAGS) $(LDFLAGS) supvit_modules.o supvit_main.f $(LIBS_SUP) -o supvit - @echo " " - -supvit_modules.o: supvit_modules.f - @echo " " - @echo " Compiling the modules....." - $(COMP) -c supvit_modules.f -o supvit_modules.o - @echo " " - -CMD = supvit - -clean: - -rm -f *.o *.mod - -install: - mv $(CMD) ../../exec/$(CMD) - diff --git a/sorc/syndat_getjtbul.fd/makefile b/sorc/syndat_getjtbul.fd/makefile deleted file mode 100755 index 3ac5730f..00000000 --- a/sorc/syndat_getjtbul.fd/makefile +++ /dev/null @@ -1,23 +0,0 @@ -SHELL= /bin/sh -#LIBS= -L/nwprod/lib -lw3nco_v2.0.5_4 -#LIBS= -L/contrib/nceplibs/nwprod/lib -lw3nco_v2.0.5_4 -FC= ifort -#DEBUG = -ftrapuv -check all -fp-stack-check -fstack-protector -##DEBUG = -ftrapuv -fp-stack-check -fstack-protector -FFLAGS= -O3 -g -traceback -assume noold_ldout_format $(DEBUG) -LDFLAGS= -SRCS= getjtbul.f -OBJS= getjtbul.o -CMD= syndat_getjtbul - -all: $(CMD) - -$(CMD): $(OBJS) - $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS_SYN_GET) - -clean: - -rm -f $(OBJS) - -install: - -mv $(CMD) ../../exec/$(CMD) - diff --git a/sorc/syndat_maksynrc.fd/makefile b/sorc/syndat_maksynrc.fd/makefile deleted file mode 100755 index 9adcb17e..00000000 --- a/sorc/syndat_maksynrc.fd/makefile +++ /dev/null @@ -1,21 +0,0 @@ -SHELL= /bin/sh -#LIBS= -L/nwprod/lib -lw3nco_v2.0.5_4 -lbacio_v2.0.1_4 -##LIBS_SYN_MAK= -L/contrib/nceplibs/nwprod/lib -lw3nco_v2.0.5_4 -lbacio_v2.0.1_4 -FC= ifort -#DEBUG = -ftrapuv -check all -check nooutput_conversion -fp-stack-check -fstack-protector -FFLAGS= -O3 -g -traceback -assume noold_ldout_format $(DEBUG) -LDFLAGS= -SRCS= maksynrc.f -OBJS= maksynrc.o -CMD= syndat_maksynrc - -all: $(CMD) - -$(CMD): $(OBJS) - $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS_SYN_MAK) - -clean: - -rm -f $(OBJS) - -install: - mv $(CMD) ../../exec/$(CMD) diff --git a/sorc/syndat_qctropcy.fd/makefile b/sorc/syndat_qctropcy.fd/makefile deleted file mode 100755 index d667c26c..00000000 --- a/sorc/syndat_qctropcy.fd/makefile +++ /dev/null @@ -1,23 +0,0 @@ -SHELL= /bin/sh -#LIBS= -L/nwprod/lib -lw3nco_v2.0.5_8 -##LIBS= -L/contrib/nceplibs/nwprod/lib -lw3nco_v2.0.5_8 -FC= ifort -#DEBUG = -ftrapuv -check all -check noarg_temp_created -fp-stack-check -fstack-protector -## if '-check all' enabled, include '-check noarg_temp_created' to avoid warning msgs indicating -## slight performance hit due to chosen method of passing array arguments to w3difdat -FFLAGS= -O3 -g -traceback -r8 -i8 -assume byterecl -assume noold_ldout_format $(DEBUG) -LDFLAGS= -SRCS= qctropcy.f -OBJS= qctropcy.o -CMD= syndat_qctropcy - -all: $(CMD) - -$(CMD): $(OBJS) - $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS_SYN_QCT) - -clean: - -rm -f $(OBJS) - -install: - mv $(CMD) ../../exec/$(CMD) diff --git a/sorc/tave.fd/makefile b/sorc/tave.fd/makefile deleted file mode 100755 index 3ccaf4b8..00000000 --- a/sorc/tave.fd/makefile +++ /dev/null @@ -1,25 +0,0 @@ -SHELL= /bin/sh -ISIZE = 4 -RSIZE = 8 -COMP= ifort -##INC = /contrib/nceplibs/nwprod/lib/incmod/g2_d -##LIBS= -L/contrib/nceplibs/nwprod/lib -lw3emc_d -lw3nco_d -lg2_d -lbacio_4 -ljasper -lpng -lz -LDFLAGS= -# DEBUG= -check all -debug all -traceback -FFLAGS= -O2 -g -traceback -I $(INC) -i$(ISIZE) -r$(RSIZE) -# FFLAGS= -O3 -I $(INC) -i$(ISIZE) -r$(RSIZE) - -tave: tave.f - @echo " " - @echo " Compiling the interpolation program....." - $(COMP) $(FFLAGS) $(LDFLAGS) tave.f $(LIBS) -o tave.x - @echo " " - -CMD = tave.x - -clean: - -rm -f *.o *.mod - -install: - mv $(CMD) ../../exec/$(CMD) - diff --git a/sorc/tocsbufr.fd/makefile_module b/sorc/tocsbufr.fd/makefile_module deleted file mode 100755 index 06f5ba70..00000000 --- a/sorc/tocsbufr.fd/makefile_module +++ /dev/null @@ -1,82 +0,0 @@ -SHELL=/bin/sh -# -# This makefile was produced by /usr/bin/fmgen at 11:21:07 AM on 10/28/94 -# If it is invoked by the command line -# make -f makefile -# it will compile the fortran modules indicated by SRCS into the object -# modules indicated by OBJS and produce an executable named a.out. -# -# If it is invoked by the command line -# make -f makefile a.out.prof -# it will compile the fortran modules indicated by SRCS into the object -# modules indicated by OBJS and produce an executable which profiles -# named a.out.prof. -# -# To remove all the objects but leave the executables use the command line -# make -f makefile clean -# -# To remove everything but the source files use the command line -# make -f makefile clobber -# -# To remove the source files created by /usr/bin/fmgen and this makefile -# use the command line -# make -f makefile void -# -# The parameters SRCS and OBJS should not need to be changed. If, however, -# you need to add a new module add the name of the source module to the -# SRCS parameter and add the name of the resulting object file to the OBJS -# parameter. The new modules are not limited to fortran, but may be C, YACC, -# LEX, or CAL. An explicit rule will need to be added for PASCAL modules. -# -SRCS= tocsbufr.f - -OBJS= tocsbufr.o - -# Tunable parameters -# -# FC Name of the fortran compiling system to use -# LDFLAGS Flags to the loader -# LIBS List of libraries -# CMD Name of the executable -# PROFLIB Library needed for profiling -# -FC = $(myFC) -LDFLAGS = $(myFCFLAGS) -LIBS = $(W3EMC_LIB4) \ - $(W3NCO_LIB4) \ - $(BUFR_LIB4) \ - $(BACIO_LIB4) \ - $(SP_LIB4) \ - $(SIGIO_LIB) -CMD = ../../exec/tocsbufr -PROFLIB = -lprof - -# To perform the default compilation, use the first line -# To compile with flowtracing turned on, use the second line -# To compile giving profile additonal information, use the third line -# WARNING: SIMULTANEOUSLY PROFILING AND FLOWTRACING IS NOT RECOMMENDED -FFLAGS = $(FFLAGSM) -#FFLAGS = -F -#FFLAGS = -Wf"-ez" - -# Lines from here on down should not need to be changed. They are the -# actual rules which make uses to build a.out. -# -all: $(CMD) - -$(CMD): $(OBJS) - $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS) - -# Make the profiled version of the command and call it a.out.prof -# -$(CMD).prof: $(OBJS) - $(FC) $(LDFLAGS) -o $(@) $(OBJS) $(PROFLIB) $(LIBS) - -clean: - -rm -f $(OBJS) - -clobber: clean - -rm -f $(CMD) $(CMD).prof - -void: clobber - -rm -f $(SRCS) makefile diff --git a/sorc/vint.fd/makefile b/sorc/vint.fd/makefile deleted file mode 100755 index 06647d1f..00000000 --- a/sorc/vint.fd/makefile +++ /dev/null @@ -1,27 +0,0 @@ -SHELL= /bin/sh -ISIZE = 4 -RSIZE = 8 -COMP= ifort -##INC = /contrib/nceplibs/nwprod/lib/incmod/g2_d -##LIBS= -L/contrib/nceplibs/nwprod/lib -lw3emc_d -lw3nco_d -lg2_d -lbacio_4 -ljasper -lpng -lz -LDFLAGS= -# FFLAGS= -O3 -I $(INC) -i$(ISIZE) -r$(RSIZE) -# DEBUG= -check all -debug all -traceback -FFLAGS= -O2 -g -traceback -I $(INC) -i$(ISIZE) -r$(RSIZE) - -vint: vint.f - @echo " " - @echo " Compiling the interpolation program....." - $(COMP) $(FFLAGS) $(LDFLAGS) vint.f $(LIBS) -o vint.x - @echo " " - -.PHONY: clean - -CMD = vint.x - -clean: - -rm -f *.o *.mod - -install: - mv $(CMD) ../../exec/$(CMD) - diff --git a/sorc/.gitignore b/src/.gitignore similarity index 100% rename from sorc/.gitignore rename to src/.gitignore diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..f0719c52 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,21 @@ +add_subdirectory(enkf_chgres_recenter.fd) +add_subdirectory(enkf_chgres_recenter_nc.fd) +add_subdirectory(fv3nc2nemsio.fd) +add_subdirectory(regrid_nemsio.fd) +add_subdirectory(gaussian_sfcanl.fd) +add_subdirectory(gfs_bufr.fd) +add_subdirectory(reg2grb2.fd) +add_subdirectory(tocsbufr.fd) +add_subdirectory(fbwndgfs.fd) +add_subdirectory(vint.fd) +add_subdirectory(tave.fd) +add_subdirectory(syndat_qctropcy.fd) +add_subdirectory(syndat_maksynrc.fd) +add_subdirectory(syndat_getjtbul.fd) +add_subdirectory(supvit.fd) + +add_subdirectory(mkgfsawps.fd) +add_subdirectory(overgridid.fd) +# add_subdirectory(rdbfmsua.fd) +add_subdirectory(webtitle.fd) + diff --git a/sorc/enkf_chgres_recenter.fd/.gitignore b/src/enkf_chgres_recenter.fd/.gitignore similarity index 100% rename from sorc/enkf_chgres_recenter.fd/.gitignore rename to src/enkf_chgres_recenter.fd/.gitignore diff --git a/sorc/enkf_chgres_recenter.fd/CMakeLists.txt b/src/enkf_chgres_recenter.fd/CMakeLists.txt similarity index 61% rename from sorc/enkf_chgres_recenter.fd/CMakeLists.txt rename to src/enkf_chgres_recenter.fd/CMakeLists.txt index 36389b8d..3bbdbbf0 100644 --- a/sorc/enkf_chgres_recenter.fd/CMakeLists.txt +++ b/src/enkf_chgres_recenter.fd/CMakeLists.txt @@ -15,15 +15,13 @@ endif() set(exe_name enkf_chgres_recenter.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - nemsio::nemsio - bacio::bacio_4 - ip::ip_d - sp::sp_d - w3nco::w3nco_d) +target_link_libraries(${exe_name} PRIVATE nemsio::nemsio + bacio::bacio_4 + ip::ip_d + sp::sp_d + w3emc::w3emc_d) if(OpenMP_Fortran_FOUND) - target_link_libraries(${exe_name} OpenMP::OpenMP_Fortran) + target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) endif() install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/enkf_chgres_recenter.fd/driver.f90 b/src/enkf_chgres_recenter.fd/driver.f90 similarity index 100% rename from sorc/enkf_chgres_recenter.fd/driver.f90 rename to src/enkf_chgres_recenter.fd/driver.f90 diff --git a/sorc/enkf_chgres_recenter.fd/input_data.f90 b/src/enkf_chgres_recenter.fd/input_data.f90 similarity index 100% rename from sorc/enkf_chgres_recenter.fd/input_data.f90 rename to src/enkf_chgres_recenter.fd/input_data.f90 diff --git a/sorc/enkf_chgres_recenter.fd/interp.f90 b/src/enkf_chgres_recenter.fd/interp.f90 similarity index 100% rename from sorc/enkf_chgres_recenter.fd/interp.f90 rename to src/enkf_chgres_recenter.fd/interp.f90 diff --git a/sorc/enkf_chgres_recenter.fd/output_data.f90 b/src/enkf_chgres_recenter.fd/output_data.f90 similarity index 100% rename from sorc/enkf_chgres_recenter.fd/output_data.f90 rename to src/enkf_chgres_recenter.fd/output_data.f90 diff --git a/sorc/enkf_chgres_recenter.fd/setup.f90 b/src/enkf_chgres_recenter.fd/setup.f90 similarity index 100% rename from sorc/enkf_chgres_recenter.fd/setup.f90 rename to src/enkf_chgres_recenter.fd/setup.f90 diff --git a/sorc/enkf_chgres_recenter.fd/utils.f90 b/src/enkf_chgres_recenter.fd/utils.f90 similarity index 100% rename from sorc/enkf_chgres_recenter.fd/utils.f90 rename to src/enkf_chgres_recenter.fd/utils.f90 diff --git a/sorc/enkf_chgres_recenter_nc.fd/CMakeLists.txt b/src/enkf_chgres_recenter_nc.fd/CMakeLists.txt similarity index 50% rename from sorc/enkf_chgres_recenter_nc.fd/CMakeLists.txt rename to src/enkf_chgres_recenter_nc.fd/CMakeLists.txt index 79375e34..bb446821 100644 --- a/sorc/enkf_chgres_recenter_nc.fd/CMakeLists.txt +++ b/src/enkf_chgres_recenter_nc.fd/CMakeLists.txt @@ -13,16 +13,14 @@ endif() set(exe_name enkf_chgres_recenter_nc.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - bacio::bacio_4 - ip::ip_4 - sp::sp_4 - w3nco::w3nco_4 - ncio::ncio - NetCDF::NetCDF_Fortran) +target_link_libraries(${exe_name} PRIVATE NetCDF::NetCDF_Fortran + bacio::bacio_4 + ip::ip_4 + sp::sp_4 + w3emc::w3emc_4 + ncio::ncio) if(OpenMP_Fortran_FOUND) - target_link_libraries(${exe_name} OpenMP::OpenMP_Fortran) + target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) endif() install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/enkf_chgres_recenter_nc.fd/driver.f90 b/src/enkf_chgres_recenter_nc.fd/driver.f90 similarity index 100% rename from sorc/enkf_chgres_recenter_nc.fd/driver.f90 rename to src/enkf_chgres_recenter_nc.fd/driver.f90 diff --git a/sorc/enkf_chgres_recenter_nc.fd/input_data.f90 b/src/enkf_chgres_recenter_nc.fd/input_data.f90 similarity index 100% rename from sorc/enkf_chgres_recenter_nc.fd/input_data.f90 rename to src/enkf_chgres_recenter_nc.fd/input_data.f90 diff --git a/sorc/enkf_chgres_recenter_nc.fd/interp.f90 b/src/enkf_chgres_recenter_nc.fd/interp.f90 similarity index 100% rename from sorc/enkf_chgres_recenter_nc.fd/interp.f90 rename to src/enkf_chgres_recenter_nc.fd/interp.f90 diff --git a/sorc/enkf_chgres_recenter_nc.fd/output_data.f90 b/src/enkf_chgres_recenter_nc.fd/output_data.f90 similarity index 100% rename from sorc/enkf_chgres_recenter_nc.fd/output_data.f90 rename to src/enkf_chgres_recenter_nc.fd/output_data.f90 diff --git a/sorc/enkf_chgres_recenter_nc.fd/setup.f90 b/src/enkf_chgres_recenter_nc.fd/setup.f90 similarity index 100% rename from sorc/enkf_chgres_recenter_nc.fd/setup.f90 rename to src/enkf_chgres_recenter_nc.fd/setup.f90 diff --git a/sorc/enkf_chgres_recenter_nc.fd/utils.f90 b/src/enkf_chgres_recenter_nc.fd/utils.f90 similarity index 100% rename from sorc/enkf_chgres_recenter_nc.fd/utils.f90 rename to src/enkf_chgres_recenter_nc.fd/utils.f90 diff --git a/sorc/fbwndgfs.fd/CMakeLists.txt b/src/fbwndgfs.fd/CMakeLists.txt similarity index 69% rename from sorc/fbwndgfs.fd/CMakeLists.txt rename to src/fbwndgfs.fd/CMakeLists.txt index dcdf057c..938fc774 100644 --- a/sorc/fbwndgfs.fd/CMakeLists.txt +++ b/src/fbwndgfs.fd/CMakeLists.txt @@ -10,12 +10,9 @@ endif() set(exe_name fbwndgfs.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - bacio::bacio_8 - ip::ip_8 - sp::sp_8 - w3emc::w3emc_8 - w3nco::w3nco_8) +target_link_libraries(${exe_name} PRIVATE bacio::bacio_8 + ip::ip_8 + sp::sp_8 + w3emc::w3emc_8) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/fbwndgfs.fd/fbwndgfs.f b/src/fbwndgfs.fd/fbwndgfs.f similarity index 100% rename from sorc/fbwndgfs.fd/fbwndgfs.f rename to src/fbwndgfs.fd/fbwndgfs.f diff --git a/sorc/fv3nc2nemsio.fd/0readme b/src/fv3nc2nemsio.fd/0readme similarity index 100% rename from sorc/fv3nc2nemsio.fd/0readme rename to src/fv3nc2nemsio.fd/0readme diff --git a/src/fv3nc2nemsio.fd/CMakeLists.txt b/src/fv3nc2nemsio.fd/CMakeLists.txt new file mode 100644 index 00000000..3c6d6171 --- /dev/null +++ b/src/fv3nc2nemsio.fd/CMakeLists.txt @@ -0,0 +1,15 @@ +list(APPEND fortran_src +constants.f90 +fv3_main.f90 +fv3_module.f90 +kinds.f90 +) + +set(exe_name fv3nc2nemsio.x) +add_executable(${exe_name} ${fortran_src}) +target_link_libraries(${exe_name} PRIVATE NetCDF::NetCDF_Fortran + bacio::bacio_4 + w3emc::w3emc_d + nemsio::nemsio) + +install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/fv3nc2nemsio.fd/constants.f90 b/src/fv3nc2nemsio.fd/constants.f90 similarity index 100% rename from sorc/fv3nc2nemsio.fd/constants.f90 rename to src/fv3nc2nemsio.fd/constants.f90 diff --git a/sorc/fv3nc2nemsio.fd/fv3_main.f90 b/src/fv3nc2nemsio.fd/fv3_main.f90 similarity index 100% rename from sorc/fv3nc2nemsio.fd/fv3_main.f90 rename to src/fv3nc2nemsio.fd/fv3_main.f90 diff --git a/sorc/fv3nc2nemsio.fd/fv3_module.f90 b/src/fv3nc2nemsio.fd/fv3_module.f90 similarity index 100% rename from sorc/fv3nc2nemsio.fd/fv3_module.f90 rename to src/fv3nc2nemsio.fd/fv3_module.f90 diff --git a/sorc/fv3nc2nemsio.fd/kinds.f90 b/src/fv3nc2nemsio.fd/kinds.f90 similarity index 100% rename from sorc/fv3nc2nemsio.fd/kinds.f90 rename to src/fv3nc2nemsio.fd/kinds.f90 diff --git a/sorc/gaussian_sfcanl.fd/.gitignore b/src/gaussian_sfcanl.fd/.gitignore similarity index 100% rename from sorc/gaussian_sfcanl.fd/.gitignore rename to src/gaussian_sfcanl.fd/.gitignore diff --git a/sorc/gaussian_sfcanl.fd/CMakeLists.txt b/src/gaussian_sfcanl.fd/CMakeLists.txt similarity index 61% rename from sorc/gaussian_sfcanl.fd/CMakeLists.txt rename to src/gaussian_sfcanl.fd/CMakeLists.txt index b83035e8..6bfe8387 100644 --- a/sorc/gaussian_sfcanl.fd/CMakeLists.txt +++ b/src/gaussian_sfcanl.fd/CMakeLists.txt @@ -1,5 +1,3 @@ -add_subdirectory(weight_gen) - list(APPEND fortran_src gaussian_sfcanl.f90 ) @@ -12,12 +10,10 @@ endif() set(exe_name gaussian_sfcanl.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - nemsio::nemsio - bacio::bacio_4 - sp::sp_4 - w3nco::w3nco_d - NetCDF::NetCDF_Fortran) +target_link_libraries(${exe_name} PRIVATE NetCDF::NetCDF_Fortran + bacio::bacio_4 + sp::sp_4 + w3emc::w3emc_d + nemsio::nemsio) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/gaussian_sfcanl.fd/gaussian_sfcanl.f90 b/src/gaussian_sfcanl.fd/gaussian_sfcanl.f90 similarity index 100% rename from sorc/gaussian_sfcanl.fd/gaussian_sfcanl.f90 rename to src/gaussian_sfcanl.fd/gaussian_sfcanl.f90 diff --git a/sorc/gfs_bufr.fd/CMakeLists.txt b/src/gfs_bufr.fd/CMakeLists.txt similarity index 68% rename from sorc/gfs_bufr.fd/CMakeLists.txt rename to src/gfs_bufr.fd/CMakeLists.txt index b0fc45b6..7df490d0 100644 --- a/sorc/gfs_bufr.fd/CMakeLists.txt +++ b/src/gfs_bufr.fd/CMakeLists.txt @@ -38,18 +38,16 @@ endif() set(exe_name gfs_bufr.x) add_executable(${exe_name} ${fortran_src} ${fortran_src_free}) -target_link_libraries( - ${exe_name} - nemsio::nemsio - bacio::bacio_4 - sigio::sigio - sp::sp_4 - w3emc::w3emc_4 - w3nco::w3nco_4 - bufr::bufr_4_DA - NetCDF::NetCDF_Fortran) +target_link_libraries(${exe_name} PRIVATE NetCDF::NetCDF_Fortran + bacio::bacio_4 + sigio::sigio + sp::sp_4 + w3emc::w3emc_4 + nemsio::nemsio + bufr::bufr_4) + if(OpenMP_Fortran_FOUND) - target_link_libraries(${exe_name} OpenMP::OpenMP_Fortran) + target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) endif() install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/gfs_bufr.fd/bfrhdr.f b/src/gfs_bufr.fd/bfrhdr.f similarity index 100% rename from sorc/gfs_bufr.fd/bfrhdr.f rename to src/gfs_bufr.fd/bfrhdr.f diff --git a/sorc/gfs_bufr.fd/bfrize.f b/src/gfs_bufr.fd/bfrize.f similarity index 100% rename from sorc/gfs_bufr.fd/bfrize.f rename to src/gfs_bufr.fd/bfrize.f diff --git a/sorc/gfs_bufr.fd/buff.f b/src/gfs_bufr.fd/buff.f similarity index 100% rename from sorc/gfs_bufr.fd/buff.f rename to src/gfs_bufr.fd/buff.f diff --git a/sorc/gfs_bufr.fd/calpreciptype.f b/src/gfs_bufr.fd/calpreciptype.f similarity index 100% rename from sorc/gfs_bufr.fd/calpreciptype.f rename to src/gfs_bufr.fd/calpreciptype.f diff --git a/sorc/gfs_bufr.fd/calwxt_gfs_baldwin.f b/src/gfs_bufr.fd/calwxt_gfs_baldwin.f similarity index 100% rename from sorc/gfs_bufr.fd/calwxt_gfs_baldwin.f rename to src/gfs_bufr.fd/calwxt_gfs_baldwin.f diff --git a/sorc/gfs_bufr.fd/calwxt_gfs_ramer.f b/src/gfs_bufr.fd/calwxt_gfs_ramer.f similarity index 100% rename from sorc/gfs_bufr.fd/calwxt_gfs_ramer.f rename to src/gfs_bufr.fd/calwxt_gfs_ramer.f diff --git a/sorc/gfs_bufr.fd/funcphys.f b/src/gfs_bufr.fd/funcphys.f similarity index 100% rename from sorc/gfs_bufr.fd/funcphys.f rename to src/gfs_bufr.fd/funcphys.f diff --git a/sorc/gfs_bufr.fd/gfsbufr.f b/src/gfs_bufr.fd/gfsbufr.f similarity index 100% rename from sorc/gfs_bufr.fd/gfsbufr.f rename to src/gfs_bufr.fd/gfsbufr.f diff --git a/sorc/gfs_bufr.fd/gslp.f b/src/gfs_bufr.fd/gslp.f similarity index 100% rename from sorc/gfs_bufr.fd/gslp.f rename to src/gfs_bufr.fd/gslp.f diff --git a/sorc/gfs_bufr.fd/lcl.f b/src/gfs_bufr.fd/lcl.f similarity index 100% rename from sorc/gfs_bufr.fd/lcl.f rename to src/gfs_bufr.fd/lcl.f diff --git a/sorc/gfs_bufr.fd/machine.f b/src/gfs_bufr.fd/machine.f similarity index 100% rename from sorc/gfs_bufr.fd/machine.f rename to src/gfs_bufr.fd/machine.f diff --git a/sorc/gfs_bufr.fd/meteorg.f b/src/gfs_bufr.fd/meteorg.f similarity index 100% rename from sorc/gfs_bufr.fd/meteorg.f rename to src/gfs_bufr.fd/meteorg.f diff --git a/sorc/gfs_bufr.fd/modstuff1.f b/src/gfs_bufr.fd/modstuff1.f similarity index 100% rename from sorc/gfs_bufr.fd/modstuff1.f rename to src/gfs_bufr.fd/modstuff1.f diff --git a/sorc/gfs_bufr.fd/mstadb.f b/src/gfs_bufr.fd/mstadb.f similarity index 100% rename from sorc/gfs_bufr.fd/mstadb.f rename to src/gfs_bufr.fd/mstadb.f diff --git a/sorc/gfs_bufr.fd/newsig1.f b/src/gfs_bufr.fd/newsig1.f similarity index 100% rename from sorc/gfs_bufr.fd/newsig1.f rename to src/gfs_bufr.fd/newsig1.f diff --git a/sorc/gfs_bufr.fd/physcons.f b/src/gfs_bufr.fd/physcons.f similarity index 100% rename from sorc/gfs_bufr.fd/physcons.f rename to src/gfs_bufr.fd/physcons.f diff --git a/sorc/gfs_bufr.fd/read_nemsio.f b/src/gfs_bufr.fd/read_nemsio.f similarity index 100% rename from sorc/gfs_bufr.fd/read_nemsio.f rename to src/gfs_bufr.fd/read_nemsio.f diff --git a/sorc/gfs_bufr.fd/read_netcdf.f b/src/gfs_bufr.fd/read_netcdf.f similarity index 100% rename from sorc/gfs_bufr.fd/read_netcdf.f rename to src/gfs_bufr.fd/read_netcdf.f diff --git a/sorc/gfs_bufr.fd/read_netcdf_p.f b/src/gfs_bufr.fd/read_netcdf_p.f similarity index 100% rename from sorc/gfs_bufr.fd/read_netcdf_p.f rename to src/gfs_bufr.fd/read_netcdf_p.f diff --git a/sorc/gfs_bufr.fd/rsearch.f b/src/gfs_bufr.fd/rsearch.f similarity index 100% rename from sorc/gfs_bufr.fd/rsearch.f rename to src/gfs_bufr.fd/rsearch.f diff --git a/sorc/gfs_bufr.fd/svp.f b/src/gfs_bufr.fd/svp.f similarity index 100% rename from sorc/gfs_bufr.fd/svp.f rename to src/gfs_bufr.fd/svp.f diff --git a/sorc/gfs_bufr.fd/tdew.f b/src/gfs_bufr.fd/tdew.f similarity index 100% rename from sorc/gfs_bufr.fd/tdew.f rename to src/gfs_bufr.fd/tdew.f diff --git a/sorc/gfs_bufr.fd/terp3.f b/src/gfs_bufr.fd/terp3.f similarity index 100% rename from sorc/gfs_bufr.fd/terp3.f rename to src/gfs_bufr.fd/terp3.f diff --git a/sorc/gfs_bufr.fd/vintg.f b/src/gfs_bufr.fd/vintg.f similarity index 100% rename from sorc/gfs_bufr.fd/vintg.f rename to src/gfs_bufr.fd/vintg.f diff --git a/sorc/mkgfsawps.fd/CMakeLists.txt b/src/mkgfsawps.fd/CMakeLists.txt similarity index 69% rename from sorc/mkgfsawps.fd/CMakeLists.txt rename to src/mkgfsawps.fd/CMakeLists.txt index 3be45ef5..f4079e9e 100644 --- a/sorc/mkgfsawps.fd/CMakeLists.txt +++ b/src/mkgfsawps.fd/CMakeLists.txt @@ -12,15 +12,12 @@ endif() set(exe_name mkgfsawps.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - bacio::bacio_4 - ip::ip_d - sp::sp_d - w3nco::w3nco_4 - w3nco::w3nco_d) +target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 + ip::ip_d + sp::sp_d + w3emc::w3emc_d) if(OpenMP_Fortran_FOUND) - target_link_libraries(${exe_name} OpenMP::OpenMP_Fortran) + target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) endif() -install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) \ No newline at end of file +install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/mkgfsawps.fd/mkgfsawps.f b/src/mkgfsawps.fd/mkgfsawps.f old mode 100755 new mode 100644 similarity index 100% rename from sorc/mkgfsawps.fd/mkgfsawps.f rename to src/mkgfsawps.fd/mkgfsawps.f diff --git a/sorc/overgridid.fd/CMakeLists.txt b/src/overgridid.fd/CMakeLists.txt similarity index 84% rename from sorc/overgridid.fd/CMakeLists.txt rename to src/overgridid.fd/CMakeLists.txt index 807117f1..6b4f249f 100644 --- a/sorc/overgridid.fd/CMakeLists.txt +++ b/src/overgridid.fd/CMakeLists.txt @@ -12,9 +12,7 @@ endif() set(exe_name overgridid.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - bacio::bacio_4 - w3nco::w3nco_4) +target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 + w3emc::w3emc_4) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/overgridid.fd/overgridid.f b/src/overgridid.fd/overgridid.f old mode 100755 new mode 100644 similarity index 100% rename from sorc/overgridid.fd/overgridid.f rename to src/overgridid.fd/overgridid.f diff --git a/sorc/overgridid.fd/sample.script b/src/overgridid.fd/sample.script similarity index 100% rename from sorc/overgridid.fd/sample.script rename to src/overgridid.fd/sample.script diff --git a/sorc/rdbfmsua.fd/CMakeLists.txt b/src/rdbfmsua.fd/CMakeLists.txt similarity index 73% rename from sorc/rdbfmsua.fd/CMakeLists.txt rename to src/rdbfmsua.fd/CMakeLists.txt index f514936e..4b9e3a45 100644 --- a/sorc/rdbfmsua.fd/CMakeLists.txt +++ b/src/rdbfmsua.fd/CMakeLists.txt @@ -12,11 +12,9 @@ endif() set(exe_name rdbfmsua.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - bufr::bufr_4 - gempak::gempak - gfortran::gfortran - w3nco::w3nco_4) +target_link_libraries(${exe_name} PRIVATE bufr::bufr_4 + w3emc::w3emc_4 + gempak::gempak + gfortran::gfortran) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/rdbfmsua.fd/MAPFILE b/src/rdbfmsua.fd/MAPFILE similarity index 100% rename from sorc/rdbfmsua.fd/MAPFILE rename to src/rdbfmsua.fd/MAPFILE diff --git a/sorc/rdbfmsua.fd/README b/src/rdbfmsua.fd/README old mode 100755 new mode 100644 similarity index 100% rename from sorc/rdbfmsua.fd/README rename to src/rdbfmsua.fd/README diff --git a/sorc/rdbfmsua.fd/README.new b/src/rdbfmsua.fd/README.new old mode 100755 new mode 100644 similarity index 100% rename from sorc/rdbfmsua.fd/README.new rename to src/rdbfmsua.fd/README.new diff --git a/sorc/rdbfmsua.fd/makefile b/src/rdbfmsua.fd/makefile old mode 100755 new mode 100644 similarity index 100% rename from sorc/rdbfmsua.fd/makefile rename to src/rdbfmsua.fd/makefile diff --git a/sorc/rdbfmsua.fd/makefile.hera b/src/rdbfmsua.fd/makefile.hera old mode 100755 new mode 100644 similarity index 100% rename from sorc/rdbfmsua.fd/makefile.hera rename to src/rdbfmsua.fd/makefile.hera diff --git a/sorc/rdbfmsua.fd/makefile.wcoss_cray b/src/rdbfmsua.fd/makefile.wcoss_cray old mode 100755 new mode 100644 similarity index 100% rename from sorc/rdbfmsua.fd/makefile.wcoss_cray rename to src/rdbfmsua.fd/makefile.wcoss_cray diff --git a/sorc/rdbfmsua.fd/makefile.wcoss_dell_p3 b/src/rdbfmsua.fd/makefile.wcoss_dell_p3 old mode 100755 new mode 100644 similarity index 100% rename from sorc/rdbfmsua.fd/makefile.wcoss_dell_p3 rename to src/rdbfmsua.fd/makefile.wcoss_dell_p3 diff --git a/sorc/rdbfmsua.fd/rdbfmsua.f b/src/rdbfmsua.fd/rdbfmsua.f old mode 100755 new mode 100644 similarity index 100% rename from sorc/rdbfmsua.fd/rdbfmsua.f rename to src/rdbfmsua.fd/rdbfmsua.f diff --git a/sorc/rdbfmsua.fd/rdbfmsua.f_org b/src/rdbfmsua.fd/rdbfmsua.f_org old mode 100755 new mode 100644 similarity index 100% rename from sorc/rdbfmsua.fd/rdbfmsua.f_org rename to src/rdbfmsua.fd/rdbfmsua.f_org diff --git a/sorc/reg2grb2.fd/CMakeLists.txt b/src/reg2grb2.fd/CMakeLists.txt similarity index 52% rename from sorc/reg2grb2.fd/CMakeLists.txt rename to src/reg2grb2.fd/CMakeLists.txt index c866ca51..3bdb1188 100644 --- a/sorc/reg2grb2.fd/CMakeLists.txt +++ b/src/reg2grb2.fd/CMakeLists.txt @@ -11,18 +11,16 @@ endif() set(exe_name reg2grb2.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - landsfcutil::landsfcutil_d - ip::ip_d - sp::sp_d - bacio::bacio_4 - w3nco::w3nco_4 - wgrib2::wgrib2 - NetCDF::NetCDF_Fortran) +target_link_libraries(${exe_name} PRIVATE NetCDF::NetCDF_Fortran + landsfcutil::landsfcutil_d + ip::ip_d + sp::sp_d + bacio::bacio_4 + w3emc::w3emc_4 + wgrib2::wgrib2) if(OpenMP_Fortran_FOUND) - target_link_libraries(${exe_name} OpenMP::OpenMP_Fortran) + target_link_libraries(${exe_name} PRIVATE OpenMP::OpenMP_Fortran) endif() install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/reg2grb2.fd/reg2grb2.f b/src/reg2grb2.fd/reg2grb2.f similarity index 100% rename from sorc/reg2grb2.fd/reg2grb2.f rename to src/reg2grb2.fd/reg2grb2.f diff --git a/sorc/reg2grb2.fd/regdiag.f b/src/reg2grb2.fd/regdiag.f similarity index 100% rename from sorc/reg2grb2.fd/regdiag.f rename to src/reg2grb2.fd/regdiag.f diff --git a/sorc/regrid_nemsio.fd/CMakeLists.txt b/src/regrid_nemsio.fd/CMakeLists.txt similarity index 53% rename from sorc/regrid_nemsio.fd/CMakeLists.txt rename to src/regrid_nemsio.fd/CMakeLists.txt index 068a7213..dbd5138c 100644 --- a/sorc/regrid_nemsio.fd/CMakeLists.txt +++ b/src/regrid_nemsio.fd/CMakeLists.txt @@ -15,13 +15,11 @@ variable_interface.f90 set(exe_name regrid_nemsio.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - nemsio::nemsio - bacio::bacio_4 - sp::sp_d - w3nco::w3nco_d - NetCDF::NetCDF_Fortran - MPI::MPI_Fortran) +target_link_libraries(${exe_name} PRIVATE NetCDF::NetCDF_Fortran + MPI::MPI_Fortran + bacio::bacio_4 + sp::sp_d + w3emc::w3emc_d + nemsio::nemsio) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/regrid_nemsio.fd/constants.f90 b/src/regrid_nemsio.fd/constants.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/constants.f90 rename to src/regrid_nemsio.fd/constants.f90 diff --git a/sorc/regrid_nemsio.fd/fv3_interface.f90 b/src/regrid_nemsio.fd/fv3_interface.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/fv3_interface.f90 rename to src/regrid_nemsio.fd/fv3_interface.f90 diff --git a/sorc/regrid_nemsio.fd/gfs_nems_interface.f90 b/src/regrid_nemsio.fd/gfs_nems_interface.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/gfs_nems_interface.f90 rename to src/regrid_nemsio.fd/gfs_nems_interface.f90 diff --git a/sorc/regrid_nemsio.fd/interpolation_interface.f90 b/src/regrid_nemsio.fd/interpolation_interface.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/interpolation_interface.f90 rename to src/regrid_nemsio.fd/interpolation_interface.f90 diff --git a/sorc/regrid_nemsio.fd/kinds.f90 b/src/regrid_nemsio.fd/kinds.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/kinds.f90 rename to src/regrid_nemsio.fd/kinds.f90 diff --git a/sorc/regrid_nemsio.fd/main.f90 b/src/regrid_nemsio.fd/main.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/main.f90 rename to src/regrid_nemsio.fd/main.f90 diff --git a/sorc/regrid_nemsio.fd/mpi_interface.f90 b/src/regrid_nemsio.fd/mpi_interface.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/mpi_interface.f90 rename to src/regrid_nemsio.fd/mpi_interface.f90 diff --git a/sorc/regrid_nemsio.fd/namelist_def.f90 b/src/regrid_nemsio.fd/namelist_def.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/namelist_def.f90 rename to src/regrid_nemsio.fd/namelist_def.f90 diff --git a/sorc/regrid_nemsio.fd/netcdfio_interface.f90 b/src/regrid_nemsio.fd/netcdfio_interface.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/netcdfio_interface.f90 rename to src/regrid_nemsio.fd/netcdfio_interface.f90 diff --git a/sorc/regrid_nemsio.fd/physcons.f90 b/src/regrid_nemsio.fd/physcons.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/physcons.f90 rename to src/regrid_nemsio.fd/physcons.f90 diff --git a/sorc/regrid_nemsio.fd/regrid_nemsio_interface.f90 b/src/regrid_nemsio.fd/regrid_nemsio_interface.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/regrid_nemsio_interface.f90 rename to src/regrid_nemsio.fd/regrid_nemsio_interface.f90 diff --git a/sorc/regrid_nemsio.fd/variable_interface.f90 b/src/regrid_nemsio.fd/variable_interface.f90 similarity index 100% rename from sorc/regrid_nemsio.fd/variable_interface.f90 rename to src/regrid_nemsio.fd/variable_interface.f90 diff --git a/sorc/supvit.fd/CMakeLists.txt b/src/supvit.fd/CMakeLists.txt similarity index 85% rename from sorc/supvit.fd/CMakeLists.txt rename to src/supvit.fd/CMakeLists.txt index 106fe3a7..7562641e 100644 --- a/sorc/supvit.fd/CMakeLists.txt +++ b/src/supvit.fd/CMakeLists.txt @@ -11,9 +11,6 @@ endif() set(exe_name supvit.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - w3emc::w3emc_d - w3nco::w3nco_d) +target_link_libraries(${exe_name} PRIVATE w3emc::w3emc_d) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/supvit.fd/supvit_main.f b/src/supvit.fd/supvit_main.f similarity index 100% rename from sorc/supvit.fd/supvit_main.f rename to src/supvit.fd/supvit_main.f diff --git a/sorc/supvit.fd/supvit_modules.f b/src/supvit.fd/supvit_modules.f similarity index 100% rename from sorc/supvit.fd/supvit_modules.f rename to src/supvit.fd/supvit_modules.f diff --git a/sorc/syndat_getjtbul.fd/CMakeLists.txt b/src/syndat_getjtbul.fd/CMakeLists.txt similarity index 84% rename from sorc/syndat_getjtbul.fd/CMakeLists.txt rename to src/syndat_getjtbul.fd/CMakeLists.txt index 9659f0a2..2d9cb9be 100644 --- a/sorc/syndat_getjtbul.fd/CMakeLists.txt +++ b/src/syndat_getjtbul.fd/CMakeLists.txt @@ -8,8 +8,6 @@ endif() set(exe_name syndat_getjtbul.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - w3nco::w3nco_4) +target_link_libraries(${exe_name} PRIVATE w3emc::w3emc_4) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/syndat_getjtbul.fd/getjtbul.f b/src/syndat_getjtbul.fd/getjtbul.f similarity index 100% rename from sorc/syndat_getjtbul.fd/getjtbul.f rename to src/syndat_getjtbul.fd/getjtbul.f diff --git a/sorc/syndat_maksynrc.fd/CMakeLists.txt b/src/syndat_maksynrc.fd/CMakeLists.txt similarity index 84% rename from sorc/syndat_maksynrc.fd/CMakeLists.txt rename to src/syndat_maksynrc.fd/CMakeLists.txt index 38893bbe..10801803 100644 --- a/sorc/syndat_maksynrc.fd/CMakeLists.txt +++ b/src/syndat_maksynrc.fd/CMakeLists.txt @@ -8,8 +8,6 @@ endif() set(exe_name syndat_maksynrc.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - w3nco::w3nco_4) +target_link_libraries(${exe_name} PRIVATE w3emc::w3emc_4) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/syndat_maksynrc.fd/maksynrc.f b/src/syndat_maksynrc.fd/maksynrc.f similarity index 100% rename from sorc/syndat_maksynrc.fd/maksynrc.f rename to src/syndat_maksynrc.fd/maksynrc.f diff --git a/sorc/syndat_qctropcy.fd/CMakeLists.txt b/src/syndat_qctropcy.fd/CMakeLists.txt similarity index 89% rename from sorc/syndat_qctropcy.fd/CMakeLists.txt rename to src/syndat_qctropcy.fd/CMakeLists.txt index b8814c29..f0eb426a 100644 --- a/sorc/syndat_qctropcy.fd/CMakeLists.txt +++ b/src/syndat_qctropcy.fd/CMakeLists.txt @@ -10,8 +10,6 @@ endif() set(exe_name syndat_qctropcy.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - w3nco::w3nco_8) +target_link_libraries(${exe_name} PRIVATE w3emc::w3emc_8) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/syndat_qctropcy.fd/qctropcy.f b/src/syndat_qctropcy.fd/qctropcy.f similarity index 100% rename from sorc/syndat_qctropcy.fd/qctropcy.f rename to src/syndat_qctropcy.fd/qctropcy.f diff --git a/sorc/tave.fd/CMakeLists.txt b/src/tave.fd/CMakeLists.txt similarity index 71% rename from sorc/tave.fd/CMakeLists.txt rename to src/tave.fd/CMakeLists.txt index b24a91fe..70905a0b 100644 --- a/sorc/tave.fd/CMakeLists.txt +++ b/src/tave.fd/CMakeLists.txt @@ -10,10 +10,8 @@ endif() set(exe_name tave.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - bacio::bacio_4 - w3nco::w3nco_d - g2::g2_d) +target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 + w3emc::w3emc_d + g2::g2_d) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/tave.fd/tave.f b/src/tave.fd/tave.f similarity index 100% rename from sorc/tave.fd/tave.f rename to src/tave.fd/tave.f diff --git a/sorc/tocsbufr.fd/CMakeLists.txt b/src/tocsbufr.fd/CMakeLists.txt similarity index 62% rename from sorc/tocsbufr.fd/CMakeLists.txt rename to src/tocsbufr.fd/CMakeLists.txt index ed1dc8e6..5f55927b 100644 --- a/sorc/tocsbufr.fd/CMakeLists.txt +++ b/src/tocsbufr.fd/CMakeLists.txt @@ -10,13 +10,10 @@ endif() set(exe_name tocsbufr.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - bacio::bacio_4 - sigio::sigio - sp::sp_4 - w3emc::w3emc_4 - w3nco::w3nco_4 - bufr::bufr_4_DA) +target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 + sigio::sigio + sp::sp_4 + w3emc::w3emc_4 + bufr::bufr_4) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/tocsbufr.fd/tocsbufr.f b/src/tocsbufr.fd/tocsbufr.f similarity index 100% rename from sorc/tocsbufr.fd/tocsbufr.f rename to src/tocsbufr.fd/tocsbufr.f diff --git a/sorc/vint.fd/CMakeLists.txt b/src/vint.fd/CMakeLists.txt similarity index 71% rename from sorc/vint.fd/CMakeLists.txt rename to src/vint.fd/CMakeLists.txt index 21bf6901..118faab2 100644 --- a/sorc/vint.fd/CMakeLists.txt +++ b/src/vint.fd/CMakeLists.txt @@ -10,10 +10,8 @@ endif() set(exe_name vint.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - bacio::bacio_4 - w3nco::w3nco_d - g2::g2_d) +target_link_libraries(${exe_name} PRIVATE bacio::bacio_4 + w3emc::w3emc_d + g2::g2_d) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/vint.fd/vint.f b/src/vint.fd/vint.f similarity index 100% rename from sorc/vint.fd/vint.f rename to src/vint.fd/vint.f diff --git a/sorc/webtitle.fd/CMakeLists.txt b/src/webtitle.fd/CMakeLists.txt similarity index 91% rename from sorc/webtitle.fd/CMakeLists.txt rename to src/webtitle.fd/CMakeLists.txt index 505b8d64..94aff269 100644 --- a/sorc/webtitle.fd/CMakeLists.txt +++ b/src/webtitle.fd/CMakeLists.txt @@ -12,8 +12,6 @@ endif() set(exe_name webtitle.x) add_executable(${exe_name} ${fortran_src}) -target_link_libraries( - ${exe_name} - w3nco::w3nco_4) +target_link_libraries(${exe_name} PRIVATE w3emc::w3emc_4) install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/sorc/webtitle.fd/README b/src/webtitle.fd/README old mode 100755 new mode 100644 similarity index 100% rename from sorc/webtitle.fd/README rename to src/webtitle.fd/README diff --git a/sorc/webtitle.fd/webtitle.f b/src/webtitle.fd/webtitle.f old mode 100755 new mode 100644 similarity index 100% rename from sorc/webtitle.fd/webtitle.f rename to src/webtitle.fd/webtitle.f diff --git a/ush/CMakeLists.txt b/ush/CMakeLists.txt new file mode 100644 index 00000000..9e24306c --- /dev/null +++ b/ush/CMakeLists.txt @@ -0,0 +1,10 @@ +list(APPEND ush_files + finddate.sh + make_ntc_bull.pl + make_NTC_file.pl + make_tif.sh + month_name.sh + ) + +install(PROGRAMS ${ush_files} + DESTINATION "ush") diff --git a/ush/build.sh b/ush/build.sh new file mode 100755 index 00000000..c4f43811 --- /dev/null +++ b/ush/build.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +set -eu + +# Get the root of the cloned GFS-utils directory +readonly DIR_ROOT=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )/.." && pwd -P) + +# User Options +BUILD_TYPE=${BUILD_TYPE:-"Release"} +CMAKE_OPTS=${CMAKE_OPTS:-} +COMPILER=${COMPILER:-"intel"} +BUILD_DIR=${BUILD_DIR:-"${DIR_ROOT}/build"} +INSTALL_PREFIX=${INSTALL_PREFIX:-"${DIR_ROOT}/install"} + +#==============================================================================# + +# Detect machine (sets MACHINE_ID) +source $DIR_ROOT/ush/detect_machine.sh + +# Load modules +source $DIR_ROOT/ush/module-setup.sh +module use $DIR_ROOT/modulefiles +module load gfsutils_$MACHINE_ID +module list + +# Collect BUILD Options +CMAKE_OPTS+=" -DCMAKE_BUILD_TYPE=$BUILD_TYPE" + +# Install destination for built executables, libraries, CMake Package config +CMAKE_OPTS+=" -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX" + +# Re-use or create a new BUILD_DIR (Default: create new BUILD_DIR) +[[ ${BUILD_CLEAN:-"YES"} =~ [yYtT] ]] && rm -rf $BUILD_DIR +mkdir -p $BUILD_DIR && cd $BUILD_DIR + +# Configure, build, install +set -x +cmake $CMAKE_OPTS $DIR_ROOT +make -j ${BUILD_JOBS:-8} VERBOSE=${BUILD_VERBOSE:-} +make install +set +x + +exit diff --git a/ush/detect_machine.sh b/ush/detect_machine.sh new file mode 100755 index 00000000..ecd1ad53 --- /dev/null +++ b/ush/detect_machine.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +case $(hostname -f) in + + adecflow0[12].acorn.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### acorn + alogin0[12].acorn.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### acorn + clogin0[1-9].cactus.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### cactus01-9 + clogin10.cactus.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### cactus10 + dlogin0[1-9].dogwood.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### dogwood01-9 + dlogin10.dogwood.wcoss2.ncep.noaa.gov) MACHINE_ID=wcoss2 ;; ### dogwood10 + + gaea9) MACHINE_ID=gaea ;; ### gaea9 + gaea1[0-6]) MACHINE_ID=gaea ;; ### gaea10-16 + gaea9.ncrc.gov) MACHINE_ID=gaea ;; ### gaea9 + gaea1[0-6].ncrc.gov) MACHINE_ID=gaea ;; ### gaea10-16 + + hfe0[1-9]) MACHINE_ID=hera ;; ### hera01-9 + hfe1[0-2]) MACHINE_ID=hera ;; ### hera10-12 + hecflow01) MACHINE_ID=hera ;; ### heraecflow01 + + s4-submit.ssec.wisc.edu) MACHINE_ID=s4 ;; ### s4 + + fe[1-8]) MACHINE_ID=jet ;; ### jet01-8 + tfe[12]) MACHINE_ID=jet ;; ### tjet1-2 + + Orion-login-[1-4].HPC.MsState.Edu) MACHINE_ID=orion ;; ### orion1-4 + + cheyenne[1-6].cheyenne.ucar.edu) MACHINE_ID=cheyenne ;; ### cheyenne1-6 + cheyenne[1-6].ib0.cheyenne.ucar.edu) MACHINE_ID=cheyenne ;; ### cheyenne1-6 + chadmin[1-6].ib0.cheyenne.ucar.edu) MACHINE_ID=cheyenne ;; ### cheyenne1-6 + + login[1-4].stampede2.tacc.utexas.edu) MACHINE_ID=stampede ;; ### stampede1-4 + + login0[1-2].expanse.sdsc.edu) MACHINE_ID=expanse ;; ### expanse1-2 + + discover3[1-5].prv.cube) MACHINE_ID=discover ;; ### discover31-35 +esac + +# Overwrite auto-detect with MACHINE if set +MACHINE_ID=${MACHINE:-${MACHINE_ID}} + +# Append compiler (only on machines that have multiple compilers) +if [ $MACHINE_ID = hera ] || [ $MACHINE_ID = cheyenne ]; then + MACHINE_ID=${MACHINE_ID}.${COMPILER} +fi diff --git a/ush/machine-setup.sh b/ush/machine-setup.sh deleted file mode 100644 index 30d2e0dc..00000000 --- a/ush/machine-setup.sh +++ /dev/null @@ -1,154 +0,0 @@ -# Create a test function for sh vs. bash detection. The name is -# randomly generated to reduce the chances of name collision. -__ms_function_name="setup__test_function__$$" -eval "$__ms_function_name() { /bin/true ; }" - -# Determine which shell we are using -__ms_ksh_test=$( eval '__text="text" ; if [[ $__text =~ ^(t).* ]] ; then printf "%s" ${.sh.match[1]} ; fi' 2> /dev/null | cat ) -__ms_bash_test=$( eval 'if ( set | grep '$__ms_function_name' | grep -v name > /dev/null 2>&1 ) ; then echo t ; fi ' 2> /dev/null | cat ) - -if [[ ! -z "$__ms_ksh_test" ]] ; then - __ms_shell=ksh -elif [[ ! -z "$__ms_bash_test" ]] ; then - __ms_shell=bash -else - # Not bash or ksh, so assume sh. - __ms_shell=sh -fi - -target="" -USERNAME=$(echo $LOGNAME | awk '{ print tolower($0)'}) -##--------------------------------------------------------------------------- -export hname=$(hostname | cut -c 1,1) -if [[ -d /lfs/f1 ]] ; then - # We are on NOAA Cactus or Dogwood - if ( ! eval module help > /dev/null 2>&1 ) ; then - echo load the module command 1>&2 - source /usr/share/lmod/lmod/init/$__ms_shell - fi - target=wcoss2 - module reset - -elif [[ -d /work ]] ; then - # We are on MSU Orion - if ( ! eval module help > /dev/null 2>&1 ) ; then - echo load the module command 1>&2 - source /apps/lmod/lmod/init/$__ms_shell - fi - target=orion - module purge - export myFC=mpiifort - export FCOMP=mpiifort - -##--------------------------------------------------------------------------- -elif [[ -d /scratch1 ]] ; then - # We are on NOAA Hera - if ( ! eval module help > /dev/null 2>&1 ) ; then - echo load the module command 1>&2 - source /apps/lmod/lmod/init/$__ms_shell - fi - target=hera - module purge - export myFC=mpiifort - export FCOMP=mpiifort - -##--------------------------------------------------------------------------- -elif [[ -d /glade ]] ; then - # We are on NCAR Yellowstone - if ( ! eval module help > /dev/null 2>&1 ) ; then - echo load the module command 1>&2 - . /usr/share/Modules/init/$__ms_shell - fi - target=yellowstone - module purge - -##--------------------------------------------------------------------------- -elif [[ -d /lustre && -d /ncrc ]] ; then - # We are on GAEA. - if ( ! eval module help > /dev/null 2>&1 ) ; then - # We cannot simply load the module command. The GAEA - # /etc/profile modifies a number of module-related variables - # before loading the module command. Without those variables, - # the module command fails. Hence we actually have to source - # /etc/profile here. - source /etc/profile - __ms_source_etc_profile=yes - else - __ms_source_etc_profile=no - fi - module purge - module purge - # clean up after purge - unset _LMFILES_ - unset _LMFILES_000 - unset _LMFILES_001 - unset LOADEDMODULES - module load modules - if [[ -d /opt/cray/ari/modulefiles ]] ; then - module use -a /opt/cray/ari/modulefiles - fi - if [[ -d /opt/cray/pe/ari/modulefiles ]] ; then - module use -a /opt/cray/pe/ari/modulefiles - fi - if [[ -d /opt/cray/pe/craype/default/modulefiles ]] ; then - module use -a /opt/cray/pe/craype/default/modulefiles - fi - if [[ -s /etc/opt/cray/pe/admin-pe/site-config ]] ; then - source /etc/opt/cray/pe/admin-pe/site-config - fi - export NCEPLIBS=/lustre/f1/pdata/ncep_shared/NCEPLIBS/lib - if [[ -d "$NCEPLIBS" ]] ; then - module use $NCEPLIBS/modulefiles - fi - if [[ "$__ms_source_etc_profile" == yes ]] ; then - source /etc/profile - unset __ms_source_etc_profile - fi - target=gaea - - # GWV ADD - module load craype - module load intel - export NCEPLIBS=/lustre/f2/dev/ncep/George.Vandenberghe/NEWCOPY/l508/lib/ - module use $NCEPLIBS/modulefiles - export WRFPATH=$NCEPLIBS/wrf.shared.new/v1.1.1/src - export myFC=ftn - export FCOMP=ftn - # END GWV ADD - -##--------------------------------------------------------------------------- -elif [[ -d /lfs3 ]] ; then - # We are on NOAA Jet - if ( ! eval module help > /dev/null 2>&1 ) ; then - echo load the module command 1>&2 - source /apps/lmod/lmod/init/$__ms_shell - fi - target=jet - module purge - export NCEPLIBS=/mnt/lfs3/projects/hfv3gfs/gwv/ljtjet/lib - export NCEPLIBS=/mnt/lfs3/projects/hfv3gfs/gwv/NCEPLIBS.15X - module use $NCEPLIBS/modulefiles - export WRFPATH=$NCEPLIBS/wrf.shared.new/v1.1.1/src - export myFC=mpiifort - -##--------------------------------------------------------------------------- -elif [[ -d /data/prod ]] ; then - # We are on SSEC S4 - if ( ! eval module help > /dev/null 2>&1 ) ; then - echo load the module command 1>&2 - source /usr/share/lmod/lmod/init/$__ms_shell - fi - target=s4 - module purge - export myFC=mpiifort - export FCOMP=mpiifort - -else - echo WARNING: UNKNOWN PLATFORM 1>&2 -fi - -unset __ms_shell -unset __ms_ksh_test -unset __ms_bash_test -unset $__ms_function_name -unset __ms_function_name diff --git a/ush/module-setup.sh b/ush/module-setup.sh new file mode 100755 index 00000000..469fd4a3 --- /dev/null +++ b/ush/module-setup.sh @@ -0,0 +1,103 @@ +#!/bin/bash +set -eu + +if [[ $MACHINE_ID = jet* ]] ; then + # We are on NOAA Jet + if ( ! eval module help > /dev/null 2>&1 ) ; then + source /apps/lmod/lmod/init/bash + fi + module purge + +elif [[ $MACHINE_ID = hera* ]] ; then + # We are on NOAA Hera + if ( ! eval module help > /dev/null 2>&1 ) ; then + source /apps/lmod/lmod/init/bash + fi + module purge + +elif [[ $MACHINE_ID = orion* ]] ; then + # We are on Orion + if ( ! eval module help > /dev/null 2>&1 ) ; then + source /apps/lmod/init/bash + fi + module purge + +elif [[ $MACHINE_ID = s4* ]] ; then + # We are on SSEC Wisconsin S4 + if ( ! eval module help > /dev/null 2>&1 ) ; then + source /usr/share/lmod/lmod/init/bash + fi + module purge + +elif [[ $MACHINE_ID = wcoss2 ]]; then + # We are on WCOSS2 + module reset + +elif [[ $MACHINE_ID = cheyenne* ]] ; then + # We are on NCAR Cheyenne + if ( ! eval module help > /dev/null 2>&1 ) ; then + source /glade/u/apps/ch/modulefiles/default/localinit/localinit.sh + fi + module purge + +elif [[ $MACHINE_ID = stampede* ]] ; then + # We are on TACC Stampede + if ( ! eval module help > /dev/null 2>&1 ) ; then + source /opt/apps/lmod/lmod/init/bash + fi + module purge + +elif [[ $MACHINE_ID = gaea* ]] ; then + # We are on GAEA. + if ( ! eval module help > /dev/null 2>&1 ) ; then + # We cannot simply load the module command. The GAEA + # /etc/profile modifies a number of module-related variables + # before loading the module command. Without those variables, + # the module command fails. Hence we actually have to source + # /etc/profile here. + source /etc/profile + __ms_source_etc_profile=yes + else + __ms_source_etc_profile=no + fi + module purge + # clean up after purge + unset _LMFILES_ + unset _LMFILES_000 + unset _LMFILES_001 + unset LOADEDMODULES + module load modules + if [[ -d /opt/cray/ari/modulefiles ]] ; then + module use -a /opt/cray/ari/modulefiles + fi + if [[ -d /opt/cray/pe/ari/modulefiles ]] ; then + module use -a /opt/cray/pe/ari/modulefiles + fi + if [[ -d /opt/cray/pe/craype/default/modulefiles ]] ; then + module use -a /opt/cray/pe/craype/default/modulefiles + fi + if [[ -s /etc/opt/cray/pe/admin-pe/site-config ]] ; then + source /etc/opt/cray/pe/admin-pe/site-config + fi + if [[ "$__ms_source_etc_profile" == yes ]] ; then + source /etc/profile + unset __ms_source_etc_profile + fi + +elif [[ $MACHINE_ID = expanse* ]]; then + # We are on SDSC Expanse + if ( ! eval module help > /dev/null 2>&1 ) ; then + source /etc/profile.d/modules.sh + fi + module purge + module load slurm/expanse/20.02.3 + +elif [[ $MACHINE_ID = discover* ]]; then + # We are on NCCS discover + export SPACK_ROOT=/discover/nobackup/mapotts1/spack + export PATH=$PATH:$SPACK_ROOT/bin + . $SPACK_ROOT/share/spack/setup-env.sh + +else + echo WARNING: UNKNOWN PLATFORM 1>&2 +fi