printim within an animation

Michael Boettinger boettinger at DKRZ.DE
Tue Sep 13 03:49:25 EDT 2005


Hi Adam,

I encountered the same problem, but I found a workaround:
I was able to produce correct images (and without
error messages) when I switched double buffering off and
also added a 'clear' command after the 'printim' command in
the loop.

Good luck and best regards,
Michael

Adam Wolf schrieb:

> Friends -
>
> I am trying to animate a time sequence of a simulation.
> Every timestep, I write 4 images to a buffer screen,
> print the buffer using "printim", then swap the images.
>
> I get the following error every few frames:
> Logic Error 20 in gxhpng.  Notify Developer
>
> The program seems to be swapping the image before
> printim is finished writing the files.  The gif files that printim
> manages to create often are missing parts of the plot.
> (Note: if I print after swapping the gif is totally blank)
>
> I wonder if it is possible to introduce a delay between
> printim and swap that allows the gif to be created sucessfully.
>
> Does anyone have experience with this problem?
> I copied my script below
>
> Thanks - Adam
>
>              Adam Wolf
>
> Carnegie Institute of Washington
> Department of Global Ecology
> 260 Panama Street
> Stanford CA 94305
>                   *
>                       cel 510.207.8303
>                  adamwolf at stanford.edu
>             globalecology.stanford.edu
>
> ======================================
>
> 'open dailygrid2.ctl'
> 'set dbuff on'
> t = 10
> 'set lon -130 -50'
> 'set lat 15 55'
> 'set gxout shaded'
> while (t <= 365)
>   'set t 't
>   'q time'
>   result=subwrd(result,3)
>   hour=substr(result,1,2)
>   day=substr(result,4,2)
>   month=substr(result,6,3)
>   day=substr(result,4,2)
>   year=substr(result,9,4)
>
>   'set vpage 0   5.5 4 8.5'
>   'set clevs -5 -4 -3 -2 -1 0 1 2 3 4 5'
>   'draw title SIB  'day' 'month' 'year''
>   'd SIB'
>   'cbarn'
>
>   'set vpage 5.5 11 4 8.5'
>   'set clevs -5 -4 -3 -2 -1 0 1 2 3 4 5'
>   'draw title PCTM-Derived NEE'
>   'd NEE'
>   'cbarn'
>
>   'set vpage 0   5.5 0 4.5'
>   'set clevs -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30'
>   'draw title dCO2 ppm'
>   'd CO2ABL-CO2FT'
>   'cbarn'
>
>   'set vpage 5.5 11 0 4.5'
>   'set clevs 0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1.0'
>   'draw title PBL turnover n/day'
>   'd W/PBL*86400'
>   'cbarn'
>
>    if(t < 100)
>    * This is where the error is occurring
>       'printim NEE0't'.gif gif x1100 y850 black'
>    else
>       'printim NEE't'.gif gif x1100 y850 black'
>    endif
>
>    'swap'
>
>   t = t + 1
> endwhile

--
_______________________________________________________
Michael Boettinger
Deutsches Klimarechenzentrum
Bundesstrasse 55
20146 Hamburg
Germany
email: boettinger at dkrz.de
phone: +49 40 411 73 344
fax: +49 40 411 73 270
http://www.dkrz.de/
_______________________________________________________



More information about the gradsusr mailing list