*IF DEF,SCMA                                                               S_INITIM.2      
C *****************************COPYRIGHT******************************     S_INITIM.3      
! (c) CROWN COPYRIGHT 1998, METEOROLOGICAL OFFICE, All Rights Reserved     S_INITIM.4      
!                                                                          S_INITIM.5      
! Use, duplication or disclosure of this code is subject to the            S_INITIM.6      
! restrictions as set forth in the contract                                S_INITIM.7      
!                                                                          S_INITIM.8      
!                Meteorological Office                                     S_INITIM.9      
!                London Road                                               S_INITIM.10     
!                BRACKNELL                                                 S_INITIM.11     
!                Berkshire UK                                              S_INITIM.12     
!                RG12 2SZ                                                  S_INITIM.13     
!                                                                          S_INITIM.14     
! If no contract has been raised with this copy of the code, the use       S_INITIM.15     
! duplication and disclosure of it is strictly prohibited.  Permission     S_INITIM.16     
! to do so must first be obtained in writing, from the Head of Numerical   S_INITIM.17     
! Modelling at the the above address.                                      S_INITIM.18     
C *****************************COPYRIGHT******************************     S_INITIM.19     
!!!  INITTIME                                                              S_INITIM.20     
!!!                                                                        S_INITIM.21     
!!!  Purpose: Initialises the model time relative to the calender zero     S_INITIM.22     
!!!           time. The model basis time (MBT) is converted to a time      S_INITIM.23     
!!!           in seconds since T=0 with respect to the calender. The       S_INITIM.24     
!!!           model initialisation time in days and seconds is then        S_INITIM.25     
!!!           calculated relative to this.                                 S_INITIM.26     
!!!                                                                        S_INITIM.27     
!!!  INPUTS - Year                                                         S_INITIM.28     
!!!         - Month                                                        S_INITIM.29     
!!!         - Day                                                          S_INITIM.30     
!!!         - Hour                                                         S_INITIM.31     
!!!         - Minute                                                       S_INITIM.32     
!!!         - Second                                                       S_INITIM.33     
!!!         - Flag for 360 day year calender                               S_INITIM.34     
!!!                                                                        S_INITIM.35     
!!!  OUTPUTS - Daynumber in year                                           S_INITIM.36     
!!!          - Time within daynumber                                       S_INITIM.37     
!!!                                                                        S_INITIM.38     
!!!                                                                        S_INITIM.39     
!!! Phil Hopwood <- programmer of some or all of previous code changes     S_INITIM.40     
!!!                                                                        S_INITIM.41     
!!!                                                                        S_INITIM.42     
!!!                                                                        S_INITIM.43     
!!! Documentation: SSFM Project Documentation - Implementation of UM       S_INITIM.44     
!!!                date structure within the SCM                           S_INITIM.45     
!!!                                                                        S_INITIM.46     
!!!-------------------------------------------------------------------     S_INITIM.47     
                                                                           S_INITIM.48     
!!  Arguments --------------------------------------------------------     S_INITIM.49     
!                                                                          S_INITIM.50     

      Subroutine inittime(iyear,imonth,iday,ihour,imin,isec,                2,25S_INITIM.51     
     &                    dayno,daytime,lcal360)                           S_INITIM.52     
!                                                                          S_INITIM.53     
      Implicit none                                                        S_INITIM.54     
!                                                                          S_INITIM.55     
      external time2sec                                                    S_INITIM.56     
!                                                                          S_INITIM.57     
      Integer                                                              S_INITIM.58     
     & iyear                       ! IN Year                               S_INITIM.59     
     &,imonth                      ! IN Month                              S_INITIM.60     
     &,iday                        ! IN Day                                S_INITIM.61     
     &,ihour                       ! IN Hour                               S_INITIM.62     
     &,imin                        ! IN Minute                             S_INITIM.63     
     &,isec                        ! IN Second                             S_INITIM.64     
      Logical                                                              S_INITIM.65     
     & lcal360                     ! IN Flag for 360 year calender         S_INITIM.66     
      Integer                                                              S_INITIM.67     
     & dayno                       ! OUT Daynumber in year                 S_INITIM.68     
     &,daytime                     ! OUT Time in daynumber                 S_INITIM.69     
      Integer                                                              S_INITIM.70     
     & basis_time_days             ! LOCAL whole days to basis time        S_INITIM.71     
!                                    from start of calender                S_INITIM.72     
     &,basis_time_secs             ! LOCAL secs in day at basis time       S_INITIM.73     
!                                                                          S_INITIM.74     
! Calculate Model Basis Time (i.e. begining of current year)               S_INITIM.75     
! relative to calender zero                                                S_INITIM.76     
!                                                                          S_INITIM.77     
      Call time2sec(iyear-1,12,31,0,0,0,                                   S_INITIM.78     
     &  0,0,basis_time_days,basis_time_secs,lcal360)                       S_INITIM.79     
!                                                                          S_INITIM.80     
! Calculate daynumber and initial time relative to Model Basis Time        S_INITIM.81     
!                                                                          S_INITIM.82     
      Call time2sec(iyear,imonth,iday,ihour,imin,isec,                     S_INITIM.83     
     &  basis_time_days,basis_time_secs,                                   S_INITIM.84     
     &  dayno,daytime,lcal360)                                             S_INITIM.85     
                                !                                          S_INITIM.86     
      Return                                                               S_INITIM.87     
      End                                                                  S_INITIM.88     
!                                                                          S_INITIM.89     
*ENDIF                                                                     S_INITIM.90