*IF DEF,C70_1A                                                             GLW1F404.16     
C ******************************COPYRIGHT******************************    GTS2F400.1693   
C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.    GTS2F400.1694   
C                                                                          GTS2F400.1695   
C Use, duplication or disclosure of this code is subject to the            GTS2F400.1696   
C restrictions as set forth in the contract.                               GTS2F400.1697   
C                                                                          GTS2F400.1698   
C                Meteorological Office                                     GTS2F400.1699   
C                London Road                                               GTS2F400.1700   
C                BRACKNELL                                                 GTS2F400.1701   
C                Berkshire UK                                              GTS2F400.1702   
C                RG12 2SZ                                                  GTS2F400.1703   
C                                                                          GTS2F400.1704   
C If no contract has been raised with this copy of the code, the use,      GTS2F400.1705   
C duplication or disclosure of it is strictly prohibited.  Permission      GTS2F400.1706   
C to do so must first be obtained in writing from the Head of Numerical    GTS2F400.1707   
C Modelling at the above address.                                          GTS2F400.1708   
C ******************************COPYRIGHT******************************    GTS2F400.1709   
C                                                                          GTS2F400.1710   
CLL  Subroutine : DAY2CHAR  -------------------------------------------    DAY2CHA1.3      
CLL                                                                        DAY2CHA1.4      
CLL  Purpose: Convert days to the character to represent the period.       DAY2CHA1.5      
CLL                                                                        DAY2CHA1.6      
CLL  Tested under compiler:   cft77                                        DAY2CHA1.7      
CLL  Tested under OS version: UNICOS 6.1.5A                                DAY2CHA1.8      
CLL                                                                        DAY2CHA1.9      
CLL  Author:   R A Stratton                                                DAY2CHA1.10     
CLL                                                                        DAY2CHA1.11     
CLL  Model            Modification history from model version 3.0:         DAY2CHA1.12     
CLL version  Date                                                          DAY2CHA1.13     
CLL                                                                        DAY2CHA1.14     
CLL  Programming standard: UM Doc Paper 3, version 1 (15/1/90)             DAY2CHA1.15     
CLL                                                                        DAY2CHA1.16     
CLL  Logical components covered: S51                                       DAY2CHA1.17     
CLL                                                                        DAY2CHA1.18     
CLL  Project task: S51                                                     DAY2CHA1.19     
CLL                                                                        DAY2CHA1.20     
CLL  External documentation: UM documentation paper 7 - Filenaming         DAY2CHA1.21     
CLL                          conventions for the Unified Model             DAY2CHA1.22     
CLL                                                                        DAY2CHA1.23     
CLLEND -----------------------------------------------------------------   DAY2CHA1.24     
C*L  Interface and arguments: ------------------------------------------   DAY2CHA1.25     
C                                                                          DAY2CHA1.26     

      SUBROUTINE DAY2CHAR(NDAYS,DAYCHAR)                                    2DAY2CHA1.27     
C                                                                          DAY2CHA1.28     
      IMPLICIT NONE                                                        DAY2CHA1.29     
C                                                                          DAY2CHA1.30     
      INTEGER       NDAYS        ! IN  - number of days in period          DAY2CHA1.31     
      CHARACTER*1   DAYCHAR      ! OUT - character for period              DAY2CHA1.32     
C                                                                          DAY2CHA1.33     
C*----------------------------------------------------------------------   DAY2CHA1.34     
C  Common blocks                                                           DAY2CHA1.35     
C                                                                          DAY2CHA1.36     
C                                                                          DAY2CHA1.37     
C  Local variables                                                         DAY2CHA1.38     
C                                                                          DAY2CHA1.39     
C                                                                          DAY2CHA1.40     
C  IF period a multiple of years                                           DAY2CHA1.41     
C                                                                          DAY2CHA1.42     
        IF (MOD(NDAYS,360).EQ.0)THEN                                       DAY2CHA1.43     
         IF (NDAYS.EQ.360) THEN        ! 1 year mean                       DAY2CHA1.44     
           DAYCHAR='y'                                                     DAY2CHA1.45     
         ELSE IF (NDAYS.EQ.1800) THEN  ! 5 year means                      DAY2CHA1.46     
           DAYCHAR='v'                                                     DAY2CHA1.47     
         ELSE IF (NDAYS.EQ.3600) THEN  ! 10 year means                     DAY2CHA1.48     
           DAYCHAR='x'                                                     DAY2CHA1.49     
         ELSE IF (NDAYS.EQ.18000) THEN ! 50 year means                     DAY2CHA1.50     
           DAYCHAR='l'                                                     DAY2CHA1.51     
         ELSE IF (NDAYS.EQ.36000) THEN ! 100 year means                    DAY2CHA1.52     
           DAYCHAR='u'                                                     DAY2CHA1.53     
         ELSE IF (NDAYS.EQ.360000) THEN ! 1000 year means                  DAY2CHA1.54     
           DAYCHAR='z'                                                     DAY2CHA1.55     
         ELSE                           ! not a special period             DAY2CHA1.56     
           DAYCHAR='0'                                                     DAY2CHA1.57     
         ENDIF                                                             DAY2CHA1.58     
c                                                                          DAY2CHA1.59     
        ELSE                                                               DAY2CHA1.60     
C periods less than one year                                               DAY2CHA1.61     
C                                                                          DAY2CHA1.62     
         IF (NDAYS.EQ.5) THEN          ! 5 days means                      DAY2CHA1.63     
           DAYCHAR='p'                                                     DAY2CHA1.64     
         ELSE IF (NDAYS.EQ.7) THEN     ! weekly means                      DAY2CHA1.65     
           DAYCHAR='w'                                                     DAY2CHA1.66     
         ELSE IF (NDAYS.EQ.10) THEN    ! 10 day means                      DAY2CHA1.67     
           DAYCHAR='t'                                                     DAY2CHA1.68     
         ELSE IF (NDAYS.EQ.14) THEN    ! fortnightly means                 DAY2CHA1.69     
           DAYCHAR='r'                                                     DAY2CHA1.70     
         ELSE IF (NDAYS.EQ.30) THEN    ! monthly means                     DAY2CHA1.71     
           DAYCHAR='m'                                                     DAY2CHA1.72     
         ELSE IF (NDAYS.EQ.90) THEN    ! seasonal means                    DAY2CHA1.73     
           DAYCHAR='s'                                                     DAY2CHA1.74     
         ELSE                          ! not a special period              DAY2CHA1.75     
           DAYCHAR='0'                                                     DAY2CHA1.76     
         ENDIF                                                             DAY2CHA1.77     
        ENDIF                                                              DAY2CHA1.78     
C                                                                          DAY2CHA1.79     
      RETURN                                                               DAY2CHA1.80     
CL----------------------------------------------------------------------   DAY2CHA1.81     
      END                                                                  DAY2CHA1.82     
*ENDIF                                                                     DAY2CHA1.83