fortran2018-conditional-memory

A Fortran 2018 library for conditional (de-)allocation of allocatable objects of intrinsic types.

https://github.com/kevinmatthes/fortran2018-conditional-memory

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.0%) to scientific vocabulary

Keywords from Contributors

hack standardization meshing pipeline-testing datacleaner data-profilers sequences bridges interpretability argument-parser
Last synced: 8 months ago · JSON representation ·

Repository

A Fortran 2018 library for conditional (de-)allocation of allocatable objects of intrinsic types.

Basic Info
  • Host: GitHub
  • Owner: kevinmatthes
  • License: gpl-3.0
  • Language: Fortran
  • Default Branch: main
  • Size: 187 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 2
  • Releases: 1
Created over 3 years ago · Last pushed 12 months ago
Metadata Files
Readme Changelog License Citation

README.md

fortran2018-conditional-memory

Summary

A Fortran 2018 library for conditional (de-)allocation of allocatable objects of intrinsic types.

  1. License
  2. Software Requirements
  3. Description
  4. Build

License

This project's license is GPL-3.0. The whole license text can be found in LICENSE in the main directory of this repository. The brief version is as follows:

Copyright (C) 2022 Kevin Matthes

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Software Requirements

| Requirement | Type | Role | |:------------------|:-------------:|:--------------------------------------| | Doxygen | application | source code documentation | | GFortran | application | Fortran 2018 compiler | | Git | application | build artifact removal | | Just | Rust binary | execution of the build instructions | | Latexmk | application | LaTeX compilation of Doxygen manual | | TeX Live (full) | package | LaTeX environment for Doxygen manual | | Valgrind | application | memory leak detection |

This library is written in Fortran 2018 such that its build requires a compiler supporting this standard. This project relies on GFortran therefore.

The library build is organised with Just. The corresponding .justfile does not only take care for the compilation of the library but also for its documentation and testing.

The documentation is generated by Doxygen. The configured output formats are listed in the following.

  • HTML
  • LaTeX
  • UNIX manual pages

In order to finalise the LaTeX documentation, an appropriate LaTeX distribution is required. A full installation of TeX Live is recommended. This project employs Latexmk as LaTeX build manager for the manual finalisation.

There are unit tests for the library logic written in plain Fortran 2018 without requiring any further libraries. When running the tests, Valgrind will analyse their memory management.

Build artifacts are prevented from begin committed by the .gitignore this repository contains. It furthermore controls which files are going to be removed by git clean. Thus, it is the simplest solution to employ Git for the removal of build artifacts.

Description

This repository provides the source code for a library named libf18cndmem.a. The purpose of this library is the conditional allocation and deallocation of allocatable objects of Fortran intrinsic types. It is written in Free Form Fortran 2018.

As the deallocation of an allocatable object which is not already allocated will result in a runtime error, it needs to be checked whether the object to deallocate is allocated at all. The deallocation subroutines this library provides will take care about both this check and the deallocation, if required. All those subroutines are exposed with the generic interface cnddel which is an abbreviation of "Conditional Deallocation". At the moment, the following types are supported:

  • character (default)

Fortran 2018 has automatic reallocation features which allow for a convenient and comprehensive coding style. Under certain circumstances, it might not be obvious if an allocatable object is already allocated such that the automatic reallocation on intrinsic assignment could be processed. Then, it need to be tested whether there is already a memory region allocated for the respective object. If not so, an according amount of memory needs to be allocated before the assignment can be performed. This library provides a counterpart to the conditional deallocation, named cndall, to check whether some memory was already allocated and to assign the intended object to the target object. The name cndall is an abbreviation of "Conditional Allocation". At the moment, the following types are supported:

  • character (default)

Build

The build routine is organised by Just and defined in the .justfile in the repository root. To build the library, one of the following instructions can be executed.

bash just b just build just l just library

In addition, an automatic source code documentation with Doxygen is configured. One of the following commands will invoke the compilation.

bash just d just doxygen

The correctness of this library is ensured by a set of unit tests. They are furthermore analysed for their memory management by Valgrind. By calling for the Valgrind analysis, the unit tests are executed implicitly. This can be done with one of the following commands.

bash just v just valgrind

If the compilation of both the library and its documentation is wished, the following instructions can be executed. This will also run all unit tests.

bash just just a just all

Owner

  • Name: Kevin Matthes
  • Login: kevinmatthes
  • Kind: user

Citation (CITATION.cff)

######################## GNU General Public License 3.0 ########################
##                                                                            ##
## Copyright (C) 2022 Kevin Matthes                                           ##
##                                                                            ##
## This program is free software: you can redistribute it and/or modify       ##
## it under the terms of the GNU General Public License as published by       ##
## the Free Software Foundation, either version 3 of the License, or          ##
## (at your option) any later version.                                        ##
##                                                                            ##
## This program is distributed in the hope that it will be useful,            ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of             ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              ##
## GNU General Public License for more details.                               ##
##                                                                            ##
## You should have received a copy of the GNU General Public License          ##
## along with this program.  If not, see <https://www.gnu.org/licenses/>.     ##
##                                                                            ##
################################################################################

################################################################################
##
##  AUTHOR      Kevin Matthes
##  BRIEF       Citation settings for the Git repository.
##  COPYRIGHT   GPL-3.0
##  DATE        2022
##  FILE        CITATION.cff
##  NOTE        See `LICENSE' for full license.
##              See `README.md' for project details.
##
################################################################################

# Parser settings.
cff-version: 1.2.0
message: Please cite this library using these meta data.

# Version information.
date-released: 2022-11-14
version: 0.0.1

# Project information.
abstract: >-
  A Fortran 2018 library for conditional (de-)allocation of allocatable objects
  of intrinsic types.
authors:
  - alias: kevinmatthes
    family-names: Matthes
    given-names: Kevin
license: GPL-3.0
repository-code: https://github.com/kevinmatthes/fortran2018-conditional-memory
title: fortran2018-conditional-memory
url: https://github.com/kevinmatthes/fortran2018-conditional-memory

# References.
references:
  - authors:
      - family-names: Chivers
        given-names: Ian
      - family-names: Sleightholme
        given-names: Jane
    doi: 10.1007/978-3-319-75502-1
    edition: '4'
    isbn: 978-3-030-09248-1
    languages:
      - en
    pages: 956
    publisher:
      city: Cham
      country: CH
      name: Springer
    title: Introduction to Programming with Fortran
    type: book
    year: 2018
  - authors:
      - family-names: Kühme
        given-names: Thomas
      - family-names: Witschital
        given-names: Peter
    edition: '3'
    isbn: 978-3-486-22016-2
    languages:
      - de
    pages: 248
    publisher:
      city: Munich
      country: DE
      name: Oldenbourg
    title: Die FORTRAN-Fibel
    type: book
    year: 1991
  - abstract: Incorporating Fortran 2018
    authors:
      - family-names: Metcalf
        given-names: Michael
      - family-names: Reid
        given-names: John
      - family-names: Cohen
        given-names: Malcolm
    doi: 10.1093/oso/9780198811886.001.0001
    edition: '2'
    isbn: 978-0-19-881188-6
    languages:
      - en
    pages: 522
    publisher:
      city: Oxford
      country: GB
      name: Oxford University Press
    title: Modern Fortran Explained
    type: book
    year: 2018

################################################################################

GitHub Events

Total
  • Delete event: 5
  • Issue comment event: 1
  • Push event: 4
  • Pull request review event: 4
  • Pull request event: 12
  • Create event: 7
Last Year
  • Delete event: 5
  • Issue comment event: 1
  • Push event: 4
  • Pull request review event: 4
  • Pull request event: 12
  • Create event: 7

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 95
  • Total Committers: 3
  • Avg Commits per committer: 31.667
  • Development Distribution Score (DDS): 0.295
Past Year
  • Commits: 13
  • Committers: 1
  • Avg Commits per committer: 13.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
dependabot[bot] 4****] 67
Kevin Matthes 9****s 27
Kevin Matthes 4****] 1

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 0
  • Total pull requests: 105
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Total issue authors: 0
  • Total pull request authors: 2
  • Average comments per issue: 0
  • Average comments per pull request: 0.37
  • Merged pull requests: 93
  • Bot issues: 0
  • Bot pull requests: 76
Past Year
  • Issues: 0
  • Pull requests: 15
  • Average time to close issues: N/A
  • Average time to close pull requests: 6 days
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.13
  • Merged pull requests: 9
  • Bot issues: 0
  • Bot pull requests: 15
Top Authors
Issue Authors
  • dependabot[bot] (1)
Pull Request Authors
  • dependabot[bot] (97)
  • kevinmatthes (29)
Top Labels
Issue Labels
dependencies (1) github_actions (1)
Pull Request Labels
dependencies (97) github_actions (60) submodules (34) enhancement (20) documentation (5) bug (4) python (3)

Dependencies

requirements.txt pypi
  • bump2version ==1.0.1
  • scriv ==0.17.0
.github/workflows/bump2version.yml actions
  • actions/checkout v3.3.0 composite
  • actions/setup-python v4.5.0 composite
  • extractions/setup-just v1.6.0 composite
  • py-actions/py-dependency-install v4.0.0 composite
.github/workflows/cffconvert.yml actions
  • actions/checkout v3.3.0 composite
  • citation-file-format/cffconvert-github-action 2.0.0 composite
.github/workflows/scriv.yml actions
  • actions/checkout v3.3.0 composite
  • actions/setup-python v4.5.0 composite
  • ad-m/github-push-action v0.6.0 composite
  • fregante/setup-git-user v1.1.0 composite
  • py-actions/py-dependency-install v4.0.0 composite
.github/workflows/valgrind.yml actions
  • actions/checkout v3.3.0 composite
  • extractions/setup-just v1.6.0 composite