Search code examples
visual-studiofortranfortran90fortran77

Problems to convert FORTRAN 77-File into FORTRAN 90 in Visual Studio


Sorry to ask this question, but I am totally new to Visual Studio and to Fortran .

I have a FORTRAN ( 77?) File Filename.f which I want to edit in Visual studio.

Is there a possibility to edit only this file and compile it later in Visual Studio without having to create a whole project? I didn`t find a way to do that.

So I tried to create a new f90-project X in Visual Studio and to copy/paste the code of my Filename.f into that X.f90. I know that I would have to take care of the file-name ( .f -> .f90) and the commentaries ( C -> ! ) but there seem to be problems right at the top of my file.

DIMENSION UZ(N,M),VZ(N,M),EZ(N,M)
DIMENSION UP(N,M),VP(N,M),EP(N,M)
1,UPZ(N,M),VPZ(N,M),EPZ(N,M)
DIMENSION RHO(N,M),RHOZ(N,M)

The compiler likes thew lines with DIMENSION.... but in line 3 he doesn`t like the 1.

Does anybody know why? What does the 1 mean anyway ?


Solution

  • My guess is that the 1 was in the 6th position of that line.

    In F77 fixed form format, this means that this line is a continuation of the previous line.

    Properly converted, this would look like this:

    DIMENSION UZ(N,M),VZ(N,M),EZ(N,M)
    DIMENSION UP(N,M),VP(N,M),EP(N,M)  &
              ,UPZ(N,M),VPZ(N,M),EPZ(N,M)
    DIMENSION RHO(N,M),RHOZ(N,M)