The steps necessary to obtain dynlib are described below. A more thorough documentation is compiled in the main documentation page.
- Create a new folder for the project that'll use dynlib, and go into that directory.
$ mkdir <project-name>
$ cd <project-name>
- Copying the source code repository
$ git clone /Data/gfi/users/tsp065/lib/dynlib.git
- To clone the repository to your laptop or any machine outside the UiB network, use
$ git clone <username>@login.uib.no/Data/gfi/users/tsp065/lib/dynlib.git
- Change into the dynlib folder
$ cd dynlib
- Compile the library
- Make sure everything works as expected
- You can now go back to your main project folder and use dynib from there. Dynlib automatically installed a
settings.pywhere you can override the default settings and some examples scripts in that project folder.
$ cd ..
example_ani.py example_diag.py example_netcdf_write.py example_stat.py settings.py
Quick start to developing with dynlib
Editing the Fortran code
The fortran code lives in
src directory. At the moment there are 12 source code files
$ ls src/*.f95
- src/config.f95 src/derivatives.f95 src/detect_fronts.f95 src/diag.f95 src/humidity.f95 src/stat.f95
src/const.f95 src/detect.f95 src/detect_rwb_contour.f95 src/ellipse.f95 src/kind.f95 src/utils.f95
- The most important are
diag.f95which contains subroutines that calculate various diagnostics, and
stat.f95which contains statistical functions. Changed Fortran sources need to be recompiled, again using
The changes you made to the source code files can be listed by
$ git status
or viewed in detailed diff-comparisons by
$ git diff
or for one file only
$ git diff <filename>
In case you want to undo your changes, you can revert any file to the last committed version by
git checkout <filename>
Commit your changes from time to time and give a sensible and brief description of your changes in the editor that is opened (automatically)
$ git commit -a
The commit is then stored in your copy of the source code repository, but not yet available for others, which allows you to also commit work-in-progress.
Using the Fortran functions
An example python script which calculates deformation using the Fortran function is provided with
The functions are classified into different categories.