mixed PUBLIC and PRIVATE variables in NAMELIST (Compaq compilers) 
Author Message
 mixed PUBLIC and PRIVATE variables in NAMELIST (Compaq compilers)

Hello,

I encountered the following problem with Compaq compilers (Digital Unix, Tru64,
and Linux) in code using a namelist containing both public and private variables:

f90: Error: RDF_calculation_mod.f90, line 37: If a namelist-group-name has the
PUBLIC attribute, no item in the namelist-group-object-list may have the
PRIVATE attribute.   [DELTA_R]
    namelist /rdf/ atom1, atom2, delta_r, traj_file, &
---------------------------------^

Any other compiler I used happily compiled the program.

Now, of course, I could just declare the namelist private but don't know how to
exactly achieve this.  The only solution I found so far was to use a single
private statement to make everything private unless declared explicitly public.

The question is why the Compaq compiler is so picky about that (non-standard?)
and how to resolve this problem cleanly.

Hannes.



Wed, 18 Jun 1902 08:00:00 GMT  
 mixed PUBLIC and PRIVATE variables in NAMELIST (Compaq compilers)
f90: Error: RDF_calculation_mod.f90, line 37: If a namelist-group-name has the
PUBLIC attribute, no item in the namelist-group-object-list may have the
PRIVATE attribute.   [DELTA_R]
    namelist /rdf/ atom1, atom2, delta_r, traj_file, &
---------------------------------^

Any other compiler I used happily compiled the program.

Now, of course, I could just declare the namelist private but don't know how
to exactly achieve this.  
============================================================

The compiler is standard conforming to report this error, the others are not.
The code is in breach of a constraint, and thus non-standard ("fortran 90/95
Explained", Section 7.15). Breaches of constraints must be detected.

To make a mamelist group private, you can write

private :: name_of_namelist_group

Gruesse aus Wien,

Mike Metcalf

--



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Compaq compiler - mixing .f90 and .f codes

2. Lots of Public and Private variables - no penalties on modern PC.

3. Public\private memory variables

4. public variable of a private type?

5. Namelist and private attributes

6. Mixing Compaq Visual Fortran 6 with Microsoft Visual C++ .NET

7. Mix free and fixed form with Compaq Fortran

8. Mixed language problems in Compaq VF 6.5

9. Private/public toggle bug

10. Are there any differences between public and private methods in VisualAge for smalltalk

11. API vs Internal vs Public vs Private in Envy/QA

12. mark as private / public

 

 
Powered by phpBB® Forum Software