[gradsusr] how to find monthly sum from a ctl file while writing it as nc file using lats4d

Marcelino II Villafuerte mqvillafuerte at gmail.com
Wed Jun 2 00:57:41 EDT 2010


hi Waheed,

1. aphrodite daily precipitation data can be downloaded in a netcdf file
format via:
http://www.chikyu.ac.jp/precip/cgi-bin/aphrodite/script/aphrodite_cgi.cgi/register
2. I have attached a script which I used to produce a monthly average
precipitation. you can modify it depending on your need. for example: you
have to change "ave" with "sum" which in this case, can produce a monthly
total rainfall. Note: I did not use looping to accommodate leap years. it
works in GrADS 2.0 or later version because of sdfwrite command which can
able to write your output to a netcdf file format.

hope it helps.

Mar



On Tue, May 25, 2010 at 11:17 AM, Waheed <waheed.met at gmail.com> wrote:

>
>
> ---------- Forwarded message ----------
> From: Waheed <waheed.met at gmail.com>
> Date: Mon, May 24, 2010 at 5:18 PM
> Subject: how to find monthly sum: when using lats4d
> To: dasilva at alum.mit.edu
>
>
>
>  hello
>
> dear i am converting daily precipitaion data (aphrodite) form 1961 to 2007
> from ctl type to nc(netcdf) type , i have done it but now i want to find the
> monthly total from 1961-2007 using lats4d
>  but i am not understading how to do?
> the script that i have wrtten is as :
>
> 'reinit'
> 'open
> data-aphd\APHRO_PAK_005deg_V0902.1961-2007/APHRO_PAK_005deg_V0902.ctl'
> ti=1
> tf=ti+30
> y=1961
> while (y<=2007)
> while (ti<=16832)
> 'set t 'ti
> 'lats4d -v -i
> data-aphd\APHRO_PAK_005deg_V0902.1961-2007/APHRO_PAK_005deg_V0902.ctl
> -ftype ctl -o waheed/JAN'y' -func sum(precip,t='ti',t='tf')'
> ti=ti+365
> 'set t 'ti
> 'q time'
> say result
> res=subwrd(result,3)
> yf=substr(res,9,4)
> if (y=yf)
> ti=ti+1
> 'set t 'ti
> endif
> y=y+1
> endwhile
> endwhile
>
>
>
>
> any help
>
>
> thanx in advance
>
> Regards
>
>
>
>
> --
> waheed iqbal
> (Meteorologist)
> Pakistan Meteorological Department
> R & D islamabad
> +923334547814
>
>
>
> --
> waheed iqbal
> (Meteorologist)
> Pakistan Meteorological Department
> R & D islamabad
> +923334547814
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20100602/7bd4bc85/attachment-0003.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aphrotomonthly.gs
Type: application/octet-stream
Size: 6026 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20100602/7bd4bc85/attachment-0003.obj 


More information about the gradsusr mailing list