Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
lnferris committed Feb 23, 2022
1 parent 5765988 commit 571088d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions shell_scripts/download_hycom_for_windows
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# Instructions:
# 1. Copy the below script into a *new* text file. Save as 'download_hycom_bulk_daily' (no file extension).
# 2. Open a terminal window (Cygwin with wget package).
# 3. Run command: chmod ugo+x download_hycom_bulk_daily
# 4. Run command: ./download_hycom_bulk_daily
# 5. Set user inputs (lines 13-29).


WGET='/usr/bin/wget'

YEAR='2018'
MONTH='10'
DAY='01'
StartSeq='0'
EndSeq='50' # How many days from start date to pull

NCSS='https://ncss.hycom.org/thredds/ncss'
MODEL='GLBu0.08'
EXPT='expt_93.0'

VARS="var=water_u&var=water_v"
Subset='spatial=bb'
NORTH='north=20'
SOUTH='south=10'
EAST='east=-50'
WEST='west=-70'
LEVEL='vertCoord=0'

for PlusDay in `seq $StartSeq $EndSeq`; do

MyTimeSt=`date -d "$YEAR-$MONTH-$DAY +$PlusDay days" +%Y-%m-%dT00`
MyTimeEn=`date -d "$YEAR-$MONTH-$DAY +$PlusDay days" +%Y-%m-%dT21`
TimeStart="time_start=$MyTimeSt"
TimeEnd="time_end=$MyTimeEn"

OutFile=$MODEL"_"$EXPT"_"$LEVEL"_`echo $MyTimeSt | cut -d 'T' -f 1`T00Z.nc"

URL="$NCSS/$MODEL/$EXPT?$VARS&$NORTH&$WEST&$EAST&$SOUTH&horizStride=1&$TimeStart%3A00%3A00Z&$TimeEnd%3A00%3A00Z&timeStride=1&$LEVEL&accept=netcdf"

if [ -s $OutFile ]; then
echo "[warning] File $OutFile exists (skipping)"
else
wget -O $OutFile "$URL" --no-check-certificate
fi
done

0 comments on commit 571088d

Please sign in to comment.