[gradsusr] display values in a script

James T. Potemra jimp at hawaii.edu
Sun Sep 20 22:06:40 EDT 2020


Hi Frank,

In a script you'll have to explicitly print the output, so right after

'd 'sp

add

say result

Jim

On 9/20/20 7:10 AM, Frank Colby wrote:
> Dear GradUsers,
>
> I can open a file, set latitude and longitude and time, and display a 
> variable.  The value of the variable displays in the command window.
>
> If I try this in a script, it displays nothing.
>
> Does anyone know why this is?  The script is below.
>
> Thanks,
> Frank Colby
> UMass Lowell
>
> *********************Script
> 'set mpdset hires'
> filen = 20100219
>   latt = 42.361
>   lont = -071.010
> * All times in one file 'set t ' t1
> say 'ERA5-'filen'-s2.nc'
> 'sdfopen ERA5-'filen'-s2.nc'
> *
> 'set lat 'latt
> 'set lon 'lont
> *
> t1=1
> t2=24
> while (t1<=t2)
> 'set t ' t1
> 'd 'sp
> *
> say t1
> say '<enter>=next, q=quit, b=back, t<enter>n<enter>=n-th step'
> say 'i to create an image'
> pull ans
> *
> if (ans ="q"); break; endif;
> if (ans = "b")
>   t1 = t1 -2
> endif
> if (ans = "t"); say 'Time step =';pull num;
>   if (num > t2); say 'Timestep too high!'; num=t2-1; endif;
>   t1 = num - 1
> endif
> *
> t1 = t1 + 1
> 'c'
> endwhile
> 'reinit'
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr


More information about the gradsusr mailing list