Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

keyword SAVE and DLLs

mountain_ike
Beginner
412 Views

This is a general question, with some specific implimentations.  I am building a fortran DLL that will be part of a much larger program (written in C++ and C#).  I want to retain some of the varaibles internally without having to re-compute them.  If I was building the program all myself I would simply use the 'SAVE' keyword.  Will that still work across the DLL interface?  I don't want my data to get corrupted without me knowing it.  And in a similar situation, if the variable I am 'SAVE'ing is allocatable?  Will it maintain its allocated nature and the data?  This is something I need to be sure about.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
412 Views

If you're talking about calls to DLL routines from the same program run, then yes, SAVE is what you want. In this context it is no different from a static library. Yes, if you SAVE an ALLOCATABLE it will persist across calls.

0 Kudos
Reply