ROMS model compile problem

Hi, I am trying to compile ROMS (available from http://www.myroms.org/) and am receiving the following error

cd Build; f95 -c -u -U -xarch=v9 -openmp -fast mod_forces.f90

f95: Warning: -xarch=native has been explicitly specified, or implicitly specified by a macro option, -xarch=native on this architecture implies -xarch=v8plusb which generates code that does not run on pre UltraSPARC III processors

MODULE mod_forces

^

"mod_forces.f90", Line = 1, Column = 14: ERROR: The compiler has detected errors in module "mod_forces". No module information file will be created for this module.

SUBROUTINE initialize_forces (ng, tile, model)

^

"mod_forces.f90", Line = 207, Column = 41: ERROR: IMPLICIT NONE is specified in the host scope, therefore an explicit type must be specified for data object "tile".

integer, intent(in) :: ng, tile, model

^

"mod_forces.f90", Line = 223, Column = 34: ERROR: "tile" has the INTENT attribute, therefore it must be a dummy argument.

f90comp: 312 SOURCE LINES

f90comp: 3 ERRORS, 0 WARNINGS, 0 OTHER MESSAGES, 0 ANSI

gmake: *** [Build/mod_forces.o] Error 1

A code snippet from initialize_forces is

SUBROUTINE initialize_forces(ng, tile, model)

!

!=======================================================================

! !

! This routine initialize all variables in the module using first!

! touch distribution policy. In shared-memory configuration, this!

! operation actually performs propagation of the "shared arrays"!

! across the cluster, unless another policy is specified to!

! override the default.!

! !

!=======================================================================

!

USE mod_param

!

! Imported variable declarations.

!

integer, intent(in) :: ng, tile,model

Can anyone shed some light on why

f95: Sun Fortran 95 8.2 Patch 121019-05 2006/12/08

complains about this bit of code.

Thanks,

Simon.

[2073 byte] By [sspagnola] at [2007-11-27 5:10:29]
# 1
Is the name "tile" defined in the module mod_param?Bob Corbett
rpcorbetta at 2007-7-12 10:30:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

No, tile isn't in mod_param. Trolled around bugs.sun.com and found bug id 6472154 which looks like a fragment from ROMS source code. However of the three workarounds

1- use 'Tile' istead of 'tile' :-)

2- do not use -U option

3- in used modules do not use initialisations of constants by any intrinsic

functions

#1 works, #2 does not, #3 not under my control - and did this mean that the code is not strictly correct? Or is it a compiler dependent implentation? FYI the goes through ok on a i686 linux box using gcc version 4.1.1 20061011 (Red Hat 4.1.1-30)

Not sure how you find out if a particular patch set covers that particular bug id.

Thanks,

Simon.

sspagnola at 2007-7-12 10:30:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3

The CR you pointed out does seem to deal with the same problem.

The evaluation given in the CR is not detailed enough for me to

understand what the problem is. I tried asking the engineer here

who is most familiar with the code involved, but he was already

gone.

Given that the CR was accepted and a fix was delivered, I assume

that the problem is a bug in our compiler. Since a fix has been

delivered, you might try compiling with the Sun Studio Express

or the Early Access version of the compiler to see if the problem

has been fixed. If it has not, please let me know.

Bob Corbett

rpcorbetta at 2007-7-12 10:30:36 > top of Java-index,Development Tools,Solaris and Linux Development Tools...