*IF DEF,FLDC                                                               GBTABINT.2      
C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.    GTS2F400.15337  
C                                                                          GTS2F400.15338  
C Use, duplication or disclosure of this code is subject to the            GTS2F400.15339  
C restrictions as set forth in the contract.                               GTS2F400.15340  
C                                                                          GTS2F400.15341  
C                Meteorological Office                                     GTS2F400.15342  
C                London Road                                               GTS2F400.15343  
C                BRACKNELL                                                 GTS2F400.15344  
C                Berkshire UK                                              GTS2F400.15345  
C                RG12 2SZ                                                  GTS2F400.15346  
C                                                                          GTS2F400.15347  
C If no contract has been raised with this copy of the code, the use,      GTS2F400.15348  
C duplication or disclosure of it is strictly prohibited.  Permission      GTS2F400.15349  
C to do so must first be obtained in writing from the Head of Numerical    GTS2F400.15350  
C Modelling at the above address.                                          GTS2F400.15351  
C ******************************COPYRIGHT******************************    GTS2F400.15352  
C                                                                          GTS2F400.15353  
!+ Initailise a stash code to new grib code table                          GBTABINT.3      
!                                                                          GBTABINT.4      
! Subroutine Interface:                                                    GBTABINT.5      

      SUBROUTINE GRIB_TABLE_INIT1                                           1GBTABINT.6      
                                                                           GBTABINT.7      
      IMPLICIT NONE                                                        GBTABINT.8      
!                                                                          GBTABINT.9      
! Description:                                                             GBTABINT.10     
!   Initialises array GRIB_TABLE used to map stash codes to                GBTABINT.11     
!   standard table 2 grib grib edition 1 field codes                       GBTABINT.12     
!                                                                          GBTABINT.13     
! Method:                                                                  GBTABINT.14     
!   See WMO documentation on grib for list of codes.                       GBTABINT.15     
!                                                                          GBTABINT.16     
! Current Code Owner: R.A.Stratton                                         GBTABINT.17     
!                                                                          GBTABINT.18     
! History:                                                                 GBTABINT.19     
! Version   Date     Comment                                               GBTABINT.20     
! -------   ----     -------                                               GBTABINT.21     
!  4.0     31/03/95  Original code. R.A.Stratton                           GBTABINT.22     
!                                                                          GBTABINT.23     
! Code Description:                                                        GBTABINT.24     
!   Language: FORTRAN 77 + common extensions.                              GBTABINT.25     
!   This code is written to UMDP3 v6 programming standards.                GBTABINT.26     
!                                                                          GBTABINT.27     
! System component covered:                                                GBTABINT.28     
! System Task:                                                             GBTABINT.29     
!                                                                          GBTABINT.30     
! -------------------------------------------------------------------      GBTABINT.31     
! Declarations:                                                            GBTABINT.32     
!                                                                          GBTABINT.33     
*CALL CGRIBTAB                                                             GBTABINT.34     
                                                                           GBTABINT.35     
! Subroutine arguments - none                                              GBTABINT.36     
                                                                           GBTABINT.37     
! Local varaibles:                                                         GBTABINT.38     
      INTEGER                                                              GBTABINT.39     
     &      I,J        ! loop counters                                     GBTABINT.40     
                                                                           GBTABINT.41     
! Function & Subroutine calls: none                                        GBTABINT.42     
! --------------------------------------------------------------------     GBTABINT.43     
! Initilise table with -99 - indicate no matching code                     GBTABINT.44     
                                                                           GBTABINT.45     
      DO I=0,MAX_SECT_GRBTAB,1                                             GBTABINT.46     
        DO J=1,MAX_ITEM_GRBTAB                                             GBTABINT.47     
          GRIB_TABLE(I,J)=-99                                              GBTABINT.48     
        ENDDO                                                              GBTABINT.49     
      ENDDO                                                                GBTABINT.50     
! --------------------------------------------------------------------     GBTABINT.51     
!  Change entries for field with matching grib codes                       GBTABINT.52     
      GRIB_TABLE(16,222)=2     ! mslp                                      GBTABINT.53     
      GRIB_TABLE(15,201)=3     ! pressure tendency                         GBTABINT.54     
      GRIB_TABLE(10,206)=6     ! geopotential                              GBTABINT.55     
      GRIB_TABLE(10,206)=6     ! geopotential                              GBTABINT.56     
      GRIB_TABLE(16,201)=7     ! geopotential height                       GBTABINT.57     
      GRIB_TABLE(16,202)=7     ! geopotential height                       GBTABINT.58     
      GRIB_TABLE(1,  4)=11    ! temperature                                GBTABINT.59     
      GRIB_TABLE(2,  4)=11    ! temperature                                GBTABINT.60     
      GRIB_TABLE(3,  4)=11    ! temperature                                GBTABINT.61     
      GRIB_TABLE(4,  4)=11    ! temperature                                GBTABINT.62     
      GRIB_TABLE(5,209)=11    ! temperature                                GBTABINT.63     
      GRIB_TABLE(9,209)=11    ! temperature                                GBTABINT.64     
      GRIB_TABLE(15,216)=11    ! temperature                               GBTABINT.65     
      GRIB_TABLE(16,203)=11    ! temperature                               GBTABINT.66     
      GRIB_TABLE(0,4)=13       ! potential temperature                     GBTABINT.67     
      GRIB_TABLE(5,4)=13       ! potential temperature                     GBTABINT.68     
      GRIB_TABLE(10,4)=13      ! potential temperature                     GBTABINT.69     
      GRIB_TABLE(0,2)=33      ! u_component of wind speed                  GBTABINT.70     
      GRIB_TABLE(3,2)=33      ! u_component of wind speed                  GBTABINT.71     
      GRIB_TABLE(6,2)=33      ! u_component of wind speed                  GBTABINT.72     
      GRIB_TABLE(7,2)=33      ! u_component of wind speed                  GBTABINT.73     
      GRIB_TABLE(10,2)=33      ! u_component of wind speed                 GBTABINT.74     
      GRIB_TABLE(12,2)=33      ! u_component of wind speed                 GBTABINT.75     
      GRIB_TABLE(13,2)=33      ! u_component of wind speed                 GBTABINT.76     
      GRIB_TABLE(15,201)=33      ! u_component of wind speed               GBTABINT.77     
      GRIB_TABLE(0,3)=34      ! v_component of wind speed                  GBTABINT.78     
      GRIB_TABLE(3,3)=34      ! v_component of wind speed                  GBTABINT.79     
      GRIB_TABLE(6,3)=34      ! v_component of wind speed                  GBTABINT.80     
      GRIB_TABLE(7,3)=34      ! v_component of wind speed                  GBTABINT.81     
      GRIB_TABLE(10,3)=34      ! v_component of wind speed                 GBTABINT.82     
      GRIB_TABLE(12,3)=34      ! v_component of wind speed                 GBTABINT.83     
      GRIB_TABLE(13,3)=34      ! v_component of wind speed                 GBTABINT.84     
      GRIB_TABLE(15,202)=34      ! v_component of wind speed               GBTABINT.85     
      GRIB_TABLE(12,201)=39      ! vertical velocity                       GBTABINT.86     
      GRIB_TABLE(12,202)=39      ! vertical velocity                       GBTABINT.87     
      GRIB_TABLE(15,222)=39      ! vertical velocity                       GBTABINT.88     
      GRIB_TABLE(0,10)=51      ! specific humidity                         GBTABINT.89     
      GRIB_TABLE(3,10)=51      ! specific humidity                         GBTABINT.90     
      GRIB_TABLE(4,10)=51      ! specific humidity                         GBTABINT.91     
      GRIB_TABLE(5,10)=51      ! specific humidity                         GBTABINT.92     
      GRIB_TABLE(9,10)=51      ! specific humidity                         GBTABINT.93     
      GRIB_TABLE(15,226)=51      ! specific humidity                       GBTABINT.94     
      GRIB_TABLE(16,204)=52      ! relative humidity                       GBTABINT.95     
      GRIB_TABLE(3,223)=57      ! evaporation (units not correct?)         GBTABINT.96     
      GRIB_TABLE(5,216)=59      ! precipitation rate                       GBTABINT.97     
      GRIB_TABLE(2,204)=71      ! total cloud cover (should be %)          GBTABINT.98     
      GRIB_TABLE(0,13)=72      ! total convective cloud                    GBTABINT.99     
      GRIB_TABLE(5,13)=72      ! total convective cloud                    GBTABINT.100    
      GRIB_TABLE(9,203)=73      ! low cloud                                GBTABINT.101    
      GRIB_TABLE(9,204)=74      ! medium cloud                             GBTABINT.102    
      GRIB_TABLE(9,205)=75      ! high cloud                               GBTABINT.103    
      GRIB_TABLE(3,238)=85      ! soil temperature                         GBTABINT.104    
      GRIB_TABLE(8,208)=86      ! soil moisture                            GBTABINT.105    
      GRIB_TABLE(2,201)=112     ! net long-wave radiation surface          GBTABINT.106    
      GRIB_TABLE(2,205)=114     ! net long-wave radiation toa              GBTABINT.107    
      GRIB_TABLE(3,234)=121     ! latent heat flux                         GBTABINT.108    
      GRIB_TABLE(3,217)=122     ! sensible heat flux                       GBTABINT.109    
! --------------------------------------------------------------------     GBTABINT.110    
      RETURN                                                               GBTABINT.111    
      END                                                                  GBTABINT.112    
! ======================================================================   GBTABINT.113    
!+ Initailise a stash code to new user grib code table                     GBTABINT.114    
!                                                                          GBTABINT.115    
! Subroutine Interface:                                                    GBTABINT.116    

      SUBROUTINE GRIB_TABLE_INIT2                                           1GBTABINT.117    
                                                                           GBTABINT.118    
      IMPLICIT NONE                                                        GBTABINT.119    
!                                                                          GBTABINT.120    
! Description:                                                             GBTABINT.121    
!   Initialises array GRIB_TABLE used to map stash codes to                GBTABINT.122    
!   a user defined  grib table 2 set of field codes                        GBTABINT.123    
!                                                                          GBTABINT.124    
! Method:                                                                  GBTABINT.125    
!   Uses special set of mapping for AMIP highres experiment.               GBTABINT.126    
! NOTE : This subroutine is present  to allow a user to                    GBTABINT.127    
!        edit it for their own set of mappings.                            GBTABINT.128    
!        Codes must be between 129 and 255 to conform to user              GBTABINT.129    
!        extensions to grib edition 1 table 2.                             GBTABINT.130    
!                                                                          GBTABINT.131    
! Current Code Owner: R.A.Stratton                                         GBTABINT.132    
!                                                                          GBTABINT.133    
! History:                                                                 GBTABINT.134    
! Version   Date     Comment                                               GBTABINT.135    
! -------   ----     -------                                               GBTABINT.136    
!  4.0     31/03/95  Original code. R.A.Stratton                           GBTABINT.137    
!                                                                          GBTABINT.138    
! Code Description:                                                        GBTABINT.139    
!   Language: FORTRAN 77 + common extensions.                              GBTABINT.140    
!   This code is written to UMDP3 v6 programming standards.                GBTABINT.141    
!                                                                          GBTABINT.142    
! System component covered:                                                GBTABINT.143    
! System Task:                                                             GBTABINT.144    
!                                                                          GBTABINT.145    
! -------------------------------------------------------------------      GBTABINT.146    
! Declarations:                                                            GBTABINT.147    
!                                                                          GBTABINT.148    
*CALL CGRIBTAB                                                             GBTABINT.149    
                                                                           GBTABINT.150    
! Subroutine arguments - none                                              GBTABINT.151    
                                                                           GBTABINT.152    
! Local varaibles:                                                         GBTABINT.153    
      INTEGER                                                              GBTABINT.154    
     &      I,J        ! loop counters                                     GBTABINT.155    
                                                                           GBTABINT.156    
! Function & Subroutine calls: none                                        GBTABINT.157    
! --------------------------------------------------------------------     GBTABINT.158    
! Initilise table with -99 - indicate no matching code                     GBTABINT.159    
                                                                           GBTABINT.160    
      DO I=0,MAX_SECT_GRBTAB,1                                             GBTABINT.161    
        DO J=1,MAX_ITEM_GRBTAB                                             GBTABINT.162    
          GRIB_TABLE(I,J)=-99                                              GBTABINT.163    
        ENDDO                                                              GBTABINT.164    
      ENDDO                                                                GBTABINT.165    
! --------------------------------------------------------------------     GBTABINT.166    
!  Change entries for field with matching grib codes                       GBTABINT.167    
      GRIB_TABLE(9,206)=129   ! cloud liquid water vertical mean           GBTABINT.168    
      GRIB_TABLE(9,207)=130   ! cloud ice content vertical mean            GBTABINT.169    
      GRIB_TABLE(1,201)=131   ! net surface downward SW radiation          GBTABINT.170    
      GRIB_TABLE(1,207)=132   ! Incoming SW TOA                            GBTABINT.171    
      GRIB_TABLE(1,208)=133   ! outgoing SW TOA                            GBTABINT.172    
      GRIB_TABLE(1,209)=134   ! outgoing SW TOA clear sky                  GBTABINT.173    
      GRIB_TABLE(1,210)=135   ! downward surface SW clear sky              GBTABINT.174    
      GRIB_TABLE(1,235)=136   ! total downward surface SW                  GBTABINT.175    
      GRIB_TABLE(2,201)=137   ! net surface downward LW radiation          GBTABINT.176    
      GRIB_TABLE(2,204)=138   ! Total cloud amount                         GBTABINT.177    
      GRIB_TABLE(2,205)=139   ! OLR TOA                                    GBTABINT.178    
      GRIB_TABLE(2,206)=140   ! OLR TOA  clear sky                         GBTABINT.179    
      GRIB_TABLE(2,207)=141   ! downward surface LW                        GBTABINT.180    
      GRIB_TABLE(2,208)=142   ! downward surface LW clear sky              GBTABINT.181    
      GRIB_TABLE(3,217)=143   ! surface sensible heat flux                 GBTABINT.182    
      GRIB_TABLE(3,219)=144   ! u - comp of surface wind stress            GBTABINT.183    
      GRIB_TABLE(3,220)=145   ! v - comp of surface wind stress            GBTABINT.184    
      GRIB_TABLE(3,223)=146   ! surface  evaportaion rate                  GBTABINT.185    
      GRIB_TABLE(3,225)=147   ! u - comp of wind 10m                       GBTABINT.186    
      GRIB_TABLE(3,226)=148   ! v - comp of wind 10m                       GBTABINT.187    
      GRIB_TABLE(3,234)=149   ! latent heat flux                           GBTABINT.188    
      GRIB_TABLE(3,236)=150   ! 1.5m temperature                           GBTABINT.189    
      GRIB_TABLE(3,237)=151   ! 1.5m specific humidity                     GBTABINT.190    
      GRIB_TABLE(3,238)=152   ! deep soil temperature level 1              GBTABINT.191    
      GRIB_TABLE(3,245)=153   ! 1.5m relative humidity                     GBTABINT.192    
      GRIB_TABLE(4,203)=154   ! surface rainfall rate (L_S)                GBTABINT.193    
      GRIB_TABLE(4,204)=155   ! surface snowfall rate (L_S)                GBTABINT.194    
      GRIB_TABLE(5,205)=156   ! surface snowfall rate (CONV)               GBTABINT.195    
      GRIB_TABLE(5,206)=157   ! surface rainfall rate (CONV)               GBTABINT.196    
      GRIB_TABLE(8,23)=158   !snow mass                                    GBTABINT.197    
      GRIB_TABLE(8,204)=159   ! surface runoff                             GBTABINT.198    
      GRIB_TABLE(8,205)=160   ! sub-surface runoff                         GBTABINT.199    
      GRIB_TABLE(8,208)=161   ! soil moisture                              GBTABINT.200    
      GRIB_TABLE(8,209)=162   ! canopy water content                       GBTABINT.201    
      GRIB_TABLE(6,201)=163   ! u -comp of GWD stress                      GBTABINT.202    
      GRIB_TABLE(6,202)=164   ! v -comp of GWD stress                      GBTABINT.203    
      GRIB_TABLE(16,222)=165   ! mslp                                      GBTABINT.204    
      GRIB_TABLE(0,1)=166      ! surface pressure                          GBTABINT.205    
      GRIB_TABLE(0,10)=167      ! specific humidity vertical mean          GBTABINT.206    
      GRIB_TABLE(0,24)=168      ! surface temperature                      GBTABINT.207    
! --------------------------------------------------------------------     GBTABINT.208    
      RETURN                                                               GBTABINT.209    
      END                                                                  GBTABINT.210    
*ENDIF                                                                     GBTABINT.211