Difference between revisions of "Dynlib"
m (Fixed typo.)
|Line 34:||Line 34:|
=== Editing the Fortran code ===
=== Editing the Fortran code ===
The fortran code lives in <code>
The fortran code lives in <code></code> directory. At the moment there are source code files
<>$ ls *.
The most important are <code>diag.</code> which contains subroutines that calculate various diagnostics, and <code>.</code> which contains . Changed Fortran sources need to be recompiled, again using
Revision as of 14:59, 18 September 2017
The steps necessary to obtain dynlib are described below. A more thorough documentation is compiled in the main documentation website.
Use the centrally installed dynlib
Dynlib is installed centrally for python 2.7 and python 3.4 in the python environments at
/Data/gfi/users/local/share/virtualenv/dynpie3. You'll only have to activate one of these python enviroments to start using dynlib:
In this command
X=2 for python 2.7 and
X=3 for python 3.4. For convenience add this command to your
~/.bash_profile to activate the respective python environment automatically at each login.
Note: For some types of login
.bash_profile is not taken into account. In case you'll experience problems create a symbolic link
~/.bashrc to point to the
~/.bash_profile and re-login.
Quick start to developing with dynlib
The following procedure is only necessary if you want to start developing dynlib further, for example if you want to add your own functions to dynlib. If you only want to use dynlib, the procedure in the above section is all you need.
- 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/local/src/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/local/src/dynlib.git
- Change into the dynlib folder
$ cd dynlib
- Compile the library
- (known broken right now) Make sure everything works as expected
Editing the Fortran code
The fortran code lives in
lib/fortran directory. At the moment there are 16 source code files
$ ls *.f90 config.f90 detect_lines.f90 ellipse.f90 stat.f90 const.f90 detect_rwb_contour.f90 interpol.f90 tend.f90 derivatives.f90 diag.f90 kind.f90 thermodyn.f90 detect.f90 diag_tend.f90 sphere.f90 utils.f90
The most important are
diag.f90 which contains subroutines that calculate various diagnostics, and
detect.f90 which contains feature detection algorithms. 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. All functions and categories listed in the API documentation.