Oasis3 4.0.2
locreadh.f
Go to the documentation of this file.
00001       SUBROUTINE locreadh (cdfldn, cdjob, ktime, pfield, 
00002      $                     kdimax, knulre, kflgre)
00003 C****
00004 C               *****************************
00005 C               * OASIS ROUTINE  -  LEVEL 0 *
00006 C               * -------------     ------- *
00007 C               *****************************
00008 C
00009 C**** *locreadh*  - Read header and binary field on unit knulre 
00010 C
00011 C     Purpose:
00012 C     -------
00013 C     Find string cdfldn on unit knulre and read header and array pfield
00014 C
00015 C**   Interface:
00016 C     ---------
00017 C       *CALL*  *locreadh (cdfldn, cdjob, ktime, pfield, 
00018 C                          kdimax, knulre, kflgre)*
00019 C
00020 C     Input:
00021 C     -----
00022 C                cdfldn : character string locator
00023 C                kdimax : dimension of field to be read 
00024 C                knulre : logical unit to be read 
00025 C
00026 C     Output:
00027 C     ------
00028 C                cdjob  : experiment name
00029 C                ktime  : header array (integer 1D)
00030 C                pfield : field array (real 1D)
00031 C                kflgre : error status flag
00032 C
00033 C     Workspace:
00034 C     ---------
00035 C     None
00036 C
00037 C     Externals:
00038 C     ---------
00039 C     None
00040 C
00041 C     Reference:
00042 C     ---------
00043 C     See OASIS manual (1997) 
00044 C
00045 C     History:
00046 C     -------
00047 C       Version   Programmer     Date      Description
00048 C       -------   ----------     ----      -----------  
00049 C       2.2       L. Terray      97/12/14  created
00050 C       2.3       S. Valcke      99/04/30  added: printing levels
00051 C
00052 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00053 C
00054 C* ---------------------------- Include files ---------------------------
00055 C
00056       USE mod_unit
00057       USE mod_printing
00058 C
00059 C* ---------------------------- Argument declarations -------------------
00060 C
00061       REAL (kind=ip_realwp_p) pfield(kdimax)
00062       INTEGER (kind=ip_intwp_p) ktime(3)
00063       CHARACTER*8 cdfldn
00064       CHARACTER*3 cdjob
00065 C
00066 C* ---------------------------- Local declarations ----------------------
00067 C
00068       CHARACTER*8 clecfl
00069 C
00070 C* ---------------------------- Poema verses ----------------------------
00071 C
00072 C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00073 C
00074 C*    1. Initialization
00075 C        --------------
00076 C
00077       IF (nlogprt .GE. 2) THEN
00078           WRITE (UNIT = nulou,FMT = *)' '
00079           WRITE (UNIT = nulou,FMT = *)'    ROUTINE locreadh  -  Level 0'
00080           WRITE (UNIT = nulou,FMT = *)'    ****************     *******'
00081           WRITE (UNIT = nulou,FMT = *) ' '
00082           WRITE (UNIT = nulou,FMT = 1001) knulre
00083           WRITE (UNIT = nulou,FMT = *) ' '
00084           CALL FLUSH(nulou)
00085       ENDIF
00086 C
00087 C* Formats
00088 C
00089  1001 FORMAT(5X,' Read binary file connected to unit = ',I3)
00090 C
00091 C     2. Find field in file
00092 C        ------------------
00093 C
00094       REWIND knulre
00095  200  CONTINUE
00096 C* Find string
00097       READ (UNIT = knulre, ERR = 200, END = 210) clecfl, cdjob, ktime
00098       IF (clecfl .NE. cdfldn) GO TO  200
00099 C* Read associated field
00100       READ (UNIT = knulre, ERR = 210, END = 210) pfield
00101 C* Reading done and ok
00102       kflgre = 0
00103       GO TO 220
00104 C* Problem in reading
00105  210  kflgre = 1
00106  220  CONTINUE
00107 C
00108 C
00109 C*    3. End of routine
00110 C        --------------
00111 C
00112       IF (nlogprt .GE. 2) THEN
00113           WRITE (UNIT = nulou,FMT = *) 
00114      $    '          --------- End of ROUTINE locreadh ---------'
00115           WRITE (UNIT = nulou,FMT = *)' '
00116           CALL FLUSH (nulou)
00117       ENDIF
00118       RETURN
00119       END
00120 
00121 
 All Data Structures Namespaces Files Functions Variables Defines