Skip to content

Commit

Permalink
Build rdbfmsua.x with a traditional makefile (#57)
Browse files Browse the repository at this point in the history
This PR:
- builds `rdbfmsua.x` with a traditional makefile instead of cmake due
to problems with gempak and cmake. The issues are documented in #50
- skips building the above executable if the modulefile for this
executable is not found.
- only supports wcoss2, hera and orion at the moment where gempak is
available.

Fixes #54

Co-authored-by: Walter.Kolczynski <[email protected]>
  • Loading branch information
aerorahul and WalterKolczynski-NOAA authored Mar 20, 2024
1 parent 7cb499a commit ad6592f
Show file tree
Hide file tree
Showing 14 changed files with 151 additions and 264 deletions.
6 changes: 0 additions & 6 deletions modulefiles/gfsutils_hera.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,4 @@ load(pathJoin("cmake", cmake_ver))

load("gfsutils_common")

local gempak_ver=os.getenv("gempak_ver") or "7.4.2"
-- load(pathJoin("gempak", gempak_ver))

-- Used in rdbfmsua.f
setenv("gfortran_ROOT", "/apps/gnu/gcc-9.2.0")

whatis("Description: GFS utilities environment on Hera with Intel Compilers")
6 changes: 0 additions & 6 deletions modulefiles/gfsutils_orion.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,4 @@ load(pathJoin("cmake", cmake_ver))

load("gfsutils_common")

local gempak_ver=os.getenv("gempak_ver") or "7.5.1"
-- load(pathJoin("gempak", gempak_ver))

-- Used in rdbfmsua.f
setenv("gfortran_ROOT", "/apps/gcc-8/gcc-8.3.0")

whatis("Description: GFS utilities environment on Orion with Intel Compilers")
5 changes: 0 additions & 5 deletions modulefiles/gfsutils_wcoss2.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ 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 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("PrgEnv-intel", PrgEnv_intel_ver))
Expand All @@ -50,12 +49,8 @@ load(pathJoin("nemsio", nemsio_ver))
load(pathJoin("wrf_io", wrf_io_ver))
load(pathJoin("g2", g2_ver))
load(pathJoin("landsfcutil", landsfcutil_ver))
-- load(pathJoin("gempak", gempak_ver))
load(pathJoin("wgrib2", wgrib2_ver))

-- Used in rdbfmsua.f
setenv("gfortran_ROOT", "//opt/cray/pe/gcc/10.3.0/snos")

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")
Expand Down
26 changes: 26 additions & 0 deletions modulefiles/rdbfmsua_hera.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
help([[
Build environment for GFS utilities on Hera
]])

prepend_path("MODULEPATH", "/scratch1/NCEPDEV/nems/role.epic/spack-stack/spack-stack-1.6.0/envs/gsi-addon-dev/install/modulefiles/Core")

local stack_intel_ver=os.getenv("stack_intel_ver") or "2021.5.0"
local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1"
local cmake_ver=os.getenv("cmake_ver") or "3.23.1"

load(pathJoin("stack-intel", stack_intel_ver))
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))

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.10.0"
local gempak_ver=os.getenv("gempak_ver") or "7.4.2"

load(pathJoin("bufr", bufr_ver))
load(pathJoin("bacio", bacio_ver))
load(pathJoin("w3emc", w3emc_ver))
load(pathJoin("gempak", gempak_ver))

setenv("gfortran_ROOT", "/apps/gnu/gcc-9.2.0")

whatis("Description: GFS utilities environment on Hera with Intel Compilers")
25 changes: 25 additions & 0 deletions modulefiles/rdbfmsua_orion.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
help([[
Build environment for GFS utilities on Orion
]])

prepend_path("MODULEPATH", "/work/noaa/epic/role-epic/spack-stack/orion/spack-stack-1.6.0/envs/gsi-addon-env/install/modulefiles/Core")

local stack_intel_ver=os.getenv("stack_intel_ver") or "2022.0.2"
local stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.1"

load(pathJoin("stack-intel", stack_intel_ver))
load(pathJoin("stack-intel-oneapi-mpi", stack_impi_ver))

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.10.0"
local gempak_ver=os.getenv("gempak_ver") or "7.5.1"

load(pathJoin("bufr", bufr_ver))
load(pathJoin("bacio", bacio_ver))
load(pathJoin("w3emc", w3emc_ver))
load(pathJoin("gempak", gempak_ver))

setenv("gfortran_ROOT", "/apps/gcc-8/gcc-8.3.0")

whatis("Description: GFS utilities environment on Orion with Intel Compilers")
25 changes: 25 additions & 0 deletions modulefiles/rdbfmsua_wcoss2.intel.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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 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 gempak_ver=os.getenv("gempak_ver") or "7.14.1"

load(pathJoin("PrgEnv-intel", PrgEnv_intel_ver))
load(pathJoin("intel", intel_ver))
load(pathJoin("craype", craype_ver))

load(pathJoin("bufr", bufr_ver))
load(pathJoin("bacio", bacio_ver))
load(pathJoin("w3emc", w3emc_ver))
load(pathJoin("gempak", gempak_ver))

setenv("gfortran_ROOT", "/opt/cray/pe/gcc/10.3.0/snos")

whatis("Description: GFS utilities environment on WCOSS2 with Intel Compilers")
19 changes: 19 additions & 0 deletions src/rdbfmsua.fd/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SHELL=/bin/sh

include makefile.${MACHINE_ID}.${COMPILER}

CMD = rdbfmsua.x
OBJS = rdbfmsua.o

$(CMD): $(OBJS)
$(FC) $(LDFLAGS) -o $(@) $(OBJS) $(LIBS)

clean:
-rm -f ${OBJS}

clobber: clean
-rm -f ${CMD}

install:
-mv ${CMD} ${PREFIX}/bin/

9 changes: 9 additions & 0 deletions src/rdbfmsua.fd/makefile.hera.intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FC = ifort
FFLAGS = -g -traceback -I${GEMPAK}/include -I${OS_INC}
LIBS = ${BUFR_LIB4} \
${GEMLIB}/gemlib.a \
${GEMLIB}/appl.a \
${GEMLIB}/syslib.a \
${GEMLIB}/cgemlib.a \
${GEMLIB}/bridge.a \
-L${gfrortran_ROOT}/lib64 -lgfortran
9 changes: 9 additions & 0 deletions src/rdbfmsua.fd/makefile.orion.intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FC = ifort
FFLAGS = -g -traceback -I${GEMPAK}/include -I${OS_INC}
LIBS = ${BUFR_LIB4} \
${GEMLIB}/gemlib.a \
${GEMLIB}/appl.a \
${GEMLIB}/syslib.a \
${GEMLIB}/cgemlib.a \
${GEMLIB}/bridge.a \
-L${gfrortran_ROOT}/lib64 -lgfortran
6 changes: 6 additions & 0 deletions src/rdbfmsua.fd/makefile.wcoss2.intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FC = ftn
FFLAGS = -g -traceback -I${GEMINC} -I${OS_INC}
LIBS = ${BUFR_LIB4} \
-L${GEMOLB} -lgemlib -lappl -lsyslib -lcgemlib \
${GEMOLB}/libbridge.a \
${gfortran_ROOT}/lib64/libgfortran.a
84 changes: 0 additions & 84 deletions src/rdbfmsua.fd/to_be_deleted/makefile

This file was deleted.

76 changes: 0 additions & 76 deletions src/rdbfmsua.fd/to_be_deleted/makefile.hera

This file was deleted.

Loading

0 comments on commit ad6592f

Please sign in to comment.