#!/bin/csh -f

# This is a C-SHELL script
# echo all steps to screen to see what you are doing
set echo
set verbose

# set parameter names

setenv STARTYR 1980 
setenv ENDYR 2018 

##wget https://gmao.gsfc.nasa.gov/gmaoftp/acollow/ARTMIP/MERRA-2_IVT/readme.txt
setenv STARTYR 2019 
setenv ENDYR 2019 
@ n = $STARTYR
while ($n <= $ENDYR)
  echo $n
#  wget https://gmao.gsfc.nasa.gov/gmaoftp/acollow/ARTMIP/MERRA-2_IVT/MERRA2_hourlyIVT_$n.nc 
  @ n ++
end    #while

setenv STARTYR 1980 
setenv ENDYR 1980 
@ n = $STARTYR
while ($n <= $ENDYR)
  echo $n
  wget https://gmao.gsfc.nasa.gov/gmaoftp/acollow/ARTMIP/MERRA-2_IVT/MERRA2.tavg1_2d_slv_Nx.variablesubset.{$n}.nc 
  #wget https://gmao.gsfc.nasa.gov/gmaoftp/acollow/ARTMIP/MERRA-2_IVT/MERRA2.tavg1_2d_int_Nx.variablesubset.{$n}.nc 
  @ n ++
end    #while

exit


