Skip to content

Commit 7d64c11

Browse files
author
jim-215-fisher
committed
Merge remote-tracking branch 'origin/master' into Distribution-Exponential
2 parents ff0da26 + 30f5321 commit 7d64c11

30 files changed

+1540
-31
lines changed

API-doc-FORD-file.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extra_mods: iso_fortran_env:https://gcc.gnu.org/onlinedocs/gfortran/ISO_005fFORT
2828
print_creation_date: true
2929
creation_date: %Y-%m-%d %H:%M %z
3030
project_github: https://github.com/fortran-lang/stdlib
31-
project_download: https://github.com/fortran-lang/stdlib/archive/master.zip
31+
project_download: https://github.com/fortran-lang/stdlib/archive/HEAD.zip
3232
project_website: https://stdlib.fortran-lang.org
3333
favicon: doc/media/favicon.ico
3434
license: by-sa
@@ -57,7 +57,7 @@ The documentation for comment markup in source code, running [FORD] and the [FOR
5757

5858
[FORD]: https://github.com/Fortran-FOSS-Programmers/ford#readme
5959
[FORD wiki]: https://github.com/Fortran-FOSS-Programmers/ford/wiki
60-
[FORD project file]: https://github.com/fortran-lang/stdlib/blob/master/API-doc-FORD-file.md
60+
[FORD project file]: https://github.com/fortran-lang/stdlib/blob/HEAD/API-doc-FORD-file.md
6161

6262
Goals and Motivation
6363
====================

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Features available from the latest git source
44

5+
- new module `stdlib_array`
6+
[#603](https://github.com/fortran-lang/stdlib/pull/603)
7+
- new procedures `trueloc`, `falseloc`
58
- new module `stdlib_distribution_uniform`
69
[#272](https://github.com/fortran-lang/stdlib/pull/272)
710
- new module `stdlib_selection`
@@ -10,9 +13,17 @@ Features available from the latest git source
1013
- new module `stdlib_version`
1114
[#579](https://github.com/fortran-lang/stdlib/pull/579)
1215
- new procedure `get_stdlib_version`
16+
- update module `stdlib_io`
17+
[597](https://github.com/fortran-lang/stdlib/pull/597)
18+
- new procedure `getline`
1319
- new module `stdlib_io_npy`
1420
[#581](https://github.com/fortran-lang/stdlib/pull/581)
1521
- new procedures `save_npy`, `load_npy`
22+
- update module `stdlib_math`
23+
- new procedures `is_close` and `all_close`
24+
[#488](https://github.com/fortran-lang/stdlib/pull/488)
25+
- new procedures `arg`, `argd` and `argpi`
26+
[#498](https://github.com/fortran-lang/stdlib/pull/498)
1627

1728
Changes to existing modules
1829

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ requests.
99

1010
By contributing to *stdlib*, you certify that you own or are allowed to share the
1111
content of your contribution under the
12-
[stdlib license](https://github.com/fortran-lang/stdlib/blob/master/LICENSE).
12+
[stdlib license](https://github.com/fortran-lang/stdlib/blob/HEAD/LICENSE).
1313

1414
* [Style](#style)
1515
* [Reporting a bug](#reporting-a-bug)
@@ -22,7 +22,7 @@ content of your contribution under the
2222
## Style
2323

2424
Please follow the
25-
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/master/STYLE_GUIDE.md)
25+
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/HEAD/STYLE_GUIDE.md)
2626
for any Fortran code that you contribute.
2727
This allows the community to focus on substance rather than style.
2828

@@ -42,7 +42,7 @@ Before opening a bug report:
4242
1. Check if the issue has already been reported
4343
([issues](https://github.com/fortran-lang/stdlib/issues)).
4444
2. Check if it is still an issue or it has been fixed?
45-
Try to reproduce it with the latest version from the master branch.
45+
Try to reproduce it with the latest version from the default branch.
4646
3. Isolate the problem and create a minimal test case.
4747

4848
A good bug report should include all information needed to reproduce the bug.
@@ -74,7 +74,7 @@ It is quite possible we have not considered such solutions yet.
7474
## Workflow
7575

7676
The general workflow is documented in
77-
[this document](https://github.com/fortran-lang/stdlib/blob/master/WORKFLOW.md)
77+
[this document](https://github.com/fortran-lang/stdlib/blob/HEAD/WORKFLOW.md)
7878

7979
The workflow guide is a living document.
8080
You are welcome to propose changes to the workflow by
@@ -93,7 +93,7 @@ You are welcome to propose changes to the workflow by
9393
[CHANGELOG](https://github.com/fortran-lang/stdlib/blob/master/CHANGELOG.md)
9494
* Be open to constructive criticism and requests for improving your code.
9595
* Again, please follow the
96-
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/master/STYLE_GUIDE.md).
96+
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/HEAD/STYLE_GUIDE.md).
9797

9898

9999
## For new contributors

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ make -f Makefile.manual ADD_FYPPFLAGS=-DMAXRANK=4
184184

185185
You can also specify the compiler and compiler-flags by setting the ``FC`` and ``FFLAGS`` environmental variables. Among other things, this facilitates use of compiler optimizations that are not specified in the Makefile.manual defaults.
186186
```sh
187-
make -f Makefile.manual ADD_FYPPFLAGS=-DMAXRANK=4 FC=gfortran FFLAGS="-O3 -flto"
187+
make -f Makefile.manual ADD_FYPPFLAGS=-DMAXRANK=4 FC=gfortran FFLAGS="-O3"
188188
```
189189

190190
### Build with [fortran-lang/fpm](https://github.com/fortran-lang/fpm)

STYLE_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The following two sections are most relevant for contributing new code:
8181

8282
To write the "spec" (specification) for a new proposal, please place it in the
8383
[FORD "pages"](https://github.com/Fortran-FOSS-Programmers/ford/wiki/Writing-Pages) directory at
84-
[`doc/specs/`](https://github.com/fortran-lang/stdlib/tree/master/doc/specs).
84+
[`doc/specs/`](https://github.com/fortran-lang/stdlib/tree/HEAD/doc/specs).
8585
To get help please see the ["Writing Pages"](https://github.com/Fortran-FOSS-Programmers/ford/wiki/Writing-Pages)
8686
and ["Writing Documentation"](https://github.com/Fortran-FOSS-Programmers/ford/wiki/Writing-Documentation) pages
8787
on the [FORD wiki](https://github.com/Fortran-FOSS-Programmers/ford/wiki).

doc/specs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This is and index/directory of the specifications (specs) for each new module/fe
1111

1212
## Experimental Features & Modules
1313

14+
- [array](./stdlib_array.html) - Procedures for index manipulation and array handling
1415
- [ascii](./stdlib_ascii.html) - Procedures for handling ASCII characters
1516
- [bitsets](./stdlib_bitsets.html) - Bitset data types and procedures
1617
- [error](./stdlib_error.html) - Catching and handling errors

doc/specs/stdlib_array.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: array
3+
---
4+
5+
# The `stdlib_array` module
6+
7+
[TOC]
8+
9+
## Introduction
10+
11+
Module for index manipulation and array handling tasks.
12+
13+
## Procedures and methods provided
14+
15+
16+
### `trueloc`
17+
18+
#### Status
19+
20+
Experimental
21+
22+
#### Description
23+
24+
Turn a logical mask into an index array by selecting all true values.
25+
Provides similar functionality like the built-in `where` or the intrinsic procedures `merge` and `pack` when working with logical mask.
26+
The built-in / intrinsics are usually preferable to `trueloc`, unless the access to the index array is required.
27+
28+
#### Syntax
29+
30+
`loc = [[trueloc(function)]] (array[, lbound])`
31+
32+
#### Class
33+
34+
Pure function.
35+
36+
#### Arguments
37+
38+
`array`: List of default logical arrays. This argument is `intent(in)`.
39+
40+
`lbound`: Lower bound of the array to index. This argument is `optional` and `intent(in)`.
41+
42+
#### Return value
43+
44+
Returns an array of default integer size, with a maximum length of `size(array)` elements.
45+
46+
#### Examples
47+
48+
```fortran
49+
program demo_trueloc
50+
use stdlib_array, only : trueloc
51+
implicit none
52+
real, allocatable :: array(:)
53+
allocate(array(500))
54+
call random_number(array)
55+
array(trueloc(array > 0.5)) = 0.0
56+
end program demo_trueloc
57+
```
58+
59+
60+
### `falseloc`
61+
62+
#### Status
63+
64+
Experimental
65+
66+
#### Description
67+
68+
Turn a logical mask into an index array by selecting all false values.
69+
Provides similar functionality like the built-in `where` or the intrinsic procedures `merge` and `pack` when working with logical mask.
70+
The built-in / intrinsics are usually preferable to `falseloc`, unless the access to the index array is required.
71+
72+
#### Syntax
73+
74+
`loc = [[falseloc(function)]] (array[, lbound])`
75+
76+
#### Class
77+
78+
Pure function.
79+
80+
#### Arguments
81+
82+
`array`: List of default logical arrays. This argument is `intent(in)`.
83+
84+
`lbound`: Lower bound of the array to index. This argument is `optional` and `intent(in)`.
85+
86+
#### Return value
87+
88+
Returns an array of default integer size, with a maximum length of `size(array)` elements.
89+
90+
#### Examples
91+
92+
```fortran
93+
program demo_falseloc
94+
use stdlib_array, only : falseloc
95+
implicit none
96+
real, allocatable :: array(:)
97+
allocate(array(-200:200))
98+
call random_number(array)
99+
array(falseloc(array < 0.5), lbound(array)) = 0.0
100+
end program demo_falseloc
101+
```

doc/specs/stdlib_io.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,53 @@ program demo_savenpy
223223
call save_npy('example.npy', x)
224224
end program demo_savenpy
225225
```
226+
227+
## `getline`
228+
229+
### Status
230+
231+
Experimental
232+
233+
### Description
234+
235+
Read a whole line from a formatted unit into a string variable
236+
237+
### Syntax
238+
239+
`call [[stdlib_io(module):getline(interface)]] (unit, line[, iostat][, iomsg])`
240+
`call [[stdlib_io(module):getline(interface)]] (line[, iostat][, iomsg])`
241+
242+
### Arguments
243+
244+
`unit`: Formatted input unit.
245+
This argument is `intent(in)`.
246+
If `unit` is not specified standard input is used.
247+
248+
`line`: Deferred length character or `string_type` variable.
249+
This argument is `intent(out)`.
250+
251+
`iostat`: Default integer, contains status of reading from unit, zero in case of success.
252+
It is an optional argument, in case not present the program will halt for non-zero status.
253+
This argument is `intent(out)`.
254+
255+
`iomsg`: Deferred length character value, contains error message in case `iostat` is non-zero.
256+
It is an optional argument, error message will be dropped if not present.
257+
This argument is `intent(out)`.
258+
259+
### Example
260+
261+
```fortran
262+
program demo_getline
263+
use, intrinsic :: iso_fortran_env, only : input_unit, output_unit
264+
use stdlib_io, only: getline
265+
implicit none
266+
character(len=:), allocatable :: line
267+
integer :: stat
268+
269+
call getline(input_unit, line, stat)
270+
do while(stat == 0)
271+
write(output_unit, '(a)') line
272+
call getline(input_unit, line, stat)
273+
end do
274+
end program demo_getline
275+
```

0 commit comments

Comments
 (0)