#!/bin/csh

cd /spare11/ralazear/wrf_output/500

set yy = `date -u +%y`
set mm = `date -u +%m`
set dd = `date -u +%d`
set hh = `date -u +%H`
set ddm = `date +%d`

if (${hh} < 05) then
    set mdate = ${yy}${mm}${ddm}18
    echo ${mdate}
endif    
if (${hh} >= 22) then
    set mdate = ${yy}${mm}${ddm}18
    echo ${mdate} 
endif       
if (${hh} >= 05 && ${hh} < 10) then
    set mdate = ${yy}${mm}${dd}00
    echo ${mdate}
endif
if (${hh} >= 10 && ${hh} < 16) then
    set mdate = ${yy}${mm}${dd}06
    echo ${mdate}
endif
if (${hh} >= 16 && ${hh} < 22) then
    set mdate = ${yy}${mm}${dd}12
    echo ${mdate}
endif   

foreach fhr ( '000' '003' '006' '009' '012' '015' '018' \
'021' '024' '027' '030' '033' '036' '039' '042' '045' \
'048' ) 

foreach res ( '27' '09' '03' )
500_${res}.csh ${fhr} ${mdate}

end
end

exit

gpend

