Quantcast
Channel: Intel® Fortran Composer XE
Viewing all articles
Browse latest Browse all 1424

Problems with MODULE

$
0
0

Show trimmed contentHi,

I am relative new to Fortran, so forgive me for 3 simple questions:

1) I have made a MODULE like this in Fortran 90 using intel fortran visual compiler and get an error in the code line "CompMF( N2     )..." below:

MODULE SSBGAS

    IMPLICIT NONE

    Integer         N2,     O2,     H2,      Ar,     CO

    Parameter( N2     =   1)
    Parameter( O2     =   2)
    Parameter( H2     =   3)
    Parameter( Ar     =   4)
    Parameter( CO     =   5)

    INTEGER, PARAMETER :: MaxCom = 38
    Character*18   CompMF( MaxCom)

    CONTAINS
  
    CompMF( N2     )   = 'N2' ! Here I have problems...?? error #6274: This statement must not appear in the specification part of a module


! If I write DATA CompMF( N2     )   / 'N2' / it works fine but isn't the DATA stamement obsolete ?

    END MODULE SSBGAS

2) Again, in the same module:

Data (CCpGas( i, N2 ), i=1,9) / 2.89054E+01 ,&

5.36709E-03 , -4.03662E-05 ,&

1.18534E-07 , -1.48467E-10 ,&

9.89388E-14 , -3.69281E-17 ,&

7.31369E-21 , -6.00168E-25 /

!This works fine but isn't the DATA statement obsolete? what should I write instead of using the DATA statement??

!If I write

CCpGas( 1, N2 ) = 2.89054E+01
CCpGas( 2, N2 ) = 5.36709E-03
CCpGas( 3, N2 ) = -4.03662E-05
CCpGas( 4, N2 ) = 1.18534E-07
CCpGas( 5, N2 ) = -1.48467E-10
CCpGas( 6, N2 ) = 9.89388E-14
CCpGas( 7, N2 ) = -3.69281E-17
CCpGas( 8, N2 ) = 7.31369E-21
CCpGas( 9, N2 ) = -6.00168E-25

!I get an error like "error #6274: This statement must not appear in the specification part of a module"??

 

3) In the end of the MODULE I write SAVE but I get the error "A specification statement cannot appear in the executable section" ??

 


Viewing all articles
Browse latest Browse all 1424

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>