# !/bin/tcsh
echo "Removing duplicate data"
echo
rm -f *.gem
echo "Pulling data from Gempak Archive"
echo

foreach year (2002 2003 2004 2005 2006 2007 2008 2010 2011 2012 2013 2014)
    if (year == 2002) then
        foreach month (11 12)
            if (month == 11) then
		set day=27
		set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
		echo "I'm working!!!!"
endif
	    if (month == 12) then
		set day=16
		set hour=12
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif
    if (year == 2003) then
        foreach month (01 07 08)
	    if (month == 01) then
		set day=24
                set hour=00
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 07) then
		set day=24
		set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 08) then
		set day=17
		set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif
    if (year == 2004) then
        foreach month (05 08)
	    if (month == 05) then
		set day=15
                set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 08) then
		set day=04
		set hour=00
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif
    if (year == 2005) then
        foreach month (01 06 08)
	    if (month == 01) then
		set day=17
                set hour=12
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 06) then
		set day=29
		set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 08) then
		set day=01
		set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif
    if (year == 2006) then
        foreach month (06 09)
	    if (month == 06) then
		foreach day (01 19 29)
                    set hour=18
		    wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 09) then
		set day=09
		set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif
    if (year == 2007) then
        foreach month (01 02)
	    if (month == 01) then
		set day=28
                set hour=06
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 02) then
		set day=23
		set hour=06
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif
    if (year == 2008) then
        foreach month (01 12)
	    if (month == 01) then
		set day=02
                set hour=12
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 12) then
		foreach day (19 31)
                    if (day == 19) then 
		        set hour=12
		        wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif

                    if (day == 31) then  
		        set hour=18
		        wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif
end
endif
    if (year == 2010) then
        set month = 07
	set day=21
        set hour=18
        wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
    if (year == 2011) then
        foreach month (01 06 07 09 10)
	    if (month == 01) then 
		set day=12
                set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 06) then
		foreach day (01 08 25)
                    if (day == 01)  then
		        set hour=18
		        wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
                    if (day == 08) then  
		        set hour=18
		        wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
                    if (day == 25) then 
		        set hour=18
		        wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif

	    if (month == 07) then
		set day=13
                set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 09) then
		set day=04
                set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 10) then
		set day=30
                set hour=06
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif
    if (year == 2012) then
        foreach month (05 07)
	    if (month == 05) then
		set day=29
                set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
	    if (month == 07) then
		set day=23
                set hour=18
		wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end
endif

    if (year == 2013) then 
        set month = 09
	set day= 13
        set hour=18
        wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
    if (year == 2014) then 
        set month = 08
	set day= 05
        set hour=18
        wget mtarchive.geol.iastate.edu/${year}/${month}/${day}/gempak/model/ruc/${year}${month}${day}${hour}_ruc211.gem
endif
end



