- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting these compiler errors and I do not think I have the hang of passing arrays whose size is not fixed yet. Can somebody help me understand the basis of these errors ?
zfilereader.f(73): error #8363: An entity is not a coarray. [TLONS]
tlons = modulo((olons+180.0),360.0)-180.0
---------^
zfilereader.f(73): error #8363: An entity is not a coarray. [OLONS]
tlons = modulo((olons+180.0),360.0)-180.0
This is my subroutine -
subroutine transformLongitude(lonlen,olons,tlons) real olons(lonlen),tlons(lonlen) integer i,lonlen do i=1,lonlen tlons = modulo((olons+180.0),360.0)-180.0 end do return end
and in my main program I have these instructions -
real lons[allocatable](:) real transformedLons[allocatable](:)
allocate(transformedLons(lonlen)) call transformLongitude(lonlen,lons,transformedLons)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You misunderstand Fortran syntax, perhaps confusing it somewhat with C.
In the subroutine you want instead:
tlons(i) = modulo((olons(i)+180.0),360.0)-180.0
That is, parentheses instead of square brackets.
In the main program you want instead:
real, allocatable :: lons(:) real, allocatable :: transformedLons(:)
I predict that you have other non-Fortran syntax elsewhere in your program given these two issues. Where did you get this code from or where did you see descriptions of the syntax you used?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Steve,
Blame the first one on switching between languages constantly and I apologize for that :-). But the second one
lons[allocatable](:)
does seem to work. Ifort does not seem to complain about it. This is legacy code that I had on my system and it has worked so far. I can switch it to the syntax you wrote but the above one has not failed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's an old Microsoft extension that we continue to support. Please don't use it.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page