[ < ][]   [Contents][Index][ ? ]

3.10 Programming with cmz directives


[ < ][]   [Contents][Index][ ? ]

3.10.1 Cmz directives used with Miniker

The main feature of cmz directive is to use code conditionnaly for a given select flag. For example when the double precision is selected (see Double precision) the use of the conditionnal double flag may be required in case there is a different subroutine name for different types. If, for example, the user use the subroutine smysub for simple precision and dmysub for double precision the following code is an example of what could appear in the user code:

+IF,double
 call dmysub(eta);
+ELSE
 call smysub(eta);
+ENDIF

For a complete reference on cmz directives see the appendix Cmz directives reference.


[ < ][]   [Contents][Index][ ? ]

3.10.2 Using cmz directives in Miniker

In cmz the KEEP and DECK have their cmz directives preprocessed as part of the source files extraction. And the +KEEP and +DECK directives are automatically set when creating the KEEP or DECK. With make, files with these directives has to be created within the files that are to be preprocessed by the cmz directives preprocessor.

To be processed by make, a file that contains cmz directives should have a file suffix corresponding with the language of the resulting file and with the normal file suffix of that language. More precisely ‘cm’ should be added before the normal file suffix and after the ‘.’. Therefore if the resulting file language is associated with a suffix ‘.suf’, the file with cmz directives should have a ‘.cmsuf’ suffix. The tradition is to have a different suffix for main files and include files. To add directories searched for cmfiles (files with cmz directives) they should be added to the CMFDIRS makefile variable, separated by ‘:’.

Rules for preprocessing of the files are defined in the file ‘Makefile.miniker’ for the file types described in table 3.2:

languagefile typecmfile suffixsuffixlanguage
fortranmain/deck.cmf.fftn
fortran preprocessedmain/deck.cmF.Ff77
fortran preprocessedinclude/keep.cminc.incf77
mortranmain/deck.cmmtn.mtnmtn
mortraninclude/keep.cmmti.mtimtn

table 3.2: Association between file language, file type, file suffixes and language identifier in cmz directives. A main file is called a deck in cmz and an include file is called a keep.


[Contents][Index][ ? ]