User models under VAX/VMS



next up previous contents
Next: Example Up: No Title Previous: VMS

User models under VAX/VMS

In the VAX/VMS version of XSPEC, it is possible to have a user-written model in a shareable executable that is separate from the main program. This executable has the advantage that only the user model needs to be linked and not XSPEC as a whole. It is particularly useful for sophisticated models not used very often and keeps the program smaller. The current version of XSPEC can have one additive and one multiplicative user model but it is easy with the method described above to add more user models. In xanadu:[spectral.xspec.functions] two template routines can be found; XSUSA1.FOR for the additive model and XSUSM1.FOR for the multiplicative model. The user can start from those routines and write his or her own model. Only the name of the subroutine in the file and the variables returned to XSPEC must be the same. The variables are described in XSUSA1.FOR and XSUSM1.FOR. The files also contain the subroutines MOUSA1 and MOUSM1, which initialize parameter names, initial values for the model parameters and the number of parameters of the model-which can be over 20, such as the normalization in the case of the additive model.

The new user model then can be compiled in the normal way and linked with the MKUMD command, which is supplied with the software. For a debug, version DBUMD can be used. The shareable executable then is ready, and the SETUMD command can be used to set the logical UMDSHR to point to the right user model before starting the XSPEC session. In this way, the user can have several user models as shareable executables and only needs to point to the one he intends to use in XSPEC.





Keith Arnaud (kaa@genji.gsfc.nasa.gov)
Mon Sep 18 14:36:38 EDT 1995