Skip to content

Commit 3f6f5cb

Browse files
nbehrndperazz
andauthored
add Bader's draft about OOP in Fortran to the learning section (#477)
* add Bader's draft about OOP features in Fortran The draft by the late Reinhold Bader (1966-2024) about OOP features in Fortran is added to the learning section. Except the addition to the `learning.yml` file and a boiler plate header in the mandatory `index.md` file, it is a copy-paste of the illustrations and the text provided by `pandoc_md.md`, commit a77670d by 2024-09-03 of the rescuing GitHub repository.[1] [1] https://github.com/nbehrnd/bader_article Signed-off-by: Norwid Behrnd <[email protected]> * explicitly credit Reinhold Bader as author Signed-off-by: Norwid Behrnd <[email protected]> * test Sphinx' tip environment The contribution page[1] describes optional admonition environments which could help to retrieve hints. It is tested on one case. [1] https://fortran-lang.org/en/community/contributing/ Signed-off-by: Norwid Behrnd <[email protected]> * extend usage of admonitions Now each instance of string `_Hint:_` is substituted by an admonition environment. Signed-off-by: Norwid Behrnd <[email protected]> * adjust indentations to 2 spaces/level Snippets of code in the learning section indent with 2 spaces per level eachl. This pattern now is used, mostly with help of findent. Signed-off-by: Norwid Behrnd <[email protected]> * revise usage of f90 code block fence label Following the requested Code style,[1] snippets of code which show a principe but as such can not be successfully compiled no longer carry the `f90` label. The presence of at least one colon `:`, or one elipsis `...` is considered as an indicator. [1] https://fortran-lang.org/en/community/contributing/ Signed-off-by: Norwid Behrnd <[email protected]> * redefine images as block level images The usage of the two illustrations were edited; they now are block level images.[1] [1] https://myst-parser.readthedocs.io/en/latest/syntax/images_and_figures.html Signed-off-by: Norwid Behrnd <[email protected]> * change Fortran keywords to lower-case letters Following a recommendation,[1] keywords of Fortran in the snippets of code, running text, and section headers now are set in lower- case characters only. Beside syntax highlighlighting the web site offers, this then is more consistent in style with the other booklets already present. There however are exceptions to this change in the table about value statements, section Performing I/O with objects of container-like type). [1] #477 Signed-off-by: Norwid Behrnd <[email protected]> * add booklet to the index of the learning section Bader's draft about the support of OOP by Fortran now equally is accessible from the centre (section Fortran documentation) as well as from the lateral menu of the booklets. The entry in the later is new by this commit. Signed-off-by: Norwid Behrnd <[email protected]> * split oop single page booklet into a multipage booklett The booklet's content now is organized in three pages. This deviates from the state of commit a77670d (2024-09-03) of the rescuing GitHub respository,[1] however likely reflects better the original intent by Bader. [1] https://github.com/nbehrnd/bader_article Signed-off-by: Norwid Behrnd <[email protected]> * lightly lint the markdown file for eventual aesthetics A light edit to improve the aesthetics of the eventual rendering as html file. The cross-links within the booklet are removed because I don't understand the working of internal site links as explained by the guidelines,[1] nor successfully identified a working example among the other booklets by others. [1] https://fortran-lang.org/en/community/contributing/ Signed-off-by: Norwid Behrnd <[email protected]> * Update source/learn/oop_features_in_fortran/object_based_programming_techniques.md Co-authored-by: Federico Perini <[email protected]> * Update source/learn/oop_features_in_fortran/object_based_programming_techniques.md Co-authored-by: Federico Perini <[email protected]> * Update performance_and_ease_of_use.md add code fence labels `f90` * add missing f90 code fence labels Signed-off-by: Norwid Behrnd <[email protected]> --------- Signed-off-by: Norwid Behrnd <[email protected]> Co-authored-by: Federico Perini <[email protected]>
1 parent f2419dd commit 3f6f5cb

File tree

8 files changed

+1922
-0
lines changed

8 files changed

+1922
-0
lines changed

data/learning.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,16 @@ books:
276276
- link: /learn/intrinsics/UNPACK
277277
- link: /learn/intrinsics/VERIFY
278278

279+
- title: Fortran Object Oriented Programming
280+
description: Putting Fortran’s object-related features to practical use
281+
category: Fortran Documentation
282+
link: /learn/oop_features_in_fortran
283+
pages:
284+
- /learn/oop_features_in_fortran
285+
- /learn/oop_features_in_fortran/object_based_programming_techniques
286+
- /learn/oop_features_in_fortran/object_oriented_programming_techniques
287+
- /learn/oop_features_in_fortran/performance_and_ease_of_use
288+
279289
# Web links listed at the bottom of the 'Learn' landing page
280290
#
281291
reference-links:

source/learn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,5 @@ learn/building_programs/index
185185
learn/best_practices/index
186186
learn/intrinsics/index
187187
learn/rosetta_stone
188+
learn/oop_features_in_fortran/index
188189
:::
167 KB
Loading
35.2 KB
Loading
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Putting Fortran’s object-related features to practical use
2+
3+
:::{toctree}
4+
:maxdepth: 2
5+
:hidden:
6+
Object-based programming techniques <object_based_programming_techniques>
7+
Object-oriented programming techniques <object_oriented_programming_techniques>
8+
Performance and ease of use <performance_and_ease_of_use>
9+
:::
10+
11+
This article by the late Reinhold Bader (1966-2024)
12+
describes how advanced Fortran language features can be
13+
applied toward object-based and object-oriented programming techniques.
14+
These are, of course, to a significant extent a matter of taste,
15+
personal style and possibly overarching program design considerations,
16+
so should be taken with a pinch of salt.
17+
18+
Language features from Fortran 95 and later will be used; those from
19+
Fortran 2003 and later will also be shortly described. They are
20+
explained in more detail in e.g., Metcalf, Reid, Cohen and Bader.[^mfe]
21+
See also [Fortran 95 language
22+
features](https://en.wikipedia.org/wiki/Fortran_95_language_features) for
23+
the language's fundamentals; the prerequisite for understanding this article
24+
is that features explained there are well understood.
25+
26+
Boldface will be used where term definitions are introduced. They are
27+
additionally annotated by "(not a Fortran term)" or similar if the term
28+
is not used in the Fortran standard itself, but is in general use in the
29+
technical literature.
30+
31+
Compilable and runnable example code is available from an external
32+
[Github repository](https://github.com/reinh-bader/object_fortran).
33+
34+
[^mfe]:
35+
Metcalf, Michael; Reid, John; Cohen, Malcolm; Bader, Reinhold (2023).
36+
_Modern Fortran Explained._ Numerical Mathematics and Scientific Computation.
37+
Oxford University Press.
38+
[ISBN 978-0-19-887657-1](https://en.wikipedia.org/wiki/Special:BookSources/978-0-19-887657-1).

0 commit comments

Comments
 (0)