3. Fortran issues#

Fortran sources are the ones that cause the most problems for agla users. The reason for this is the multiplicity of tools that are applied to them:

  • Fortran control script

  • compiler (s)

  • ANSI77 (CRS) standard verification tool

  • intercompilation tool (CRP)

  • link editing

We are going to illustrate the list of these tools.

3.1. Fortran control script#

This script is run at the start of the tool. His listing can be found in part <VERIF_2>. Several checks are carried out:

  • that the source looks like Fortran

  • that the source does not contain forbidden (or not recommended) characters or lines that are too long

  • that the source comes from the latest official version (checking the « C MODIF » card)

  • that the user did not modify the « C TOLE » cards (we will understand this sentence after reading the paragraph concerning the CRS tool)

--- Verify that the source is of type FORTRAN


/tmp/519797/aster/eda/vabhhts/identi/fortran contains source FORTRAN


--- Check that the source does not contain a step

--- annoying characters

17/-:C WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTAB

17/+: ILITY OR FITNESS FOR TO PARTICULAR PURPOSE. SEE THE GNU GENERAL PUBLIC LICENSE FOR MORE DETAILS.


(A/U-014): The previous lines (from the file /tmp/519797/aster/eda/vabhhts/identi/fortran)

: are preceded by their number in the file and by a diagnosis:

line_num/-: the first 72 characters of a line (ERREUR FATALE)

line_num/+: the continuation of the previous line (ERREUR FATALE)

line_num/! : contains characters that are not recommended (ALERTE)

line_num/? : contains INTERDITS characters (ERREUR FATALE)


(F/U-014): The /tmp/519797/aster/eda/vabhhts/identi/fortran file contains:

: INTERDITS characters

: and/or lines TROP LONGUES


--- Consistency check with the reference version (NEW7)


(A/U-222): calculation: Modification of map TOLE

The errors preceded by an A have been added to the map

Errors preceded by an S have been removed from the map

A CRP_20 CALCUL

3.2. Compiler (s)#

Only fatal compiler errors should be taken into account. Any « warnings » are not intercepted by agla. On the machine currently used by agla (in August 2003: the alphaserver), sources are compiled twice using 2 different compilers f90 (<VERIF_8>) and g77 (<VERIF_9>).

excerpt from <VERIF_8>:

=== === === === === === === === === === === ===

=== Compilation of sources FORTRAN in Majobj ===

=== === === === === === === === === === === ===


(F/U-090): ERROR (S) and WARNING (S) FORTRAN:

+ f90 -v -c -fast -i8 -r8 -r8 -omp /tmp/519797/tmp_asverif/bibfor/calculate/...

f90: Warning: /tmp/519797/tmp_asverif/bibfor/calculel/calcul.f, line 268:

Variable IACHIX is used before its value has been defined

EXICH = (IPARIN .GT.0). AND. ZL (IACHIX -1+ IPARIN)

-----------

Note:

asverifrelies on the return code of the command to launch the compilation tool to emit the error message ((F/U-090) : ERROR (S) and WARNING (S) FORTRAN). It is therefore necessary then to consult the messages sent by the compilation tool.

3.3. ANSI77 (CRS) Standard Audit Tool#

Tool CRS has been recovered from the public domain (it is actually a barely modified version of the ftncheck tool). The executable of this tool produces a listing (in <VERIF_8>) that can contain a large number of types of errors or warnings. Each type of message is preceded by a label in the form CRS_nnn; for example:

CRS_206 routine CALCUL "/tmp/519808/tmp_asverif/bibfor/calculel/calcul.f",

line 93 col 15: Warning: non-standard: (non-standard statement: REAL *8,...)


CRS_513 routine CALCUL: Warning:Variables used before set: IACHIX

The « trap » of this tool is that in printed messages (in English), it uses the words « error » and « warning » while for agla tools these words are not necessarily synonymous with fatal error or alarm.

There are CRS « Warnings » that cause fatal agla errors and unimportant CRS « errors »!!

The principle of using CRS in agla is as follows:

  • We execute the program CRS and we get its listing: l1

*We see if in listing l1, there are lines starting with « CRS_nnn » labels searched for by agla (note: some CRS_nnn messages are completely ignored; for example those concerning non-standard types REAL*8 or COMPLEX *16).

  • In the lines selected, we remove the CRS_nnn errors that are tolerated (« C TOLE CRS_nnn » mechanism described below).

  • If there are any lines left, the following text is printed:

  • ==⇒ Compilation refused for Code_Aster due to the following FORTRAN CRS errors (without a “C TOLE “map):

  • CRS_513 CALCUL

  • Then we print the raw listing l1

3.3.1. Mechanism of the « C TOLE CRS_nnn »#

The agla considers that some « errors » in CRS may be subject to exceptions. For example, the prohibition of equivalence between numerical and CHARACTER variables makes it impossible to use JEVEUX. For an exception to be admitted by the tool, the user must indicate in the source that he is deliberately violating the programming rule. To do this, for example, he will write in one of his routines: « C TOLE CRS_513 »

3.3.2. Summary#

To use the result of tool CRS, you must search for the string « ==⇒ Compilation refused… » If it is present, you should only look at the CRS_nnn messages that are indicated below.

3.4. Inter-compilation tool (CRP)#

Tool CRP works the same way as tool CRS. It also accepts exceptions handled by « C TOLE CRP_nnn » cards.

The specificity of this tool is to check the inter-compilation of Fortran sources. That is to say for example:

  • check that the number and type of arguments when calling a procedure are the same as those defined when defining the procedure,

  • check the consistency of the different occurrences of a COMMON,

*

Example listing for CRP (<VERIF_10>):

=== === === === === === === === === === === ===

=== Source check FORTRAN with CRP ===

=== === === === === === === === === === === ===

(F/U-222): Error (s) detected by crp:

===> CRP and inter-compilation errors:

CRP_150 CALCUL

CRP_3 CALCUL