# Intel Fortran, dislin, plotting

**URL:** https://fortran-lang.discourse.group/t/intel-fortran-dislin-plotting/7742
**Category:** Uncategorized
**Created:** [April 1, 2024, 9:25am UTC](https://fortran-lang.discourse.group/t/intel-fortran-dislin-plotting/7742 "2024-04-01T09:25:38Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)
#### Post date: [April 1, 2024, 9:25am UTC](https://fortran-lang.discourse.group/t/intel-fortran-dislin-plotting/7742/1 "2024-04-01T09:25:39Z")

</div>

Good morning everyone,

I finally succeeded in making dislin work with Intel Fortran.  
I succesfully compiled an example from Chivers ‘Introduction to progamming in Fortran’  
As a result I obtain a .met metafile.  
How can I plot this data or with what command do I send the results to a ps or pdf file.  
I searched in the docs but the documentation is not very transparent for a beginner like me.  
Thx.

Roger

---

<div class="post-metadata">

### Author: ![art-rasa](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@art-rasa](https://fortran-lang.discourse.group/u/art-rasa)
#### Post date: [April 1, 2024, 3:01pm UTC](https://fortran-lang.discourse.group/t/intel-fortran-dislin-plotting/7742/2 "2024-04-01T15:01:15Z")

</div>

> DISLIN is a high-level plotting library.

> **[Dislin](https://www.dislin.de/)**
>
> Home page of the Data Plotting Software Dislin

---

<div class="post-metadata">

### Author: ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)
#### Post date: [April 1, 2024, 3:21pm UTC](https://fortran-lang.discourse.group/t/intel-fortran-dislin-plotting/7742/3 "2024-04-01T15:21:32Z")

</div>

I’m aware of that.  
This is the program:

```auto
program ch41_dislin_01
  use dislin
  implicit none
  integer :: i, j
! Total number of processors and hence data
! points
  integer, parameter :: nprocs = 8
! Number of percentage values from
! 10% -> 90% 9
! 95% 1
! Total 10
  integer, parameter :: nn = 10
  real, dimension (nn) :: pp = (/ 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95 /)
  real, dimension (nprocs) :: x
  real, dimension (nprocs) :: y
  real, dimension (nprocs, nn) :: ydata
  integer :: nx
  integer :: ny
  character *30 cbuf

  do i = 1, nprocs
    x(i) = real(i)
  end do
! Amdahl calculations. Store in 2 d array and
! then
! assign to 1 d array for plotting.
  do i = 1, nprocs
    do j = 1, nn
      ydata(i, j) = 1/((1-pp(j))+pp(j)/i)
    end do
  end do
! Write the data to a file for verification
! purposes
  open (unit=10, file='amdahl_table_08.txt')
  do i = 1, nprocs
    write (unit=10, fmt=100) x(i), ydata(i, 1:nn)
100 format (11(f7.2,2x))
  end do
  close (10)
  call disini
  call complx
  call axspos(450, 1800)
  call axslen(2200, 1400)
  call name('Number of processors', 'x')
  call name('Speed up', 'y')
  call titlin('Plot of Amdahls Law', 1)
  call titlin('8 Processors', 3)
  call labdig(-1, 'x')
  call ticks(10, 'xy')
  call graf(1.0, 8.0, 1.0, 1.0, 1.0, 7.0, 1.0, 1.0)
  call title
  call xaxgit
  call chncrv('line')
! Plot the curves. Copy from 2 d array to 1 d
! array
! before the call to curve.
  do i = 1, nn
    y = ydata(1:nprocs, i)
    call curve(x, y, nprocs)
  end do
  call legini(cbuf, 10, 3)
! Coordinates of the start of the legend
! for the curves.
  nx = 500
  ny = 450
  call legpos(nx, ny)
  call leglin(cbuf, '10%', 1)
  call leglin(cbuf, '20%', 2)
  call leglin(cbuf, '30%', 3)
  call leglin(cbuf, '40%', 4)
  call leglin(cbuf, '50%', 5)
  call leglin(cbuf, '60%', 6)
  call leglin(cbuf, '70%', 7)
  call leglin(cbuf, '80%', 8)
  call leglin(cbuf, '90%', 9)
  call leglin(cbuf, '95%', 10)
  call legtit('legend')
  call legend(cbuf, 3)
  call disfin
end program

```

As a result I get a met file: ‘dislin.met’ and a text file ‘amdahl\_table.txt’.  
I suppose the met file contains all the information to generate a plot.  
My question is: how can I produce a plot. I tried call metafl(‘PDF’) to no avail.

Roger

---

<div class="post-metadata">

### Author: ![cmaapic](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/cmaapic/32/659_2.png) [@cmaapic](https://fortran-lang.discourse.group/u/cmaapic)
#### Post date: [April 1, 2024, 3:24pm UTC](https://fortran-lang.discourse.group/t/intel-fortran-dislin-plotting/7742/4 "2024-04-01T15:24:01Z")

</div>

When you’ve compiled and ran a program a .met file will be created. dislin provide a utility program that can be use to display the plot or generate a so called device file.

Here are some sample runs

Display to the screen

disdrv dislin\_2.met CONS

Generate a poscript file

disdrv dislin\_2.met PS

Generate a pdf

disdrv dislin\_2.met PDF

Hope this helps

Ian Chivers

---

<div class="post-metadata">

### Author: ![mecej4](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/mecej4/32/855_2.png) [@mecej4](https://fortran-lang.discourse.group/u/mecej4)
#### Post date: [April 1, 2024, 3:40pm UTC](https://fortran-lang.discourse.group/t/intel-fortran-dislin-plotting/7742/5 "2024-04-01T15:40:42Z")

</div>

Where did you add the call to METAFL?  
I added

```auto
call metafl('pdf')

```

before the call to DISINI() in your source file listed above, then built the program using IFX and ran it. The program produced a file “dislin.pdf”.

---

<div class="post-metadata">

### Author: ![rmoortgat](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/rmoortgat/32/3569_2.png) [@rmoortgat](https://fortran-lang.discourse.group/u/rmoortgat)
#### Post date: [April 1, 2024, 5:21pm UTC](https://fortran-lang.discourse.group/t/intel-fortran-dislin-plotting/7742/6 "2024-04-01T17:21:29Z")

</div>

Thank you all for your comments.  
It worked. I got a nice

 ![dislin](https://global.discourse-cdn.com/free1/uploads/fortran_lang/original/2X/d/df99c9cb8559bcbc7a7bfe1e4ddde11c96a9b2be.jpeg)  
plot in PDF.  
Fortran is cool!

Roger
