NAME

       FMREAD - read an article from FM-file



SYNOPSIS

       USE MODI_FMREAD_ll

       CALL  FMREAD(  HFILEM, HRECFM, HFIPRI, HDIR, FIELD, KGRID,
       KLENCH, HCOMMENT, KRESP)



ARGUMENTS

       IN

              CHARACTER*    ::    HFILEM
              CHARACTER*    ::    HRECFM
              CHARACTER*    ::    HFIPRI
              CHARACTER*    ::    HDIR


       OUT

              GENERIC       ::    FIELD
              INTEGER       ::    KGRID
              INTEGER       ::    KLENCH
              CHARACTER*    ::    HCOMMENT
              INTEGER       ::    KRESP




DESCRIPTION

       The FMREAD routine reads an article with HRECFM name  from
       the  binary LFI part of a FM-File. The FM-file whose base­
       name is hold in HFILEM must have  been  previously  opened
       with  the  FMOPEN_ll  routine. The data associated with an
       article are the C-grid indicator KGRID, the comment string
       HCOMMENT  (with  a  KLENCH size) and the data array FIELD.
       FMREAD is a generic routine that can read different  kinds
       of  data types FIELD: integer, real, logical, character or
       type(DATE_TIME).  The following types are allowed for  the
       FIELD argument :


       REAL : scalar, 1D, 2D, 3D, 4D, 5D or 6D arrays

       INTEGER : scalar, 1D and 2D arrays

       LOGICAL : scalar and 1D arrays

       CHARACTER : string data

       type(DATE_TIME) : scalar data

       FMREAD is intended to work in a parallel environment where
       multiple processors  handle  different  sub-parts  of  the
       MésoNH  domain.   Consequently,  the HDIR argument must be
       carefully specified. It helps the FMREAD routine in order­
       ing the field array in order to give to each processor the
       right section of the FIELD array.  The  reading  operation
       must take into account that the MesoNH computing domain is
       split along the x and y axes according to  the  number  of
       processors  used.  The following string values are allowed
       for HDIR:

       ´XY´   when the FIELD array is of  the  form  (x,y,  ...),
              where  (x,y,...)     denotes  an array of rank >= 2
              with the two first dimensions that spread along the
              X and Y axes of the MésoNH domain,

       ´XX´   when  the FIELD array is of the form (x, ...),where
              (x,...)  denotes an array of rank  >=  1  with  the
              first dimension that spreads along the X axe of the
              MésoNH domain,

       ´YY´   when the FIELD array is of the  form  (y,...),where
              (y,...)denotes an array of rank >= 1 with the first
              dimension that spreads  along  the  Y  axe  of  the
              MésoNH domain,

       ´--´   for all other scalar or array fields.

       Note  that  specifying a wrong HDIR value may cause unpre­
       dictable results.

       Internally, the FMREAD statement causes only  one  proces­
       sor,  the  so-called I/O processor, to read the whole data
       associated with the HRECFM article. The I/O processor  can
       deduce  from  the  HDIR specifier and the domain splitting
       what are the relevant data to transmit  (with  MPI  opera­
       tions)  to the other processors. When HDIR is set to ´XY´,
       ´XX´ or ´YY´, the data array associated  with  the  HRECFM
       article  is  split and each non I/O processor will receive
       its expected array section. When HDIR = ´--´ then the  I/O
       processor  broadcasts  the  data array to the other nodes.
       Note that all the communication processes are  transparent
       to the user.



RETURN VALUES

       Upon successful completion, FMREAD returns (for the HRECFM
       article) the expected data in  FIELD,  together  with  the
       C-grid  indicator in KGRID and the string comment in HCOM­
       MENT with KLENCH as the comment length.  The  return  code
       KRESP  is  then  set to 0. Otherwise KRESP is set to a non
       zero value and an error message is printed in  the  HFIPRI
       file.



NOTES

       The  FMREAD  operation handles only the binary LFI part of
       an FM-file.  The other part (the so-called ASCII  descrip­
       tive part) is read with the fortran READ statement.

       The  FMREAD  routine doesn´t handle the LB (Lateral Bound­
       ary) field : use the FMREAD_LB routine instead.



SEE ALSO

       FMREAD_LB(3f), FMWRIT(3f), FMOPEN_ll(3f)












































Man(1) output converted with man2html