forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DLLs - Global Parameters, Pure Subroutines

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
viroxa



Joined: 28 Jul 2017
Posts: 69

PostPosted: Mon Jul 31, 2017 10:41 am    Post subject: DLLs - Global Parameters, Pure Subroutines Reply with quote

Hello, Everyone,

Is there a way to store global parameters in a .DLL? If so, how can they be called? I've tried

Code:

MODULE mod_double
   IMPLICIT NONE
   
!   Double precision
   INTEGER,PARAMETER::DP=KIND(0.0D0)
END MODULE mod_double


in the DLL but when using the parameter in a program I got a message, that a constant was expected.

------------------------

The other issue is the PURE attribute, which seems to get lost somewhere on the way. As long as the pure subroutines are called from internal modules, it works just fine. But as soon as they're called from DLLs, they aren't pure anymore. Any advice on that?

Thanks a lot!
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4915
Location: Salford, UK

PostPosted: Mon Jul 31, 2017 1:35 pm    Post subject: Reply with quote

You can store parameters in a DLL but you can't access them directly by name. You could provide a function that maps an index for each parameter to the output of the function.
Back to top
View user's profile Send private message
viroxa



Joined: 28 Jul 2017
Posts: 69

PostPosted: Mon Jul 31, 2017 7:17 pm    Post subject: Reply with quote

Thanks for the advice.
Do you also have an idea, why PURE functions/subroutines don't remain pure?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 4915
Location: Salford, UK

PostPosted: Mon Jul 31, 2017 8:33 pm    Post subject: Reply with quote

I may have to pass on that question. How do you know that they are no longer PURE and why is it of interest?
Back to top
View user's profile Send private message
viroxa



Joined: 28 Jul 2017
Posts: 69

PostPosted: Tue Aug 01, 2017 10:18 am    Post subject: Reply with quote

I apply them to arrays using FORALL. Before i moved them to the DLL it worked, now I get an error, stating that PURE functions/subroutines are required.

I'll also include that in the example from the other thread (http://forums.silverfrost.com/viewtopic.php?t=3555).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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