[gradsusr] vertically integrated moisture flux

Sridhara Nayak sridharanayakiitkgp at gmail.com
Thu Jun 1 23:14:22 EDT 2017


How about the following?

sdfopen shum.nc
sdfopen uwnd.nc
sdfopen vwnd.nc

p1000 = const(shum.1,1000,-a)
define qu=vint(p1000,shum.1*uwnd.2,100)
define qv=vint(p1000,shum.1*vwnd.3,100)
d -hdivg(qu,qv)

Best Regards
Sridhara


On Fri, Jun 2, 2017 at 10:01 AM, afwande juliet <afwandej965 at gmail.com>
wrote:

> Dear users of grads
> did someone manage to plot vertically integrated moisture flux.
> I have tried the function vint but gets the below error
> http://cola.gmu.edu/grads/gadoc/gradfuncvint.html
> ga-> q file
> File 1 : mean daily NMC reanalysis (1997)
>   Descriptor: shum.1997.nc
>   Binary: shum.1997.nc
>   Type = Gridded
>   Xsize = 144  Ysize = 73  Zsize = 8  Tsize = 365  Esize = 1
>   Number of Variables = 1
>      shum  8  t,z,y,x  mean Daily specific humidity
> ga-> set t 1
> Time values set: 1997:1:1:0 1997:1:1:0
> ga-> set z 1
> LEV set to 1000 1000
> ga-> set z 2
> LEV set to 925 925
> ga-> set z 3
> LEV set to 850 850
> ga-> set z 8
> LEV set to 300 300
> ga-> d vint(850,shum.1*lterp(uwnd.2,shum.1),600)
> Error from VINT:  Incompatible grids.
> Contouring: -0.25 to 0.2 interval 0.05
> *** Error in `grads': free(): invalid pointer: 0x000000000145a430 ***
> ======= Backtrace: =========
> /lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f41ce33c7e5]
> /lib/x86_64-linux-gnu/libc.so.6(+0x7fe0a)[0x7f41ce344e0a]
> /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f41ce34898c]
> grads(gagfre+0x5a)[0x449e5a]
> grads(gagrel+0x58)[0x493be8]
> grads(gadspl+0x668)[0x4ab318]
> grads(gacmd+0x17ae)[0x4aa33e]
> grads(main+0x62e)[0x41277e]
> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f41ce2e5830]
> grads(_start+0x29)[0x412e79]
> ======= Memory map: ========
> 00400000-004e8000 r-xp 00000000 08:05 524842
> /usr/bin/grads
> 006e7000-006e8000 r--p 000e7000 08:05 524842
> /usr/bin/grads
> 006e8000-006ec000 rw-p 000e8000 08:05 524842
> /usr/bin/grads
> 006ec000-00992000 rw-p 00000000 00:00 0
> 012a4000-014b8000 rw-p 00000000 00:00 0
>
> On Wed, May 31, 2017 at 1:00 AM, Jennifer M Adams <jadams21 at gmu.edu>
> wrote:
>
>> Usage Note #5: The vint function operates only in an X-Y varying
>> dimension environment.
>>
>> So, you will have to fix A, and if you must have T varying, it will
>> probably work with ‘define’ instead of ‘display’, but I would try fixing T
>> first just to make sure you’re getting the result you intend:
>>
>> set z 1
>> set t 182
>> d vint(etc. etc.)
>>
>> If that works and you are sure your expression is what you want, then you
>> can
>>
>> set t 182 274
>> define yourvname = vint(etc. etc.)
>>
>> … and GrADS will loop over T under the hood to create your defined
>> variable that varies X, Y, and T.
>> —Jennifer
>>
>>
>> On May 30, 2017, at 5:43 PM, Pablo Camarena <jcamarena006 at gmail.com>
>> wrote:
>>
>> >
>> > Thanks Jennifer,
>> >
>> > Now I'm trying the following:
>> >
>> > sdfopen shum.mon.mean.nc
>> > sdfopen uwind.mon.mean.nc
>> > sdfopen vwind.mon.mean.nc
>> > set lon 225 227
>> > set lat 23 24
>> > set t 182 274
>> > set z 1 3
>> > d vint(1000,shum.1*lterp(uwnd.2,shum.1),850)
>> > And I get the following error:
>> > "Operation error:  Invalid dimension environment
>> >   Too many varying dimensions"
>> >
>> > I think the error is with vertical levels.
>> >
>> > 2017-05-30 14:08 GMT-06:00 Jennifer M Adams <jadams21 at gmu.edu>:
>> > Hi, Pablo —
>> > Grads shouldn’t be dumping core on you, but at least you got a clue
>> before it crashed. The grids of your shum.1 and uwnd.2 files apparently
>> don’t match. Try using the lterp() function to interpolate in the lat/lon
>> dimenions, something like this:
>> >
>> > ga-> d vint(1000,shum.1*lterp(uwnd.2,shum.1),600)
>> >
>> > In the script lines you posted, I noticed that the syntax here is
>> incorrect:
>> > > qu=vint(1000,shu,.1*uwnd.2,300)
>> > > qv=vint(1000,shu,.1*vwnd.3,300)
>> >
>> > change "shu,.1" to "shum.1"
>> >
>> > If the problem is that the vertical levels are different in your data
>> files, then you need to fix that. There’s a script in the library that may
>> be helpful —ftp://cola.gmu.edu/grads/scripts/zinterp.gs.  I believe the
>> vint() function is a bit fussy about the Z axis. The lterp() function does
>> not do vertical interpolation. Please read the vint() function Usage Notes
>> carefully (http://cola.gmu.edu/grads/gadoc/gradfuncvint.html) to make
>> sure you’ve got everything right. If you’re still having trouble, please
>> also include the output from "ncdump -c” on your data files, the version of
>> GrADS you are using, and the shortest possible script that illustrates the
>> error.
>> > —Jennifer
>> >
>> >
>> > On May 30, 2017, at 2:18 PM, Pablo Camarena <jcamarena006 at gmail.com>
>> wrote:
>> >
>> > > Hi,
>> > >
>> > > I want to calculate Vertically integarted moisture flux convergence
>> (VIMFC)
>> > >
>> > > But when I give the following instruction it marks me errors:
>> > >
>> > > sdfopen shum.mon.mean.nc
>> > > sdfopen uwind.mon.mean.nc
>> > > sdfopen vwind.mon.mean.nc
>> > >
>> > > set lon 180 320
>> > > set lat 0 60
>> > > set t 763 766
>> > > set lev 1000 300
>> > > qu=vint(1000,shu,.1*uwnd.2,300)
>> > > qv=vint(1000,shu,.1*vwnd.3,300)
>> > >
>> > > vimf=-hdivg(qu,qv)
>> > > d vimf
>> > >
>> > > ga-> qu=vint(1000, shum.1*uwnd.2,600)
>> > >
>> > > Error from VINT:  Incompatible grids.
>> > > *** glibc detected *** grads: double free or corruption (!prev):
>> 0x0000000003707c40 ***
>> > > ======= Backtrace: =========
>> > > /lib/x86_64-linux-gnu/libc.so.
>> > > 6(+0x7e846)[0x7f898ac4c846]
>> > > grads(gree+0x2bb)[0x4fab92]
>> > > grads(gadef+0x126b)[0x518144]
>> > > grads(gacmd+0x16c)[0x52af24]
>> > > grads(main+0xa7a)[0x4975ab]
>> > > /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f
>> 898abef76d]
>> > > grads[0x4960a9]
>> > > ======= Memory map: ========
>> > > 00400000-00bcb000 r-xp 00000000 08:05 1573111
>> > > 7f898bdc2000-7f898bdc3000 r--p 00017000 08:05 1572886
>>     /lib/x86_64-linux-gnu/libpthread-2.15.soAborted (core dumped)
>> > >
>> > > Does anyone know how to fix it?
>> > > Best,
>> > > Pablo Camarena
>> > >
>> > > _______________________________________________
>> > > gradsusr mailing list
>> > > gradsusr at gradsusr.org
>> > > http://gradsusr.org/mailman/listinfo/gradsusr
>> >
>> > --
>> > Jennifer Miletta Adams
>> > Center for Ocean-Land-Atmosphere Studies (COLA)
>> > George Mason University
>> >
>> >
>> >
>> >
>> > _______________________________________________
>> > gradsusr mailing list
>> > gradsusr at gradsusr.org
>> > http://gradsusr.org/mailman/listinfo/gradsusr
>> >
>> > _______________________________________________
>> > gradsusr mailing list
>> > gradsusr at gradsusr.org
>> > http://gradsusr.org/mailman/listinfo/gradsusr
>>
>> --
>> Jennifer Miletta Adams
>> Center for Ocean-Land-Atmosphere Studies (COLA)
>> George Mason University
>>
>>
>>
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>
>
> _______________________________________________
> 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/20170602/8b9b6e7c/attachment.html 


More information about the gradsusr mailing list