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
g95 compiler error for mod_grid
- m.hadfield
- Posts: 521
- Joined: Tue Jul 01, 2003 4:12 am
- Location: NIWA
Re: g95 compiler error for mod_grid
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.
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.
- m.hadfield
- Posts: 521
- Joined: Tue Jul 01, 2003 4:12 am
- Location: NIWA
Re: g95 compiler error for mod_grid
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.
Re: g95 compiler error for mod_grid
Using the older version of g95 solved the compilation problem.
Thanks!
Jessica
Thanks!
Jessica
- arango
- Site Admin
- Posts: 1367
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
Re: g95 compiler error for mod_grid
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.
- m.hadfield
- Posts: 521
- Joined: Tue Jul 01, 2003 4:12 am
- Location: NIWA
Re: g95 compiler error for mod_grid
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.
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.