# [Fortran]  Alten Code neu kompilieren



## BassSportler (2. Oktober 2009)

Hallo,
für meine Bachelorarbeit hab ich gestern ein älteres Fortranprogramm abgetippt und wollt es kompilieren, jedoch gab der Kompilierer mit viele ähnliche Fehler vom Typ:
"Invalid character in name at (1)"

Da es das Programm schö länger gibt müsste es ja so gehen, oder kann es an den neuen Standards lliegen?
Hat jemand ne Idee?

PS: Datei hat nur wegen Hochladen endung txt, sonst f90


----------



## deepthroat (2. Oktober 2009)

Hi.

Ein paar mehr Informationen wären nicht schlecht.

Welcher Compiler? Welche Version?

Vollständige Fehlerausgabe vom Compiler.

Gruß


----------



## BassSportler (2. Oktober 2009)

Compiler:

```
PS D:\gfortran\bin> .\gfortran.exe --version
GNU Fortran (GCC) 4.5.0 20090421 (experimental) [trunk revision 146519]
Copyright (C) 2009 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
```

Fehler:

```
PS D:\gfortran\bin> .\gfortran.exe E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:56.8:

  type 'Index of the TOP film is ' WRITE(9,14) N1
        1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:58.8:

  type 'Index of the MIDDLE film is ' WRITE(9,14) N2
        1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:59.8:

  type 'Thickness of the MIDDLE film is ' WRITE(9,16) D2
        1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:61.8:

  type 'Index of the BOTTOM film is ' WRITE(9,14) N3
        1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:62.8:

  type 'Thickness of the BOTTOM film is ' WRITE(9,16) D3
        1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:64.8:

  type 'Index of the substrate is ' WRITE(9,14) N4
        1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:66.8:

  FORMAT(' For the substrate, DEL = ',F6.2,' PSI = ',F6.2)
        1
Error: Missing format label at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:83.8:

  TYPE 'CHOOSE Which One: ' ; ACCEPT CHOICE
        1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:83.30:

  TYPE 'CHOOSE Which One: ' ; ACCEPT CHOICE
                              1
Error: Unclassifiable statement at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:88.10:

    TYPE 'Type in values for DEL & PSI: '
          1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:92.45:

    RHO=TAND(PSI)*CEXP((0.0,1.0)*DEL/57.29578
                                             1
Error: Syntax error in argument list at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:97.10:

    TYPE 'Type n & k for the bottom film:'
          1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:100.10:

    TYPE 'Type the thickness of the bottom film: '
          1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:105.10:

    TYPE 'Type n & k for the middle film:'
          1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:108.10:

    TYPE 'Type the thickness of the middle film: '
          1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:113.10:

    TYPE 'Type n & k for the top film:'
          1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:123.10:

    TYPE "End Program? <Y or N<:" ACCEPT CHOICE
          1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:129.10:

    TYPE "Hit <Return> to continue:" ; pause
          1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:129.44:

    TYPE "Hit <Return> to continue:" ; pause
                                            1
Warning: Deleted feature: PAUSE statement at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:138.7:

 TYPE 'Type the LOWER Limit of film thickness: ' ACCEPT DL
       1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:139.7:

 TYPE 'Type the thickness INCREMENT: ' ACCEPT DI
       1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:140.7:

 TYPE 'Type the UPPER Limit of film thickness: ' ACCEPT DU
       1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:144.7:

 FORMAT('From' F7.0' to ' , F7.0, ' in steps of '. F5.1)
       1
Error: Missing format label at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:146.7:

 TYPE(9,*) 'Is this correct? <Y or N>: ' ACCEPT CHOICE
       1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:181.7:

 TYPE 'Filename to store Data? :' ACCEPT FILENAME
       1
Error: Invalid character in name at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:210.1:

 DO (D1=DL, DU, DI)
 1
Error: Unclassifiable statement at (1)
Fatal Error: Error count reached limit of 25.
gfortran.exe: Internal error: Aborted (program f951)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
```


----------



## deepthroat (2. Oktober 2009)

Bitte verwende die Code-Tags so dass man die Fehlermeldungen auch ordentlich sehen kann.


```
PS D:\gfortran\bin> .\gfortran.exe E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal.f90:56.8:

  type 'Index of the TOP film is ' WRITE(9,14) N1
        1
Error: Invalid character in name at (1)
```
Hier verwendest du das TYPE Schlüsselwort, welches zur Definition von benutzerdef. Typen benutzt werden kann.

Wieso hast du das Programm denn "abgetippt"? Wie alt ist das? Fortran 77?

Gruß


----------



## BassSportler (2. Oktober 2009)

ich habe es abgetippt weil ich es zur Berechnung von Ergebnissen aus meinem Experiment brauch. Ist schon von 1969 oder so, habs nirgends im WEb gefunden, also tippen


----------



## deepthroat (2. Oktober 2009)

Hab gerade dies gefunden:



> DIGITAL Fortran Extensions
> ACCEPT 	Reads input from stdin . Unlike READ, ACCEPT only provides formatted sequential output and does not specify a unit number.
> 
> *TYPE* 	Writes record output to stdout (same as *PRINT*).


Also, statt type, nimm einfach print bzw. write.

Gruß


----------



## BassSportler (2. Oktober 2009)

geht leider imme rnoch nicht:

```
PS D:\gfortran\bin> .\gfortran.exe -c E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:56.8:

  print 'Index of the TOP film is '; WRITE(9,14) N1
        1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:58.8:

  print ('Index of the MIDDLE film is '); WRITE(9,14) N2
        1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:59.9:

  print ('Thickness of the MIDDLE film is '); WRITE(9,16) D2
         1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:61.8:

  print ('Index of the BOTTOM film is '); WRITE(9,14) N3
        1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:62.9:

  print ('Thickness of the BOTTOM film is '); WRITE(9,16) D3
         1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:64.8:

  print ('Index of the substrate is '); WRITE(9,14) N4
        1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:83.8:

  print 'CHOOSE Which One: ' ; ACCEPT CHOICE
        1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:83.31:

  print 'CHOOSE Which One: ' ; ACCEPT CHOICE
                               1
Error: Unclassifiable statement at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:88.10:

    print ('print in values for DEL & PSI: ')
          1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:97.10:

    print ('print n & k for the bottom film:')
          1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:100.10:

    print ('print the thickness of the bottom film: ')
          1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:105.10:

    print ('print n & k for the middle film:')
          1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:108.10:

    print ('print the thickness of the middle film: ')
          1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:113.10:

    print ('print n & k for the top film:')
          1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:123.11:

    print ("End Program? <Y or N>:"); ACCEPT CHOICE
           1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:123.38:

    print ("End Program? <Y or N>:"); ACCEPT CHOICE
                                      1
Error: Unclassifiable statement at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:129.10:

    print ("Hit <Return> to continue:" ); pause
          1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:129.47:

    print ("Hit <Return> to continue:" ); pause
                                               1
Warning: Deleted feature: PAUSE statement at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:138.7:

 print ('print the LOWER Limit of film thickness: '); ACCEPT DL
       1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:138.54:

 print ('print the LOWER Limit of film thickness: '); ACCEPT DL
                                                      1
Error: Unclassifiable statement at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:139.7:

 print ('print the thickness INCREMENT: '); ACCEPT DI
       1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:139.44:

 print ('print the thickness INCREMENT: '); ACCEPT DI
                                            1
Error: Unclassifiable statement at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:140.7:

 print ('print the UPPER Limit of film thickness: '); ACCEPT DU
       1
Error: Missing leading left parenthesis in format string at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:140.54:

 print ('print the UPPER Limit of film thickness: '); ACCEPT DU
                                                      1
Error: Unclassifiable statement at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:144.7:

 FORMAT('From' F7.0' to ' , F7.0, ' in steps of '. F5.1)
       1
Error: Missing format label at (1)
E:\Physik-Studium\SoSe09\Ellipsometrie\ellipso_cal2.f90:146.6:

 print(9,*) ('Is this correct? <Y or N>: '); ACCEPT CHOICE
      1
Error: Syntax error in PRINT statement at (1)
Fatal Error: Error count reached limit of 25.
gfortran.exe: Internal error: Aborted (program f951)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
```


----------



## deepthroat (2. Oktober 2009)

Evtl. solltest du versuchen die Sprache zu lernen?

http://www.personal.psu.edu/jhm/f90/statements/print.html


----------

