[RegCNET] Work with multiple file

Ho Thi Minh ha hahtm at vnu.vn
Wed Apr 28 15:00:34 CEST 2010


Hi Rajesh,

You can try this way:

Step 1/ Touch average.sh
Step 2/ Chmod +x average.sh
Step 3/ In average.sh:

year="2000"
month_start="1";month_end="5"

rm -f calculate.gs
month=$((${month_start}-1))
i=0
while [ $month -le ${month_start} ]
do
 month=$(($month+1))
 i=$(($i+1))
 if [ $month -lt 10 ]
 then
  echo "'open SRF."${year}0${month}"0100.ctl'" >> calculate.gs
 else
  echo "'open SRF."${year}${month}"0100.ctl'" >> calculate.gs
 fi
 if [ $i == 1 ]
 then
  echo "'f=ave(t2m,t=1,t=248)'" >> calculate.gs
 else
  echo "'f=f+ave(t2m,t=1,t=248)'" >> calculate.gs
 fi
 echo "'close 1'" >> calculate.gs
done
echo "'d f/"${i}"'" >> calculate.gs
....
grads -lbc calculate.gs

Now please run the file average.sh. I hope this can help you at this moment.
I also appreciate any other suggestions.

Best regards,
Ha


> Hi.
>
> I convert data from RegCM format to GeoTiff. These files can be imported in the GRASS
> (http://grass.itc.it/) or other GIS. With GRASS I can analyze, manipulate and plot any data from
> model ad other source.
>
> If you are interested in the program for exporting data, I am ready to give you this program ("AS
> IS" WITHOUT WARRANTY OF ANY KIND :)).
>
>>
>> Hi All,
>>
>> ?
>>
>> I want to use the data from 5 files to plotting average and sum in grads,?I am able to open
>> multiple file(like 1....5)?but how can i switch to?view the file?for rxample 3.
>>
>> Here my purpose is to work for seasonal model(Monsoon season). Here i am stuck to find the grads
>> command to complete my work.
>>
>> ?
>>
>> So please let me know the some sample of useful command (script) to overcome with this problem
>>
>> ?
>>
>> Thanks in advance.??
>>
>> --
>> Rajesh Kumar Maurya
>> M.Sc(Tech)- Geophysics(Meteorology); Junior Research Fellow & Research Scholar
>> Department of Geophysics
>> Banaras Hindu University
>> Varanasi 221005
>>
>> _______________________________________________
>> RegCNET mailing list
>> RegCNET at lists.ictp.it
>> https://lists.ictp.it/mailman/listinfo/regcnet
>
> _______________________________________________
> RegCNET mailing list
> RegCNET at lists.ictp.it
> https://lists.ictp.it/mailman/listinfo/regcnet
>


Ho Thi Minh Ha, PhD.

Department of Meteorology, Hanoi University of Sciences
334 Nguyen Trai street, Thanh Xuan district, Hanoi city, VIETNAM
Phone: +84435583811
Email: hahtm at vnu.vn
or      ha_meteo at yahoo.com




More information about the RegCNET mailing list