- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am in the process of trying to scale back my program's use of memory in preparation for implementing OMP. As many of the arrays have the same dimensions I decided to replace the hard-coded numbers with values defined via the Parameter statement. As I had already placed a large number of parameters in a module, I decided to add these parameters to the existing module.
The subroutine code lookslike this:
-----------------
SUBROUTINE PROCNAME(ARG1,ARG2,ARG3)
C INFORMATIVE COMMENTS
C
USE HERS_PARAMS
INCLUDE 'SECTN.CMN'
---------------
The modules HERS_PARAMS includes the following:
----------------
INTEGER ININCR, WZIMP, NUMIMPS, FPMAX, IMP_RANGE
PARAMETER ( ININCR = 3 )
PARAMETER ( NUMIMPS = 11 )
PARAMETER ( FPMAX = 6 )
PARAMETER ( IMP_RANGE = (NUMIMPS+1)*ININCR )
------------------
The pertinent definitions in the common block are:
-------------------
REAL, DIMENSION (0:IMP_RANGE,0:FPMAX) ::
& ESALS, ESALSM, PSR, PSRM, VC
Of the 72 subroutines that use HERS_PARAMS and include SECTN.CMN 68 compile without problem. But three subroutines and one Real Function don't seem able to use the parameter module. For each of the five arrays dimensioned above they generate "error #6756: A COMMON block data object must not be an automatic object. [arrayname]" followed by " error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [parname]" for each of the two parameters.
For two of these routines, the set of messages is generated once, for a third twice, and for the fourth, four times.
What bad articles have I done in my youth that now the compiler would treat me this way?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you come up with a short but complete example that demonstrates the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you come up with a short but complete example that demonstrates the problem?
Well, sometimes all that is needed is a nudge to look elsewhere, in this case, deeper into the subroutines. What I found is that all of the files generating errors contained multiple subroutines/functions, and the errors were generated because I had not inserted the USE statement for each subroutine. That done, the problem was solved.
Thanks for the nudge!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, sometimes all that is needed is a nudge to look elsewhere, in this case, deeper into the subroutines. What I found is that all of the files generating errors contained multiple subroutines/functions, and the errors were generated because I had not inserted the USE statement for each subroutine. That done, the problem was solved.
Thanks for the nudge!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page