Bug with MINing in script?

Don Hooper hoop at COLORADO.EDU
Mon Jul 14 18:53:44 EDT 2008


Seems to me that the issue here is that you want word four of the
second line in result.  So, adding the line:
        line2=sublin(result,2)
and changing the other assignment to:
        val=subwrd(line2,4)
Should get you what you want.

-Hoop

> From owner-GRADSUSR at LIST.CINECA.IT  Mon Jul 14 16:08:35 2008
> Date:     Tue, 15 Jul 2008 00:07:48 +0200
> Reply-To: GRADSUSR at LIST.CINECA.IT
> From: Automatic digest processor <LISTSERV at LIST.CINECA.IT>
> Subject:  GRADSUSR Digest - 12 Jul 2008 to 14 Jul 2008 (#2008-195)
> To: Recipients of GRADSUSR digests <GRADSUSR at LIST.CINECA.IT>
>
> There is one message totalling 40 lines in this issue.
>
> Topics of the day:
>
>   1. Bug with MINing in script?
>
> ----------------------------------------------------------------------
>
> Date:    Mon, 14 Jul 2008 22:18:43 +0200
> From:    Paul emck <pemck at GMX.NET>
> Subject: Bug with MINing in script?
>
> Hi,
> This script will not return a value, hence neither write something sensible
> to the text file. When executing the script until *Here and then manually
> enter 'd min(minair,lon=290,lon=300)' into the GrADS command line it does
> return the desired value perfectly (-1.70758).
> Somebody a hint? Thanks, I would really appreciate some!
>
> (This script is simplified; it calculates zonal maximum negativ anomalies.
> I stripped the loops etc. for clearness)
>
> ------script begin---------
> 'reinit'
> 'c'
> file='lat100N.txt'
> 'sdfopen air.day.sig995.ltm.nc'
> 'sdfopen air.sig995.1948.nc'
>
> 'set lon 290 300'
> 'set lat 10'
>
> 'define minair=air.2(t=1)-273.15-air.1(t=1)'
>
> *Here
>
> 'd min(minair,lon=290,lon=300)'
>
> val=subwrd(result,4)
> OK=write(lat100N.txt,val,append)
>
> ------script end---------
>
> Config Grads: v1.8SL11 32-bit little-endian readline sdf/xdf netcdf lats
> printim
>
> ------------------------------
>
> End of GRADSUSR Digest - 12 Jul 2008 to 14 Jul 2008 (#2008-195)
> ***************************************************************
>



More information about the gradsusr mailing list