next up previous contents
Next: Reinitialisation Up: User Access to Titles Previous: Link Access   Contents

COMMON Block Access

In this case one or more routines share a COMMON which contains a complete map of the user data in the RFXM bank preceded by the 8 word array LARFXM.

So the definition might be:-

 
      INTEGER       MXRFXM
      PARAMETER    (MXRFXM = 20)
 
      COMMON/MYCOMM/ LARFXM(8),NRFXM,REFRAC(MXRFXM)
      INTEGER        LRFXM,LDRFXM
      EQUIVALENCE    (LARFXM(6),LRFXM),  (LARFXM(7),LDRFXM)
Next a request to manage the RFXM 1 is required (the code should only be executed once - it won't hurt if done more often but will waste time):-

 
*     Declare the size of the user data area
*     In this case:-
*
*       size of user data = size of REFRAC array + 1 (for NRFXM).
*
      LARFXM(8) = MXRFXM + 1
*     Declare the request level: = 1 optional, = 2 compulsory.
      IREQ = 1
*     Ask for management.
      CALL MT_REQUEST_TITLES('RFXM',1,IREQ,LARFXM,SU_ID)

MT_REQUEST_TITLES looks for the RFXM bank and sets up the pointers LRFXM and LDRFXM. If the system cannot find the bank, but it is optional, it will return with LRFXM and LDRFXM set to zero. It also copies the user data into the COMMON so that the use can now access e.g.:-

 
      IF (LRFXM .NE. 0) WRITE(IQPRNT,90000) NRFXM,
     +                      (REFRAC(JRFXM), JRFXM = 1, NRFXM)
 
90000 FORMAT(' The RFXM banks contains',I5,' media.',/,
     +       ' The refractive indices are:- ',/,
     +       (' ',F10.5))



sno Guest Acct 2009-09-09