[gradsusr] Dimensions that Grads can operate
James T. Potemra
jimp at hawaii.edu
Wed Apr 22 08:34:27 EDT 2015
Hi Jayakrishnan,
In addition to adding the appropriate depth levels to your descriptor
file, I'm not sure your script is doing what you want. You are writing a
single point each time. Instead, set the lat/lon range, then loop over
time then depth:
'reinit'
'sdfopen G:/Sample_MT/samp/uwnd.2006.nc'
prompt 'key in filename'
pull fname
'set fwrite 'fname
'set y 1 73'
'set x 1 144'
tm=1
while(tm<=7)
'set t 'tm
prl=1
while(prl<=8)
'set t 'tm
'set z 'prl
'set gxout fwrite'
'd uwnd'
prl=prl+1
endwhile
tm=tm+1
endwhile
'disable fwrite'
Jim
On 4/22/15 2:08 PM, M.Mahakur wrote:
> Hi,
>
> You have 8 pressure levels, but zero (0) here:
>
> u 0 99 mean Daily qu [kg/s]
>
> Also, please check your undefine value after fwrite. Is it -999 or grads default undefine?
>
> Regards,
>
>
> ----- Original Message -----
> From: Jayakrishnan P.R <prjayakrishnan at gmail.com>
> To: GrADS Users Forum <gradsusr at gradsusr.org>
> Sent: Wed, 22 Apr 2015 16:01:27 +0530 (IST)
> Subject: Re: [gradsusr] Dimensions that Grads can operate
>
> Thanks. Eventhough the script after modification is working, the output
> file is having some endian problem or the output figure is erroneous. The
> modified script and ctl file is as follows.
>
> *********************************************************************
>
> 'reinit'
> 'sdfopen G:/Sample_MT/samp/uwnd.2006.nc'
> prompt 'key in filename'
> pull fname
> 'set fwrite 'fname
> yy=1
> while(yy<=73)
> xx=1
> while(xx<=144)
> 'set x 'xx
> 'set y 'yy
> tm=1
> while(tm<=7)
> 'set t 'tm
> prl=1
> while(prl<=8)
> 'set t 'tm
> 'set z 'prl
> 'set gxout fwrite'
> 'd uwnd'
> prl=prl+1
> endwhile
> tm=tm+1
> endwhile
> xx=xx+1
> endwhile
> yy=yy+1
> endwhile
> 'disable fwrite'
>
>
>
> dset ^U.grd
> undef -999.000000
> xdef 144 linear 0.0 2.5
> ydef 73 linear -90.0 2.5
> zdef 8 levels 1000 925 850 700 600 500 400 300
> tdef 7 linear 00:00Z23jun2006 24hr
> vars 1
> u 0 99 mean Daily qu [kg/s]
> endvars
>
>
>
>
>
> Sincerely
> ***********************************************
> Jayakrishnan.P.R
> Project Scientist-C
> National Centre for Medium Range Weather Forecasting
> Earth System Science Organisation
> Ministry of Earth Sciences
> A-50, Sector 62, NOIDA -201 309, INDIA
> Mob: 09496026547
> Alternate Email: jkrishna at ncmrwf.gov.in
>
> ***********************************************
>
> On Tue, Apr 21, 2015 at 7:49 PM, Madhu Latha <madhulatha11 at gmail.com> wrote:
>
>> hi
>> it will work
>> you have to keep x,y also in while loop
>> for example
>>
>> yy=117
>> while(yy<=119)
>> xx=164
>> while(xx<=166)
>> 'set x 'xx
>> 'set y 'yy
>> tm=1
>>
>> while(tm<=76)
>> 'set t 'tm
>> prl=2
>> while(prl<=20)
>> 'set t 'tm
>> 'set z 'prl
>> 'd u'
>> 'save here with file name'
>> prl=prl+1
>> endwhile
>> tm=tm+1
>> endwhile
>> xx=xx+1
>> endwhile
>> yy=yy+1
>>
>> you try this,it may work.
>>
>> On Tue, Apr 21, 2015 at 5:45 PM, Jayakrishnan P.R <
>> prjayakrishnan at gmail.com> wrote:
>>
>>> Hello,
>>> I am in need of converting NCEP wind data to gridded format
>>> extracted over a latitude longitude domain. I wrote a script for this thing
>>> like the following.
>>>
>>> 'reinit'
>>> 'sdfopen G:/Sample_MT/samp/uwnd.2006.nc'
>>> 'set x 1 144'
>>> 'set y 1 73'
>>> prompt 'key in filename'
>>> pull fname
>>> 'set fwrite 'fname
>>> tt=1
>>> while (tt<=365)
>>> 'set t 'tt
>>> zz=1
>>> while (zz<=17)
>>> 'set z 'zz
>>> 'set gxout fwrite'
>>> 'd uwnd'
>>> zz=zz+1
>>> endwhile
>>> tt=tt+1
>>> endwhile
>>>
>>>
>>> But eventhough the script is working, it extracts the data for a single
>>> level only. Do grads operate if we give dimensions greater than 2?. I mean,
>>> latitude is varying, longitude is varying, Time is varying, Level is
>>> varying for output..?
>>>
>>>
>>>
>>> Sincerely
>>> ***********************************************
>>> Jayakrishnan.P.R
>>> Project Scientist-C
>>> National Centre for Medium Range Weather Forecasting
>>> Earth System Science Organisation
>>> Ministry of Earth Sciences
>>> A-50, Sector 62, NOIDA -201 309, INDIA
>>> Mob: 09496026547
>>> Alternate Email: jkrishna at ncmrwf.gov.in
>>>
>>> ***********************************************
>>>
>>> _______________________________________________
>>> gradsusr mailing list
>>> gradsusr at gradsusr.org
>>> http://gradsusr.org/mailman/listinfo/gradsusr
>>>
>>>
>>
>> --
>>
>>
>> *With RegardsMadhulatha Akkisetti*
>>
>> *Project Scientist - C*
>>
>>
>> *National Centre for Medium Range Weather Forecasting (NCMRWF) Ministry of
>> Earth Sciences (MoES) *
>>
>> *Noida, UP*
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
More information about the gradsusr
mailing list