Skip to content

Commit

Permalink
Merge pull request #840
Browse files Browse the repository at this point in the history
apply autoformatting; update to latest develop for dev/ufs-weather-model branch; fix wave_elevation export for coupling with CICE6
  • Loading branch information
MatthewMasarik-NOAA authored Nov 3, 2022
2 parents d1df516 + 4293329 commit cec631c
Show file tree
Hide file tree
Showing 209 changed files with 226,409 additions and 227,977 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gnu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: checkout-ww3
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
with:
path: ww3
# Cache spack, OASIS, and compiler
# No way to flush Action cache, so key may have # appended
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: checkout-ww3
if: steps.cache-env.outputs.cache-hit != 'true'
uses: actions/checkout@v2
with:
with:
path: ww3

# Cache spack, OASIS, and compiler
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindMETIS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ find_package_handle_standard_args(
${CMAKE_FIND_PACKAGE_NAME}
REQUIRED_VARS metis_lib
metis_inc)

message(STATUS "Found METIS: ${metis_lib}")
22 changes: 11 additions & 11 deletions model/bin/ad3.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
compress=0 # source code compression par in w3adc
# if not 0, documentaion removed from .f90 file

# 1.d Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -
# 1.d Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -

source $(dirname $0)/w3_setenv
main_dir=$WWATCH3_DIR
Expand Down Expand Up @@ -201,14 +201,14 @@
if [ "$w3adc" = 'yes' ]
then

# 2.b Run CPP preprocessor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 2.b Run CPP preprocessor - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

#Generate list of CPP Flags based on switches:
CPPFLAGS=()
for sw in $sw_str
do
for sw in $sw_str
do
CPPFLAGS+=("-DW3_$sw")
done
done

CPPFLAGS+=("-D__WW3_SWITCHES__='$sw_str'")

Expand Down Expand Up @@ -259,14 +259,14 @@
# rm -f *.mod ## too indiscriminate

## Using find -iname most succinct, but maybe not all version of find have
## the -iname option?
## the -iname option?
# find . -iname "${name}.mod" -delete # not all versions of find have -iname?

# Fall back on grep -i
# Fall back on grep -i
mods=`ls *.mod 2> /dev/null | grep -i "${name}.mod"`
if [ -n ${mods} ]; then
rm -f ${mods}
fi
fi

# --------------------------------------------------------------------------- #
# 3. Compile source code f / f90 #
Expand Down Expand Up @@ -346,13 +346,13 @@ then
## ChrisB: Don't move all module files...could break parallel make.
## Just target specific module file (could be mixed case filename
## depending on compiler - use case insensitive find):
# mods=`ls *.mod 2> /dev/null`
# mods=`ls *.mod 2> /dev/null`

## Using find -iname most succinct, but maybe not all version of find have
## the -iname option?
## the -iname option?
# mods=`find . -iname "${name}.mod"` # not all versions of find have -iname?

# Fall back on grep -i
# Fall back on grep -i
mods=`ls *.mod 2> /dev/null | grep -i "${name}.mod"`
if [ -n "$mods" ]
then
Expand Down
2 changes: 1 addition & 1 deletion model/bin/all_switches
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
echo 'Find all switches in WAVEWATCH III'
echo '----------------------------------'

# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -
# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -

source $(dirname $0)/w3_setenv
main_dir=$WWATCH3_DIR
Expand Down
20 changes: 10 additions & 10 deletions model/bin/cmplr.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# remarks : #
# #
# - template files comp.tmpl and link.tmpl will be used to create the #
# comp and link file based on the following environment variables : #
# comp and link file based on the following environment variables : #
# $optc, $optl, $comp_seq, $comp_mpi, $optomp, $err_pattern, $warn_pattern #
# #
# #
Expand Down Expand Up @@ -61,8 +61,8 @@ if [ "$cmplr" == "mpt" ] || [ "$cmplr" == "mpt_debug" ] || [ "$cmplr" == "mpt_pr
comp_seq='ftn'
comp_mpi='ftn'
fi


# OPTIONS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# common options
Expand Down Expand Up @@ -104,7 +104,7 @@ if [ "$cmplr" == "mpt" ] || [ "$cmplr" == "mpt_debug" ] || [ "$cmplr" == "mpt_pr
optl="$optl -xhost"
fi

#Flags for CPP:
#Flags for CPP:
cppad3procflag='-E'
cppad3flag2=' '
cppad3flag3='-o'
Expand Down Expand Up @@ -140,7 +140,7 @@ if [ "$cmplr" == "intel" ] || [ "$cmplr" == "intel_debug" ] || [ "$c
comp_seq='ftn'
comp_mpi='ftn'
fi

if [ ! -z "$(echo $cmplr | grep cheyenne)" ] ; then
comp_seq='ifort'
comp_mpi='mpif90'
Expand All @@ -162,7 +162,7 @@ if [ "$cmplr" == "intel" ] || [ "$cmplr" == "intel_debug" ] || [ "$c
if [ ! -z "$(echo $cmplr | grep datarmor)" ] || [ "$cmplr" == "hera.intel" ] || [ "$cmplr" == "orion.intel" ] || \
[ "$cmplr" == "wcoss_cray" ] || [ "$cmplr" == "wcoss_dell_p3" ] || [ "$cmplr" == "cheyenne.intel" ] || \
[ "$cmplr" == "gaea.intel" ] || [ "$cmplr" == "jet.intel" ] || [ "$cmplr" == "wcoss2" ] || \
[ "$cmplr" == "stampede.intel" ] || [ "$cmplr" == "s4.intel" ] || [ "$cmplr" == "expanse.intel" ] ; then
[ "$cmplr" == "stampede.intel" ] || [ "$cmplr" == "s4.intel" ] || [ "$cmplr" == "expanse.intel" ] ; then
optomp="-qopenmp"
else
optomp="-openmp"
Expand Down Expand Up @@ -219,7 +219,7 @@ if [ "$cmplr" == "intel" ] || [ "$cmplr" == "intel_debug" ] || [ "$c
fi


#Flags for CPP:
#Flags for CPP:
cppad3procflag='-E'
cppad3flag2=' '
cppad3flag3='>'
Expand Down Expand Up @@ -301,7 +301,7 @@ if [ "$cmplr" == "gnu" ] || [ "$cmplr" == "gnu_debug" ] || [ "$cmplr" == "gnu_pr
optc="$optc -fPIC"
fi

#Flags for CPP:
#Flags for CPP:
cppad3procflag='-E'
cppad3flag2=' '
cppad3flag3='-o'
Expand Down Expand Up @@ -361,7 +361,7 @@ if [ "$cmplr" == "pgi" ] || [ "$cmplr" == "pgi_debug" ] || [ "$cmplr" == "pgi_pr
optl="$optl"
fi

#Flags for CPP:
#Flags for CPP:
cppad3procflag='-E'
cppad3flag2=' '
cppad3flag3='>'
Expand Down Expand Up @@ -419,7 +419,7 @@ if [ "$cmplr" == "ukmo_cray" ] || [ "$cmplr" == "ukmo_cray_debug" ] || \

# system-dependant options
# N/A
#Flags for CPP:
#Flags for CPP:
cppad3procflag='-eP'
cppad3flag2=' '
cppad3flag3='#'
Expand Down
8 changes: 4 additions & 4 deletions model/bin/comp.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
name="$1"
echo " Compiling $name"

# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1.b Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - -

rm -f $name.l
rm -f $name.o
Expand Down Expand Up @@ -120,7 +120,7 @@
fi
fi

# 3.b Make file comp.stat - - - - - - - - - - - - - - - - - - - - - - - - - -
# 3.b Make file comp.stat - - - - - - - - - - - - - - - - - - - - - - - - - -

echo "ERROR $nr_err" > comp.stat.$name
echo "WARNING $nr_war" >> comp.stat.$name
Expand All @@ -131,12 +131,12 @@
# comment lines are to be numbered.

# listing done by the compiler
if [ -s $name.lst ]
if [ -s $name.lst ]
then
mv $name.lst $name.l
fi
# add comp options, warnings and error to listing
if [ -s $name.l ]
if [ -s $name.l ]
then
echo '------------' >> $name.l
echo "$comp $opt" >> $name.l
Expand Down
10 changes: 5 additions & 5 deletions model/bin/find_switch
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
echo 'Find switches in WAVEWATCH III'
echo '------------------------------'

# 1.b Process/save input - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1.b Process/save input - - - - - - - - - - - - - - - - - - - - - - - - - - -

if test "$#" != '0'
then
Expand All @@ -38,21 +38,21 @@

echo ' ' ; echo "Files including $switch :" ; echo ' '

# 1.c Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -
# 1.c Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -

source $(dirname $0)/w3_setenv
main_dir=$WWATCH3_DIR
temp_dir=$WWATCH3_TMP
source=$WWATCH3_SOURCE
list=$WWATCH3_LIST

# 1.d Raw data file - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1.d Raw data file - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

### TO DO: This needs to be improved for CPP transition
### TO DO: This needs to be improved for CPP transition
cd $main_dir/src
grep "$switch" * | sed 's/\:/ /' | awk '{ print $1}' > ../.switch.files

# 1.e Output - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1.e Output - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

last=$NULL
for file in `cat ../.switch.files`
Expand Down
8 changes: 4 additions & 4 deletions model/bin/link.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
echo " Linking $prog"
input="$*"

# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -
# 1.b Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -

source $(dirname $0)/w3_setenv
main_dir=$WWATCH3_DIR
Expand All @@ -42,7 +42,7 @@
list=$WWATCH3_LIST


# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1.c Initial clean-up - - - - - - - - - - - - - - - - - - - - - - - - - - - -

rm -f $main_dir/exe/$prog

Expand Down Expand Up @@ -117,15 +117,15 @@
libs="$libs `$NETCDF_CONFIG --flibs` `$NETCDF_CONFIG --libs`"
fi

# parmetis library
# parmetis library
if [ "$prog" = 'ww3_shel' ] || [ "$prog" = 'ww3_multi' ] || [ "$prog" = 'ww3_sbs1' ] ; then
if [ "$pdlib_mod" = 'yes' ] ; then
if [ -z "$(env | grep METIS_PATH)" ] ; then
echo ''
echo "[ERROR] METIS_PATH is not defined"
exit 1
fi
echo "link with parmetis"
echo "link with parmetis"
libs="$libs $METIS_PATH/lib/libparmetis.a $METIS_PATH/lib/libmetis.a"
fi
fi
Expand Down
2 changes: 1 addition & 1 deletion model/bin/make_makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
# Get file - the list of files to be compiled
# and filel - list of files for linking a particular prog
create_file_list

case $prog in
ww3_grid) IDstring='Grid preprocessor' ;;
ww3_strt) IDstring='Initial conditions program' ;;
Expand Down
4 changes: 2 additions & 2 deletions model/bin/sort_all_switches
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Options:
otherwise this gives an error exit
EOF
}

# 1.a.3 Process input (part 1)

args=`getopt $optstr $*`
Expand Down Expand Up @@ -75,7 +75,7 @@ EOF
exit 1
fi

# 1.a.4 Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -
# 1.a.4 Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -

source $(dirname $0)/w3_setenv
main_dir=$WWATCH3_DIR
Expand Down
16 changes: 8 additions & 8 deletions model/bin/sort_switch
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Options:
-v : verbose, show program output
EOF
}

# 1.a.3 Process input (part 1)

args=`getopt $optstr $*`
Expand Down Expand Up @@ -112,14 +112,14 @@ EOF
exit 2
fi

# 1.a.4 Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -
# 1.a.4 Get data from setup file - - - - - - - - - - - - - - - - - - - - - - - -

source $(dirname $0)/w3_setenv
main_dir=$WWATCH3_DIR
temp_dir=$WWATCH3_TMP
source=$WWATCH3_SOURCE
list=$WWATCH3_LIST

# 1.a.5 Process input (part 2)

bin_dir="$main_dir/exe"
Expand All @@ -133,7 +133,7 @@ EOF

if [ ! -f $script ] ; then
echo " *** cannot find $script ***" ; exit 5 ; fi

# 1.a.6 Additional setups

outs="O0 O1 O2 O2a O2b O2c O3 O4 O5 O6 O7 O7a O7b O8 O9 O10 O11 O12 O13 O14 O15 O16"
Expand Down Expand Up @@ -162,7 +162,7 @@ EOF
echo ' '
fi

# 1.d Set up work space - - - - - - - - - - - - - - - - - - - - - - - - - - -
# 1.d Set up work space - - - - - - - - - - - - - - - - - - - - - - - - - - -

cd $temp_dir

Expand Down Expand Up @@ -300,7 +300,7 @@ EOF
fi
fi
done

done

if [ "$verbose" ]
Expand Down Expand Up @@ -433,7 +433,7 @@ EOF
# --------------------------------------------------------------------------- #
# 4. Dealing with left over switches #
# --------------------------------------------------------------------------- #
# 4.a Loop over additional types
# 4.a Loop over additional types

for type in out strace test
do
Expand All @@ -457,7 +457,7 @@ EOF

# 4.c Loop over switchs

for sw in $switches
for sw in $switches
do
i_fnd='0'
found=
Expand Down
Loading

0 comments on commit cec631c

Please sign in to comment.