The UFZ services GitLab and Mattermost will be unavailable on Monday, January 24 from 06:00 AM to 08:00 AM due to maintenance work.

Want to get a quick-start introduction to Shell, Git and GitLab? Join the next beginners course on 28/31 January. Register now!

Commit b3705d3a authored by Sebastian Müller's avatar Sebastian Müller 🐈
Browse files

add readme

parent 11dba4e6
cmake_minimum_required(VERSION 3.12.0)
project(globals_fortran)
enable_language(Fortran)
find_package(PythonExtensions REQUIRED)
find_package(NumPy REQUIRED)
find_package(F2PY REQUIRED)
......
# skbuild_fortran_test
A sample project build with [scikit-build](https://scikit-build.readthedocs.io/en/latest/).
We provide a fortran wrapper file, that is linked against an external
[fortran library](https://git.ufz.de/muellese/fortran-lib-test) that provides
global variables and interfaces to manipulated them.
In addition, the external library is also linking against [FORCES](https://git.ufz.de/chs/forces/).
This fortran library will eventually be [mHM](https://git.ufz.de/mhm/mhm) in the context of FINAM.
The wrapper (`wrap_lib/wrapper.f90`) is just a small layer on top of these
interfaces to be compatible with [f2py](https://numpy.org/doc/stable/f2py/index.html).
To compile everything locally
([editable install](https://pip.pypa.io/en/stable/cli/pip_install/#install-editable)),
you can use pip:
```bash
pip install -e . --user
```
Afterwards you can call the wrapper routines from (I)Python:
```python
In [1]: import wrap_lib as wl
In [2]: wl.set_globals(1, 2., [3,4])
In [3]: wl.set_container(10, 20., [30,40])
In [4]: wl.print_vars()
global int: 1
global real: 2.0000000000000000
global array: 3.0000000000000000 4.0000000000000000
container int: 10
container real: 20.000000000000000
container array: 30.000000000000000 40.000000000000000
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment