Type mismatch error in Graf3

30 views
Skip to first unread message

Shahid Maqbool

unread,
Mar 31, 2022, 4:27:57 AM3/31/22
to dislin-users
Hey all,

I am trying to get the contour plot with the following Dislin code in the main program.      

      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('Parameter','Z')

      CALL INTAX()
      CALL AUTRES(Nx,Ny)
      CALL AXSPOS(300,1850)
      CALL AX3LEN(2200,1400,1400)
           
      CALL GRAF3(1.,300.,1.,50.,1.,300.,1.,50.,0.1,0.9,0.1,0.1)
      CALL CRVMAT(phi,Nx,Ny,1,1)

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

I am using the following commands for double precision

gfortran main.f90 -o main -L/usr/local/dislin/ -I/usr/local/dislin/gf/real64 -ldislin

It shows this error

 212 |       CALL GRAF3(1.,300.,1.,50.,1.,300.,1.,50.,0.1,0.9,0.1,0.1)
                                                                                                                    1
Error: Type mismatch in argument ‘ax’ at (1); passed REAL(4) to REAL(8)


1)  The first thing is why is the argument 'ax'. Apparently, it should be 'xa' by following

CALL GRAF3 (XA, XE, XOR, XSTEP, YA, YE, YOR, YSTEP,
ZA, ZE, ZOR, ZSTEP)

2)  The second thing is how to correct it?

Many thanks for your help.

Best regards
Shahid

Helmut Michels

unread,
Mar 31, 2022, 5:51:58 AM3/31/22
to dislin-users
Dear Shahid,

the parameters in GRAF3 are real*4 constants and you are linking with the single precision
library of Dislin, but the Dislin module 'dislin.mod' in /usr/local/dislin/real64 is compiled for
real*8 parameters. Please use just the option -I/usr/local/dislin/gf for the real*4 module.

With best regards,

Helmut

Shahid Maqbool

unread,
Mar 31, 2022, 7:01:06 AM3/31/22
to dislin-users
Dear Helmut,

Thanks for the reply. Now it shows the error

gfortran main.f90 -o main -L/usr/local/dislin/ -I/usr/local/dislin/gf -ldislin

  213 |       CALL CRVMAT(phi,Nx,Ny,1,1)
          |                                                         1
Error: Type mismatch in argument ‘zmat’ at (1); passed REAL(8) to REAL(4)

Phi just can not be with single precision in the simulation. What else do I need to consider? 

Best regards,
Shahid

Helmut Michels

unread,
Mar 31, 2022, 7:48:13 AM3/31/22
to dislin-users
Hi Shahid,

for that case you should convert the parameters in GRAF3 to double precision values. For example
by appending the term 'd0' to constants.  Note that you have to link with the double precision library of
Dislin:

    gfortran main.f90 -o main -L/usr/local/dislin/ -I/usr/local/dislin/gf/real64 -ldislin_d

The alternative is to convert phi to a real*4 array.

With best regards,

Helmut

Shahid Maqbool

unread,
Mar 31, 2022, 9:18:35 AM3/31/22
to dislin-users
Dear Helmut,

Thanks for the suggestions. The appending of d0 has solved the problem.

Best regards,
Shahid

Reply all
Reply to author
Forward
0 new messages