3.5.5 Compiling and linking user-defined code

Users can add their own (modified) user-interface to a PALM-run by carrying out the following steps:

  1. Copy the default (empty) user-interface (file user_interface.f90) to a directory of your choice, e.g.:

       cd ~/palm/current_version
       mkdir -p USER_CODE/example
       cp trunk/SOURCE/user_interface.f90  USER_CODE/example/user_example.f90
  2. Set an additional path in the configuration file .mrun.config to allow mrun to find and include this file:

       %add_source_path   $base_directory/USER_CODE/$fname

    The default configuration file (trunk/SCRIPTS/.mrun.config.default) already includes this setting.
  3. Modify the interface routines according to your needs.
  4. Start a PALM run by executing

       mrun -d example ...

    The file user_example.f90 will be automatically compiled within the job and will replace PALM‘s default user-interface.
The above method with including $fname in the additional source path allows to use different user-interfaces for different runs at the same time. Just store the respective interface-files in subdirectories USER_CODE/abcd, USER_CODE/cdef, etc. and start mrun with option “-d abcd“, “-d cdef“, etc.

The modified user-interface file cannot be pre-compiled by using mbuild!

While programming user-defined code, errors are frequently made. Possible ways of error tracing are described in the next chapter.


Last change:  $Id: chapter_3.5.5.html 62 2007-03-13 02:52:40Z steinfeld $