CUPID: INPUT AND OUTPUT CODING


                                       

  1) Regular hours code: 

  The first four lines of the input data file carry code numbers that specify 
  the content and format of the CUPID output file.

  The first two lines of input fill the arrays IPNT and JPNT. JPNT is the 
  number of the line, where a certain variable is printed and IPNT specifies 
  the time nature of the data (e.g. whether fixed, daily or hourly, see below).
  IPNT and JPNT are arranged in pairs in the two dimensional array
  IWRITE (IPNT,JPNT). Each pair of these code numbers stands for two lines of 
  data output: a line of labels and a line of numeric data. For each pair of 
  IPNT and JPNT that has been input, the IWRITE (IPNT,JPNT) will be assigned 
  the value 1. The 'WRITE' statement will then later have the following form:

  Example:

            IF (IWRITE(1,2).EQ.1) WRITE (21,40)
     40     FORMAT ('11 2',9X,/,14X,'RSOIL1,RSOIL2,.....)               (1)  
            IF (IWRITE(1,2).EQ.1) WRITE (21,41)(RSOIL(M),M=1,3...)
     41     FORMAT('212',9X,9F7.2)                                      (2) 


  These output lines repeat the code in the first columns in the form:

            '1MNN'  (see (1))  for any line of LABELS
            '2MNN'  (see (2))  for any line of DATA  

     where: M (=IPNT as a program variable) is the time nature identifier.

            N  (=JPNT as a program variable) is the line identifier.

  The code reported in the output file can have up to 16 digits specifying 
  other 'data identifier'. Here is the list of code numbers:

   Example:

        LMNNDDDHHIIJJ
        1150320101000 ITER  EXPDIR EXPDIF TLAYER RLAYER

        L:  distinguishes between column labels and data:

        1: alphanumeric label
        2: numeric data

        M:  identifies the time nature of data:

        1: fixed header data (constant for entire output)
        2: daily header data
        3: daily summary data
        4: hourly header data
        5: hourly summary by layer
        7: hourly summary data
        8: hourly summary by layer and leaf angle

        NN: line identifying number where data values can be found in the 
            output.

        DDD: Julian day (number of the day of the year)

        HH : time step number of the day

        II : leaf angle class number, 1: horizontal, ITOT: vertical
             ITOT + 1: shaded

        JJ : canopy layer number, 1: soil sfc, JTOT : canopy top  





  This same system of code numbers is used later in another program (cread 
  FORTRAN) to pick out particular data from the original CUPID output file and 
  file them separately.  

  The pages following this chapter are examples of a CUPID input file section 
  and some sections of a CUPID output file.


  2) Special hours

  There exists the option to produce a more detailed output for specially 
  designated hours.  If a longer output is desired for some, but not all hours, 
  the variable ISPECL in line 3 of the input file has to be set =1.  The 
  'special hours' are specified through the variables ISTRPN and INCPN in line 
  5 of the input file.  ISTRPN is the first hour for which a longer output is 
  desired and INCPN is the time step to the next 'special hour'.   

  Example:
     If 4 special hour outputs are desired every day at 9am, 12 noon,
     3pm and 6pm, the setting would have to be:
     ISTRPN = 9
     INCPN  = 3

  For those hours the IHRPNT(IHR) is set =1.

  In line 4, the code numbers for the lines of variables to appear in the 
  'special hour'output are specified in the variables KPNT and LPNT.  The code 
  system is the same one as used for the regular hour output.  All IWRITE 
  (KPNT,LPNT) are set =1 at the beginning of the hourly loop, provided that IHR 
  has been specified to be a 'special hour' (i.e.IHRPNT(IHR)=1).  So the total 
  output for every 'special hour' IHR every day consists of the lines of label 
  and numeric data of the code IPNT,JPNT and KPNT,LPNT.


  3) The use of the code in the CUPIDREAD program

  Cread FORTAN is a program designed to extract desired output data from the 
  long original CUPID output file and to bring them into a format that can 
  readily be used in a plotting routine.  

  The data that are extracted by Cread from the CUPID output file can be 
  organized by day, time step, layer, or leaf angle class as an independent 
  variable.  A maximum of nine variables can be listed together by one of the 
  above.  The information required by the program to locate the desired data 
  consists of the names of the variables, the day numbers, the time step
  numbers and the index numbers for layers and angle classes.  From this input 
  information, the program creates the complete set of code numbers 
  (LMNNDDDHHIIJJ, as discussed above) for the requested data. These code 
  numbers are then located in the CUPID output file and the data are put 
  together in a new file called EXTRACT DATA.

  More information on the use of Cread FORTRAN is available in a separate 
  summary.