Skip to content

Commit

Permalink
master: various updates to the make system VLab Issue #52315
Browse files Browse the repository at this point in the history
- use make j ${WW3_PARCOMPN} in w3_make to have parallel make
  the default for the environment variable WW3_PARCOMPN is 4 to
  allow for parllel make it  required setting *.{ext} to $file.{ext}
  in ad3 and comp
- changed loop structure in make_makefile to speed up the dependency
  checking for which modules are used for a file
- update w3_new
- cleaned up PDLIB compiling process removing the links of yow* from
  the ftn directory. NOTE: This puts a limitation on file naming such
  that yow*.* files must all be in the ftn/PDLIB directory
- add switch_OLD.MPI to .gitignore
- greps in make_makefile are now case insensitive VLab Issue #51311

Former-commit-id: d86cc66c30b63aca168d80fae735df3cccc963f2
  • Loading branch information
JessicaMeixner-NOAA committed Jul 6, 2018
1 parent 04cc83b commit 4d00e2f
Show file tree
Hide file tree
Showing 42 changed files with 272 additions and 220 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ model/bin/switch.old_SHRD
model/bin/switch.old_HYB
model/bin/switch.old_OMP
model/bin/switch.old_SEQ
model/bin/switch.old_MPI
model/bin/w3adc
model/bin/w3list
model/bin/w3prnt
Expand Down
44 changes: 24 additions & 20 deletions model/bin/ad3
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
then
path_i="$path_i/SCRIP"
fi
if [ ${name:0:3} = 'yow' ]
then
path_i="$path_i/PDLIB"
fi

if [ -z "$(env | grep switch_file)" ]
then
Expand Down Expand Up @@ -206,9 +210,9 @@
if [ "$w3adc" = 'yes' ]
then

echo "0 $compress" > w3adc.inp
echo "'$path_i/$name.ftn' '$name.$fext'" >> w3adc.inp
echo "'$sw_str'" >> w3adc.inp
echo "0 $compress" > w3adc.inp.$name
echo "'$path_i/$name.ftn' '$name.$fext'" >> w3adc.inp.$name
echo "'$sw_str'" >> w3adc.inp.$name

# 2.b Add NCEP/NCO docmentation - - - - - - - - - - - - - - - - - - - - - - -

Expand All @@ -219,15 +223,15 @@
if [ "$itst" != '0' ]
then
echo '-- input file w3adc.inp -------------------------------------------'
cat w3adc.inp
cat w3adc.inp.$name
echo '-- end of file ----------------------------------------------------'
fi

$path_b/w3adc < w3adc.inp > w3adc.out 2> w3adc.err
$path_b/w3adc < w3adc.inp.$name > w3adc.out.$name 2> w3adc.err.$name

# 2.c Test the output of w3adc - - - - - - - - - - - - - - - - - - - - - - - -

ad3_tst="`grep ERROR w3adc.out`"
ad3_tst="`grep ERROR w3adc.out.$name`"
if [ -n "$ad3_tst" ]
then
echo ' *** w3adc error ***'
Expand All @@ -238,24 +242,24 @@
then
echo ' *** w3adc error ***'
echo " file $name.$fext not found (1)."
cat w3adc.out ; cat w3adc.err ; exit 4
cat w3adc.out.$name ; cat w3adc.err.$name ; exit 4
fi

if [ "`wc -l $name.$fext | awk '{ print $1}'`" -lt '2' ]
then
echo ' *** w3adc error ***'
echo " file $name.$fext not found (2)."
cat w3adc.out ; cat w3adc.err ; exit 4
cat w3adc.out.$name ; cat w3adc.err.$name ; exit 4
fi

if [ "$itst" != '0' ]
then
cat w3adc.out
cat w3adc.out.$name
fi

# 2.d Clean up - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

rm -f w3adc.*
rm -f w3adc.*.$name

# 2.e Add switches in w3initmd - - - - - - - - - - - - - - - - - - - - - -

Expand Down Expand Up @@ -316,18 +320,18 @@ then

error='0'

if $path_b/comp $name > comp.out 2> comp.err
if $path_b/comp $name > comp.out.$name 2> comp.err.$name
then
rm -f comp.err
rm -f comp.out
rm -f comp.err.$name
rm -f comp.out.$name

# 3.b Check comp.stat - - - - - - - - - - - - - - - - - - - - - - - - - - - -

if [ -f comp.stat ]
if [ -f comp.stat.$name ]
then
nr_err=`grep ERROR comp.stat | awk '{ print $2 }'`
nr_war=`grep WARNING comp.stat | awk '{ print $2 }'`
rm -f comp.stat
nr_err=`grep ERROR comp.stat.$name | awk '{ print $2 }'`
nr_war=`grep WARNING comp.stat.$name | awk '{ print $2 }'`
rm -f comp.stat.$name
if [ "$nr_err" != '0' ]
then
echo " $nr_err errors found, see $path_w/$name.l"
Expand Down Expand Up @@ -381,11 +385,11 @@ then
echo ' *** compile error ***'
echo ' error in comp'
echo '--- comp output -------------------------------------------------'
cat comp.out
cat comp.out.$name
echo '--- comp error output -------------------------------------------'
cat comp.err
cat comp.err.$name
echo '-----------------------------------------------------------------'
rm -f comp.*
rm -f comp.*.$name
error='6'
fi

Expand Down
16 changes: 10 additions & 6 deletions model/bin/ad3_test
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
then
path_i="$path_i/SCRIP"
fi
if [ ${name:0:3} = 'yow' ]
then
path_i="$path_i/PDLIB"
fi

sw_str=`cat $path_b/$switch`

Expand Down Expand Up @@ -114,9 +118,9 @@
if [ "$w3adc" = 'yes' ]
then

echo "1 $compress" > w3adc.inp
echo "'$path_i/$name.ftn' '$name.f90'" >> w3adc.inp
echo "'$sw_str'" >> w3adc.inp
echo "1 $compress" > w3adc.inp.$name
echo "'$path_i/$name.ftn' '$name.f90'" >> w3adc.inp.$name
echo "'$sw_str'" >> w3adc.inp.$name

# 2.b Add NCEP/NCO docmentation - - - - - - - - - - - - - - - - - - - - - - -

Expand All @@ -127,15 +131,15 @@
if [ "$itst" != '0' ]
then
echo '-- input file w3adc.inp -------------------------------------------'
cat w3adc.inp
cat w3adc.inp.$name
echo '-- end of file ----------------------------------------------------'
fi

$path_b/w3adc < w3adc.inp
$path_b/w3adc < w3adc.inp.$name

fi

rm -f w3adc.inp
rm -f w3adc.inp.$name
rm -f $name.f90

# End of ad3 ---------------------------------------------------------------- #
10 changes: 5 additions & 5 deletions model/bin/comp.Altix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# $name.f90 : Source code (generated by ad3). #
# $name.o : Object module. #
# $name.l : Listing file. #
# comp.stat : status file of compiler, containing number of errors #
# comp.stat.$name : status file of compiler, containing number of errors #
# and number of warnings (generated by comp). #
# #
# - Upon (first) installation of WAVEWATCH III the user needs to check the #
Expand Down Expand Up @@ -51,7 +51,7 @@

rm -f $name.l
rm -f $name.o
rm -f comp.stat
rm -f comp.stat.$name

# --------------------------------------------------------------------------- #
# 2. Compile #
Expand Down Expand Up @@ -162,10 +162,10 @@
fi
fi

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

echo "ERROR $nr_err" > comp.stat
echo "WARNING $nr_war" >> comp.stat
echo "ERROR $nr_err" > comp.stat.$name
echo "WARNING $nr_war" >> comp.stat.$name

# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# if compiler does not provide listing, make listing from source code
Expand Down
10 changes: 5 additions & 5 deletions model/bin/comp.Altix_debug
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# $name.f90 : Source code (generated by ad3). #
# $name.o : Object module. #
# $name.l : Listing file. #
# comp.stat : status file of compiler, containing number of errors #
# comp.stat.$name : status file of compiler, containing number of errors #
# and number of warnings (generated by comp). #
# #
# - Upon (first) installation of WAVEWATCH III the user needs to check the #
Expand Down Expand Up @@ -51,7 +51,7 @@

rm -f $name.l
rm -f $name.o
rm -f comp.stat
rm -f comp.stat.$name

# --------------------------------------------------------------------------- #
# 2. Compile #
Expand Down Expand Up @@ -165,10 +165,10 @@
fi
fi

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

echo "ERROR $nr_err" > comp.stat
echo "WARNING $nr_war" >> comp.stat
echo "ERROR $nr_err" > comp.stat.$name
echo "WARNING $nr_war" >> comp.stat.$name

# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# if compiler does not provide listing, make listing from source code
Expand Down
10 changes: 5 additions & 5 deletions model/bin/comp.DATARMOR
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# $name.f90 : Source code (generated by ad3). #
# $name.o : Object module. #
# $name.l : Listing file. #
# comp.stat : status file of compiler, containing number of errors #
# comp.stat.$name : status file of compiler, containing number of errors #
# and number of warnings (generated by comp). #
# #
# - Upon (first) installation of WAVEWATCH III the user needs to check the #
Expand Down Expand Up @@ -51,7 +51,7 @@

rm -f $name.l
rm -f $name.o
rm -f comp.stat
rm -f comp.stat.$name

# --------------------------------------------------------------------------- #
# 2. Compile #
Expand Down Expand Up @@ -264,10 +264,10 @@
fi
fi

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

echo "ERROR $nr_err" > comp.stat
echo "WARNING $nr_war" >> comp.stat
echo "ERROR $nr_err" > comp.stat.$name
echo "WARNING $nr_war" >> comp.stat.$name

# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# if compiler does not provide listing, make listing from source code
Expand Down
10 changes: 5 additions & 5 deletions model/bin/comp.DATARMOR_debug
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# $name.f90 : Source code (generated by ad3). #
# $name.o : Object module. #
# $name.l : Listing file. #
# comp.stat : status file of compiler, containing number of errors #
# comp.stat.$name : status file of compiler, containing number of errors #
# and number of warnings (generated by comp). #
# #
# - Upon (first) installation of WAVEWATCH III the user needs to check the #
Expand Down Expand Up @@ -51,7 +51,7 @@

rm -f $name.l
rm -f $name.o
rm -f comp.stat
rm -f comp.stat.$name

# --------------------------------------------------------------------------- #
# 2. Compile #
Expand Down Expand Up @@ -264,10 +264,10 @@
fi
fi

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

echo "ERROR $nr_err" > comp.stat
echo "WARNING $nr_war" >> comp.stat
echo "ERROR $nr_err" > comp.stat.$name
echo "WARNING $nr_war" >> comp.stat.$name

# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# if compiler does not provide listing, make listing from source code
Expand Down
8 changes: 4 additions & 4 deletions model/bin/comp.Intel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# $name.f90 : Source code (generated by ad3). #
# $name.o : Object module. #
# $name.l : Listing file. #
# comp.stat : status file of compiler, containing number of errors #
# comp.stat.$name : status file of compiler, containing number of errors #
# and number of warnings (generated by comp). #
# #
# - Upon (first) installation of WAVEWATCH III the user needs to check the #
Expand Down Expand Up @@ -52,7 +52,7 @@

rm -f $name.l
rm -f $name.o
rm -f comp.stat
rm -f comp.stat.$name

# 1.c Set listing option - - - - - - - - - - - - - - - - - - - - - - - - - - -

Expand Down Expand Up @@ -184,8 +184,8 @@

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

echo "ERROR $nr_err" > comp.stat
echo "WARNING $nr_war" >> comp.stat
echo "ERROR $nr_err" > comp.stat.$name
echo "WARNING $nr_war" >> comp.stat.$name

# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# if compiler does not provide listing, make listing from source code
Expand Down
10 changes: 5 additions & 5 deletions model/bin/comp.Lahey
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# $name.f90 : Source code (generated by ad3). #
# $name.o : Object module. #
# $name.l : Listing file. #
# comp.stat : status file of compiler, containing number of errors #
# comp.stat.$name : status file of compiler, containing number of errors #
# and number of warnings (generated by comp). #
# #
# - Upon (first) installation of WAVEWATCH III the user needs to check the #
Expand Down Expand Up @@ -51,7 +51,7 @@

rm -f $name.l
rm -f $name.o
rm -f comp.stat
rm -f comp.stat.$name

# --------------------------------------------------------------------------- #
# 2. Compile #
Expand Down Expand Up @@ -163,10 +163,10 @@
fi
fi

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

echo "ERROR $nr_err" > comp.stat
echo "WARNING $nr_war" >> comp.stat
echo "ERROR $nr_err" > comp.stat.$name
echo "WARNING $nr_war" >> comp.stat.$name

# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# if compiler does not provide listing, make listing from source code
Expand Down
10 changes: 5 additions & 5 deletions model/bin/comp.NEC
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# $name.f90 : Source code (generated by ad3). #
# $name.o : Object module. #
# $name.l : Listing file. #
# comp.stat : status file of compiler, containing number of errors #
# comp.stat.$name : status file of compiler, containing number of errors #
# and number of warnings (generated by comp). #
# #
# #
Expand All @@ -48,7 +48,7 @@

rm -f $name.l
rm -f $name.o
rm -f comp.stat
rm -f comp.stat.$name

# --------------------------------------------------------------------------- #
# 2. Compile #
Expand Down Expand Up @@ -180,10 +180,10 @@
fi
fi

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

echo "ERROR $nr_err" > comp.stat
echo "WARNING $nr_war" >> comp.stat
echo "ERROR $nr_err" > comp.stat.$name
echo "WARNING $nr_war" >> comp.stat.$name

# 3.c Prepare listing - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# if compiler does not provide listing, make listing from source code
Expand Down
Loading

0 comments on commit 4d00e2f

Please sign in to comment.