cant see PRIVATE variable in MODULE SUBROUTINE when debugging with IFC/IDB v7.1 
Author Message
 cant see PRIVATE variable in MODULE SUBROUTINE when debugging with IFC/IDB v7.1

The following code illustrates my problem.

the question comes down to this:

Why does a variable, defined locally in a module and set PRIVATE, behave
differently from a global variable in a module, declared PRIVATE as well
but defined via USE from another module.???

!compilation: >ifc -g variablesgone.f90

!debugging:   >idb a.out

!IntelfortranCompiler v7.1 Linux environment

!var1 and var2 are accessible in pub_default and priv_default via USE

!after declaring var2 as PRIVATE, something strange happens:

!No errors or warnings during compilation, and during execution

!both, locally defined variables (var4/var5 and var3/var4) as well as

!global variables via USE invocation (var1/var2) are accessible.

!however, when debugging, var2 is no longer defined in the module

!subroutines pub_vis and priv_invis,i.e. I can not see their values as
they are "not defined", but var6/var4 are defined.

!Q: what is the difference between (private) locally defined

!variables and (private) variables from other modules????

!Why:I want to reset the default to PRIVATE in order to protect my

!variables from outside access, but still want to see all variables

!(local or via USE from other modules) within the contained module

!procedures for debugging.

!*************************************

MODULE vars

  IMPLICIT NONE

  INTEGER :: var1, var2

END MODULE vars

MODULE pub_default

  USE vars

  IMPLICIT NONE

  INTEGER var5, var6

  PRIVATE var6,var2 !why is var5 defined in pub_vis but var2 isn't?

CONTAINS

  SUBROUTINE pub_vis

    print*,var1,var2,var5,var6

  END SUBROUTINE pub_vis

END MODULE pub_default

MODULE priv_default

  USE vars

  IMPLICIT NONE

  INTEGER var3, var4

  PRIVATE

  PUBLIC var3,var1,priv_invis

CONTAINS

  SUBROUTINE priv_invis

    print*,var1,var2,var3,var4

  END SUBROUTINE priv_invis

END MODULE priv_default

PROGRAM disappear

  USE vars

  USE priv_default

  USE pub_default

  CALL pub_vis

  CALL priv_invis

  STOP

END PROGRAM DISAPPEAR

!***********************************

--
Posted via http://www.*-*-*.com/



Mon, 24 Apr 2006 17:56:43 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Value of f90 module variables not visible from either gdb or idb

2. Debugging multi-DLL apps. Cant follow variable

3. problem with idb and ifc 7.0

4. Problem debugging with DDD / IDB

5. PRIVATE Attribute on the Intel v7 compiler?

6. Accessing MODULE variables from within subroutines in the CONTAINS section

7. Subroutine arguments vs module variables

8. Module.Scoping.Subroutine call not initializing variable

9. Class sees privates of instances...

10. EQUIVALENCE(variable inside module, variable outside module) ????

11. Passing logical variables from Fortran subroutine to C subroutine

12. Private subroutines, bug or feature

 

 
Powered by phpBB® Forum Software