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:

  1. In the genfile window, create a new directory by writing "mkdir my_gensys"

  2. Go to the new directory by writing "cd my_gensys"

  3. Create a new genfile-window by pressing Ctrl-N

  4. In the new genfile-window write "cd $gensys/code"

  5. 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

  6. In your own work space change to directory calc/calc

  7. Open file makef for editing.

  8. Change line
    PROGRAM= $(gensys)/scripts/gen_calc.exe
    into
    PROGRAM= $(HOME)/mybin/gen_calc.exe

  9. Check that directory $HOME/mybin do exists, if not write mkdir $HOME/mybin.

  10. 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
    


  11. In file makef, also define the names of the user couplings. In the example only coupling cuser4 has been defined.

  12. Open the files cuser4.f and icusr4.f and make changes to the code.

  13. Save the changes in file cuser4.f and icusr4.f and write the command makef.

  14. 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.