Skip to content

Commit

Permalink
Adding a .gitignore and a script for downloading from ftp site
Browse files Browse the repository at this point in the history
Former-commit-id: 950e18915ad36f14c6ec48408d03265553806d2a
  • Loading branch information
JessicaMeixner-NOAA committed Oct 13, 2017
1 parent 7423c08 commit e4c427f
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
tch3.env
cases
data_regtests
smc_docs
ww3_from_ftp.tar.gz
guide/*.log
guide/*.aux
guide/*.bbl
guide/*.blg
guide/*.toc
guide/*.out
guide/*.dvi
guide/*.pdf
manual/ww3_grid.tex
manual/ww3_strt.tex
manual/ww3_bounc.tex
manual/ww3_bound.tex
manual/ww3_prep.tex
manual/ww3_prtide.tex
manual/ww3_prnc.tex
manual/ww3_gspl.tex
manual/ww3_shel.tex
manual/ww3_multi.tex
manual/ww3_multi.tel
manual/ww3_trck.tex
manual/ww3_outf.tex
manual/ww3_outp.tex
manual/ww3_ounf.tex
manual/ww3_ounp.tex
manual/ww3_systrk.tex
manual/ww3_uprstr.tex
manual/ww3_grib.tex
manual/ww3_gint.tex
manual/gx_outf.tex
manual/gx_outp.tex
manual/*.log
manual/*/*.aux
manual/*.aux
manual/*.bbl
manual/*.blg
manual/*.toc
manual/*.out
manual/*.dvi
manual/*.pdf
regtests/matrix*
regtests/*/work*
regtests/*/input*/*.nc
regtests/*/input*/*/*.nc
regtests/*/input*/partition.ww3
regtests/*/*.png
regtests/ww3_tp2.14/input/oasis3-mct/doc
regtests/ww3_tp2.14/input*/*.nc.OAS*CM
regtests/ww3_tp2.14/input*/*/*.nc.OAS*CM
*.nc
*/*.nc
*/*/*.nc
*/*/*/*.nc
*.pdf
*/*.pdf
*/*/*.pdf
*/*/*/*.pdf
66 changes: 66 additions & 0 deletions model/bin/ww3_from_ftp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/bin/sh
# --------------------------------------------------------------------------- #
# #
# Script for downloading data from ftp #
# Created 0ct 10, 2017 #
# --------------------------------------------------------------------------- #

curr_dir=`pwd`

#Get top level directory of ww3 from user:
echo -e "\n\n This script will download data from the ftp for WAVEWATCH III "
echo -e "Enter the relative path to the main/top level directory, this would "
echo -e "be '../../' if in the model/bin directory or '.' if already in the "
echo -e "top/main directory:"
read ww3dir

#Move to top level directory of ww3:
cd $ww3dir

#Download from ftp and uptar:
echo -e "Downloading and untaring file from ftp:"
wget ftp://polar.ncep.noaa.gov/tempor/ww3ftp/ww3_from_ftp.tar.gz
tar -xvzf ww3_from_ftp.tar.gz

#Move regtest info from data_regtests to regtests:
echo -e "Moving data from data_regtests to regtets"
cp -r data_regtests/ww3_tp2.15/input/*.nc regtests/ww3_tp2.15/input/
cp -r data_regtests/ww3_tp2.13/*.png regtests/ww3_tp2.13/
cp -r data_regtests/ww3_tic1.4/input/*.nc regtests/ww3_tic1.4/input/
cp -r data_regtests/ww3_tp2.8/input/*.nc regtests/ww3_tp2.8/input/
cp -r data_regtests/ww3_tp2.12/input/* regtests/ww3_tp2.12/input/
cp -r data_regtests/ww3_tp2.12/input_be/* regtests/ww3_tp2.12/input_be/
cp -r data_regtests/ww3_tp2.12/input_le/* regtests/ww3_tp2.12/input_le/
cp -r data_regtests/ww3_tp2.14/input/r-ww3.nc.OAS*CM regtests/ww3_tp2.14/input/
if [ ! -d regtests/ww3_tp2.14/input/oasis3-mct/doc ]
then
mkdir regtests/ww3_tp2.14/input/oasis3-mct/doc
fi
cp -r data_regtests/ww3_tp2.14/input/oasis3-mct/doc/* regtests/ww3_tp2.14/input/oasis3-mct/doc/
cp -r data_regtests/ww3_tp2.14/input/toy/*.nc.OAS*CM regtests/ww3_tp2.14/input/toy/

#Do you want to clean up (aka delete tar file, delete the data_regtests directory)
echo -e "\n\n Do you want to delete the tar file ww3_from_ftp.tar.gz [y|n]: "
read wnew
if [ "${wnew}" = "Y" ] || [ "${wnew}" = "y" ]
then
echo -e '\n Deleting tar file ww3_from_ftp.tar.gz'
rm ww3_from_ftp.tar.gz
else
echo -e ' Not deleting tar file.'
fi

echo -e "\n\n Files were copied from the data_regtests to the regtets folder."
echo -e "Do you want to delete the data_regtests folder? [y|n]: "
read wnew2
if [ "${wnew2}" = "Y" ] || [ "${wnew2}" = "y" ]
then
echo -e '\n Deleting the data_regtests folder'
rm -rf data_regtests
else
echo -e ' Not deleting the data_regtests folder.'
fi

#move back to original directory:
cd $curr_dir
echo -e "End of ww3_from_ftp.sh"

0 comments on commit e4c427f

Please sign in to comment.