Guylaine Prat wrote:
> Hi,
> I have got some problems when trying a new compiler (on a Linux/PC), although the codes have been
> successfully used on several platform: Cray, HP, Sun, NT , with different compiler versions on each platform.
> So I am wondering if the code is not ANSI compliant (a compilation with an "ansi" option
> works well) or if the compiler I am testing is not able to deal with my code.
>
> Example:
> I initialise some data (parameters) in a module, and want to use them in a program.
> I use two seperate files to do so, such as:
> ------------------------
> module data_module
> real, parameter :: single_value = 3.9e14
> real, parameter, dimension(6) :: data_value = (/1.,2.,3.,4.,5.,6./)
> end module data_module
> ------------------------
> program pgm_data_use
> use data_module
> implicit none
> integer i
> real, dimension(6) :: data_mod ! in which data_value are copied
> real, parameter, dimension(6) :: pgme_value = (/1.,2.,3.,4.,5.,6./)
>
> print*, '########### VALUES read from the module data_module :'
> write(*,999) (i,data_value(i),i=1,6)
> write(*,998) single_value
>
> print*, '########### VALUES copied inside the program:'
> data_mod(:) = data_value(:)
> write(*,996) (i,data_mod(i),i=1,6)
>
> print*, '########### VALUES initialised in the program :'
> write(*,997) (i,pgme_value(i),i=1,6)
> 999 format (6('data_value(',i1,')= ',e9.1,/))
> 996 format (6('data_mod(',i1,')= ',e9.1,/))
> 998 format ('single_value = ',e9.1)
> 997 format (6('pgme_value(',i1,')= ',e9.1,/))
> end program pgm_data_use
> -------------------------
snipped
> So if someone can tell me if this code is ANSI compliant, it will help me.
> Thanks.
> Guylaine PRAT
>
>
The Intel compiler ifc beta 6 appears to work as you intended. I don't
have available any newer compiler than that.
--
Tim Prince
[log in to unmask]
|