*IF DEF,SCMA                                                               S_RESTDP.2      
C *****************************COPYRIGHT******************************     S_RESTDP.3      
C (c) CROWN COPYRIGHT 1998, METEOROLOGICAL OFFICE, All Rights Reserved.    S_RESTDP.4      
C                                                                          S_RESTDP.5      
C Use, duplication or disclosure of this code is subject to the            S_RESTDP.6      
C restrictions as set forth in the contract.                               S_RESTDP.7      
C                                                                          S_RESTDP.8      
C                Meteorological Office                                     S_RESTDP.9      
C                London Road                                               S_RESTDP.10     
C                BRACKNELL                                                 S_RESTDP.11     
C                Berkshire UK                                              S_RESTDP.12     
C                RG12 2SZ                                                  S_RESTDP.13     
C                                                                          S_RESTDP.14     
C If no contract has been raised with this copy of the code, the use,      S_RESTDP.15     
C duplication or disclosure of it is strictly prohibited.  Permission      S_RESTDP.16     
C to do so must first be obtained in writing from the Head of Numerical    S_RESTDP.17     
C Modelling at the above address.                                          S_RESTDP.18     
C ******************************COPYRIGHT******************************    S_RESTDP.19     
C                                                                          S_RESTDP.20     
C     = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =      S_RESTDP.21     
C     SUBROUTINE RESTART_DUMP                                              S_RESTDP.22     
C     PURPOSE:-           To create restart dump for subsequent runs       S_RESTDP.23     
C                                                                          S_RESTDP.24     
C     PROGRAMMER:-        J. LEAN                                          S_RESTDP.25     
C                                                                          S_RESTDP.26     
C     Modification History:                                                S_RESTDP.27     
C Version  Date                                                            S_RESTDP.28     
C  4.5     07/98     SCM integrated as a standard UM configuration         S_RESTDP.29     
C                    JC Thil.                                              S_RESTDP.30     
C     = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =      S_RESTDP.31     
C                                                                          S_RESTDP.32     

      Subroutine RESTART_DUMP(                                              8S_RESTDP.33     
                                ! IN dimensions of main arrays             S_RESTDP.34     
     &  points, nlevs, nwet, nprimvars,                                    S_RESTDP.35     
     &  nbl_levs, nsoilt_levs, nsoilm_levs,                                S_RESTDP.36     
                                !                                          S_RESTDP.37     
     &  resdump, u, v, t, theta, q, qcl, qcf, layer_cloud,                 S_RESTDP.38     
     &  pstar, t_deep_soil, smc, canopy, snodep, tstar, zh, z0msea,        S_RESTDP.39     
     &  cca, iccb, icct, smcl)                                             S_RESTDP.40     
      Implicit none                                                        S_RESTDP.41     
C                                                                          S_RESTDP.42     
      Integer                                                              S_RESTDP.43     
     &  points                  ! IN no of points to be processed          S_RESTDP.44     
     &  ,nlevs                  ! IN no of levels.                         S_RESTDP.45     
     &  ,nwet                   ! IN no of model levels in which Q         S_RESTDP.46     
                                !   is set.                                S_RESTDP.47     
     &  ,nprimvars              ! IN minimum no. of                        S_RESTDP.48     
                                !   variables required to restart          S_RESTDP.49     
                                !   from a dump and is equal to            S_RESTDP.50     
     &  ,nbl_levs               ! IN Number of Boundary layer levels       S_RESTDP.51     
     &  ,nsoilt_levs            ! IN Number of soil temperature            S_RESTDP.52     
                                !   levels                                 S_RESTDP.53     
     &  ,nsoilm_levs            ! IN Number of soil moisture levels        S_RESTDP.54     
C                                                                          S_RESTDP.55     
C---------------------------------------------------------------------     S_RESTDP.56     
C     Arguments                                                            S_RESTDP.57     
C---------------------------------------------------------------------     S_RESTDP.58     
C     Primary model variables + T                                          S_RESTDP.59     
C                                                                          S_RESTDP.60     
      Integer                                                              S_RESTDP.61     
     &  iccb(points)            ! IN Convective cloud base                 S_RESTDP.62     
     &  ,icct(points)           ! IN Convective cloud top                  S_RESTDP.63     
      Real                                                                 S_RESTDP.64     
     &  canopy(points)          ! IN Surface canopy water (kg m            S_RESTDP.65     
     &  ,cca(points)            ! IN Convective cloud amount               S_RESTDP.66     
     &  ,layer_cloud(points,nwet) ! IN Layer cloud amount (decima          S_RESTDP.67     
     &  ,pstar(points)          ! IN Pressure at earth's surfac            S_RESTDP.68     
                                !  (Pa not HPa)                            S_RESTDP.69     
     &  ,q(points,nwet)         ! IN Specific humidity (kg kg^-1)          S_RESTDP.70     
     &  ,qcf(points,nwet)       ! IN Cloud ice content (kg kg^-1)          S_RESTDP.71     
     &  ,qcl(points,nwet)       ! IN Cloud water content (kg kg^-)         S_RESTDP.72     
     &  ,smc(points)            ! IN Soil moisture content                 S_RESTDP.73     
                                !  (kg m^-2)                               S_RESTDP.74     
     &  ,smcl(points,nsoilm_levs) ! IN Soil moisture in levels             S_RESTDP.75     
                                !  (kg m^-2)                               S_RESTDP.76     
     &  ,snodep(points)         ! IN Snow depth (kg m^-2)                  S_RESTDP.77     
     &  ,t(points,nlevs)        ! IN Temperature at each level (K)         S_RESTDP.78     
     &  ,t_deep_soil(points,nsoilt_levs) ! IN Deep soil temperatures K     S_RESTDP.79     
     &  ,theta(points,nlevs)    ! IN Potential temperature (K)             S_RESTDP.80     
     &  ,tstar(points)          ! IN Surface temperature (K)               S_RESTDP.81     
     &  ,u(points,nlevs)        ! IN Zonal wind at each level              S_RESTDP.82     
                                !  (m s^-2)                                S_RESTDP.83     
     &  ,v(points,nlevs)        ! IN Meridional wind at each level         S_RESTDP.84     
                                !  (m s^-2)                                S_RESTDP.85     
     &  ,zh(points)             ! IN Height above surface of top of        S_RESTDP.86     
                                !  boundary layer (m)                      S_RESTDP.87     
     &  ,z0msea(points)         ! IN Sea surface roughness length          S_RESTDP.88     
     &  ,resdump(points,nprimvars) ! IN Contains restart dump              S_RESTDP.89     
      Integer                                                              S_RESTDP.90     
     &  i, k                    ! Loop counter                             S_RESTDP.91     
     &  ,icount                 ! Counter                                  S_RESTDP.92     
                                                                           S_RESTDP.93     
      Do k = 1, points          !                                          S_RESTDP.94     
                                                                           S_RESTDP.95     
        Do i = 1, nlevs                                                    S_RESTDP.96     
          resdump(k, i) = resdump(k, i) + u(k, i)                          S_RESTDP.97     
        enddo                                                              S_RESTDP.98     
        icount = i                                                         S_RESTDP.99     
        Do i = icount,icount + nlevs-1                                     S_RESTDP.100    
          resdump(k, i) = resdump(k, i) + v(k, i-icount + 1)               S_RESTDP.101    
        enddo                                                              S_RESTDP.102    
        icount = i                                                         S_RESTDP.103    
        Do i = icount,icount + nlevs-1                                     S_RESTDP.104    
          resdump(k, i) = resdump(k, i) + t(k, i-icount + 1)               S_RESTDP.105    
        enddo                                                              S_RESTDP.106    
        icount = i                                                         S_RESTDP.107    
        Do i = icount,icount + nlevs-1                                     S_RESTDP.108    
          resdump(k, i) = resdump(k, i) + theta(k, i-icount + 1)           S_RESTDP.109    
        enddo                                                              S_RESTDP.110    
        icount = i                                                         S_RESTDP.111    
        Do i = icount,icount + nwet-1                                      S_RESTDP.112    
          resdump(k, i) = resdump(k, i) + q(k, i-icount + 1)               S_RESTDP.113    
        enddo                                                              S_RESTDP.114    
        icount = i                                                         S_RESTDP.115    
        Do i = icount,icount + nwet-1                                      S_RESTDP.116    
          resdump(k, i) = resdump(k, i) + qcl(k, i-icount + 1)             S_RESTDP.117    
        enddo                                                              S_RESTDP.118    
        icount = i                                                         S_RESTDP.119    
        Do i = icount,icount + nwet-1                                      S_RESTDP.120    
          resdump(k, i) = resdump(k, i) + qcf(k, i-icount + 1)             S_RESTDP.121    
        enddo                                                              S_RESTDP.122    
        icount = i                                                         S_RESTDP.123    
        Do i = icount,icount + nwet-1                                      S_RESTDP.124    
          resdump(k, i) = resdump(k, i) + layer_cloud(k, i-icount + 1)     S_RESTDP.125    
        enddo                                                              S_RESTDP.126    
        icount = i                                                         S_RESTDP.127    
        Do i = icount,icount + nsoilt_levs-1                               S_RESTDP.128    
          resdump(k, i) = resdump(k, i) +                                  S_RESTDP.129    
     &      t_deep_soil(k, i-icount + 1)                                   S_RESTDP.130    
        enddo                                                              S_RESTDP.131    
        icount = i                                                         S_RESTDP.132    
        resdump(k, icount) = resdump(k, icount) + pstar(k)                 S_RESTDP.133    
        icount = icount + 1                                                S_RESTDP.134    
        resdump(k, icount) = resdump(k, icount) + smc(k)                   S_RESTDP.135    
        icount = icount + 1                                                S_RESTDP.136    
        resdump(k, icount) = resdump(k, icount) + canopy(k)                S_RESTDP.137    
        icount = icount + 1                                                S_RESTDP.138    
        resdump(k, icount) = resdump(k, icount) + snodep(k)                S_RESTDP.139    
        icount = icount + 1                                                S_RESTDP.140    
        resdump(k, icount) = resdump(k, icount) + tstar(k)                 S_RESTDP.141    
        icount = icount + 1                                                S_RESTDP.142    
        resdump(k, icount) = resdump(k, icount) + zh(k)                    S_RESTDP.143    
        icount = icount + 1                                                S_RESTDP.144    
        resdump(k, icount) = resdump(k, icount) + z0msea(k)                S_RESTDP.145    
        icount = icount + 1                                                S_RESTDP.146    
        resdump(k, icount) = resdump(k, icount) + cca(k)                   S_RESTDP.147    
        icount = icount + 1                                                S_RESTDP.148    
        resdump(k, icount) = resdump(k, icount) + real(iccb(k))            S_RESTDP.149    
        icount = icount + 1                                                S_RESTDP.150    
        resdump(k, icount) = resdump(k, icount) + real(icct(k))            S_RESTDP.151    
        Do i = 1, nsoilm_levs                                              S_RESTDP.152    
          resdump(k, icount + i) = resdump(k, icount + i) + smcl(k, i)     S_RESTDP.153    
        enddo                                                              S_RESTDP.154    
                                                                           S_RESTDP.155    
      enddo                     ! k                                        S_RESTDP.156    
      Return                                                               S_RESTDP.157    
      End ! Subroutine RESTART_DUMP                                        S_RESTDP.158    
C                                                                          S_RESTDP.159    
*ENDIF                                                                     S_RESTDP.160