Skip to content

Commit 9ca9eea

Browse files
author
Damian Rouson
authored
Merge pull request #24 from sourceryinstitute/update-docs
Update documentation & eliminate preprocessing
2 parents 797d3b5 + 68ded28 commit 9ca9eea

File tree

5 files changed

+32
-42
lines changed

5 files changed

+32
-42
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Documentation
2+
html
3+
14
# Build directories
25
build
36

README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,38 @@ A grab bag of useful tricks in Fortran 2018.
3232

3333
This library gathers software that developers at [Archaeologic Inc.] and
3434
[Sourcery Institute] find useful across many of our projects, including in
35-
courses that we teach. Most code starts here because it feels too small to
36-
release as a standalone package but too distinct in purpose to fold into other
37-
existing packages. Over time, when code that starts here grows in capability, a
38-
new repository is born and the corresponding code is removed from the Sourcery
39-
repository. Following the practice of [semantic versioning], code removal
40-
results in a major version number increment.
35+
courses that we teach. Most code starts here because it is too limited in
36+
capability to release as a standalone package but too distinct in purpose to
37+
fold into other existing packages. Over time, when code that starts here grows
38+
in capability, a new repository is born and the corresponding code is removed
39+
from the Sourcery repository. Examples include the [Assert] and [Emulators]
40+
libraries. Following the practice of [semantic versioning], code removal
41+
causes an increment in the major version number.
4142

42-
versioning to Examples
43-
include the [Assert] and [Emulators] libraries.
44-
45-
Utility functions
46-
-----------------
43+
Procedures
44+
---------
4745

4846
* Array functions
4947
* String functions
5048
* User-defined collective subroutines: `co_all`
5149

5250
Classes
5351
-------
54-
* Parallel data partitioning and gathering
55-
* (Co-)[Object pattern] abstract parent
56-
* Runtime units tracking
52+
* Parallel data partitioning and gathering,
53+
* (Co-)[Object pattern] abstract parent,
54+
* Runtime units tracking, and
55+
* A test oracle using the [Template Method pattern].
56+
* A command-line abstraction that searches for program arguments.
5757

5858
Prerequisites
5959
-------------
60-
See the [fpm manifest](./fpm.toml) for the dependencies and developer
61-
dependencies, the latter of which are needed only for contributing to Sourcery
62-
by adding new tests. Additionally, [FORD] 6.1.0 or later is required for
63-
producing HTML documentation.
60+
[FORD] 6.1.0 or later is required for producing HTML documentation (see
61+
"[Building the documentation]" below for instructions). The Fortran Package
62+
Manager ([fpm]) is required to build Sourcery from source. See the
63+
[fpm manifest](./fpm.toml) for the dependencies and developer dependencies,
64+
all of which [fpm] automatically downloads and builds via the `fpm` command
65+
provided in the "[Downloding, Building, and Testing]" section below.
66+
6467

6568
Downloding, Building, and Testing
6669
---------------------------------
@@ -95,3 +98,6 @@ documentation.
9598
[Emulators]: https://github.com/sourceryinstitute/emulators
9699
[Object pattern]: https://www.cambridge.org/rouson
97100
[semantic versioning]: https://semver.org
101+
[Template Method pattern]: https://en.wikipedia.org/wiki/Template_method_pattern
102+
[Downloding, Building, and Testing]: #downloding-building-and-testing
103+
[Building the documentation]: #building-the-documentation

doc/ford-documentation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
project:
22
summary: A Fortran 2018 utility library.
33
src_dir: ../src
4-
src_dir: ../tests
54
output_dir: html
65
preprocess: true
76
macro: FORD
File renamed without changes.

src/units_interface.F90 renamed to src/units_interface.f90

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,12 @@ module units_interface
6161
procedure :: integer_power
6262
procedure :: real_power
6363
procedure :: assign_units
64-
#ifndef FORD
6564
generic :: operator(+)=>add
6665
generic :: operator(*)=>multiply
6766
generic :: operator(/)=>divide
6867
generic :: operator(-)=>subtract,negate
6968
generic :: operator(**)=>integer_power,real_power
7069
generic :: assignment(=)=>assign_units
71-
#endif
7270
end type
7371

7472
interface
@@ -88,10 +86,7 @@ pure module subroutine assign_units(lhs,rhs)
8886
class(units), intent(in) :: rhs
8987
end subroutine
9088

91-
#ifndef HAVE_ERROR_STOP_IN_PURE
92-
impure &
93-
#endif
94-
elemental module function integer_power(this,exponent_) result(this_raised)
89+
impure elemental module function integer_power(this,exponent_) result(this_raised)
9590
!! result has units of the opearand raised to the power "exponent_"
9691
implicit none
9792
class(units), intent(in) :: this
@@ -106,42 +101,29 @@ module function get_units(this) result(exponents)
106101
integer :: exponents(num_fundamental)
107102
end function
108103

109-
#ifndef HAVE_ERROR_STOP_IN_PURE
110-
impure &
111-
#endif
112-
elemental module function get_system(this) result(system_of_units)
104+
impure elemental module function get_system(this) result(system_of_units)
113105
!! result is enumerated value designating units system
114106
implicit none
115107
class(units), intent(in) :: this
116108
integer :: system_of_units
117109
end function
118110

119-
120-
#ifndef HAVE_ERROR_STOP_IN_PURE
121-
impure &
122-
#endif
123-
elemental module function real_power(this,exponent_) result(this_raised)
111+
impure elemental module function real_power(this,exponent_) result(this_raised)
124112
!! result is the units of the operand raised to the power "exponent_"; includes check that operand is dimensionless
125113
implicit none
126114
class(units), intent(in) :: this
127115
real, intent(in) :: exponent_
128116
type(units) :: this_raised
129117
end function
130118

131-
#ifndef HAVE_ERROR_STOP_IN_PURE
132-
impure &
133-
#endif
134-
elemental module function add(lhs,rhs) result(total)
119+
impure elemental module function add(lhs,rhs) result(total)
135120
!! result is the units of the sum of two dimensional quantities; includes operand consistency check
136121
implicit none
137122
class(units), intent(in) :: lhs,rhs
138123
type(units) :: total
139124
end function
140125

141-
#ifndef HAVE_ERROR_STOP_IN_PURE
142-
impure &
143-
#endif
144-
elemental module function subtract(lhs,rhs) result(difference)
126+
impure elemental module function subtract(lhs,rhs) result(difference)
145127
!! result is the units of the difference of two dimensional quantities; includes operand consistency check
146128
implicit none
147129
class(units), intent(in) :: lhs,rhs

0 commit comments

Comments
 (0)