Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ckormanyos/hello_f77
The epic Hello World program in the Fortran77 language
https://github.com/ckormanyos/hello_f77
fortran fortran77 hello-world
Last synced: 24 days ago
JSON representation
The epic Hello World program in the Fortran77 language
- Host: GitHub
- URL: https://github.com/ckormanyos/hello_f77
- Owner: ckormanyos
- License: bsl-1.0
- Created: 2023-08-05T07:15:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-21T05:30:59.000Z (11 months ago)
- Last Synced: 2024-04-28T03:19:38.239Z (6 months ago)
- Topics: fortran, fortran77, hello-world
- Language: Fortran
- Homepage:
- Size: 154 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
hello_f77
==================hello_f77 implements the epic _Hello_ _World_ program in `FORTRAN77`.
## Compile on `*nix`
Use GCC to compile [`hello_f77.f`](./hello_f77.f). This requires the presence
of `fortran` in the enabled languages of the GCC build (see image and description below).
The `libgfortran` library must also be installed on the system for proper linking.```sh
cd hello_f77
g++ hello_f77.f -x f77 -std=legacy -O2 -lgfortran -o hello_f77.exe
```### Query if `fortran` Is Available
If you are unsure if `fortran` is available, query GCC for the presence of `fortran`.
Use the command shown below and search for `fortran` in the list of GCC's
_enabled_ languages.```sh
g++ -v
```![](./images/gcc_has_fortran.jpg)
## Source Listing
The complete source is provided below.
It can be found in [`hello_f77.f`](./hello_f77.f).You can even try this program at the following
[short link](https://godbolt.org/z/sMoP43Mcc) to [godbolt](https://godbolt.org).```fortran
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C Copyright Christopher Kormanyos 1985 - 2023.
C Distributed under the Boost Software License,
C Version 1.0. (See accompanying file LICENSE_1_0.txt
C or copy at http://www.boost.org/LICENSE_1_0.txt)
CC g++ hello_f77.f -x f77 -std=legacy -O2 -lgfortran -o hello_f77.exe
C See also https://godbolt.org/z/sMoP43MccPROGRAM HELLO
IMPLICIT NONECHARACTER*32 MY_TEXT
MY_TEXT = 'Hello World'
WRITE (*,*) MY_TEXTEND
```## Historical Perspective
`FORTRAN` (in particular `FORTRAN77` or `f77`) was there early in the game.
From a subjective standpoint, however, it seemed like there was an intermediate
time epoch during which its support was lost, missing, or in some other
way incomplete and obscure.Now trusty old `f77` is back. It is properly supported as part of GCC on many systems.
There is also (as there should be) conformance with legacy code.
This includes support for the $128$-bit floating-point data type `REAL*16`.Even though `REAL*16` (and its complex counterpart `COMPLEX*32`)
are not used in _Hello_ _World_, they are available for number crunching
when needed. These high-precision types can be difficult to find in the world of
high-performance, efficient, object-code-generating programming languages._Even_ _today_ this makes `FORTRAN77` still a leading program
for high-performance, high-precision numerical calculations.