|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
sabbash
Joined: 15 Feb 2016 Posts: 2
|
Posted: Tue Mar 22, 2016 4:30 am Post subject: how to use imsl library in plato 4.7.0 |
|
|
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? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Tue Mar 22, 2016 8:04 am Post subject: |
|
|
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.) |
|
Back to top |
|
|
sabbash
Joined: 15 Feb 2016 Posts: 2
|
Posted: Tue Mar 22, 2016 9:57 am Post subject: |
|
|
thanks..ill try some dll |
|
Back to top |
|
|
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Mon Mar 28, 2016 6:03 pm Post subject: |
|
|
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? _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Mon Mar 28, 2016 7:32 pm Post subject: |
|
|
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: http://forums.silverfrost.com/viewtopic.php?t=888 .
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.
Code: | 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:
Code: |
ftn95 xqdag.f90
slink xqdag.obj c:imsl_dll.dll
|
Last edited by mecej4 on Thu Mar 31, 2016 9:09 am; edited 2 times in total |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1886
|
Posted: Tue Mar 29, 2016 1:27 am Post subject: Re: |
|
|
narayanamoorthy_k wrote: | 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. |
|
Back to top |
|
|
narayanamoorthy_k
Joined: 19 Jun 2014 Posts: 142 Location: Chennai, IN
|
Posted: Tue Mar 29, 2016 4:36 am Post subject: |
|
|
Thanks for clarifying mecej4.. _________________ Thanks and Regards
Moorthy |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|