Skip to content

Commit

Permalink
Merge branch 'develop' into feature/new_orog
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed Dec 13, 2023
2 parents 6678129 + a757eb0 commit a01e090
Show file tree
Hide file tree
Showing 28 changed files with 3,520 additions and 160 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ option(FVCOMTOOLS "Enable building fvcom_tools.fd" ON)
option(GBLEVENTS "Enable building gblevents.fd" ON)
option(CPLD_GRIDGEN "Enable building cpld_gridgen.fd" ON)
option(WEIGHT_GEN "Enable building weight_gen.fd" ON)
option(OCEAN_MERGE "Enable building ocean_merge.fd" ON)

# Option to build application specific utilities
option(GFS "Enable building GFS-only utilities" OFF)
Expand All @@ -46,6 +47,7 @@ if(GFS)
set(GBLEVENTS OFF CACHE BOOL "Disable building gblevents.fd" FORCE)
set(CPLD_GRIDGEN OFF CACHE BOOL "Disable building cpld_gridgen.fd" FORCE)
set(WEIGHT_GEN OFF CACHE BOOL "Disable building weight_gen.fd" FORCE)
set(OCEAN_MERGE OFF CACHE BOOL "Disable building ocean_merge.fd" FORCE)
endif()

SET(TEST_FILE_DIR "." CACHE STRING "Check this directory for test files before using FTP.")
Expand Down
2 changes: 1 addition & 1 deletion cmake/mpiexec.hera
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# $2+ - Executable and its arguments
#

ACCOUNT=gsd-fv3
ACCOUNT=fv3-cpu
QOS=debug

NP=$1
Expand Down
20 changes: 12 additions & 8 deletions docs/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ https://github.com/ufs-community/UFS_UTILS.
- <a href="chgres_cube/index.html">chgres_cube</a> - Creates cold
start initial conditions for FV3 model runs.

- <a href="cpld_gridgen/index.html">cpld_gridgen</a> - Utility to
create the Fix and IC files for the S2SW and S2S applications

- <a href="emcsfc_ice_blend/index.html">emcsfc_ice_blend</a> - Blends
National Ice Center sea ice cover and EMC sea ice concentration data
to create a global sea ice analysis used to update the GFS once per
Expand Down Expand Up @@ -57,6 +60,15 @@ https://github.com/ufs-community/UFS_UTILS.
gnomonic grids, and to compute the equivalent global resolution of a
regional grid.

- <a href="lsm_routines/index.html">lsm_routines</a> - Land surface
model-specific routines that are utilised elsewhere within UFS_UTILS.
Currently, contains the routines required by global_cycle to
perform data assimilation updates to land model states

- <a href="ocean_merge/index.html">ocean_merge</a> - Utility to
determine the water mask by merging a lake mask with a mapped
ocean mask from MOM6.

- <a href="orog_mask_tools/index.html">orog_mask_tools</a> - Utilities
to create land mask, terrain and gravity wave drag fields; set lake
fraction and depth; creates an inland land mask.
Expand All @@ -70,14 +82,6 @@ https://github.com/ufs-community/UFS_UTILS.
top and the number of vertical levels. Outputs the 'ak' and 'bk'
parameters used by the forecast model to define the hybrid levels.

- <a href="lsm_routines/index.html">lsm_routines</a> - Land surface
model-specific routines that are utilised elsewhere within UFS_UTILS.
Currently, contains the routines required by global_cycle to
perform data assimilation updates to land model states

- <a href="cpld_gridgen/index.html">cpld_gridgen</a> - Utility to
create the Fix and IC files for the S2SW and S2S applications

- <a href="weight_gen/index.html">weight_gen</a> - Utility to
create gaussian grid ESMF 'scrip' files for use in creating
ESMF interpolation weight files.
10 changes: 6 additions & 4 deletions driver_scripts/driver_grid.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#SBATCH --open-mode=truncate
#SBATCH -o log.fv3_grid_driver
#SBATCH -e log.fv3_grid_driver
#SBATCH --nodes=1 --ntasks-per-node=24
#SBATCH --nodes=6 --ntasks-per-node=12
#SBATCH --partition=bigmem
#SBATCH -q debug
#SBATCH -t 00:20:00
#SBATCH -t 00:30:00

#-----------------------------------------------------------------------
# Driver script to create a cubic-sphere based model grid on Hera.
Expand Down Expand Up @@ -103,7 +103,7 @@ export soil_type_src="bnu.v3.30s" # Soil type data.
# 3) "statsgo.conus.30s" for CONUS 30s data
# 4) "statsgo.nh.30s" for NH 30s data
# 5) "statsgo.30s" for global 30s data
# For Beijing Norm. Univ. data
# For Beijing Norm. Univ. data
# 1) "bnu.v3.30s" for global 30s data.

# choose dataset sources for lakefrac & lakedepth so that lake_data_srce=LakeFrac_LakeDepth;
Expand All @@ -115,6 +115,7 @@ if [ $gtype = uniform ]; then
export add_lake=true # Add lake frac and depth to orography data.
export lake_cutoff=0.50 # return 0 if lake_frac < lake_cutoff & add_lake=T
export binary_lake=1 # return 1 if lake_frac >= lake_cutoff & add_lake=T
export ocn=${ocn:-"025"} # use one of "025", "050", "100", "500". Cannot be empty
elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down Expand Up @@ -150,14 +151,15 @@ fi

#-----------------------------------------------------------------------
# Check paths.
#
# home_dir - location of repository.
# TEMP_DIR - working directory.
# out_dir - where files will be placed upon completion.
#-----------------------------------------------------------------------

export home_dir=$SLURM_SUBMIT_DIR/..
export TEMP_DIR=/scratch2/NCEPDEV/stmp1/$LOGNAME/fv3_grid.$gtype
export out_dir=/scratch2/NCEPDEV/stmp1/$LOGNAME/my_grids
export out_dir=/scratch2/NCEPDEV/stmp1/$LOGNAME/my_grids_ocean_fixed/

#-----------------------------------------------------------------------
# Should not need to change anything below here.
Expand Down
2 changes: 1 addition & 1 deletion driver_scripts/driver_grid.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ if [ $gtype = uniform ]; then
export add_lake=true # Add lake frac and depth to orography data.
export lake_cutoff=0.50 # return 0 if lake_frac < lake_cutoff & add_lake=T
export binary_lake=1 # return 1 if lake_frac >= lake_cutoff & add_lake=T
export ocn=${ocn:-"025"} # use one of "025", "050", "100", "500". Cannot be empty
elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down Expand Up @@ -156,7 +157,6 @@ fi
export home_dir=$SLURM_SUBMIT_DIR/..
export TEMP_DIR=/lfs4/HFIP/emcda/$LOGNAME/stmp/fv3_grid.$gtype
export out_dir=/lfs4/HFIP/emcda/$LOGNAME/stmp/my_grids

#-----------------------------------------------------------------------
# Should not need to change anything below here.
#-----------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions driver_scripts/driver_grid.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ if [ $gtype = uniform ]; then
export add_lake=true # Add lake frac and depth to orography data.
export lake_cutoff=0.50 # return 0 if lake_frac < lake_cutoff & add_lake=T
export binary_lake=1 # return 1 if lake_frac >= lake_cutoff & add_lake=T
export ocn=${ocn:-"025"} # use one of "025", "050", "100", "500". Cannot be empty
elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down
2 changes: 1 addition & 1 deletion driver_scripts/driver_grid.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ if [ $gtype = uniform ]; then
export add_lake=true # Add lake frac and depth to orography data.
export lake_cutoff=0.50 # return 0 if lake_frac < lake_cutoff & add_lake=T
export binary_lake=1 # return 1 if lake_frac >= lake_cutoff & add_lake=T
export ocn=${ocn:-"025"} # use one of "025", "050", "100", "500". Cannot be empty
elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down Expand Up @@ -154,7 +155,6 @@ fi
export home_dir=$PBS_O_WORKDIR/..
export TEMP_DIR=/lfs/h2/emc/stmp/$LOGNAME/fv3_grid.$gtype
export out_dir=/lfs/h2/emc/stmp/$LOGNAME/my_grids

#-----------------------------------------------------------------------
# Should not need to change anything below here unless you want to
# to change the job card for the number of tasks to use. Then,
Expand Down
40 changes: 21 additions & 19 deletions modulefiles/build.s4.intel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@ help([[
Load environment to compile UFS_UTILS on S4 using Intel
]])

load(pathJoin("license_intel","S4"))
prepend_path("MODULEPATH", "/data/prod/hpc-stack/modulefiles/stack")
prepend_path("MODULEPATH", "/data/prod/jedi/spack-stack/spack-stack-1.5.0/envs/unified-env/install/modulefiles/Core")

hpc_ver=os.getenv("hpc_ver") or "1.2.0"
load(pathJoin("hpc", hpc_ver))
stack_intel_ver=os.getenv("stack_intel_ver") or "2021.5.0"
load(pathJoin("stack-intel", hpc_intel_ver))

hpc_intel_ver=os.getenv("hpc_intel_ver") or "2022.1"
load(pathJoin("hpc-intel", hpc_intel_ver))
stack_impi_ver=os.getenv("stack_impi_ver") or "2021.5.0"
load(pathJoin("stack-intel-oneapi-mpi", impi_ver))

impi_ver=os.getenv("impi_ver") or "2022.1"
load(pathJoin("hpc-impi", impi_ver))
cmake_ver=os.getenv("cmake_ver") or "3.23.1"
load(pathJoin("cmake", cmake_ver))

bacio_ver=os.getenv("bacio_ver") or "2.4.1"
load(pathJoin("bacio", bacio_ver))

g2_ver=os.getenv("g2_ver") or "3.4.5"
load(pathJoin("g2", g2_ver))

ip_ver=os.getenv("ip_ver") or "3.3.3"
ip_ver=os.getenv("ip_ver") or "4.3.0"
load(pathJoin("ip", ip_ver))

nemsio_ver=os.getenv("nemsio_ver") or "2.5.4"
Expand All @@ -29,31 +28,34 @@ load(pathJoin("nemsio", nemsio_ver))
sp_ver=os.getenv("sp_ver") or "2.3.3"
load(pathJoin("sp", sp_ver))

w3nco_ver=os.getenv("w3nco_ver") or "2.4.1"
load(pathJoin("w3nco", w3nco_ver))
w3emc_ver=os.getenv("w3emc_ver") or "2.10.0"
load(pathJoin("w3emc", w3emc_ver))

sfcio_ver=os.getenv("sfcio_ver") or "1.4.1"
load(pathJoin("sfcio", sfcio_ver))

sigio_ver=os.getenv("sigio_ver") or "2.3.2"
load(pathJoin("sigio", sigio_ver))

zlib_ver=os.getenv("zlib_ver") or "1.2.11"
zlib_ver=os.getenv("zlib_ver") or "1.2.13"
load(pathJoin("zlib", zlib_ver))

png_ver=os.getenv("png_ver") or "1.6.35"
png_ver=os.getenv("png_ver") or "1.6.37"
load(pathJoin("libpng", png_ver))

hdf5_ver=os.getenv("hdf5_ver") or "1.10.6"
load(pathJoin("hdf5", hdf5_ver))
netcdf_c_ver=os.getenv("netcdf_c_ver") or "4.9.2"
load(pathJoin("netcdf-c", netcdf_c_ver))

netcdf_ver=os.getenv("netcdf_ver") or "4.7.4"
load(pathJoin("netcdf", netcdf_ver))
netcdf_fortran_ver=os.getenv("netcdf_fortran_ver") or "4.6.0"
load(pathJoin("netcdf-fortran", netcdf_fortran_ver))

nccmp_ver=os.getenv("nccmp_ver") or "1.8.9.0"
nccmp_ver=os.getenv("nccmp_ver") or "1.9.0.1"
load(pathJoin("nccmp", nccmp_ver))

esmf_ver=os.getenv("esmf_ver") or "8.2.1b04"
esmf_ver=os.getenv("esmf_ver") or "8.4.2"
load(pathJoin("esmf", esmf_ver))

nco_ver=os.getenv("nco_ver") or "5.0.6"
load(pathJoin("nco", nco_ver))

whatis("Description: UFS_UTILS build environment")
2 changes: 1 addition & 1 deletion reg_tests/grid_gen/c96.uniform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ echo "Ending at: " `date`
cd $out_dir/C96

test_failed=0
for files in *tile*.nc ./fix_sfc/*tile*.nc
for files in *tile*.nc ./sfc/*tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/grid_gen/c96.viirs.bnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ echo "Ending at: " `date`
cd $out_dir/C96

test_failed=0
for files in *tile*.nc ./fix_sfc/*tile*.nc
for files in *tile*.nc ./sfc/*tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/grid_gen/esg.regional.pct.cat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ echo "Ending at: " `date`
cd $out_dir/C3113

test_failed=0
for files in *tile*.nc ./fix_sfc/*tile*.nc
for files in *tile*.nc ./sfc/*tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/grid_gen/esg.regional.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ echo "Ending at: " `date`
cd $out_dir/C3113

test_failed=0
for files in *tile*.nc ./fix_sfc/*tile*.nc
for files in *tile*.nc ./sfc/*tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/grid_gen/gfdl.regional.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ echo "Ending at: " `date`
cd $out_dir/C424

test_failed=0
for files in *tile*.nc ./fix_sfc/*tile*.nc
for files in *tile*.nc ./sfc/*tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
Expand Down
2 changes: 1 addition & 1 deletion reg_tests/grid_gen/regional.gsl.gwd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ echo "Ending at: " `date`
cd $out_dir/C772

test_failed=0
for files in *tile*.nc ./fix_sfc/*tile*.nc
for files in *tile*.nc ./sfc/*tile*.nc
do
if [ -f $files ]; then
echo CHECK $files
Expand Down
4 changes: 4 additions & 0 deletions sorc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ endif()
if(WEIGHT_GEN)
add_subdirectory(weight_gen.fd)
endif()
if(OCEAN_MERGE)
add_subdirectory(ocean_merge.fd)
endif()

26 changes: 26 additions & 0 deletions sorc/ocean_merge.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
list(APPEND fortran_src
merge_lake_ocnmsk.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")
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-argument-mismatch")
endif()
endif()

set(exe_name ocean_merge)
add_executable(${exe_name} ${fortran_src})
target_link_libraries(
${exe_name}

NetCDF::NetCDF_Fortran)

install(TARGETS ${exe_name})

# If doxygen documentation we enabled, build it.
if(ENABLE_DOCS)
add_subdirectory(docs)
endif()
15 changes: 15 additions & 0 deletions sorc/ocean_merge.fd/docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This is the CMake file for building this docs directory.
#
# Ed Hartnett 3/9/21

# Create doxyfile.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)

# Build documentation with target all.
add_custom_target(ocean_merge_doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API Documentation with Doxygen" VERBATIM)

# Ensure top-level docs have been generated.
add_dependencies(ocean_merge_doc doc)
Loading

0 comments on commit a01e090

Please sign in to comment.