Compile multiple Fortran programs in Linux

Source: Internet
Author: User
Compile multiple Fortran programs in Linux-general Linux technology-Linux programming and kernel information. For more information, see the following. Recently, I need to compile multiple Fortran programs in Linux and search for them online, but there is not much information. Maybe this problem is simple and not worth mentioning, but I still write what I know for your reference:

Method 1:
Assume that there are two Fortran programs. f90 and 2. f90, of which 1. f90 is the main program, 2. f90 is a subroutine called in the main program. It uploads the two programs to a Linux directory and uses the fortran compiling command, such as PGI pgf90 and Intel ifort. The command is as follows:

Pgf90-o exe_name 1. f90 2. f90
Ifort-o exe_name 1. f90 2. f90

Method 2:
Add the include '2. f90' statement to the main program 1. f90 and compile it with the fortran command in Linux. The command is as follows:

Pgf90-o exe_name 1. f90
Ifort-o exe_name 1. f90

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.