Use association

Use association occurs when a scoping unit accesses the entities of a module with the USE statement. You can rename use-associated entities for use in the local scoping unit. The association is in effect for the duration of the executable program. For details, see USE.

Fortran 2003 begins

A USE associated entity may have the ASYNCHRONOUS or VOLATILE attribute in the local scoping unit even if the associated module entity does not.
Note: VOLATILE is controlled by compiler option -qxlf2003.

Fortran 2003 ends

Example

MODULE m
  CONTAINS
    SUBROUTINE printchar(x)
      CHARACTER(20) x
      PRINT *, x
    END SUBROUTINE
END MODULE

PROGRAM main
  USE m                 ! Accesses public entities of module m
  CHARACTER(20) :: name = 'George' 
  CALL printchar(name)  ! Calls printchar from module m
END PROGRAM


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us