Can fortran show animation with dislin?

548 views
Skip to first unread message

xuz...@hotmail.com

unread,
Jul 24, 2011, 9:21:38 PM7/24/11
to dislin-users
hi all,

I want to show a point's path along a curve (such as sin(t) etc.) in
fortran with dislin.
Is it possible?

thanks for any suggestion!

mic...@mps.mpg.de

unread,
Jul 25, 2011, 3:24:50 AM7/25/11
to dislin-users
Hi,
Yes, animation is possible with Dislin. You can erase your old data by
plotting them again in background colour
before plotting your new data in foreground colour. Note that the
graphical output to the screen is buffered and
that the output is sent by default to the pixmap (background buffer).
You should use the Dislin routine SENDBF after
your plot statement to flush the buffer and copy the pixmap to the
screen. If you need a new axis system for your
updated data, you can erase the graphics window and setup a new axis
system.

Best regards,

Helmut

xuz...@hotmail.com

unread,
Jul 25, 2011, 9:34:44 PM7/25/11
to dislin-users
Hi Helmut

Thanks for your reply!

I will give you feedbacks after I try following your instructions.

Shahid Maqbool

unread,
Apr 7, 2022, 9:18:24 AM4/7/22
to dislin-users
Dear Helmut,

I am trying to have a sequence of output on the console. I have put the Dislin routines in the time loop.
But I am somehow unable to erase the previous screen output and there is a lot of output. The question is
how to have an output wrt the timestep; also just one output and no previous output? My calls to Dislin
are shown below.

Best regards,
Shahid

do timestep
     .
     .
     .

     CALL SCRMOD('REVERS')
      CALL METAFL('cons')

      CALL DISINI()

      CALL PAGERA()
      CALL HWFONT()

      CALL TITLIN('Contour Plot',4)

      CALL NAME('Nx','X')
      CALL NAME('Ny','Y')
      CALL NAME('Concentration','Z')

      CALL INTAX()
      CALL AUTRES(Nx,Ny)
      CALL AXSPOS(300,1850)
      CALL AX3LEN(1400,1400,1400)

      CALL LABDIG(2,'Z')        
      CALL ERASE()
      CALL GRAF3(0.d0,256.d0,0.d0,32.d0,0.d0,256.d0,0.d0,32.d0,0.05d0,1.0d0,0.05d0,0.05d0)
      CALL CRVMAT(con,Nx,Ny,1,1)
      CALL SENDBF

      CALL HEIGHT(50)
      CALL TITLE()
      CALL MPAEPL(3)

      CALL DISFIN()
 
end do

      STOP
     
end program

Helmut Michels

unread,
Apr 7, 2022, 9:55:53 AM4/7/22
to dislin-users
Hi,

yes, this is possible. Your loop should look like:

    Loop:
       CALL ERASE()
       CALL GRAF3(...)
       CALL CRVMAT(...)
       CALL HEIGHT(50)
       CALL TITLE()
       CALL ENDGRF()          !  necessary if you have multible GRAF3 calls
       CALL SENDBF()          !  flushes the buffer
    End Loop

An alternative is to erase the contents of the axis system and not to replot the
axis system again by using  the routine AXSERS instead of ERASE. I have attached
a little example code for showing this.

With best regards,

Helmut
ex11_1.f90

Shahid Maqbool

unread,
Apr 7, 2022, 12:58:48 PM4/7/22
to dislin-users
Dear Helmut,

The example works but there is always a kind of flash on the screen or discontinuity.

The loop mentioned here works very well. The output is continuous and does not show any interruption. 
However, it shows some warnings.

Best regards,
Shahid

Screenshot from 2022-04-08 00-41-54.png

Helmut Michels

unread,
Apr 8, 2022, 5:25:37 AM4/8/22
to dislin-users
Hi,

Warning 155 is caused by HWFONT. The routine tries to load the X11 font 'Times-Bold-R-Normal'.
If this fails it tries to load 'Adobe-Utopia-Bold-R-Normal'. If none of the both fonts is installed on
your system, a warning is printed and the Dislin vector font COMPLX is used. You can avoid the
warning by replacing HWFONT by COMPLX. It looks like that the routines scrmod, metafl and disini
are included in your loop. Your loop should be located between disini and disfin.

With best regards,

Helmut

reinaldo garcia

unread,
Mar 9, 2023, 9:08:26 AM3/9/23
to dislin-users
Hi Helmut,
It is possible to generate an file (e.g. .AVI, .GIF) from an DISLIN animation?

Thanks,
Rey

Reply all
Reply to author
Forward
0 new messages