-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master: 6.XX namelist format for input files
updated : ww3_multi and ww3_prnc updated added : ww3_ounf, ww3_ounp, ww3_trnc, ww3_bounc, ww3_shel clean up : -sort all variable declaration in order type / integer / real / double / character / logical and for each scalar / array / allocatable write all permanent code in uppercase update homog feature in ww3_multi.nml to remove NMOVE add homogenous field feature for ice in aux/bash : -set a inp 2 nml converter for each prog old T/F format in ww3_shel.inp and ww3_multi.inp is not supported by the bash converter inp2nml in w3timemd.ftn : -add new subroutine to substract 2 time arrays -add new subroutine to convert time units to date array differences on all regtests : -for tp1.8 due to better time precision -for netcdf output due to calendar = "standard" -all due to namelist logs Change-Id: I780d4e30c1add26a4b89951bc9814eba64aeecf4 Former-commit-id: 84c1a2661ef3f1329a49ff0e03e5ef0f0fb43565
- Loading branch information
1 parent
9f34555
commit 4994ca6
Showing
426 changed files
with
52,271 additions
and
11,074 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash -e | ||
|
||
#input argument | ||
if [ $# -ne 2 ] | ||
then | ||
echo "need 2 arguments :" | ||
echo '$1 : root path where to find all inp files [~/WW3/regtests]' | ||
echo '$2 : prog to which convert inp files [ww3_shel]' | ||
exit 1 | ||
fi | ||
|
||
rpath="$1" | ||
prog="$2" | ||
|
||
for file in $(find $rpath -name "${prog}*inp*" ! -name "${prog}_clean.inp" ) | ||
do | ||
echo 'file : '$file | ||
./${prog}_inp2nml.sh $file | ||
done | ||
|
||
echo '' | ||
echo '****** end of loop ******' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
#!/bin/bash -e | ||
|
||
|
||
if [ $# -ne 1 ] | ||
then | ||
echo ' [ERROR] need ww3_bounc input filename in argument [ww3_bounc.inp]' | ||
exit 1 | ||
fi | ||
inp=$1 | ||
cur_dir=$(dirname $1) | ||
|
||
|
||
version=$(bash --version | awk -F' ' '{print $4}') | ||
version4=$(echo $version | cut -d '.' -f1) | ||
echo "bash version : " $version4 | ||
if [ "$version4" != "4" ] | ||
then | ||
echo ' [ERROR] need a version of bash at least 4' | ||
exit 1 | ||
fi | ||
|
||
|
||
#------------------------------ | ||
# clean up inp file from all $ lines | ||
|
||
cleaninp="$cur_dir/ww3_bounc_clean.inp" | ||
rm -f $cleaninp | ||
|
||
cat $inp | while read line | ||
do | ||
|
||
if [ "$(echo $line | cut -c1)" = "$" ] | ||
then | ||
continue | ||
fi | ||
|
||
cleanline="$(echo $line | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" | ||
if [ -z "$cleanline" ] | ||
then | ||
continue | ||
fi | ||
|
||
echo $line >> $cleaninp | ||
|
||
done | ||
|
||
#------------------------------ | ||
# get all values from clean inp file | ||
|
||
readarray -t lines < "$cleaninp" | ||
il=0 | ||
|
||
mode="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" | ||
echo $mode | ||
|
||
il=$(($il+1)) | ||
interp="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" | ||
echo $interp | ||
|
||
il=$(($il+1)) | ||
verbose="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" | ||
echo $verbose | ||
|
||
il=$(($il+1)) | ||
tmpname="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" | ||
rm -f $cur_dir/spec.list | ||
while [ "$tmpname" != "STOPSTRING" ] | ||
do | ||
echo ${lines[$il]} >> $cur_dir/spec.list | ||
il=$(($il+1)) | ||
tmpname="$(echo ${lines[$il]} | awk -F' ' '{print $1}' | cut -d \" -f2 | cut -d \' -f2)" | ||
done | ||
|
||
|
||
|
||
|
||
#------------------------------ | ||
# write value in a new nml file | ||
|
||
nmlfile=$cur_dir/$(basename $inp .inp).nml | ||
|
||
# header | ||
cat > $nmlfile << EOF | ||
! -------------------------------------------------------------------- ! | ||
! WAVEWATCH III ww3_bounc.nml - Boundary input post-processing ! | ||
! -------------------------------------------------------------------- ! | ||
EOF | ||
|
||
# field namelist | ||
cat >> $nmlfile << EOF | ||
! -------------------------------------------------------------------- ! | ||
! Define the input boundaries to preprocess via BOUND_NML namelist | ||
! | ||
! * namelist must be terminated with / | ||
! * definitions & defaults: | ||
! BOUND%MODE = 'WRITE' ! ['WRITE'|'READ'] | ||
! BOUND%INTERP = 2 ! interpolation [1(nearest),2(linear)] | ||
! BOUND%VERBOSE = 1 ! [0|1|2] | ||
! BOUND%FILE = 'spec.list' ! input _spec.nc listing file | ||
! -------------------------------------------------------------------- ! | ||
&BOUND_NML | ||
EOF | ||
|
||
if [ "${mode}" != "WRITE" ]; then echo " BOUND%MODE = '${mode}'" >> $nmlfile; fi | ||
if [ "$interp" != "2" ]; then echo " BOUND%INTERP = $interp" >> $nmlfile; fi | ||
if [ "$verbose" != "1" ]; then echo " BOUND%VERBOSE = $verbose" >> $nmlfile; fi | ||
echo " BOUND%FILE = '../input/spec.list" >> $nmlfile | ||
|
||
cat >> $nmlfile << EOF | ||
/ | ||
! -------------------------------------------------------------------- ! | ||
! WAVEWATCH III - end of namelist ! | ||
! -------------------------------------------------------------------- ! | ||
EOF | ||
|
||
rm -f $cleaninp | ||
#------------------------------ | ||
|
||
|
||
|
||
|
Oops, something went wrong.