Skip to content

gklimowicz/fortran-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

202 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fortran-examples

This repository contains submodules for many Fortran-related projects.

The goal is to have a wide variety of example Fortran codes, as found in the wild.

We plan to use them to analyze Fortran source as found in nature to investigate proposed features for the Fortran 202y (such as the proposed preprocessor).

Quick start

To get all these example Fortran projects execute on a case-sensitive file system:

git clone git@github.com:gklimowicz/fortran-examples
git submodule update --init

After what seems like forever, you should have some 280 GB or so of Fortran example projects.

To update after someone else has pushed changes to fortran-examples:

git pull
git submodule update

To update all projects from each repository’s origin:

make update

To update statistics:

make all

src directory

duplicates-ok.txt

This is a list of files (produced by bin/find-duplicates) that are not really duplicated projects. They are either completely different projects, modernizations, or some other variation on a theme.

origins.txt

Originally, this was to contain the provenance of each of the repositories. Since this is already saved in .gitmodules for the git-based projects, this now only contains the origin for sources for non-git projects. (Note that this may not be a direct link to a .tgz or .zip file, but may be the page where such a link can be found.)

We manage this file manually.

fortran-exceptions.txt

There are files in projects that have names like Fortran files, but don’t actually contain Fortran source code (e.g., Makefile.f90). We ignore files that are in the file-exceptions.txt list.

fortran-file-patterns.txt

Of all the files found in the projects, files that match these grep patterns are likely to be Fortran files. (Those that aren’t really Fortran should be in fortran-exceptions.txt.

project-exceptions.txt

There are projects mentioned on the fortran-lang.org and Beliavsky pages that don’t actually contain Fortran source code that we are interested in (such as only contain .fypp files). We ignore projects that are in the project-exceptions.txt list.

Makefile

The Makefile drives the collection of these repositories and the gathering of statistics. Most of them come from the projects listed on fortran-lang.org’s projects pages and Beliavsky’s Fortran-code-on-GitHub list.

make update

Update each Git project from its origin repository. Runs git submodule update --remote.

make all

Create project lists and metrics, typically after make update.

make add-new-projects

Search for new projects to add. Only looks at fortran-lang.org and github.com/Beliavsky so far.

make stats.txt

Generate and print interesting statistics about the corpus as a whole.

projects/ directory

So. Many. Directories.

The directories in projects/ each contain the source code for a single Fortran-oriented “project”. For projects that come from a super-project (such as “GEOS-ESM”), all the directories begin with the super-project’s name as a prefix (such as “GEOS-ESM-AeroApps).

build/ directory – Built attributes and statistics files

Note that we probably shouldn’t commit build files at all. But this repo takes so long to populate the project trees and update, it’s hopefully more convenient for the rest-of-world if we just save the built files in the repo.

Metrics

File names that begin with “all-” contain aggregated lists and metrics for the sample projects.

FileContents
all-files.txtEvery file in every project (including non-Fortran)
all-fortran-files.txtEvery Fortran file in every project
all-fortran-files-attr.txtAttributes found in each Fortran file
all-fortran-files-fixed.txtEvery fixed-form Fortran file in every project
all-fortran-files-free.txtEvery free-form Fortran file in every project
all-fortran-files-lc.txtLine count for every Fortran file
all-projects.txtList of all projects
all-projects-lc.txtLine count for Fortran files in each project

all-fortran-files-attr.txt

Each Fortran file is scanned to identify simple characteristics of the file.

AttributeDescription
formfixed if the file appears to be fixed-form
free if the file appears to be free-form
linesThe number of lines in the file
maxlinelengthThe maximum length of a line in the file
cpreprocessorThe number of C preprocessor directives in the file
ccommentThe number of fixed-form comments with C in column 1
dcommentThe number of fixed-form comments with D in column 1
starcommentThe number of fixed-form comments with * in column 1
fixedbangThe number of times ! comments appear in a fixed-form file
continuationsThe total number of line continuations in the file
maxcontinuationsThe longest sequence of continuation lines in the file
text73The number of lines in fixed-form with junk in columns 73-80
text133The number of lines in fixed-form with junk in columns 133-140
ampcontThe number of &-style continuations seen in free-form
ampampcontThe number of &-style continuations with & on the next line
includeThe number of Fortran INCLUDE lines in the file
openmpdirThe number of OpenMP directives in the file
openaccdirThe number of OpenACC directives in the file
otherdirThe number of unidentifiable directives in the file

About

A sit of Fortran projects gathered from GitHub, GitLab, and other places

Topics

Resources

License

Stars

Watchers

Forks

Contributors