Home
Reference Manuals
Return
Up
Create an own coupling element
Most coupling elements can created with existing coupl- and func- commands.
However there can be situations when the user would like to write his/hers
coupling element in FORTRAN and link the source code into GENSYS.
The following steps explains how to compile an own version of GENSYS:
- In the genfile window, create a new directory by writing "mkdir my_gensys"
- Go to the new directory by writing "cd my_gensys"
- Create a new genfile-window by pressing Ctrl-N
- In the new genfile-window write "cd $gensys/code"
- Copy directory calc to your own workspace by marking the calc-directory at location $gensys/code,
and drag it to your own workspace with Ctrl + mouse button 2
- In your own work space change to directory calc/calc
- Open file makef for editing.
- Change line
PROGRAM= $(gensys)/scripts/gen_calc.exe
into
PROGRAM= $(HOME)/mybin/gen_calc.exe
- Check that directory $HOME/mybin do exists, if not write mkdir $HOME/mybin.
- Check that directory $HOME/mybin is in your $PATH, if not open your file
$HOME/.bashrc and add the following line:
PATH=$HOME/mybin:$PATH
- In file makef, also define the names of the user couplings.
In the example only coupling cuser4 has been defined.
- Open the files cuser4.f and icusr4.f and make changes to the code.
- Save the changes in file cuser4.f and icusr4.f and write the command makef.
- If no formal errors in file cuser4.f and icusr4.f can be found a own new version
has now been created.
The new version will be located at directory $HOME/mybin.
Since $HOME/mybin is defined before $gensys/scripts this new program will be executed instead
of the old.