#!/bin/csh

set sensor = $1
#cd $sensor
#cd aerosol

set models="q30 r30 s30 t30 u30 v30 w30 x30 y30 z30 q50 r50 s50 t50 u50 v50 w50 x50 y50 z50 q70 r70 s70 t70 u70 v70 w70 x70 y70 z70 q75 r75 s75 t75 u75 v75 w75 x75 y75 z75 q80 r80 s80 t80 u80 v80 w80 x80 y80 z80 q85 r85 s85 t85 u85 v85 w85 x85 y85 z85 q90 r90 s90 t90 u90 v90 w90 x90 y90 z90 q95 r95 s95 t95 u95 v95 w95 x95 y95 z95"

set new_models=""

foreach m ($models)
set p = `echo $m | cut -c 1`
set rh = `echo $m | cut -c 2-3`

if ($p == q) then
    set f = 95
endif

if ($p == r) then
    set f = 80
endif

if ($p == s) then
    set f = 50
endif

if ($p == t) then
    set f = 30
endif

if ($p == u) then
    set f = 20
endif

if ($p == v) then
    set f = 10
endif

if ($p == w) then
    set f = 05
endif

if ($p == x) then
    set f = 02
endif

if ($p == y) then
    set f = 01
endif

if ($p == z) then
    set f = 00
endif

set np = "r${rh}f${f}v01"
echo $p$rh $np

set file1 = aerosol_${sensor}_${m}.hdf
set file2 = `echo $file1 | sed "s/$m/$np/g"`
echo $file1 $file2
cp $file1 $OCDATAROOT/${sensor}/aerosol/$file2
#set new_models = ${new_models},\"${np}\"

end

echo $new_models

exit 0
