        subroutine PRENV
      include 'SIZE.INC'
      include 'GLOBAL.INC'
      include 'LOCAL.INC'
      include 'UNITS.INC'
      include 'INPAR.INC'
      include 'LOCAL1.INC'
      include 'LOCAL2.INC'
      include 'LOCAL3.INC'
        real OUT1(NCON), OUT2(NCON), OUT3(NCON), OUT4(6)
        integer LOC1(NCON), LOC2(NCON), NFIRST, NLAST
        logical MEAN
        character KOUT*2, NMON*4, TAG*2
        common/TABLES/ OUT1, OUT2, OUT3, OUT4
     &, LOC1, LOC2, NFIRST, NLAST, MEAN
        common /TABLE2/ KOUT, NMON, TAG
      if (PRSWG.eq.0.or.(PRSWG.eq.1.and.MODEG.lt.3.and.MONTHG.eq.13))
     &    then
         NFIRST = 13
         NLAST = 13
         if (PRSWG.eq.0) then
            MEAN = .true.
         else
            MEAN = .false.
         endif
         TAG = '**'
         NMON = NAMONG(13)
      elseif (PRSWG.eq.1.and.MODEG.lt.3.and.MONTHG.lt.13) then
         NFIRST = MONTHG
         NLAST = MONTHG
         MEAN = .false.
         TAG = '  '
         NMON = NAMONG(MONTHG)
      elseif (PRSWG.eq.1.and.MODEG.eq.3) then
         NFIRST = 1
         NLAST = 13
         MEAN = .false.
         TAG = '  '
      else
         IFLAG = 8
         write (TTYOUT(MACHNO),5000) PRSWG,MODEG,MONTHG
5000  format (' Code failure in subroutine PRENV due to:'/' PRSW = ',I3,
     &',  MODE = ',I3,',  and MONTH = ',I3,'.'/' Simulation aborted.')
      endif
      if (IFLAG.eq.8) go to 100
      call GEOCK
      call TABA
      call TABB
      call TABC
      call TABD
100   continue
      return
      end
