Quantcast
Viewing all articles
Browse latest Browse all 3270

Making DLL arguments part of a module

I am trying to make the arguments of a subroutine be part of the module so other subroutines can use it. Is there anyway to make this work without having to assign local variables (testDLL's a and b) to global variables (TestMod's a and b)? I am trying to avoid assignments as much as I can.

   module TestMod
      real :: a
      real :: b
      real :: c
   contains
      !================================
      subroutine testDLL ( a , b )
      implicit none
      !DEC$ ATTRIBUTES DLLEXPORT::TestDLL

      call otherSub1 ()

      end subroutine testDLL
      !================================
      subroutine otherSub1 ()

      implicit none

      c =  ( a + b ) * 5.0

      end subroutine otherSub1
   end TestMod

Thanks.


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>