      SUBROUTINE GETCTEMF (NLU,NEWFRAC,PREFRAC,C_CLIM_TIME,
     1                     MONTH,IDAY,
     2                     LNDCVRYR1,LNDCVRYR2,
     3                     LCTEM,ICC,NTLD,NLON,NLAT,IJPAK,GG)
C
C     * FEB 29, 2016 - M.LAZARE. NEW ROUTINE BASED ON FIRST PART OF CTEM_INTERPOL_LAND_COVER.DK
C     *                          TO OBTAIN NEXT MID-MONTH CTEM VEGETATION FRACTION FIELDS.
C
      IMPLICIT NONE

      integer NLU  ! I/O UNIT NUMBER FOR FILE THAT CONTAINS LAND COVER + MAY BE OTHER VARIABLES
C
C     * I/O FIELDS:
C
      REAL NEWFRAC(IJPAK,NTLD,ICC), PREFRAC(IJPAK,NTLD,ICC)
      REAL C_CLIM_TIME(3,2)
C
      INTEGER LCTEM(ICC)

      INTEGER*4 MYNODE
      COMMON /MPINFO/ MYNODE
C
C     * WORK ARRAY.
C
      REAL GG(*)
C
      INTEGER IJPAK,NTLD,K,M,NLON,NLAT,ICC

      INTEGER IDAY           ! Compressed time day     (1, 2, 3 ...   364, 365)
      INTEGER MONTH          ! Extended time month     (1, 2, 3 ...  12)
C
      INTEGER LNDCVRYR1,LNDCVRYR2
C
C     * LOCAL DATA.
C
      INTEGER :: nc4to8
C
      INTEGER START_DAYS_OF_MONTHS(12), MID_MONTH_DAYS(12)
      INTEGER MONTHP1, TMESTMP2
C
      DATA START_DAYS_OF_MONTHS /1,32,60,91,121,152,182,213,244,274,
     &305,335/
      DATA MID_MONTH_DAYS /15,46,74,105,135,166,196,227,258,288,319,
     +349/
C-----------------------------------------------------------------------------
C     * FIND THE LAND COVER FOR THE CURRENT DAY USING VALUES
C     * PREVIOUSLY EXTRACTED.
C
      LNDCVRYR1 = LNDCVRYR2*10000 + MONTH * 100 + IDAY - 
     &            START_DAYS_OF_MONTHS(MONTH) + 1 ! FOR USE IN WRITECS
C
C     * AT THIS TIME I DO NOT HAVE LAND COVER BEYOND 2100 SO THE TIME STAMP
C     * USED IN SAVING LAND COVER IN THE CM FILE IN WRITECS SUBROUTINE CANNOT 
C     * BE GREATER THAN THE LAST DAY OF 2100.
C
      IF(LNDCVRYR1.GT.21001231) THEN
        LNDCVRYR1 = 21001231
      ENDIF
C
      C_CLIM_TIME(1,1)=LNDCVRYR2
      C_CLIM_TIME(2,1)=MID_MONTH_DAYS(MONTH)
      C_CLIM_TIME(3,1)=0.0
C
      MONTHP1 = MONTH + 1
      IF (MONTHP1.NE.13)THEN
        TMESTMP2 = LNDCVRYR2*100 + MONTH + 1
        C_CLIM_TIME(1,2)=LNDCVRYR2
        C_CLIM_TIME(2,2)=MID_MONTH_DAYS(MONTH+1)
        C_CLIM_TIME(3,2)=0.0
      ELSE IF( MONTHP1.EQ.13)THEN
        TMESTMP2 = (LNDCVRYR2+1)*100 + 1 ! JANUARY OF NEXT YEAR
        IF (TMESTMP2.GT.210012) TMESTMP2=210012
        C_CLIM_TIME(1,2)=LNDCVRYR2+1
        C_CLIM_TIME(2,2)=MID_MONTH_DAYS(1)
        C_CLIM_TIME(3,2)=0.0
      ENDIF
C
C     * 15th OF THIS MONTH VALUES NOW BECOME PREFRAC
C
      PREFRAC(:,:,:)=NEWFRAC(:,:,:)
C
C     * AND WE GET VALUES FOR THE 15th OF THE NEXT MONTH
C
      REWIND NLU
      DO K = 1, ICC
      DO M = 1, NTLD
         CALL GETGGBX(NEWFRAC(1,M,K),NC4TO8("FRAC"),NLU,NLON,NLAT,
     1                TMESTMP2,LCTEM(K),GG)
      ENDDO
      ENDDO
C
      RETURN
      END
