Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fedebenelli/ftools
Set of multiusage toosl that I use with my Fortran programs
https://github.com/fedebenelli/ftools
Last synced: about 2 months ago
JSON representation
Set of multiusage toosl that I use with my Fortran programs
- Host: GitHub
- URL: https://github.com/fedebenelli/ftools
- Owner: fedebenelli
- Created: 2022-05-04T12:49:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-29T12:40:15.000Z (5 months ago)
- Last Synced: 2024-10-08T04:22:24.812Z (3 months ago)
- Language: Fortran
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ftools
Set of tools to use with Fortran programs.## Array related oprations
### Array masking
Mask an array based on a boolean expresion.```fortran
x = [1, 5, 2, 1, 6]
y = x(mask(x < 3))print *, y
! [1, 2, 1]
```### Diff
Finite difference on an array```fortran
x = [1, 5, 2, 1, 6]
y = diff(x)! y = [4, 3, -1, 5]
```## Optional values handler
Simplify the check of optional values, giving possible defaults```fortran
! if xin was present in the procedure call, x will have the xin value,
! else it will be 5x = optval(xin, 5)
```## IO
### Convert numeric values into strings
```fortran
i = 5
c = str(i)! c == "5" (True)
```