Skip to content

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
* release/1.4.0: (209 commits)
  Version 1.4.0
  CURRENT2WAM bug fix contributed by JB
  BATHYMETRY: disable bounds checks for debug builds
  IFS-49R2-SYNC: update remaining validation hashes
  PRESET: fix for non-etopo SP runs
  IFS-49R2-SYNC: fix mis-merges
  Disable DR_HOOK MPI_INIT assertion
  Update README with lack of GPU support for 1.4.x
  IFS-49R2-SYNC: update test validation hashes
  IFS-SCRIPTS-3213: output bathymetry in GRIB
  IFS-49R2-SYNC: YOWGRIBHD rebase cleanup
  readpre correction
  IFS-49R2-SYNC: PROPAG_WAM and PROPAGS2 rebase cleanup
  IFS-49R2-SYNC: PRESET_WGRIB_TEMPLATE rebase cleanup
  IFS-49R2-SYNC: MPMINMAXMAVG merge conflicts
  IFS-49R2-SYNC: GRIB2WGRID rebase cleanup
  add MSS output to one grid point simulations
  adapt for new calls to WGRIBENOUT
  Set wave model identifier for 49r2
  IFS-SOURCE-ECWAM-49R2 SYNC: rebase cleanup
  ...
  • Loading branch information
wdeconinck committed Sep 3, 2024
2 parents 10cba1c + 863d1da commit 3a9e27d
Show file tree
Hide file tree
Showing 99 changed files with 4,837 additions and 2,391 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ translation toolchain Loki. Currently, three Loki transformations are supported:
The scc-hoist and scc-stack transformations offer superior performance to the scc transformation. Currently, only the
OpenACC programming model on Nvidia GPUs is supported.

NB: GPU offload is not yet supported for ecWAM 1.4.x.

Building
--------
The recommended option for building the GPU enabled ecWAM is to use the provided bundle, and pass the
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.4.0
43 changes: 38 additions & 5 deletions share/ecwam/scripts/ecwam_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ function ecwam_configure {
# cldomain: g for global model, m for limited area model and #
# s for swamp and one grid point cases. #
# llunstr unstructured grid option
# llgrib_bathy_out: T if model input bathymetry in grib
# llgrib_obstrt_out: T if subgrid obstruction coefficients in grib
# llobstrout: T if subgrid obstruction coefficients produced
# #
# Usage : ecwam_configure $wamresol $wamnfre $wambathy #
# ----- #
Expand All @@ -52,18 +55,36 @@ function ecwam_configure {
else
ifre1=3
fi
if [[ $wambathy = "ETOPO1" ]] ; then
deptha=3.0
else
deptha=5.0
fi

cldomain=g
llobstrct=T

llunstr=F
irgg=1

if [[ $wambathy == "aqua" ]]; then
llgrib_bathy_out=F
llgrib_obstrt_out=F
else
# preproc will output the bathymetry in grib
llgrib_bathy_out=T
# the unresolved bathymetry blocking coefficients in grib
llgrib_obstrt_out=T
fi

llobstrout=T
llgribout=T

if [[ $wambathy = "ETOPO1" ]] ; then
if [[ $llgrib_bathy_out = T ]] ; then
deptha=2.0
else
deptha=3.0
fi
else
deptha=5.0
fi

# set up different configuration
if [[ ${wamresol} =~ ^O[0-9]+$ ]]; then # Octahedral grids pattern. (Grid for TCO1279: O1280)
${SCRIPTS_DIR}/ecwam_grids.py ${wamresol} --grid_description > grid_description
Expand Down Expand Up @@ -197,6 +218,9 @@ function ecwam_configure {
##!!
cldomain=s
llobstrct=F
llgrib_bathy_out=F
llgrib_obstrt_out=F
llobstrout=F
##!!
elif [[ $wamresol = swamp ]] ; then
# swamp setup
Expand All @@ -211,6 +235,9 @@ function ecwam_configure {
##!!
cldomain=s
llobstrct=F
llgrib_bathy_out=F
llgrib_obstrt_out=F
llobstrout=F
##!!
elif [[ $wamresol = standrewbay ]] ; then
# St Andrew Bay setup
Expand All @@ -225,6 +252,9 @@ function ecwam_configure {
##!!
cldomain=m
llobstrct=F
llgrib_bathy_out=F
llgrib_obstrt_out=F
llobstrout=F
fr1=0.3
##!!
elif [[ $wamresol = gm20 ]] ; then
Expand All @@ -239,6 +269,9 @@ function ecwam_configure {
##!!
cldomain=m
llobstrct=F
llgrib_bathy_out=F
llgrib_obstrt_out=F
llobstrout=F
##!!
elif [[ ${wamresol} = custom ]] ; then
xdella=3.0
Expand Down
48 changes: 35 additions & 13 deletions share/ecwam/scripts/ecwam_run_create_bathymetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,25 @@ cat reference_levels >> for_md5
md5=$(cat for_md5 | md5sum | awk '{print $1}')
WAM_TOPO=v${ecwam_bathymetry_version}/bathymetry_${wamresol}_nfre${wamnfre}_${wambathy}_${md5}

${SCRIPTS_DIR}/ecwam_retrieve.sh data/bathymetry/${WAM_TOPO} ${DATA_DIR}/data/bathymetry/${WAM_TOPO} || {
echo "Could not retrieve data/bathymetry/${WAM_TOPO}"
}

if [ -f ${DATA_DIR}/data/bathymetry/${WAM_TOPO} ]; then
echo "\n\n\t File ${WAM_TOPO} has been found\n"
subgrid_files=()
for ip in 0 1 2; do
subgrid_files+=(v${ecwam_bathymetry_version}/wam_grib_subgrid_${ip}_${wamnfre}_${wambathy}_${md5})
done

grid_files_found=true
for file in ${WAM_TOPO} ${subgrid_files[@]}; do
${SCRIPTS_DIR}/ecwam_retrieve.sh data/bathymetry/${file} ${DATA_DIR}/data/bathymetry/${file} || {
grid_files_found=false
echo "Could not retrieve data/bathymetry/${file}"
break
}
done

if [[ ${grid_files_found} == true ]]; then
echo "\n\n\t File ${WAM_TOPO} and subgrid files have been found\n"
else
echo "\n\n\t File ${DATA_DIR}/data/bathymetry/${WAM_TOPO} was not found\n"
echo "\t It needs to be computed from $wambathy data set\n"
echo "\n\n\t File ${DATA_DIR}/data/bathymetry/${WAM_TOPO} and/or subgrid files were not found\n"
echo "\t They need to be computed from the $wambathy data set\n"

if [[ $wambathy = "ETOPO1" ]] ; then
echo "\n\n\t Getting ETOPO1 data set\n"
Expand All @@ -168,17 +178,19 @@ else
EOF
if [[ $wambathy = "ETOPO1" ]] ; then
cat >> input_to_wam_bathymetry <<EOF
#Grib input:
F
#Grib output:
#Grib input of high resolution bathymetry:
F
#output of unresolved bathymetry obstruction coefficients:
${llobstrout}
#Grib output of unresolved bathymetry obstruction coefficients (if llobstrout is true} :
${llgribout}
EOF
fi

cat >> input_to_wam_bathymetry <<EOF
#Grid resolution (XDELLA):
${xdella}
#Domain boundaries S,N,W,E (AMOSOP AMONOP AMOWEP AMOEAP) :
#Domain boundaries S,N,W,E (DAMOSOP DAMONOP DAMOWEP DAMOEAP) :
${amosop} ${amonop} ${amowep} ${amoeap}
#PERIODIC DOMAIN (IPER=0 for NON-periodic domain, IPER=1 for periodic domain):
${iper}
Expand Down Expand Up @@ -222,9 +234,19 @@ EOF
mkdir -p ${DATA_DIR}/data/bathymetry/$(dirname ${WAM_TOPO})
mv wam_topo_${cwamresol} ${DATA_DIR}/data/bathymetry/${WAM_TOPO}

for ip in 0 1 2; do
mv wam_grib_subgrid_${ip} ${DATA_DIR}/data/bathymetry/${subgrid_files[$ip]}
done

fi

(cd ${RUN_DIR} && ln -sf ${DATA_DIR}/data/bathymetry/${WAM_TOPO} wam_topo)
cd ${RUN_DIR}

ln -sf ${DATA_DIR}/data/bathymetry/${WAM_TOPO} wam_topo
echo "\n\t Bathymetry is available in DATA_DIR with symlink in RUN_DIR:\n\n\t ${RUN_DIR}/wam_topo -> ${DATA_DIR}/data/bathymetry/${WAM_TOPO}"
for ip in 0 1 2; do
ln -sf ${DATA_DIR}/data/bathymetry/${subgrid_files[$ip]} wam_subgrid_${ip}
echo "\n\t wam_grib_subgrid_${ip} is available in DATA_DIR with symlink in RUN_DIR:\n\n\t ${RUN_DIR}/wam_subgrid_${ip} -> ${DATA_DIR}/data/bathymetry/${subgrid_files[$ip]}"
done

cleanup
1 change: 1 addition & 0 deletions share/ecwam/scripts/ecwam_run_model.sh
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ cat > wam_namelist << EOF
LWAMRSETCI = T,
NGRIB_VERSION = 2,
LL_GRID_SIMPLE_MATRIX = F,
LLRSTGRIBPARAM = F,
YCLASS = "rd",
YEXPVER = "wave",
ISTREAM = 1045,
Expand Down
22 changes: 13 additions & 9 deletions share/ecwam/scripts/ecwam_run_preproc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ function cleanup() {

mv ${WORK_DIR}/wam_grid_tables ${RUN_DIR}/wam_grid_tables

for ip in 0 1 2; do
mv ${WORK_DIR}/wam_subgrid_${ip} ${RUN_DIR}/wam_subgrid_${ip}
done
if [[ ${laqua} = true ]]; then
for ip in 0 1 2; do
mv ${WORK_DIR}/wam_subgrid_${ip} ${RUN_DIR}/wam_subgrid_${ip}
done
fi

# Does not seem to be used further
# mv PARWAM ${RUN_DIR}/wam_parwam
Expand Down Expand Up @@ -111,15 +113,17 @@ cat > procin <<EOF
FR1= ${fr1},
IFRE1= ${ifre1},
IRGG= ${irgg},
XDELLA= ${xdella},
XDELLO= ${xdella},
AMOSOP= ${amosop},
AMONOP= ${amonop},
AMOWEP= ${amowep},
AMOEAP= ${amoeap},
DXDELLA= ${xdella},
DXDELLO= ${xdella},
DAMOSOP= ${amosop},
DAMONOP= ${amonop},
DAMOWEP= ${amowep},
DAMOEAP= ${amoeap},
LAQUA= ${laqua},
LLOBSTRCT= ${llobstrct},
LLUNSTR = ${llunstr},
LLGRIB_BATHY_OUT=${llgrib_bathy_out},
LLGRIB_OBSTRT_OUT=${llgrib_obstrt_out},
IFORM= 1,
ITEST= 0,
ITESTB= 4,
Expand Down
3 changes: 3 additions & 0 deletions share/ecwam/scripts/ecwam_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@ export MPL_MBX_SIZE=${MPL_MBX_SIZE:-${MBX_SIZE}}

[[ ! (-d ${ecwam_ROOT}/bin) ]] || export PATH=${ecwam_ROOT}/bin:${ecwam_ROOT}/share/${ECWAM_PROJECT_NAME}/scripts:$PATH

# Allow MPI to be initialised outside of DR_HOOK
export DR_HOOK_ASSERT_MPI_INITIALIZED=0

# export python interpreter
export ECWAM_PYTHON_INTERP=@ECWAM_PYTHON_INTERP@
7 changes: 7 additions & 0 deletions src/ecwam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ list( APPEND ecwam_srcs
frcutindex.F90
gc_dispersion.h
get_preset_wgrib_template.F90
getbobstrct.F90
getgrbobstrct.F90
getcurr.F90
getfrstwnd.F90
getspec.F90
Expand Down Expand Up @@ -116,6 +118,7 @@ list( APPEND ecwam_srcs
jonswap.F90
kerkei.F90
kgribsize.F90
ktoobs.F90
kurtosis.F90
kzeone.F90
makegrid.F90
Expand Down Expand Up @@ -300,8 +303,11 @@ list( APPEND ecwam_srcs
wsmfen.F90
wstream_strg.F90
wvalloc.F90
wvchkmid.F90
wvdealloc.F90
wvfricvelo.F90
wvopenbathy.F90
wvopensubbathy.F90
wvwamdecomp.F90
wvwaminit.F90
wvwaminit1.F90
Expand All @@ -324,6 +330,7 @@ list( APPEND ecwam_srcs
yowgrib.F90
yowgrib_handles.F90
yowgribhd.F90
yowgribinfo.F90
yowgrid.F90
yowgstats.F90
yowice.F90
Expand Down
4 changes: 2 additions & 2 deletions src/ecwam/adjust.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ SUBROUTINE ADJUST (WEST, EAST)
OLD_EAST = EAST
WEST = MOD (WEST + 720._JWRB, 360._JWRB)
EAST = MOD (EAST + 720._JWRB, 360._JWRB)
IF (OLD_WEST.NE.OLD_EAST) THEN
IF (WEST.GE.EAST) WEST = WEST - 360._JWRB
IF (OLD_WEST /= OLD_EAST) THEN
IF (WEST >= EAST) WEST = WEST - 360._JWRB
ENDIF

END SUBROUTINE ADJUST
Loading

0 comments on commit 3a9e27d

Please sign in to comment.