#!/usr/bin/env csh
#
# c-shell script to download selected files from gdex.ucar.edu using Wget
# NOTE: if you want to run under a different shell, make sure you change
#       the 'set' commands according to your shell's syntax
# after you save the file, don't forget to make it executable
#   i.e. - "chmod 755 <name_of_script>"
#
# Experienced Wget Users: add additional command-line flags to 'opts' here
#   Use the -r (--recursive) option with care
#   Do NOT use the -b (--background) option - simultaneous file downloads
#       can cause your data access to be blocked
set opts = "-N"
#
# Check wget version.  Set the --no-check-certificate option 
# if wget version is 1.10 or higher
set v = `wget -V |grep 'GNU Wget ' | cut -d ' ' -f 3`
set a = `echo $v | cut -d '.' -f 1`
set b = `echo $v | cut -d '.' -f 2`
if(100 * $a + $b > 109) then
  set cert_opt = "--no-check-certificate"
else
  set cert_opt = ""
endif

set filelist= ( \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250701.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250702.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250703.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250704.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250705.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250706.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250707.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250708.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250709.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250710.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250711.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250712.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250713.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250714.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250715.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250716.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250717.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250718.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250719.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250720.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250721.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250722.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250723.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250724.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250725.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250726.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250727.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250728.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250729.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250730.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250731.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250801.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250802.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250803.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250804.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250805.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250806.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250807.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250808.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250809.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250810.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250811.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250812.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250813.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250814.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250815.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250816.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250817.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250818.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250819.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250820.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250821.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250822.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250823.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250824.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250825.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250826.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250827.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250828.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250829.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250830.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250831.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250901.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250902.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250903.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250904.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250905.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250906.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250907.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250908.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250909.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250910.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250911.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250912.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250913.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250914.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250915.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250916.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250917.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250918.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250919.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250920.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250921.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250922.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250923.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250924.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250925.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250926.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250927.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250928.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250929.nr.tar.gz \
  https://osdf-director.osg-htc.org/ncar/gdex/d337000/tarfiles/2025/prepbufr.20250930.nr.tar.gz \
)
while($#filelist > 0)
  set syscmd = "wget $cert_opt $opts $filelist[1]"
  echo "$syscmd ..."
  $syscmd
  shift filelist
end
