Module Subroutines Callable from FORTRAN

Specific module formats for PEAKFIT, Contour function, and user get ??

Commands to return Data from Genie

All commands to read data from Genie into a user program start with the "module_get_" prefix, and have their first two parameters in common. The first parameter, usually called PARS_GET, is an EXTERNAL entity passed by Genie. The second parameter, NAME, is a character variable which is the label assigned to the variable in GCL when the parameters workspace was created (XVALS in the above example). For arrays, a LENGTH variable must also be passed; on input this should be set to the maximum allowed number of points, and on output it will be set to the number actually read. If too many points are passed out from GCL, LENGTH will still indicate how many were passed, but the number actually read will be the length of the array which was passed as input.; thus testing LENGTH on return provides a check for array overflow.

SUBROUTINE MODULE_GET_INT_ARRAY(EXTERNAL PARS_GET, CHARACTER*80 NAME, INTEGER VALUE(*), INTEGER LENGTH)

SUBROUTINE MODULE_GET_REAL_ARRAY(EXTERNAL PARS_GET, CHARACTER*80 NAME, REAL VALUE(*), INTEGER LENGTH)

SUBROUTINE MODULE_GET_STRING(EXTERNAL PARS_GET, CHARACTER*80 NAME, CHARACTER*512 VALUE)

SUBROUTINE MODULE_GET_REAL(EXTERNAL PARS_GET, CHARACTER*80 NAME, REAL VALUE)

SUBROUTINE MODULE_GET_INT(EXTERNAL PARS_GET, CHARACTER*80 NAME, INTEGER VALUE)

Commands to return Data to Genie

These commands all start with a "module_put_" prefix, and have the same form as the corresponding "module_get_" commands. The NAME parameter will be the field name in the result workspace returned to GCL, and the LENGTH parameter for the array routines will indicate how many data points to send. SUBROUTINE MODULE_PUT_INT_ARRAY(EXTERNAL PARS_PUT, CHARACTER*80 NAME, INTEGER VALUE(*), INTEGER LENGTH)

SUBROUTINE MODULE_PUT_REAL_ARRAY(EXTERNAL PARS_PUT, CHARACTER*80 NAME, REAL VALUE(*), INTEGER LENGTH) SUBROUTINE MODULE_PUT_STRING(EXTERNAL PARS_PUT, CHARACTER*80 NAME, CHARACTER*512 VALUE)

SUBROUTINE MODULE_PUT_REAL(EXTERNAL PARS_PUT, CHARACTER*80 NAME, REAL VALUE) SUBROUTINE MODULE_PUT_INT(EXTERNAL PARS_PUT, CHARACTER*80 NAME, INTEGER VALUE)

Commands to print information Print something to the screen

SUBROUTINE MODULE_PRINT(CHARACTER*(*) SOMETHING) Print an INFORMATIONAL message (in blue) that will not appear if informational printing is turned off by TOGGLE/INFO

SUBROUTINE MODULE_INFORMATION(CHARACTER*(*) SOMETHING) Return an error status to Genie, and print a message in RED

SUBROUTINE MODULE_ERROR(CHARACTER*(*) FUNCTION_NAME, CHARACTER*(*) ERROR_MESSAGE, CHARACTER*(*) POSSIBLE_SOLUTION)