Skip to content

Commit

Permalink
Update generate_manifest to support AUTO_MASKTABLE
Browse files Browse the repository at this point in the history
The introduction of AUTO_MASKTABLE caused errors in
generate_manifest.sh, which assumed that mask table handling was always
specified in parameters ending in MASKTABLE.  The command has been
modified to assume that it equals MASKTABLE.

This reveals two points of error:

* This should have been detected when the PR containing AUTO_MASKTABLE
  was added to MOM6-examples.  Unfortunately, it happily runs an empty
  manifest and reports success.

* generate_manifest.sh detected an error (admittedly an absurd
  nonintuitive one) but did not signal this error to the Makefile.

  Unfortunately, there does not appear to be a practical way to signal
  an error from within a flow control block such as if-else-fi.

Hopefully we are replacing this system anyway, so we will simply accept
this patch and move on.
  • Loading branch information
marshallward committed Apr 11, 2024
1 parent 2855f89 commit fde97e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/MRS/generate_manifest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ do
test -f $layout_file && \
npi=$(egrep "^NIPROC = " $layout_file | awk '{print $3}') &&
npj=$(egrep "^NJPROC = " $layout_file | awk '{print $3}') &&
masktable=($(grep MASKTABLE $layout_file | grep -v 'MASKTABLE = "MOM_mask_table"' | sed 's/MASKTABLE = "[a-zA-Z_]*\.//;s/".*//;s/[\.x]/ /g'))
masktable=($(grep "^ *MASKTABLE" $layout_file | grep -v 'MASKTABLE = "MOM_mask_table"' | sed 's/MASKTABLE = "[a-zA-Z_]*\.//;s/".*//;s/[\.x]/ /g'))
if [[ "${#masktable}" -gt "0" ]]; then
npes=$((${masktable[1]}*${masktable[2]}-${masktable[0]}))
else
Expand Down

0 comments on commit fde97e5

Please sign in to comment.