All Projects → zbeekman → ZstdFortranLib

zbeekman / ZstdFortranLib

Licence: MIT license
👨‍💻Zaak's 🧩(missing) 🏛Standard 🔬Fortran 📚Library 🚧(WIP)

Programming Languages

fortran
972 projects
CMake
9771 projects
python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
emacs lisp
2029 projects

Projects that are alternatives of or similar to ZstdFortranLib

focal
A modern Fortran abstraction layer for OpenCL
Stars: ✭ 35 (+105.88%)
Mutual labels:  fortran-library, fortran2003, fortran2008, fortran-modules
CB-Fortran-Color-Theme
Code Blocks color theme for Fortran language
Stars: ✭ 21 (+23.53%)
Mutual labels:  fortran2003, fortran2008
faiNumber-Fortran
A fast, flexible, and secure numerical library for Fortran.
Stars: ✭ 13 (-23.53%)
Mutual labels:  fortran-library, fortran-modules
go-home
An OpenGL based progress bar that lets you know when you should really go home after a long day 🕙
Stars: ✭ 14 (-17.65%)
Mutual labels:  productivity
vim-hdl
Vim plugin to aid VHDL development (for LSP, see https://github.com/suoto/hdl_checker)
Stars: ✭ 59 (+247.06%)
Mutual labels:  productivity
workshop-sustainable-productivity
Workshop: the basics of stress, productivity, flow, focus, meditation and sustainability.
Stars: ✭ 20 (+17.65%)
Mutual labels:  productivity
Jira-Hot-Linker
Jira Hot Linker
Stars: ✭ 36 (+111.76%)
Mutual labels:  productivity
meeting-price-calculator
Meeting Price Calculator - How expensive are meetings, really?
Stars: ✭ 17 (+0%)
Mutual labels:  productivity
linearmouse
🖱 The mouse and trackpad utility for Mac.
Stars: ✭ 1,151 (+6670.59%)
Mutual labels:  productivity
wakib-keys
Emacs mode that moves to modern keybindings
Stars: ✭ 31 (+82.35%)
Mutual labels:  convenience
in-line-calculator
📟 an interface-less calculator for Windows
Stars: ✭ 44 (+158.82%)
Mutual labels:  productivity
SigTools
📆 Sigarra Tools | An extension that makes the information system of the University of Porto slightly better.
Stars: ✭ 35 (+105.88%)
Mutual labels:  productivity
pull-request-size
Applies labels to Pull Requests based on the total lines of code changed.
Stars: ✭ 98 (+476.47%)
Mutual labels:  productivity
FUPRAL
Fortran OO implementation of a generic container using an unlimited polymorphic class. Implementation of a resizable container array and a double linked list.
Stars: ✭ 18 (+5.88%)
Mutual labels:  fortran2008
CrackbookRevival
Chrome extension for discouraging the use of attention-sucking websites
Stars: ✭ 30 (+76.47%)
Mutual labels:  productivity
tabtools
🔧 SQL for csv file in UNIX command line with awk.
Stars: ✭ 16 (-5.88%)
Mutual labels:  productivity
HeadsDown
Auto-enable "Do not disturb" while coding or designing.
Stars: ✭ 18 (+5.88%)
Mutual labels:  productivity
screentime
A chrome extension for keeping track and managing your time on social media platforms and websites
Stars: ✭ 42 (+147.06%)
Mutual labels:  productivity
mouseable
'Mouseable' is intended to replace a mouse or trackpad.
Stars: ✭ 418 (+2358.82%)
Mutual labels:  productivity
dashy
🚀 A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!
Stars: ✭ 7,103 (+41682.35%)
Mutual labels:  productivity

ZstdFortranLib: Zaak's (missing) Standard Fortran Library

CI Status Coverage status Documentation Status GitHub license Download as PDF Tweet this button

Implements missing functionality such as error handling, strings manipulation, system/environment interface & testing utilities.

Table of contents

⚠️Warning ⚠️

This is currently pre-alpha software. Development is ongoing and the API is not yet stable. It is possible that documented functionality is not yet implemented.

Motivation

Certain tasks in Fortran can be awkward and there is no standard library. One often ends up re-inventing the wheel to solve common tasks. Selected pain points include:

  • String manipulation
  • File operations & IO
  • Error handling
  • Assertions
  • Interfacing with the OS, file system & environment
  • Writing tests quickly and expressively

For string, file, and OS/system/environment interfacing other languages, in particular Ruby and Python provide great expressiveness and built in functionality. These capabilities, as implemented in ZstdFortraLib are inspired by and aim to replicate the corresponding functionality in Ruby and Python, but in an idiomatic Fortran way, and only the features & functions that make sense.

Additionally unit testing and assertions should be expressive, quick to write and implement, and some assertions should be able to easily be turned off for production builds, or used to signal errors that are handled later.

Error Stack Object

By providing an error stack object, either as a singleton module variable, or as a component of a derived type, the programmer can maintain a call-stack, complete with line numbers and file names, and raise or signal exceptions deep in the call stack in pure or elemental procedures, but return control and handle any exceptions in less performance-critical, non-pure, higher-level program units.

Features

  • Dynamically sized error stack
  • Convenience macro for injecting line number and file-name into call-stack
  • Built in error types
  • Custom error messages
  • Pretty output to terminal, dynamically formatted
  • Raise fatal or deferred exceptions
  • Check if exceptions are signaling
  • Handle exceptions
  • Signal handler hooks
  • Introspective CMake build system, with exported targets

Unit Testing

Syntactic Sugar

Floating point comparisons are common in scientific computing and Fortran. Special operators are provided to hand floating point comparisons for any real kind:

if ( ( (100 - 10*epsilon(1.0_RK)) .is. one_hundred ) .within. tolerance ) ...

! Same as above, absolute is default
if ( ( (100 - 10*epsilon(1.0_RK)) .is. one_hundred ) .within. .absolute. tolerance ) ...

! R.H.S. value is taken to be truth
if ( ( (100 - 10*epsilon(1.0_RK)) .is. one_hundred ) .within. .relative. rel_olerance ) ...

Furthermore, when a test fails, you want to know where/why:

    OUTPUT = gsub(qbf, CK_"the", CK_"a")
    call assert_delayed ( &
      OUTPUT ==  CK_"a quick red fox jumped over a lazy dog", __LINE__ , &
      "character(kind=CK) gsub 'the --> a' substitution failed")

(Sub)Test Summarizing

If a failure occurs the output will look like:

Failed test

Documentation

High level user documentation is published (from the docs directory) to Read the Docs https://zstdfortranlib/readthedocs.io.

User/client API documentation (protected & public scope) as well as project developer documentation (private scope & public/protected)will be generate via FORD and published via GitHub pages to https://izaakbeekman.com/ZstdFortranLib (⚠️ not yet operational ⚠️)

Templating

This project uses templating and compile-time polymorphism (procedure overloading) for improving the functionality of operators on intrinsic types. Templating functionality is provided via the Jin2For tool, which adds functionality to the Jinja2 templating enginep specific to writing Fortran programs.

⚠️NEVER MANUALLY EDIT SOURCES IN THE generated DIRECTORY! ⚠️


GitHub forks GitHub stars GitHub watchers Tweet this button

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].