• program convert in fortran 77 to fortran 95

    From arames asus@21:1/5 to All on Mon May 16 10:26:19 2022
    program convert in fortran 77 to fortran 95

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gah4@21:1/5 to asusa...@gmail.com on Mon May 16 17:07:25 2022
    On Monday, May 16, 2022 at 10:26:21 AM UTC-7, asusa...@gmail.com wrote:
    program convert in fortran 77 to fortran 95

    There was once, and I presume still is, a program to convert Fortran 77 to free-form Fortran 90 or 95.

    Most people (but not programs) writing fixed-form Fortran will put in blanks between keywords and variable names, for readability.

    The conversion program that I knew years ago, only knew about actual
    Fortran 77 keywords. It would not generally convert fixed form to free
    form, for programs with newer keywords.

    As fixed form is still allowed in newer Fortran versions, it would be nice
    to have a program that could convert even later versions, though with
    the restrictions on blanks. (No blanks in the middle of keywords or identifiers, and at least one between them.)

    Otherwise, except for a small number of deleted features, Fortran 77
    programs are valid as fixed-form Fortran 95.

    It would also be nice to have a program that would convert some
    obsolescent features to the appropriate newer form.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jfh@21:1/5 to All on Mon May 16 17:58:50 2022
    On Tuesday, May 17, 2022 at 12:07:27 PM UTC+12, gah4 wrote:
    On Monday, May 16, 2022 at 10:26:21 AM UTC-7, asusa...@gmail.com wrote:
    program convert in fortran 77 to fortran 95
    There was once, and I presume still is, a program to convert Fortran 77 to free-form Fortran 90 or 95.

    Most people (but not programs) writing fixed-form Fortran will put in blanks between keywords and variable names, for readability.

    The conversion program that I knew years ago, only knew about actual
    Fortran 77 keywords. It would not generally convert fixed form to free
    form, for programs with newer keywords.

    As fixed form is still allowed in newer Fortran versions, it would be nice to have a program that could convert even later versions, though with
    the restrictions on blanks. (No blanks in the middle of keywords or identifiers, and at least one between them.)

    Otherwise, except for a small number of deleted features, Fortran 77 programs are valid as fixed-form Fortran 95.

    There is a way for a valid f77 program to be invalid f95. The f77 program may have included a function with the same name as an intrinsic function new in f90 or f95, but with quite different arguments, if it did not have to be labelled EXTERNAL where it
    was used.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gah4@21:1/5 to jfh on Mon May 16 18:25:30 2022
    On Monday, May 16, 2022 at 5:58:52 PM UTC-7, jfh wrote:

    (snip)

    Otherwise, except for a small number of deleted features, Fortran 77

    programs are valid as fixed-form Fortran 95.
    There is a way for a valid f77 program to be invalid f95. The f77 program may have included a function with the same name as an intrinsic function new in f90 or f95,
    but with quite different arguments, if it did not have to be labelled EXTERNAL where it was used.

    I suppose so. But about as likely, a function that is an extension, or otherwise supported
    by some compiler.

    Last time I ran into that, was porting a program that is older than Fortran 66, which
    used a LINK function. (I believe a function defined in the program.) Since it was not
    a Fortran 77 intrinsic function, it would have been valid, and should also be valid
    in later Fortran, but (as well as I remember) not to gfortran.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David Jones@21:1/5 to All on Tue May 17 08:39:53 2022
    gah4 wrote:

    On Monday, May 16, 2022 at 10:26:21 AM UTC-7, asusa...@gmail.com
    wrote:
    program convert in fortran 77 to fortran 95

    There was once, and I presume still is, a program to convert Fortran
    77 to free-form Fortran 90 or 95.

    Most people (but not programs) writing fixed-form Fortran will put in
    blanks between keywords and variable names, for readability.

    The conversion program that I knew years ago, only knew about actual
    Fortran 77 keywords. It would not generally convert fixed form to
    free form, for programs with newer keywords.

    As fixed form is still allowed in newer Fortran versions, it would be
    nice to have a program that could convert even later versions, though
    with the restrictions on blanks. (No blanks in the middle of keywords
    or identifiers, and at least one between them.)

    Otherwise, except for a small number of deleted features, Fortran 77
    programs are valid as fixed-form Fortran 95.

    It would also be nice to have a program that would convert some
    obsolescent features to the appropriate newer form.

    There is a program called "to_f90" that will do part of this, If can be
    found on the page https://wp.csiro.au/alanmiller/ (which is an archive
    of stuff from Alan J. Miller).

    The description of this says ...
    "
    TO_F90

    A Fortran 90 program for converting fixed-format Fortran 77 code to
    Fortran 90 free-format. Other changes replace old Fortran constructs
    with more modern ones.

    The conversions made include:
    1. Standard format (column 7-72) converted to free-format.
    2. DO loops and IF blocks indented.
    3. Most labels are removed from loops and replaced with END DO, CYCLE,
    EXIT, and DO-loop constructs where appropriate.
    4. 3-way arithmetic IFs converted to IF .. THEN .. ELSE constructs.
    5. TYPE and INTENT declarations inserted for all subroutine and
    function arguments.
    6. Computed GOTOs converted to SELECT CASE constructs.
    7. Embedded blanks are removed from numerical constants; they are
    illegal
    in free format.

    N.B. Some known bugs are listed in the program comments.

    N.B. Users may like to use a program such as TIDY, available from
    simtelnet,
    before using TO_F90. TIDY will convert Hollerith strings; TO_F90 will
    not.

    Warning: Both TIDY and TO_F90 expect Fortran 77 code as input.
    In particular, both programs are intolerant of so-called Fortran 77 code containing DO .. END DO constructs and in-line comments after `!' (both
    illegal in F77).

    The program is supplied in source code form. It is in standard
    Fortran 90.
    It should compile with any full Fortran 90/95 compiler.
    "

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From baf@21:1/5 to All on Tue May 17 21:04:39 2022
    On 5/16/2022 5:07 PM, gah4 wrote:
    On Monday, May 16, 2022 at 10:26:21 AM UTC-7, asusa...@gmail.com wrote:
    program convert in fortran 77 to fortran 95

    There was once, and I presume still is, a program to convert Fortran 77 to free-form Fortran 90 or 95.

    Most people (but not programs) writing fixed-form Fortran will put in blanks between keywords and variable names, for readability.

    The conversion program that I knew years ago, only knew about actual
    Fortran 77 keywords. It would not generally convert fixed form to free
    form, for programs with newer keywords.

    As fixed form is still allowed in newer Fortran versions, it would be nice
    to have a program that could convert even later versions, though with
    the restrictions on blanks. (No blanks in the middle of keywords or identifiers, and at least one between them.)

    Otherwise, except for a small number of deleted features, Fortran 77
    programs are valid as fixed-form Fortran 95.

    It would also be nice to have a program that would convert some
    obsolescent features to the appropriate newer form.



    see https://people.math.sc.edu/Burkardt/f_src/f77_to_f90/f77_to_f90.html
    for another possible tool

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Beliavsky@21:1/5 to asusa...@gmail.com on Wed May 18 06:27:43 2022
    On Monday, May 16, 2022 at 1:26:21 PM UTC-4, asusa...@gmail.com wrote:
    program convert in fortran 77 to fortran 95

    My list of Fortran tools has a section "Fixed to Free Source Form Conversion" https://github.com/Beliavsky/Fortran-Tools#fixed-to-free-source-form-conversion . Here is the text without links:

    EZUP: tool to convert Fortran fixed source form to free source form to be compatible with ELF90, by August Miller

    f2f: Perl script which does much of the tedious work of converting FORTRAN 77 source code into modern Fortran, by Colby Lemon

    f77tof90: Python script that reads in a Fortran 77 (.f or .F) fixed form file and converts it to a free form Fortran 90 file (.f90 or .F90), by mattdturner. It was successfully used to convert a legacy codebase (over 400 .f/.F files and millions of lines
    of code) from Fortran 77 to Fortran 90.

    FORTRAN77_to_Fortran90: convert old fixed source FORTRAN 77 code to free form Fortran 90 code, by Koushikphy

    fortran-legacy-tools: tools to deal with Fortran code: fixed to free source form converter, upper- to lowercase converter, formatter for variable declarations, by ylikx

    freestyle: script to convert fixed form Fortran files (written in Fortran 77) and header files to free form, by bast

    GConvert: program to convert fixed form Fortran into code that works as fixed or free form, by GeorgeTsikas.

    to_f90: Alan Miller's tool for converting Fortran 77 code to free-form Fortran 90 code, from jbdv-no

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Collins@21:1/5 to asusa...@gmail.com on Wed May 18 06:42:31 2022
    On Monday, May 16, 2022 at 6:26:21 PM UTC+1, asusa...@gmail.com wrote:
    program convert in fortran 77 to fortran 95

    fpt ( http://simconglobal.com ) will convert fixed to free format. It will also substitute intrinsic functions which have changed from the original system, systematically edit variable names and re-program many legacy features.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John@21:1/5 to All on Wed May 18 21:01:23 2022
    The commerical package https://polyhedron.com/?product=plusfort
    does a lot if not all of the conversions mentioned by the OP as well.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)