https://github.com/csdms/bmi-fortran

Basic Model Interface for Fortran

https://github.com/csdms/bmi-fortran

Science Score: 33.0%

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

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    2 of 4 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.0%) to scientific vocabulary

Keywords

bmi csdms fortran

Keywords from Contributors

cxx geosciences pymt groundwater modflow
Last synced: 5 months ago · JSON representation

Repository

Basic Model Interface for Fortran

Basic Info
  • Host: GitHub
  • Owner: csdms
  • License: mit
  • Language: Fortran
  • Default Branch: master
  • Homepage: https://bmi.csdms.io
  • Size: 162 KB
Statistics
  • Stars: 8
  • Watchers: 6
  • Forks: 9
  • Open Issues: 5
  • Releases: 0
Topics
bmi csdms fortran
Created almost 9 years ago · Last pushed about 1 year ago
Metadata Files
Readme License

README.md

DOI Build and Test Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge

bmi-fortran

The Fortran specification, created with Fortran 2003, for the CSDMS Basic Model Interface.

Build/Install

The Fortran BMI bindings can be built on Linux, macOS, and Windows. Instructions are given below.

Prerequisites: * A Fortran compiler * CMake or Fortran Package Manager * pkg-config

Alternately, conda binaries have been built for Linux, macOS, and Windows. Install the Fortran BMI bindings (no build needed) into an Anaconda distribution with

conda install bmi-fortran -c conda-forge

CMake - Linux and macOS

To build the Fortran BMI bindings from source with cmake, run

mkdir _build && cd _build
cmake .. -DCMAKE_INSTALL_PREFIX=<path-to-installation>
make

where <path-to-installation> is the base directory in which to install the bindings. The default is/usr/local. When using a conda environment, use the $CONDA_PREFIX environment variable.

Then, to install:

make install

The installation will look (on Linux) like:

bash . |-- include | `-- bmif_2_0.mod `-- lib |-- libbmif.so -> libbmif.so.2.0 |-- libbmif.so.2.0 `-- pkgconfig `-- bmif.pc

CMake - Windows

An additional prerequisite is needed for Windows:

  • Microsoft Visual Studio 2017 or Microsoft Build Tools for Visual Studio 2017

To configure the Fortran BMI bindings from source with cmake, run the following in a Developer Command Prompt

mkdir _build && cd _build
cmake .. ^
  -G "NMake Makefiles" ^
  -DCMAKE_INSTALL_PREFIX=<path-to-installation> ^
  -DCMAKE_BUILD_TYPE=Release

where <path-to-installation> is the base directory in which to install the bindings. The default is "C:\Program Files (x86)". Note that quotes and an absolute path are needed. When using a conda environment, use "%CONDA_PREFIX%\Library".

Then, to build and install:

cmake --build . --target install --config Release

Fortran Package Manager (fpm)

If you don't already have fpm installed, you can do so via Conda:

conda install fpm -c conda-forge

Then, to build and install:

fpm build --profile release
fpm install --prefix <path-to-installation>

where <path-to-installation> is the base directory in which to install the bindings. The default prefix on Unix systems is $HOME/.local and %APPDATA%\local on Windows. Note this differs from installs using CMake.

The installation will look like:

bash . |-- include | `-- bmif_2_0.mod `-- lib `-- libbmif.a

Note that fpm does not currently support the building of shared/dyanmic libraries (.so on Unix, .dll on Windows).

Use

To write a BMI for a model, use the bmif_2_0 module and implement all the BMI procedures included in the interface defined therein. BMI methods that aren't used (e.g., get_grid_x for a uniform rectilinear grid) can simply return the BMI_FAILURE status code. A sample implementation is given in the https://github.com/csdms/bmi-example-fortran repository.

Note

For a Fortran BMI that uses Fortran 90/95, see https://github.com/csdms/bmi-f90.

Why two different Fortran BMIs? Though Fortran 90/95 has the concept of an interface, it doesn't allow procedures to be included within types. This is difficult to reconcile with BMI, which, in Fortran, would ideally be implemented as a collection of procedures in a type. Thus, the Fortran 90/95 BMI is set up as an example that a user can copy and modify, substituting their code for code in the example. This is somewhat cumbersome. The Fortran 2003 BMI implementation acts a true interface--it can be imported as a type from a module into a Fortran program and its methods overridden.

The CSDMS IF software engineers recommend using the Fortran 2003 bindings; however, we will continue to support the Fortran 90/95 bindings for users who aren't comfortable with the object-oriented features of Fortran 2003. Further, both BMI implementations are backward-compatible with Fortran 77. All that is needed is a compiler that's capable of handling the more recent versions of Fortran; for example gfortran in the GNU Compiler Collection.

Owner

  • Name: Community Surface Dynamics Modeling System
  • Login: csdms
  • Kind: organization
  • Email: csdms@colorado.edu

Cyberinfrastructure for the quantitative modeling of earth and planetary surface processes

GitHub Events

Total
  • Watch event: 2
  • Delete event: 4
  • Issue comment event: 5
  • Push event: 17
  • Pull request event: 4
  • Create event: 6
Last Year
  • Watch event: 2
  • Delete event: 4
  • Issue comment event: 5
  • Push event: 17
  • Pull request event: 4
  • Create event: 6

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 213
  • Total Committers: 4
  • Avg Commits per committer: 53.25
  • Development Distribution Score (DDS): 0.014
Past Year
  • Commits: 15
  • Committers: 3
  • Avg Commits per committer: 5.0
  • Development Distribution Score (DDS): 0.133
Top Committers
Name Email Commits
Mark Piper m****r@c****u 210
Sam Harrison s****g@g****m 1
GS\emorway-usgs e****y@u****v 1
Mike Taves m****s@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 21
  • Total pull requests: 32
  • Average time to close issues: 5 months
  • Average time to close pull requests: 1 day
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 1.1
  • Average comments per pull request: 0.44
  • Merged pull requests: 30
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 2.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mdpiper (18)
  • samharrison7 (1)
  • platipodium (1)
  • hrajagers (1)
Pull Request Authors
  • mdpiper (31)
  • samharrison7 (1)
  • mwtoews (1)
  • emorway-usgs (1)
Top Labels
Issue Labels
question (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 2
  • Total dependent repositories: 0
  • Total versions: 3
conda-forge.org: bmi-fortran

Mappings, developed with Fortran 2003, for the CSDMS Basic Model Interface (BMI). This package defines a module that includes an interface intended to be overridden by a model developer when they add a BMI to their model.

  • Versions: 3
  • Dependent Packages: 2
  • Dependent Repositories: 0
Rankings
Dependent packages count: 19.5%
Dependent repos count: 34.0%
Average: 39.9%
Forks count: 47.7%
Stargazers count: 58.4%
Last synced: 6 months ago