g95 compiler error for mod_grid

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
jrcrouch
Posts: 2
Joined: Wed Jul 23, 2008 6:35 pm
Location: Old Dominion University

g95 compiler error for mod_grid

#1 Unread post by jrcrouch »

I downloaded the ROMS source yesterday and I've been following the installation instructions in the wiki tutorial "Installing ROMS in Windows XP/Vista (via Cygwin)". When I ran the build script for the upwelling example the compilation of the first few files went fine. When it got to mod_grid, mod_grid.F got through the cpp pre-processor to yield mod_grid.f90, but g95 wouldn't compile mod_grid.f90. The error message is:
-------------------------------------
In file mod_grid.f90:171

allocate (GRID(ng) % angler(LBi:UBi, LBj:UBj) )
1
Error: Component to the right of a part reference with nonzero rank must not have the POINTER attribute at (1)
-------------------------------------
The particular compilation command that produced the error was:
g95 -c -fno-second-underscore -O3 -ffast-math mod_grid.f90

I have not made any changes to the source yet, so I wasn't expecting compiler errors. I'm more of a C/C++ programmer than Fortran, and I don't entirely understand what the complaint about the pointer means. Does anyone have any thoughts on what the problem might be?

Thanks,
Jessica Crouch

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: g95 compiler error for mod_grid

#2 Unread post by m.hadfield »

The error message you describe is generated by recent G95 snapshots, after 15 July 2008. For now, the simplest solution is to downgrade your G95 installation to an older version, eg. stable version 0.91. You can get the binaries here:

http://ftp.g95.org/#V0.91

The sort of allocate statement G95 is complaining about is used throughout the ROMS code and is accepted by many different compilers. So I am inclined to think that G95 is wrong to reject it. However I am not sure of this and have not got around to investigating further.

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: g95 compiler error for mod_grid

#3 Unread post by m.hadfield »

I have sent an email about this to Andy Vaught, the G95 lead developer, and cc'ed it to Hernan. I will report here when I know more.

jrcrouch
Posts: 2
Joined: Wed Jul 23, 2008 6:35 pm
Location: Old Dominion University

Re: g95 compiler error for mod_grid

#4 Unread post by jrcrouch »

Using the older version of g95 solved the compilation problem.

Thanks!

Jessica

User avatar
arango
Site Admin
Posts: 1361
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: g95 compiler error for mod_grid

#5 Unread post by arango »

I received an e-mail from Andy Vaught today. He fixed the problem in the g95 parser for allocate. Apparently, there was a problem when dealing with whitespace. He fixed the problem. I don't know if this corrected version of g95 is available today.

User avatar
m.hadfield
Posts: 521
Joined: Tue Jul 01, 2003 4:12 am
Location: NIWA

Re: g95 compiler error for mod_grid

#6 Unread post by m.hadfield »

I tried the latest Cygwin snapshot, dated 2008-07-24, and the problem is still there. It may be that his fixes were made after the snapshots were built. I have reported this to Andy Vaught.

Another problem you get with Cygwin snapshots from time to time is that the format for module files changes.

So, if you don't want to be at the bleeding edge of G95 development, you should stick to the official releases: the latest is 0.91, dated March 2008.

Post Reply