#!/bin/csh -f 
#set echo
#      foreach date (20160313 20160331 20160430 20170121 20170428 20170430 )
#      foreach date (20160314 20160401 20160431 20170122 20170429 20170501 )
#      foreach date (20160501 )
#      foreach date (20170516 )
   set max_day = (31 28 31 30 31 30 31 31 30 31 30 31)
# set year = 2016
@ year=2015
 while ($year <= 2015)
 set month = 1
  while ($month <= 12)
      if ($month < 10) then
      set yearmonth = ${year}0$month
      else
      set yearmonth = ${year}$month
      endif
  echo "max day in month $month is ${max_day[$month]}"
 set day = 1

   while ($day <= ${max_day[$month]})
      if ($day < 10) then
      set yearmonthday = ${yearmonth}0$day
      else
      set yearmonthday = ${yearmonth}$day
      endif
     set date = ${yearmonthday}
    set hour = 18 
     while ( $hour <= 18 )
      if ($hour < 10) then
      set date_hr = ${date}0$hour
      else
      set date_hr = ${date}$hour
      endif
      echo "${date}  ${date_hr}"
 
      wget  http://www2.mmm.ucar.edu/imagearchive1/SatSfcComposite/${date}/sat_sfc_map_${date_hr}.gif
     @ hour++
    end

     @ day++
    end
   
  @ month++
 end #  
  @ year++
 end # year
