Fortran source code beautifier in Python

This project was successfully completed by suriyant for $231 USD in 5 days.

Get free quotes for a project like this
Employer working
Completed by:
Skills Required
Project Budget
$30 - $250 USD
Completed In
5 days
Total Bids
Project Description

I need a Fortran source code beautifier developed in Python.


- case: options
= everything uppercase
= only keywords uppecase
= everything lowercase
= same, but preserve variables that are already mixed case
but: leave comments and strings intact

- indentation: size of indent is a parameter
= if- statement, do- loops, select case- statements
= continued long subroutine calls and long variable declaration list: after continuation lines should be indented as +n wrt starting line,
n=5 (parameter)

- variable declarations: rewrite variable declarations to Fortran 90 style:

integer n, m(10,20)
integer :: n, m(10,20)

same for all other types (real, complex)

option to convert back and forth between
complex*16 complex(8)
real*8 real(8)
integer*8 integer(8)

character*10 str
character(len=10) :: str

Feature to reformat back and forth between F77 fixed format and F90 free source format
(in F77 line continuation character must be '&')

- spacing:
= option of space/no space after ',' in variable declarations, subroutine parameters, etc
= if (stmt1 .and. stmt2) then ...
= spacing arithmetic expressions is same as in all well-established languages (a + b*c), a = 3
= option (default=no spaces) in array dimensions: a(1,2)
= no space in subrotine calls around '(', ')':
call foo(1, b, c(2,3))
= option: space/no space in 'end do enddo', 'end if endif'

In case of doubt follow common sense, refer to Google C++ or Python style guide or ask me.

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online