buds  0.1
FORTRAN reference counted types
Development

A short introduction to the buds library and how it may be extended can be found in this section.

We highly welcome suggestions, issues and/or bug-fixes. Anybody is encouraged to contribute via the github development page:

Please do not hesitate to contribute!

Notes for developers

The library is heavily pasted with pre-processor statements which, sadly, is not well-supported in a large range of fortran compilers. As such we require a minimal usage of external preprocessors which adhere to the C preprocessor statements. Any development should adhere to the standards found in the already present buds. These guide-lines for the code must be followed:

Creating a new bud

A short description of the required steps needed to create a custom bud type is listed here:

  1. The first code present in the type must be
    #include "bud_utils.inc"
  2. Define your internal data container. Its name must be BUD_TYPE_NAME_:

    #define bud_type_name_ bud_cc2(bud_type_name,_)

    This data container name will only be visible in the module and thus it is relatively un-important what you choose.

    We, however, recommend that you re-use the public type name with an appended _.

  3. Add the common declarations:
    #include "bud_common_declarations.inc"
    This adds the common used variables such as data precisions etc.
  4. Define the data container (BUD_TYPE_NAME_)

    This data type may contain anything you want but must be defined as this:

    type bud_type_name_
    <contained data>
    #include "buds_common_type_.inc"
    end type
  5. Add specific interfaces that you may implement for interacting with the contained data. Ensure that you add a one-line documentation to the interfaces. Explicitly add public or private for clarity of the interfaced routines.
  6. Add the common buds interfaces and routines.

    #include "buds_common.inc"

    Remark that this inclusions inserts a contains statement which forces the separation of variable/interface declarations from routine declarations.

  7. Create a deletion routine which shall ensure no memory leaks. I.e. it should delete all allocatable/pointers in the BUD_TYPE_NAME_ type. This routine must be named delete_data.
  8. Add any specific routines for your data type. Note that you may never expose routines directly from the module. This will ensure that name-clashes are never encountered.