• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Home
  • Lab. Members
    • PhD Students
    • Undergraduate Students
  • Projects
  • Publications
  • Openings
  • Gallery
  • Random Links
  • Contact Us

Computational Materials Science Lab

Texas A&M University College of Engineering

FORTRAN, advanced and resourceful

Fortran versus Matlab and others

 

If you are using FORTRAN for coding, download and take a look @ Fortran Refactoring for Legacy Systems

Also, while you code, have in mind the followings:

Common FORTRAN-isms I deal with, that hurt readability are:

  • Common blocks
  • Implicit variables
  • Two or three DO loops with shared CONTINUE statements
  • GOTO’s in place of DO loops
  • Arithmetic IF statements
  • Computed GOTO’s
  • Equivalence REAL/INTEGER/other in some common block

Strategies for solving these involve:

  1. Get Spag / plusFORT, worth the money, it solves a lot of them automatically and Bug-Free(tm).
  2. Avoid fixed format Fortran 77. Move to Fortran 90, if not move to free-format Fortran 77. (2003 standard is out there. check the updates…)
  3. Add IMPLICIT NONE to each subroutine and then fix every compile error, time-consuming but ultimately necessary, some programs can do this for you automatically (or you can script it).
  4. Moving all COMMON blocks to MODULEs, low hanging fruit, worth it.
  5. Convert arithmetic IF statements to IF..ELSEIF..ELSE blocks.
  6. Convert computed GOTOs to SELECT CASE blocks.
  7. Convert all DO loops to the newer F90 syntax.
    myloop: do ii = 1, nloops      ! do something
    enddo myloop
    
    
  8. Convert equivalenced common block members to either ALLOCATABLE memory allocated in a module, or to their true character routines if it is Hollerith being stored in a REAL.

 

 

Latest News

  • Congratulations to Vahid! October 3, 2019
  • CALPHAD XLVII Conference — Successfully Finished! November 5, 2018
  • Group BBQ with Halloween Theme October 31, 2017
  • CALPHAD XLVII Conference — First Announcement! October 10, 2017
  • Dr. Arroyave becomes full professor October 9, 2017

© 2016–2023 Computational Materials Science Lab Log in

Texas A&M Engineering Experiment Station Logo
  • State of Texas
  • Open Records
  • Risk, Fraud & Misconduct Hotline
  • Statewide Search
  • Site Links & Policies
  • Accommodations
  • Environmental Health, Safety & Security
  • Employment