next up previous contents index
Next: JZINIT - initialize Up: Basic calling sequences Previous: JZIN/JZOUT - simplest

JZIN - processor entry, general use

 

Processor AA transfers control to processor BB with a simple Fortran CALL BB, having readied the contents of its down call-bank at LQDW. To trigger swopping of the processor environment, the first executable statement in the processor BB should be

CALL JZIN (chIAM, IFDOWN, NAN, 0)

with  chIAM  processor ID, a text string of 4 characters exactly
                           of type CHARACTER*4

     IFDOWN  flag indicating whether this processor does or does not
             call other processors:  = 0 no  / = 1 yes

        NAN  number of processor constants used

          0  zero; non-zero gives access to the extra features
                   described in section~\ref{sec:JZextraJZIN}.

JZIN saves the environment of the upper processor and then sets up the environment of the new processor. If this does not yet exist, it calls the internal service routine JZLIFT to create the bank of support variables, digesting the titles for this processor, if any. JZIN returns the initialisation status thus:

   IQUEST(1) =  -ve : just initialized without JZAN title
                  0 : just initialized with    JZAN title
                +ve : normal running

Thus a processor using processor constants can check this condition like in the following example:

      SUBROUTINE BB

+CDE, Q.                     declaring the store and /JZUC/

      CHARACTER    chIAM*4
      PARAMETER   (chIAM = 'BB  ')

      CALL JZIN (chIAM,0,3,0)
      IF (IQUEST(1))         11, 17, 21

C--       Initialize constants if and only if not set from title
   11 Q(LQAN+1) = .0025
      Q(LQAN+2) = .3

C--       Complete initialization calculating derived constants
   17 Q(LQAN+3) = .5 * SIN (Q(LQAN+2))

   21 CALL MZWORK (...)

          ...    processor body

      CALL JZOUT (chIAM)
      RETURN
      END

The 3rd and the 4th parameter to JZIN are looked at only on first contact for each processor.

Note that over-ruling with the JZAN title only works if the processor is programmed to handle it. This is done in this example where statement 11 is reached only if there is no title.

JZIN readies for the new processor these links:

      COMMON /JZUC/LQJZ,LQUP,LQDW,LQSV,LQAN, JQLEV,JQFLAG(10)

          LQJZ  the header bank supporting the JZ91 data-structure

          LQUP  the upper call bank

          LQDW  the  down call bank, if needed, else = zero.

          LQSV  the bank of support variables;
                IQ(LQSV+1) contains system information,
                IQ(LQSV+2) is 1 for first entry, 2 for second, etc.

          LQAN  the processor constants inside the SV bank:
                IQ(LQAN)   number of constants
                 Q(LQAN+1)  first constant
                 Q(LQAN+2) second constant
                        . . .
      and also:

          JQLEV       is the current call depth level, = zero for the root

          JQFLAG(10)  receives a copy of the flags for this processor.

Note that the data in this common /JZUC/ must not be changed by the user, JQFLAG excepted.

JZIN goes to ZFATAL if IFDOWN is non-zero and the lowest possible call-depth has been reached.

There are always 10 flag words. Words not explicitely initialized with a JZFL title for a given processor are always zero. This feature is only available with the program development version, in the production version of ZEBRA the flags are all initialized to zero and never change, JZFL titles are dropped by JZINIT and are otherwise ignored.

If you need the working space also in the initialization part of the processor, look out: you cannot place the CALL \Rind{MZWORK} before the CALL \Rind{JZIN}, nor immediately after, because MZWORK destroys IQUEST.



next up previous contents index
Next: JZINIT - initialize Up: Basic calling sequences Previous: JZIN/JZOUT - simplest


Janne Saarela
Mon May 15 08:34:47 METDST 1995