Silverfrost Forums

Welcome to our forums

how to use imsl library in plato 4.7.0

22 Mar 2016 3:30 #17326

im a new user of fortran and plato. i need to use the fortran 90 MP library in one of my programs. how can i use it in plato?

22 Mar 2016 7:04 #17327

If you have a compatible DLL then you can create a project and then add the DLL as a reference in the Project Explorer window. (In fact you can also do this without creating a project.)

22 Mar 2016 8:57 #17330

thanks..ill try some dll

28 Mar 2016 5:03 #17355

But, how to instantiate the DLL reference in the main project and subscribe the function in your main routine to execute. How this is done?

28 Mar 2016 6:32 (Edited: 31 Mar 2016 8:09) #17356

As far as I know, IMSL is available for use with the Windows compilers from Intel, PGI and Absoft, but not with FTN95.

Many of the IMSL routines have Fortran 9x interfaces, with optional arguments and allocatable array arguments. The .mod files furnished with IMSL for another compiler are not compatible with FTN95 and, in general, the DLLs are not compatible with FTN95.

This question was (more or less) discussed in an older post: https://forums.silverfrost.com/Forum/Topic/644 .

Thus, you are limited to using Fortran 77 interfaces for those IMSL routines that have such interfaces documented. In doing so, you may find it useful to consult older versions of the IMSL documentation.

Here is an example program that uses the Fortran 77 interface to the IMSL routine QDAG to compute an integral.

      PROGRAM XQDAG
      IMPLICIT   NONE
      INTEGER    IRULE, NOUT
      REAL       A, ABS, B, ERRABS, ERREST, ERROR, EXACT, EXP, &
                 F, RESULT, ERRREL
      INTRINSIC  ABS, EXP
      EXTERNAL   F
!                                 Set limits of integration
      A = 0.0; B = 2.0
!                                 Set error tolerances
      ERRABS = 0.0; ERRREL = 1e-5; IRULE = 1
!
      CALL QDAG (F, A, B, ERRABS, ERRREL, IRULE, RESULT, ERREST)
!                                 Print results
      EXACT = 1.0 + EXP(2.0)
      ERROR = ABS(RESULT-EXACT)
      WRITE (*,10) RESULT, EXACT, ERREST, ERROR
   10 FORMAT (' Computed =', F8.3, 13X, ' Exact =', F8.3, /, /, &
            ' Error estimate =', 1PE10.3, 6X, 'Error =', 1PE10.3)
      END
!
      REAL FUNCTION F (X)
      REAL       X
      REAL       EXP
      INTRINSIC  EXP
      F = X*EXP(X)
      RETURN
      END

To build the 32-bit EXE, using the IMSL 32-bit FNL7 DLL:

ftn95 xqdag.f90
slink xqdag.obj c:imsl_dll.dll
29 Mar 2016 12:27 #17357

Quoted from narayanamoorthy_k But, how to instantiate the DLL reference in the main project and subscribe the function in your main routine to execute. How this is done? The terms 'instantiate the reference' and 'subscribe the function' are meaningless in the context described in the initial post of this thread: calling routines contained in the IMSL Fortran DLL from a Fortran program. You probably imagined that IMSL was being called from C# or Java.

29 Mar 2016 3:36 #17358

Thanks for clarifying mecej4..

Please login to reply.