Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modulefiles/workflow_utils.hera
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module load sp/2.3.3
module load ip/3.3.3
module load nemsio/2.5.2
module load nemsiogfs/2.5.3
#module load ncio/1.0.0
module load ncio/1.0.0
module load landsfcutil/2.4.1
module load wgrib2/2.0.8
module load sigio/2.3.2
module load g2/3.4.1
module load bufr/11.4.0
Expand Down
4 changes: 3 additions & 1 deletion modulefiles/workflow_utils.orion
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module load sp/2.3.3
module load ip/3.3.3
module load nemsio/2.5.2
module load nemsiogfs/2.5.3
#module load ncio/1.0.0
module load ncio/1.0.0
module load landsfcutil/2.4.1
module load wgrib2/2.0.8
module load sigio/2.3.2
module load g2/3.4.1
module load bufr/11.4.0
Expand Down
4 changes: 3 additions & 1 deletion modulefiles/workflow_utils.wcoss_dell_p3
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module load sp/2.3.3
module load ip/3.3.3
module load nemsio/2.5.2
module load nemsiogfs/2.5.3
#module load ncio/1.0.0
module load ncio/1.0.0
module load landsfcutil/2.4.1
module load wgrib2/2.0.8
module load sigio/2.3.2
module load g2/3.4.1
module load bufr/11.4.0
Expand Down
4 changes: 3 additions & 1 deletion sorc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ find_package(sp REQUIRED)
find_package(ip REQUIRED)
find_package(ncio REQUIRED)
find_package(nemsio REQUIRED)
find_package(nemsiogfs REQUIRED)
find_package(sigio REQUIRED)
find_package(g2 REQUIRED)
find_package(bufr REQUIRED)
find_package(landsfcutil REQUIRED)
find_package(wgrib2 REQUIRED)

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)
Expand Down
14 changes: 0 additions & 14 deletions sorc/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,6 @@ fi
fi
}

#------------------------------------
# build reg2grb2
#------------------------------------
$Build_reg2grb2 && {
echo " .... Building reg2grb2 for ocean/ice post .... "
./build_reg2grb2.sh > $logs_dir/build_reg2grb2.log 2>&1
rc=$?
if [[ $rc -ne 0 ]] ; then
echo "Fatal error in building reg2grb2."
echo "The log file is in $logs_dir/build_reg2grb2.log"
fi
((err+=$rc))
}

#------------------------------------
# build gsi
#------------------------------------
Expand Down
45 changes: 0 additions & 45 deletions sorc/build_reg2grb2.sh

This file was deleted.

24 changes: 4 additions & 20 deletions sorc/build_workflow_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,19 @@ set -eux
readonly UTILS_DIR=$(cd "$(dirname "$($cmd -f -n "${BASH_SOURCE[0]}" )" )" && pwd -P)

# Adapt for global-workflow structure.
target=${target:-"NULL"}
source ${UTILS_DIR}/machine-setup.sh > /dev/null 2>&1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this required?
which mahcine is requiring this to be sourced that supports the global workflow?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tried running build_workflow_utils stand-alone, $target isn't defined until it is set by machine-setup, so it was using NULL, then quietly not loading a modulefile because there wasn't one for NULL, then cmake would fail.

modulefile=${UTILS_DIR}/../modulefiles/workflow_utils.$target
if [[ -f $modulefile ]]; then
set +x
source ${UTILS_DIR}/machine-setup.sh > /dev/null 2>&1
source $modulefile
module list
set -x
else
echo "FATAL: modulefile $modulefile not found!"
exit 1
Comment on lines +15 to +17
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes that on every machine there has to be a modulefile.
If the software stack is in path, a modulefile is not required.
Which machine is this failing on?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need for this came to me based on the above comment. In the context of global-workflow, I don't know that manually loading a module beforehand is a use case to support, and I'd prefer the error to specify the actual problem rather than cmake just failing.

fi
# End adaptation

# Begin hack
# In place until nceplibs-ncio is in hpc-stack and available as a module
# After nceplibs-ncio is in hpc-stack, add the following line to
# ${UTILS_DIR}/../modulefiles/workflow_utils.<platform>
# "module load ncio/<ncio-version>"
# and remove this hack

[[ -d nceplibs-ncio ]] && rm -rf nceplibs-ncio
git clone -b develop https://github.com/noaa-emc/nceplibs-ncio
cd nceplibs-ncio
mkdir -p build && cd build
cmake -DCMAKE_INSTALL_PREFIX=../install ..
make -j ${BUILD_JOBS:-4} VERBOSE=${BUILD_VERBOSE:-}
make install
cd ../..
export ncio_ROOT=$PWD/nceplibs-ncio/install
# End hack

BUILD_DIR=${BUILD_DIR:-${UTILS_DIR}/build}
[[ -d $BUILD_DIR ]] && rm -rf $BUILD_DIR
mkdir -p ${BUILD_DIR}
Expand Down
3 changes: 1 addition & 2 deletions sorc/cpl_build.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
# ***** configuration of coupled workflow build *****

Building fv3gfs (fv3gfs) .............................. yes
Building reg2grb2 (reg2grb2) .......................... yes
Building ww3_prepost (ww3_prepost) .................... yes
Building gsi (gsi) .................................... no
Building gldas (gldas) ................................ no
Building ncep_post (ncep_post) ........................ yes
Building ufs_utils (ufs_utils) ........................ no
Building gldas (gldas) ................................ no
Building gfs_wafs (gfs_wafs) .......................... no
Building workflow_utils (workflow_utils)............... no
Building workflow_utils (workflow_utils)............... yes
Building gfs_util (gfs_util) .......................... no


Expand Down
2 changes: 1 addition & 1 deletion sorc/link_fv3gfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ for workflowexec in fbwndgfs gfs_bufr regrid_nemsio supvit syndat_getjtbul \
$LINK ../sorc/install/bin/${workflowexec}.x $workflowexec
done
for workflowexec in enkf_chgres_recenter.x enkf_chgres_recenter_nc.x fv3nc2nemsio.x \
tave.x vint.x ; do
tave.x vint.x reg2grb2.x ; do
[[ -s $workflowexec ]] && rm -f $workflowexec
$LINK ../sorc/install/bin/$workflowexec .
done
Expand Down
28 changes: 28 additions & 0 deletions sorc/reg2grb2.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
list(APPEND fortran_src
reg2grb2.f
regdiag.f
)

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -free -convert big_endian -fp-model precise -assume byterecl")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fconvert=big-endian")
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
Comment on lines +16 to +20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has anyone verified that all of these are actually used in this program?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went through the makefile and compared which ones were being linked. I didn't go through the code line by line.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a question for @BrianCurtis-NOAA, but landsfcutil is a new dependency for this PR, so I assume yes for that at least.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aerorahul the old build_reg2grb2.sh has landsfcutil in a LIBS export which was then used in the makefile that was used to build reg2grb2. I don't see any subroutines that seem to be using any landsfcutil subroutines, but if needed I will spend more time on going line by line to see if i missed something. Let me know.

wgrib2::wgrib2_api
NetCDF::NetCDF_Fortran)

if(OpenMP_Fortran_FOUND)
target_link_libraries(${exe_name} OpenMP::OpenMP_Fortran)
endif()

install(TARGETS ${exe_name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
26 changes: 0 additions & 26 deletions sorc/reg2grb2.fd/Makefile

This file was deleted.