NAME

       OPEN_ll - open a NON FM-file



SYNOPSIS

       USE MODI_IO_ll

       CALL  OPEN_ll(  UNIT,  FILE, MODE, LFIPAR, STATUS, ACCESS,
       IOSTAT, FORM, RECL, BLANK, POSITION, ACTION, DELIM, PAD)



ARGUMENTS

       IN

              CHARACTER*                 ::    FILE
              CHARACTER*                 ::    ACTION
              CHARACTER*                 ::    MODE        (optional)
              TYPE(LFIPARAM), POINTER    ::    LFIPAR      (optional)
              CHARACTER*                 ::    STATUS      (optional)
              CHARACTER*                 ::    ACCESS      (optional)
              CHARACTER*                 ::    FORM        (optional)
              INTEGER                    ::    RECL        (optional)
              CHARACTER*                 ::    BLANK       (optional)
              CHARACTER*                 ::    POSITION    (optional)
              CHARACTER*                 ::    DELIM       (optional)
              CHARACTER*                 ::    PAD         (optional)


       OUT

              INTEGER    ::    UNIT
              INTEGER    ::    IOSTAT





DESCRIPTION

       The OPEN_ll routine is intended to  replace  (encapsulate)
       the  standard  OPEN Fortran routine in the parallel MésoNH
       code. It opens the file whose name is given  by  FILE  and
       associates  a Fortran logical unit to it. The files opened
       by this routine are  called  NON  FM-files  because,  once
       opened,  they  are  handled  with the standard I/O Fortran
       routines READ or WRITE (conversely,  FM-files  are  exclu­
       sively  handled with FM routines, see FMOPEN_ll).  The NON
       FM-files are usually ASCII files, for example output diag­
       nostic files or namelists files.

       The  ACTION  argument  is required to specify what is done
       with the file : open for reading (  ACTION  =  ´READ´)  or
       open  for  writing ( ACTION = ´WRITE´). There is no possi­
       bility for a ´READWRITE´ opening.

       The MODE argument may be specified to indicate the kind of
       parallel  access  that will be subsequently applied to the
       file. It can take three values defined  by  the  following
       string  constants  (available  in the MODE_IO_ll module) :
       ´GLOBAL´, ´SPECIFIC´ and ´DISTRIBUTED´.   Only  the  first
       two  are available to the MésoNH user and ´GLOBAL´ mode is
       the default value. When a file is opened in ´GLOBAL´ mode,
       it  is  viewed  in the same way by all the processors that
       compose the parallel MésoNH application.  However,  inter­
       nally the file access is different according to the ACTION
       value :


       1.     if ACTION = ´READ´, each processor performs an OPEN
              Fortran call to open the same file FILE.  Thus, all
              processors will see (and read) the same data.


       2.     if  ACTION  =  ´WRITE´,  only  one  processor,  the
              so-called  I/O  processor  makes  the  Fortran OPEN
              call. The subsequent writing  is  performed  exclu­
              sively  by  the  I/O  processor,  the others simply
              writes in /dev/null.  In a GLOBAL writing mode,  we
              suppose  that all processors have to write the same
              value to a file so only one processor will have  to
              do the job.


       The  ´SPECIFIC´ mode is intended to write data that depend
       on the processor number. Thus, each processor opens a file
       whose  name  is  given  by  appending  ´.PXXX´ to the FILE
       string value. The XXX denotes the processor number in  the
       parallel  application (from 001 to N where N is the number
       of requested processors). In a ´SPECIFIC´  writing  opera­
       tion,  the  parallel MésoNH application will then create N
       files with a same basename stored in FILE.

       The ´DISTRIBUTED´ mode is not directly  available  to  the
       MésoNH user but it is needed for the FMOPEN_ll implementa­
       tion. In this mode, only one processor, the so-called  I/O
       processor,  will  perform  the  reading and writing opera­
       tions.

       The LFIPAR argument is a reserved  argument  for  advanced
       MésoNH  user.  It  is  required for the specific FMOPEN_ll
       implementation.

       The following optional specifiers allowed in  the  OPEN_ll
       statement  have  the same meaning as those of the standard
       OPEN statement : STATUS, ACCESS, FORM, RECL, BLANK,  POSI­
       TION, DELIM, PAD.



RETURN VALUES

       Upon   successful   completion,  OPEN_ll  returns  a  file
       descriptor in UNIT to refer in a subsequently Fortran  I/O
       statement  and IOSTAT is assigned a zero value. Otherwise,
       the IOSTAT argument returns a non null  value.  Note  that
       the  IOSTAT and UNIT arguments are required in the OPEN_ll
       statement (they are optional for the standard OPEN  state­
       ment).  Moreover,  UNIT is an INTENT(OUT) argument because
       the (free) logical unit  numbers  are  attributed  by  the
       OPEN_ll  routine.  In the special GLOBAL opening for writ­
       ing, each processor except the I/O processor is assigned a
       unit  number  that  is  associated with the /dev/null file
       (initially opened with the INITIO_ll routine).



SEE ALSO

       OPEN(3f), FMOPEN_ll(3f), CLOSE_ll(3f)








































Man(1) output converted with man2html