- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have some legacy code that uses MSFLIB and DFLIB, which apparently came from COMPAQ fortran. When I get to the llinking, I get "error LNK2019: unresolved external symbol _f_setmessageqq referenced in the a routine". I know that I'm using, in the routine, SETMESSAGEQQ(...), and that is the problem. It either comes from MSLIB or DFLIB, don't know. I get no error with the statements USE MSLIB and USE DFLIB in the fortran code, so does someone have a listing of intel statements that are equivalent to the legacy statements in MSLIB and DFLIB. I've searched and can't find any reference to the routines found in these libraries. Thanks.
Tom
Link Copied
- 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
- 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
- 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
- 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
Now, S1 is of size S1(MAXSEG), which, by EQUIVALENCING X2 to S1, makes X2 of size X2(MAXSEG).This is a misconception. Consider this example (no COMMON used, to keep things simple) [fortran] program tequivalence implicit none integer :: x(3),y(6),i equivalence (x(2),y(4)) do i=1,6 y(i)=i end do write(*,*)x write(*,*)y end program tequivalence [/fortran] The output of the program: [bash] 3 4 5 1 2 3 4 5 6 [/bash] Note that the EQUIVALENCE specification did not change the length of array x or that of array y.
- 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So far I'm succeeding in converting this code over using allocatable variables; have a handle on the equivalences also. But I have a question about some other things in the code. There is a common statement called COMMON /SCRATM/. Now, some subroutines it's COMMON /SCRATM/ D(2*MAXSEG), other subroutintes it is COMMON /SCRATM/ GAIN(4*MAXSEG), and in others it is COMMON /SCRATM/ Y(2*MAXSEG). COMMON acts like globals, but there are different variables in this common located in different subroutines. In a situation like this, does this represent COMMON /SCRATM/ D(2*MAXSEG),GAIN(4*MAXSEG), Y((2*MAXSEG)? And should I treat it as such. Again, I'm converting the commons over to modules. What is the best way to convert this common over to a module? Also, I don't understand what is being shared here if the common has different variables. This looks like very bad programming, unless you have a good explanation. Or is something else going on here I don't understand? Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One more thing, it compiles and runs as it should as well with no warnings or errorrs - I just discovered this today as I'm converting commons over to modules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One more item forgot to mention, the GAIN variable is a real value, the other ones (D and Y) are defined as COMPLEX*16. So what is going on here also?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Also, I don't understand what is being shared here if the common has different variables.
The names of variables in a COMMON block are local in scope. COMMONality is by offset from the base of the COMMON block, not by name. For example, if the following statements occur in different subprograms
[fortran]subroutine subA
REAL a,b,c
COMMON /XYZ/a,b,c
...
subroutine subX
REAL p,q,r
COMMON /XYZ/p,q,r
[/fortran]
variable pairs (a, p), (b, q), (c, r) differ only in name. Variable 'a' in SubA has the same value as 'p' in SubX, etc.
When COMMON block members differ in type from one declaration to another, it gets "interesting".
- 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
Have another issue: in the application discussed above, there is something like this declared: Complex *16 CM and below is Dimenstion CM(NR,*). Now, NR is not defined anywhere in the routine, to include "include" statement. Of course, everything comples and runs OK, so what is assumed here for the integer varialbe NR?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please show the actual code. Your description is not likely to be correct. In this context, NR could be a PARAMETER constant or the name of a dummy argument, COMMON variable or USE or host-associated variable. If CM is a dummy argument, then (unless NR is a PARAMETER), it is an "adjustable array" where the first bound is taken from the current value of NR. If it is not a dummy, then it is an "automatic" array, allocated on the stack (by default) with a first dimension of NR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For a declaration such as CM(NR,*) that was accepted by the compiler, it is probable that both CM and NR are dummy arguments to a subprogram. Please check your sources.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. I'm busy with a few other items here at work, and will upload the snipets of the code (enough to evaluate) some time this week.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I figured it out - been looking at this code too long. The value of the array is coming in via the subroutine call it's under. Sorry for the inconvenience. I have another one: In many places in this code, an array is defined as an asterisk (wild card I'm assuming). So you have something like this:
Complex*16, E
Dimension E(*)
Will the following be the same (want to make sure):
Complex(8), Dimension(:), Allocatable::E
Allocate(E(0)) ! size zero to start with
Also, if the array is a double array, then is "...Dimension(:,:) ... Allocate(E(0,0)) OK to use? I think it is, but want your opinion.
One more question: I have allocations every which way but loose in the code (in modules, subroutines). When it returns to main and exits, is there a wild card that I can use to deallocate the memory, or does it automatically deallocate when it exits? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One other question not related to the above one (or might be). I have the code working with dynamic arrays. This may have reference to deallocation, not sure. But before conversion, I used an input file and runs in about a few minutes. After conversion (converting to modules, allocation statements), I increased the arrays by 10x to test the dynamic arrays, and using the same input file, it runs much, much longer. Should I be deallocating every time the code exits a subroutine to speed things up, or is there something else I can do to speed the code up. Any suggestions would be appreciated. Thanks.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page