
MODULE YOM_GRIB_CODES

USE PARKIND1  ,ONLY : JPIM

IMPLICIT NONE

SAVE

!     ------------------------------------------------------------------
!*    GRIB CODING DESCRIPTORS


! NGRB...  - Fixed GRIB codes according to ECMWF local Code Table 2
! The characters after NGRB should be the same as the MARS short name !!!!!!
! NGRBd.. where d.. are digits means not assigned (yet) in MARS
! Some of the descriptions below might not agree with MARS manual (they should)

! NGRBPT    -  3 Potential Temperature
! NGRBSRO   -  8 Surface Runoff
! NGRBSSRO  -  9 Sub-Surface Runoff
! NGRBALUVP - 15 MODIS albedo UV-vis parallel radiation
! NGRBALUVD - 16 MODIS albedo UV-vis diffuse radiation
! NGRBALNIP - 17 MODIS albedo Near-IR parallel radiation
! NGRBALNID - 18 MODIS albedo Near-IR diffuse radiation
! NGRBPARCS - 20 surface clear-sky PARadiation

! NGRBCVL  -  27 Low vegetation cover
! NGRBCVH  -  28 High vegetation cover
! NGRBTVL  -  29 Low vegetation type
! NGRBTVH  -  30 High vegetation type
! NGRBCI   -  31 Sea ice cover
! NGRBASN  -  32 Snow albedo
! NGRBRSN  -  33 Snow density
! NGRBSSTK  - 34 Sea surface temperature
! NGRBISTL1 - 35 Ice surface temperature layer 1
! NGRBISTL2 - 36 Ice surface temperature layer 2
! NGRBISTL3 - 37 Ice surface temperature layer 3
! NGRBISTL4 - 38 Ice surface temperature layer 4
! NGRBSWVL1 - 39 Volumetric soil water content layer 1
! NGRBSWVL2 - 40 Volumetric soil water content layer 2
! NGRBSWVL3 - 41 Volumetric soil water content layer 3      
! NGRBSWVL4 - 42 Volumetric soil water content layer 4 
! NGRBSLT   - 43 Soil type
! NGRBES   -  44 Evaporation of snow
! NGRBSMLT -  45 Snow melt
! NGRB10FG -  49 gust at 10 m level
! NGRBLSPF -  50 large scale precipitation fraction 

! NGRBMONT  - 53 Montgomery Geopotential
! NGRBPRES  - 54 Pressure on Theta and PV surfaces

! NGRBUVB  -  57 surface UV-B radiation
! NGRBPAR  -  58 surface PARadiation
! NGRBCAPE -  59 convect.avail.potential energy
! NGRBPV   -  60 Potential Vorticity
! NGRBLAIL -  66 Leaf Area Index Low vegitation
! NGRBLAIH -  67 Leaf Area Index High vegitation

! NGRBSDFOR - 74 standard deviation of a filtered orography
! NGRBSF6APF  -  210185 SF6 - anthropogenic emissions

! NGRBCRWC -  75 Precipitating rain water content
! NGRBCSWC -  76 Precipitating snow water content

! NGRBTCLW -  78 Total column liquid water
! NGRBTCIW -  79 Total column ice water
! NGRBTCRW -  228089 Total column rain water
! NGRBTCSW -  228090 Total column snow water
! NGRBSPD  -  80 !! 80 and 81 extra grib code introduced to 
! NGRBSVD  -  81 !! introduce extra fields for NH Not MARS codes!!!!!!
! NGRBLIT  -  82 !! land ice mask

! NGRB082 to NGRB117 reserved for extra fields. Do not use for permanent post-processed fields


! Codes for 2D and 3D extra fields
! NGRBMINXTRA  to NGRBMAXXTRA

! NGRBMX2T6 - 121 Maximum temperature at 2 m since last 6 hours 
! NGRBMN2T6 - 122 Minimum temperature at 2 m since last 6 hours 
! NGRB10FG6 - 123 Wind gust at 10 metres since last 6 hours 
! NGRBEMIS  - 124 Surface Longwave emissivity # has replaced NGRB212

! NGRBETADOT - 077 Etadotdpdeta

! NGRBAT   - 127 Atmospheric tide
! NGRBBV   - 128 Budget values
! NGRBZ    - 129 Geopotential (at the surface orography)
! NGRBT    - 130 Temperature
! NGRBU    - 131 U-velocity
! NGRBV    - 132 V-velocity
! NGRBUCUR - 131 U-velocity, using (ocean) table 151
! NGRBVCUR - 132 V-velocity, using (ocean) table 151
! NGRBSSS  - 151130 sea surface salinity, (ocean table 151)

! NGRBQ    - 133 Specific humidity
! NGRBSP   - 134 Surface pressure
! NGRBW    - 135 Vertical velocity
! NGRBTCW  - 136 Total column water
! NGRBTCWV - 137 Total column water vapour
! NGRBVO   - 138 Vorticity (relative)
! NGRBSTL1 - 139 Surface temperature level 1
! NGRBSD   - 141 Snow depth
! NGRBLSP  - 142 Large scale precipitation
! NGRBCP   - 143 Convective precipitation
! NGRBSF   - 144 Snow fall
! NGRBBLD  - 145 Boundary layer dissipation
! NGRBSSHF - 146 Surface sensible heat flux
! NGRBSLHF - 147 Surface latent heat flux
! NGRBCHNK - 148 Charnock parameter 
! NGRBSNR  - 149 Surface net radiation
! NGRBTNR  - 150 Top net radiation
! NGRBMSL  - 151 Mean sea level pressure
! NGRBLNSP - 152 Log surface pressure
! NGRBSWHR - 153 Not used?
! NGRBLWHR - 154 Not used?
! NGRBD    - 155 Divergence
! NGRBGH   - 156 Height (geopotential)
! NGRBR    - 157 Relative humidity
! NGRBTSP  - 158 Tendency of surface pressure
! NGRBBLH  - 159 Boundary layer height
! NGRBSDOR - 160 Standard deviation of orography
! NGRBISOR - 161 Anisotropy of subgrid scale orography
! NGRBANOR - 162 Angle of subgrid scale orography
! NGRBSLOR - 163 Slope of subgrid scale orography
! NGRBTCC  - 164 Total cloud cover
! NGRB10U  - 165 10 metre u wind
! NGRB10V  - 166 10 metre v wind
! NGRBZUST - 228003 Friction velocity
! NGRBFDIR - 228021 Surface total sky direct SW
! NGRBCDIR - 228022 Surface clear sky direct SW
! NGRBCBASE- 228023 Cloud base level
! NGRB0DEGL- 228024 Zero deg. level
! NGRBVISIH- 228025 Horizontal visibility
! NGRB10NU - 228131 10 metre u neutral wind
! NGRB10NV - 228132 10 metre v neutral wind
! NGRB2T   - 167 2 metre temperature
! NGRB2D   - 168 2 metre dewpoint temperature
! NGRBSSRD - 169 Surface solar radiation downwards
! NGRBSTL2 - 170 Soil temperature level 2
! NGRBLSM  - 172 Land/sea mask
! NGRBSR   - 173 Surface roughness
! NGRBAL   - 174 Albedo
! NGRBSTRD - 175 Surface thermal radiation downwards
! NGRBSSR  - 176 Surface solar radiation
! NGRBSTR  - 177 Surface thermal radiation
! NGRBTSR  - 178 Top solar radiation
! NGRBTTR  - 179 Top thermal radiation
! NGRBEWSS - 180 U-stress
! NGRBNSSS - 181 V-stress
! NGRBE    - 182 Evaporation
! NGRBSTL3 - 183 Soil temperature level 3
! NGRBCCC  - 185 Convective cloud cocer
! NGRBLCC  - 186 Low cloud cover
! NGRBMCC  - 187 Medium cloud cover
! NGRBHCC  - 188 High cloud cover
! NGRBSUND - 189 Sunshine duration
! NGRBEWOV - 190 EW component of sub-grid scale orographic variance
! NGRBNSOV - 191 NS component of sub-grid scale orographic variance
! NGRBNWOV - 192 NWSE component of sub-grid scale orographic variance
! NGRBNEOV - 193 NESW component of sub-grid scale orographic variance
! NGRBBTMP - 194 Brightness temperature (K)
! NGRBLGWS - 195 Latitudinal component of gravity wave stress
! NGRBMGWS - 196 Meridional component of gravity wave stress
! NGRBGWD  - 197 Gravity wave dissipation
! NGRBSRC  - 198 Skin reservoir content
! NGRBVEG  - 199 Percentage of vegetation
! NGRBVSO  - 200 variance of sub-grid scale orogrophy
! NGRBMX2T - 201 Maximum temperature at 2m since last post-processing
! NGRBMN2T - 202 Minimum temperature at 2m since last post-processing
! NGRBO3   - 203 Ozone mixing ratio (EC prognostic ozone)
! NGRBPAW  - 204 Precipitation analysis weights
! NGRBRO   - 205 Runoff
! NGRBTCO3 - 206 Total column ozone 
! NGRB10SI - 207 Not used?
! NGRBTSRC - 208 Top solar radiation clear sky 
! NGRBTTRC - 209 Top thermal radiation clear sky
! NGRBSSRC - 210 Surface solar radiation clear sky
! NGRBSTRC - 211 Surface thermal radiation clear sky

! NGRBTISR - 212 TOA incident solar radiation

!-- bunch of codes, confusing in their use ...
! NGRBDHR  - 214 Diabatic heating by radiation ?
! NGRBDHVD - 215 Diabatic heating by vertical diffusion?
! NGRBDHCC - 216 Diabatic heating by cumulus convection?
! NGRBDHLC - 217 Diabatic heating by large-scale condensation?
! NGRBVDZW - 218 INTSURFTEMPERATU (vertical diffusion of zonal wind?)
! NGRBVDMW - 219 PROFTEMPERATURE (vertical diffusion of meridional wind?) 

! NGRB221  - 221 Not used
! NGRBCTZW - 222 Convective tendency of zonal wind
! NGRBCTMW - 223 Convective tendency of meridional wind
! NGRBVDH  - 224 used in suafn1 (Vertical diffusion of humidity?)
! NGRBHTCC - 225 used in suafn1 (Humidity tendency by large-scale condensation)
! NGRBHTLC - 226 Not used? (defined in MARS)
! NGRBCRNH - 227 used in suafn1
! NGRBTP   - 228 Total precipitation
! NGRBIEWS - 229 Intantaneous X-surface stress
! NGRBINSS - 230 Intantaneous Y-surface stress
! NGRBISHF - 231 Intantaneous surface heat flux
! NGRBIE   - 232 Intantaneous moisture flux (evaporation)
! NGRBLSRH - 234 Logarithm of surface roughness length for heat
! NGRBSKT  - 235 Skin temperature
! NGRBSTL4 - 236 Soil temperature level 4
! NGRBTSN  - 238 Temperature of snow layer
! NGRBCSF  - 239 Convective snow-fall
! NGRBLSF  - 240 Large scale snow-fall
! NGRBACF  - 241 Not used
! NGRBALW  - 242 Not used
! NGRBFAL  - 243 Forecast albedo
! NGRBFSR  - 244 Forecast surface roughness
! NGRBFLSR - 245 Forecast logarithm of surface roughness for heat
! NGRBCLWC - 246 Cloud liquid water content
! NGRBCIWC - 247 Cloud ice water content
! NGRBCC   - 248 Cloud cover
! NGRB100U - 228246 100m u wind
! NGRB100V - 228247 100m v wind
! NGRBDNDZN - 228015 Minimum refractivity gradient inside trapping layer
! NGRBDNDZA - 228016 Mean refractivity gradient inside trapping layer
! NGRBDCTB  - 228017 Duct base height
! NGRBTPLB  - 228018 Trapping layer base height
! NGRBTPLT  - 228019 Trapping layer top height

!-- ocean fields in Table 151 ---------------------
! NGRBOCT   - 128 *In situ* ocean temperature
! NGRBOCS   - 130 salinity
! NGRBOCU   - 131 zonal velocity U
! NGRBOCV   - 132 meridional velocity V
! NGRBOCVVS - 135 viscosity
! NGRBOCVDF - 136 diffusibity
! NGRBOCDEP - 137 bathymetry (bottom layer depth)
! NGRBOCLDP - 176 layer thickness (scalar & vector)
! NGRBOCLZ  - 213 layer depth
! NGRBADVT  - 214 correction term for temperature 
! NGRBADVS  - 215 correction term for salinity

!-- aerosols in Table 210 -------------------------
! NGRBAERMR01 - 001 aerosol mixing ratio 1
! NGRBAERMR02 - 002 aerosol mixing ratio 2
! NGRBAERMR03 - 003 aerosol mixing ratio 3
! NGRBAERMR04 - 004 aerosol mixing ratio 4
! NGRBAERMR05 - 005 aerosol mixing ratio 5
! NGRBAERMR06 - 006 aerosol mixing ratio 6
! NGRBAERMR07 - 007 aerosol mixing ratio 7
! NGRBAERMR08 - 008 aerosol mixing ratio 8
! NGRBAERMR09 - 009 aerosol mixing ratio 9
! NGRBAERMR10 - 010 aerosol mixing ratio 10
! NGRBAERMR11 - 011 aerosol mixing ratio 11
! NGRBAERMR12 - 012 aerosol mixing ratio 12
! NGRBAERMR13 - 013 aerosol mixing ratio 13
! NGRBAERMR14 - 014 aerosol mixing ratio 14
! NGRBAERMR15 - 015 aerosol mixing ratio 15
! NGRBAERGN01 - 016 aerosol gain acc. 1 2D
! NGRBAERGN02 - 017 aerosol gain acc. 2 2D
! NGRBAERGN03 - 018 aerosol gain acc. 3 2D
! NGRBAERGN04 - 019 aerosol gain acc. 4 2D
! NGRBAERGN05 - 020 aerosol gain acc. 5 2D
! NGRBAERGN06 - 021 aerosol gain acc. 6 2D
! NGRBAERGN07 - 022 aerosol gain acc. 7 2D
! NGRBAERGN08 - 023 aerosol gain acc. 8 2D
! NGRBAERGN09 - 024 aerosol gain acc. 9 2D
! NGRBAERGN10 - 025 aerosol gain acc. 10 2D
! NGRBAERGN11 - 026 aerosol gain acc. 11 2D
! NGRBAERGN12 - 027 aerosol gain acc. 12 2D
! NGRBAERGN13 - 028 aerosol gain acc. 13 2D
! NGRBAERGN14 - 029 aerosol gain acc. 14 2D
! NGRBAERGN15 - 030 aerosol gain acc. 15 2D

! NGRBAERLS01 - 031 black carbon biog.      clim2D 
! NGRBAERLS02 - 032 black carbon fossil     clim2D
! NGRBAERLS03 - 033 organic matter biog.    clim2D
! NGRBAERLS04 - 034 organic amtter fossil   clim2D
! NGRBAERLS05 - 035 sulphate low-level      clim2D
! NGRBAERLS06 - 036 sulphate high-level     clim2D
! NGRBAERLS07 - 037 volcanic continuous     clim2D
! NGRBAERLS08 - 038 volcanic explosive      clim2D
! NGRBAERLS09  - 039 secondary organic 	    clim2D
! NGRBAERLS10 - 040 black carbon GFED 		2D
! NGRBAERLS11 - 041 organic matter GFED 	2D
! NGRBAERLS12 - 042 sulphate GFED               2D 

! NGRBAERLS13 - 043 aerosol loss acc. 13        2D
! NGRBAERLS14 - 044 aerosol loss acc. 14        2D
! NGRBAERLS15 - 045 aerosol loss acc. 15        2D
! NGRBAERPR   - 046 aerosol precursor mixing ratio 
! NGRBAERSM   - 047 small aerosols mixing ratio 
! NGRBAERLG   - 048 large aerosols mixing ratio 
! NGRBAODPR   - 049 aerosol precursor opt.depth 2D
! NGRBAODSM   - 050 small aerosols opt. depth   2D
! NGRBAODLG   - 051 large aerosols opt. depth   2D
! NGRBAERDEP  - 052 dust emission potential clim2D 
! NGRBAERLTS  - 053 lifting threshold speed clim2D
! NGRBAERSCC  - 054 soli clay content       clim2D

! ERA40 DIAGNOSTIC FIELDS
! NGRBMINERA    - 162100  Minimum identifier for ERA40 diagnostic fields
! NGRBMAXERA    - 162113  Maximum identifier for ERA40 diagnostic fields

! EC-Earth diagnostic fields
! NGRBMINECE  - 126001 Minimum identifier for EC-Earth diagnostic fields
! NGRBMAXECE  - 126255 Maximum identifier for EC-Earth diagnostic fields

INTEGER(KIND=JPIM) :: NGRBPT    =  3
INTEGER(KIND=JPIM) :: NGRBSRO   =  8
INTEGER(KIND=JPIM) :: NGRBSSRO  =  9
INTEGER(KIND=JPIM) :: NGRBALUVP = 15
INTEGER(KIND=JPIM) :: NGRBALUVD = 16
INTEGER(KIND=JPIM) :: NGRBALNIP = 17
INTEGER(KIND=JPIM) :: NGRBALNID = 18
INTEGER(KIND=JPIM) :: NGRBPARCS = 20
INTEGER(KIND=JPIM) :: NGRBUCTP  = 21
INTEGER(KIND=JPIM) :: NGRBUCLN  = 22
INTEGER(KIND=JPIM) :: NGRBUCDV  = 23
INTEGER(KIND=JPIM) :: NGRBCVL  = 27
INTEGER(KIND=JPIM) :: NGRBCVH  = 28
INTEGER(KIND=JPIM) :: NGRBTVL  = 29
INTEGER(KIND=JPIM) :: NGRBTVH  = 30
INTEGER(KIND=JPIM) :: NGRBCI   = 31
INTEGER(KIND=JPIM) :: NGRBASN  = 32
INTEGER(KIND=JPIM) :: NGRBRSN  = 33
INTEGER(KIND=JPIM) :: NGRBSSTK  = 34
INTEGER(KIND=JPIM) :: NGRBISTL1 = 35
INTEGER(KIND=JPIM) :: NGRBISTL2 = 36
INTEGER(KIND=JPIM) :: NGRBISTL3 = 37
INTEGER(KIND=JPIM) :: NGRBISTL4 = 38
INTEGER(KIND=JPIM) :: NGRBSWVL1 = 39
INTEGER(KIND=JPIM) :: NGRBSWVL2 = 40
INTEGER(KIND=JPIM) :: NGRBSWVL3 = 41
INTEGER(KIND=JPIM) :: NGRBSWVL4 = 42
INTEGER(KIND=JPIM) :: NGRBSLT = 43
INTEGER(KIND=JPIM) :: NGRBES   = 44
INTEGER(KIND=JPIM) :: NGRBSMLT = 45
INTEGER(KIND=JPIM) :: NGRB10FG = 49
INTEGER(KIND=JPIM) :: NGRBLSPF = 50

INTEGER(KIND=JPIM) :: NGRBMONT = 53
INTEGER(KIND=JPIM) :: NGRBPRES  = 54

INTEGER(KIND=JPIM) :: NGRBUVB   = 57
INTEGER(KIND=JPIM) :: NGRBPAR   = 58
INTEGER(KIND=JPIM) :: NGRBCAPE = 59
INTEGER(KIND=JPIM) :: NGRBPV   = 60
INTEGER(KIND=JPIM) :: NGRBLAIL   = 66
INTEGER(KIND=JPIM) :: NGRBLAIH   = 67

INTEGER(KIND=JPIM) :: NGRBSDFOR  = 74

INTEGER(KIND=JPIM) :: NGRBCRWC = 75
INTEGER(KIND=JPIM) :: NGRBCSWC = 76

INTEGER(KIND=JPIM) :: NGRBETADOT = 77
INTEGER(KIND=JPIM) :: NGRBTCLW = 78
INTEGER(KIND=JPIM) :: NGRBTCIW = 79
INTEGER(KIND=JPIM) :: NGRBTCRW = 228089
INTEGER(KIND=JPIM) :: NGRBTCSW = 228090
! LARPEGE
INTEGER(KIND=JPIM) :: NGRBSPD = 80
INTEGER(KIND=JPIM) :: NGRBSVD = 81
! LECMWF
INTEGER(KIND=JPIM) :: NGRB080 = 80
INTEGER(KIND=JPIM) :: NGRB081 = 81

INTEGER(KIND=JPIM) :: NGRBLIT = 82

INTEGER(KIND=JPIM) :: NGRBSF6APF  = 210185
! INTEGER(KIND=JPIM) :: NGRBMINXTRA  = 082
! INTEGER(KIND=JPIM) :: NGRBMAXXTRA  = 117
INTEGER(KIND=JPIM) :: NGRBMINXTRA=126001
INTEGER(KIND=JPIM) :: NGRBMAXXTRA=126255

INTEGER(KIND=JPIM) :: NGRB082  = 082
INTEGER(KIND=JPIM) :: NGRB083  = 083
INTEGER(KIND=JPIM) :: NGRB084  = 084
INTEGER(KIND=JPIM) :: NGRB085  = 085
INTEGER(KIND=JPIM) :: NGRB086  = 086
INTEGER(KIND=JPIM) :: NGRB087  = 087
INTEGER(KIND=JPIM) :: NGRB088  = 088
INTEGER(KIND=JPIM) :: NGRB089  = 089
INTEGER(KIND=JPIM) :: NGRB090  = 090
INTEGER(KIND=JPIM) :: NGRB091  = 091
INTEGER(KIND=JPIM) :: NGRB092  = 092
INTEGER(KIND=JPIM) :: NGRB093  = 093
INTEGER(KIND=JPIM) :: NGRB094  = 094
INTEGER(KIND=JPIM) :: NGRB095  = 095
INTEGER(KIND=JPIM) :: NGRB096  = 096
INTEGER(KIND=JPIM) :: NGRB097  = 097
INTEGER(KIND=JPIM) :: NGRB098  = 098
INTEGER(KIND=JPIM) :: NGRB099  = 099
INTEGER(KIND=JPIM) :: NGRB100  = 100
INTEGER(KIND=JPIM) :: NGRB101  = 101
INTEGER(KIND=JPIM) :: NGRB102  = 102
INTEGER(KIND=JPIM) :: NGRB103  = 103
INTEGER(KIND=JPIM) :: NGRB104  = 104
INTEGER(KIND=JPIM) :: NGRB105  = 105
INTEGER(KIND=JPIM) :: NGRB106  = 106
INTEGER(KIND=JPIM) :: NGRB107  = 107
INTEGER(KIND=JPIM) :: NGRB108  = 108
INTEGER(KIND=JPIM) :: NGRB109  = 109
INTEGER(KIND=JPIM) :: NGRB110  = 110
INTEGER(KIND=JPIM) :: NGRB111  = 111
INTEGER(KIND=JPIM) :: NGRB112  = 112
INTEGER(KIND=JPIM) :: NGRB113  = 113
INTEGER(KIND=JPIM) :: NGRB114  = 114
INTEGER(KIND=JPIM) :: NGRB115  = 115
INTEGER(KIND=JPIM) :: NGRB116  = 116
INTEGER(KIND=JPIM) :: NGRB117  = 117

INTEGER(KIND=JPIM) :: NGRB118  = 118
INTEGER(KIND=JPIM) :: NGRB119  = 119
INTEGER(KIND=JPIM) :: NGRB120  = 120

INTEGER(KIND=JPIM) :: NGRBMX2T6 = 121
INTEGER(KIND=JPIM) :: NGRBMN2T6 = 122
INTEGER(KIND=JPIM) :: NGRB10FG6 = 123
INTEGER(KIND=JPIM) :: NGRBEMIS  = 124

INTEGER(KIND=JPIM) :: NGRBAT   = 127
INTEGER(KIND=JPIM) :: NGRBBV   = 128
INTEGER(KIND=JPIM) :: NGRBZ    = 129
INTEGER(KIND=JPIM) :: NGRBT    = 130
INTEGER(KIND=JPIM) :: NGRBU    = 131
INTEGER(KIND=JPIM) :: NGRBV    = 132
INTEGER(KIND=JPIM) :: NGRBUCUR = 151131
INTEGER(KIND=JPIM) :: NGRBVCUR = 151132
INTEGER(KIND=JPIM) :: NGRBSSS  = 151130
INTEGER(KIND=JPIM) :: NGRBQ    = 133
INTEGER(KIND=JPIM) :: NGRBSP   = 134
INTEGER(KIND=JPIM) :: NGRBW    = 135
INTEGER(KIND=JPIM) :: NGRBTCW  = 136
INTEGER(KIND=JPIM) :: NGRBTCWV = 137
INTEGER(KIND=JPIM) :: NGRBVO   = 138
INTEGER(KIND=JPIM) :: NGRBSTL1 = 139
INTEGER(KIND=JPIM) :: NGRBSD   = 141
INTEGER(KIND=JPIM) :: NGRBLSP  = 142
INTEGER(KIND=JPIM) :: NGRBCP   = 143
INTEGER(KIND=JPIM) :: NGRBSF   = 144
INTEGER(KIND=JPIM) :: NGRBBLD  = 145
INTEGER(KIND=JPIM) :: NGRBSSHF = 146
INTEGER(KIND=JPIM) :: NGRBSLHF = 147
INTEGER(KIND=JPIM) :: NGRBCHNK = 148
INTEGER(KIND=JPIM) :: NGRBSNR  = 149
INTEGER(KIND=JPIM) :: NGRBTNR  = 150
INTEGER(KIND=JPIM) :: NGRBMSL  = 151
INTEGER(KIND=JPIM) :: NGRBLNSP = 152
INTEGER(KIND=JPIM) :: NGRBSWHR = 153
INTEGER(KIND=JPIM) :: NGRBLWHR = 154
INTEGER(KIND=JPIM) :: NGRBD    = 155
INTEGER(KIND=JPIM) :: NGRBGH   = 156
INTEGER(KIND=JPIM) :: NGRBR    = 157
INTEGER(KIND=JPIM) :: NGRBTSP  = 158
INTEGER(KIND=JPIM) :: NGRBBLH  = 159
INTEGER(KIND=JPIM) :: NGRBSDOR = 160
INTEGER(KIND=JPIM) :: NGRBISOR = 161
INTEGER(KIND=JPIM) :: NGRBANOR = 162
INTEGER(KIND=JPIM) :: NGRBSLOR = 163
INTEGER(KIND=JPIM) :: NGRBTCC  = 164
INTEGER(KIND=JPIM) :: NGRB10U  = 165
INTEGER(KIND=JPIM) :: NGRB10V  = 166
INTEGER(KIND=JPIM) :: NGRBZUST = 228003
INTEGER(KIND=JPIM) :: NGRBFDIR = 228021
INTEGER(KIND=JPIM) :: NGRBCDIR = 228022
INTEGER(KIND=JPIM) :: NGRBCBASE= 228023
INTEGER(KIND=JPIM) :: NGRB0DEGL= 228024
INTEGER(KIND=JPIM) :: NGRBVISIH= 228025
INTEGER(KIND=JPIM) :: NGRB10NU = 228131
INTEGER(KIND=JPIM) :: NGRB10NV = 228132
INTEGER(KIND=JPIM) :: NGRB100U = 228246
INTEGER(KIND=JPIM) :: NGRB100V = 228247
INTEGER(KIND=JPIM) :: NGRB2T   = 167
INTEGER(KIND=JPIM) :: NGRB2D   = 168
INTEGER(KIND=JPIM) :: NGRBSSRD = 169
INTEGER(KIND=JPIM) :: NGRBSTL2 = 170
INTEGER(KIND=JPIM) :: NGRBLSM  = 172
INTEGER(KIND=JPIM) :: NGRBSR   = 173
INTEGER(KIND=JPIM) :: NGRBAL   = 174
INTEGER(KIND=JPIM) :: NGRBSTRD = 175
INTEGER(KIND=JPIM) :: NGRBSSR  = 176
INTEGER(KIND=JPIM) :: NGRBSTR  = 177
INTEGER(KIND=JPIM) :: NGRBTSR  = 178
INTEGER(KIND=JPIM) :: NGRBTTR  = 179
INTEGER(KIND=JPIM) :: NGRBEWSS = 180
INTEGER(KIND=JPIM) :: NGRBNSSS = 181
INTEGER(KIND=JPIM) :: NGRBE    = 182
INTEGER(KIND=JPIM) :: NGRBSTL3 = 183
INTEGER(KIND=JPIM) :: NGRBCCC  = 185
INTEGER(KIND=JPIM) :: NGRBLCC  = 186
INTEGER(KIND=JPIM) :: NGRBMCC  = 187
INTEGER(KIND=JPIM) :: NGRBHCC  = 188
INTEGER(KIND=JPIM) :: NGRBSUND = 189
INTEGER(KIND=JPIM) :: NGRBEWOV = 190
INTEGER(KIND=JPIM) :: NGRBNSOV = 191
INTEGER(KIND=JPIM) :: NGRBNWOV = 192
INTEGER(KIND=JPIM) :: NGRBNEOV = 193
INTEGER(KIND=JPIM) :: NGRBBTMP = 194
INTEGER(KIND=JPIM) :: NGRBLGWS = 195
INTEGER(KIND=JPIM) :: NGRBMGWS = 196
INTEGER(KIND=JPIM) :: NGRBGWD  = 197
INTEGER(KIND=JPIM) :: NGRBSRC  = 198
INTEGER(KIND=JPIM) :: NGRBVEG  = 199
INTEGER(KIND=JPIM) :: NGRBVSO  = 200
INTEGER(KIND=JPIM) :: NGRBMX2T = 201
INTEGER(KIND=JPIM) :: NGRBMN2T = 202
INTEGER(KIND=JPIM) :: NGRBO3   = 203
INTEGER(KIND=JPIM) :: NGRBPAW  = 204
INTEGER(KIND=JPIM) :: NGRBRO   = 205
INTEGER(KIND=JPIM) :: NGRBTCO3 = 206
INTEGER(KIND=JPIM) :: NGRB10SI = 207
INTEGER(KIND=JPIM) :: NGRBTSRC = 208
INTEGER(KIND=JPIM) :: NGRBTTRC = 209
INTEGER(KIND=JPIM) :: NGRBSSRC = 210
INTEGER(KIND=JPIM) :: NGRBSTRC = 211

INTEGER(KIND=JPIM) :: NGRBDHR  = 214
INTEGER(KIND=JPIM) :: NGRBDHVD = 215
INTEGER(KIND=JPIM) :: NGRBDHCC = 216
INTEGER(KIND=JPIM) :: NGRBDHLC = 217
INTEGER(KIND=JPIM) :: NGRBVDZW = 218
INTEGER(KIND=JPIM) :: NGRBVDMW = 219

INTEGER(KIND=JPIM) :: NGRBTISR= 212
INTEGER(KIND=JPIM) :: NGRBVIMD = 213

INTEGER(KIND=JPIM) :: NGRBCTZW = 222
INTEGER(KIND=JPIM) :: NGRBCTMW = 223
INTEGER(KIND=JPIM) :: NGRBVDH  = 224
INTEGER(KIND=JPIM) :: NGRBHTCC = 225
INTEGER(KIND=JPIM) :: NGRBHTLC = 226
INTEGER(KIND=JPIM) :: NGRBCRNH = 227
INTEGER(KIND=JPIM) :: NGRBTP   = 228
INTEGER(KIND=JPIM) :: NGRBIEWS = 229
INTEGER(KIND=JPIM) :: NGRBINSS = 230
INTEGER(KIND=JPIM) :: NGRBISHF = 231
INTEGER(KIND=JPIM) :: NGRBIE   = 232
INTEGER(KIND=JPIM) :: NGRBLSRH = 234
INTEGER(KIND=JPIM) :: NGRBSKT  = 235
INTEGER(KIND=JPIM) :: NGRBSTL4 = 236
INTEGER(KIND=JPIM) :: NGRBTSN  = 238
INTEGER(KIND=JPIM) :: NGRBCSF  = 239
INTEGER(KIND=JPIM) :: NGRBLSF  = 240
INTEGER(KIND=JPIM) :: NGRBACF  = 241
INTEGER(KIND=JPIM) :: NGRBALW  = 242
INTEGER(KIND=JPIM) :: NGRBFAL  = 243
INTEGER(KIND=JPIM) :: NGRBFSR  = 244
INTEGER(KIND=JPIM) :: NGRBFLSR = 245
INTEGER(KIND=JPIM) :: NGRBCLWC = 246
INTEGER(KIND=JPIM) :: NGRBCIWC = 247
INTEGER(KIND=JPIM) :: NGRBCC   = 248
INTEGER(KIND=JPIM) :: NGRBAIW  = 249
INTEGER(KIND=JPIM) :: NGRBICE  = 250
INTEGER(KIND=JPIM) :: NGRBATTE = 251
INTEGER(KIND=JPIM) :: NGRBATHE = 252
INTEGER(KIND=JPIM) :: NGRBATZE = 253
INTEGER(KIND=JPIM) :: NGRBATMW = 254
INTEGER(KIND=JPIM) :: NGRB255  = 255

!-- ducting diagnostics -- Table 228 ---------------

INTEGER(KIND=JPIM) :: NGRBDNDZN = 228015
INTEGER(KIND=JPIM) :: NGRBDNDZA = 228016
INTEGER(KIND=JPIM) :: NGRBDCTB  = 228017
INTEGER(KIND=JPIM) :: NGRBTPLB  = 228018
INTEGER(KIND=JPIM) :: NGRBTPLT  = 228019
INTEGER(KIND=JPIM) :: NGRBASCAT_SM_CDFA  = 228253
INTEGER(KIND=JPIM) :: NGRBASCAT_SM_CDFB  = 228254
!-- ocean mixed layer -- Table 151 ----------------
INTEGER(KIND=JPIM) :: NGRBOCT   = 151128 !98 
INTEGER(KIND=JPIM) :: NGRBOCS   = 151130 !100 
INTEGER(KIND=JPIM) :: NGRBOCU   = 151131 !101 
INTEGER(KIND=JPIM) :: NGRBOCV   = 151132 !102 
INTEGER(KIND=JPIM) :: NGRBOCVVS = 151135 !105 
INTEGER(KIND=JPIM) :: NGRBOCVDF = 151136 !106 
INTEGER(KIND=JPIM) :: NGRBOCDEP = 151137 !107 
INTEGER(KIND=JPIM) :: NGRBOCLDP = 151176 !108 
INTEGER(KIND=JPIM) :: NGRBOCLZ  = 151213 !109 
INTEGER(KIND=JPIM) :: NGRBADVT  = 151214 !110 
INTEGER(KIND=JPIM) :: NGRBADVS  = 151215 !111
INTEGER(KIND=JPIM) :: NGRBOCUC  = 151216 !112
INTEGER(KIND=JPIM) :: NGRBOCVC  = 151217 !113
INTEGER(KIND=JPIM) :: NGRBUSTRC = 151218 !114
INTEGER(KIND=JPIM) :: NGRBVSTRC = 151219 !115

!-- aerosols -- Table 210 --------------------------
INTEGER(KIND=JPIM) :: NGRBAERMR01=210001
INTEGER(KIND=JPIM) :: NGRBAERMR02=210002
INTEGER(KIND=JPIM) :: NGRBAERMR03=210003
INTEGER(KIND=JPIM) :: NGRBAERMR04=210004
INTEGER(KIND=JPIM) :: NGRBAERMR05=210005
INTEGER(KIND=JPIM) :: NGRBAERMR06=210006
INTEGER(KIND=JPIM) :: NGRBAERMR07=210007
INTEGER(KIND=JPIM) :: NGRBAERMR08=210008
INTEGER(KIND=JPIM) :: NGRBAERMR09=210009
INTEGER(KIND=JPIM) :: NGRBAERMR10=210010
INTEGER(KIND=JPIM) :: NGRBAERMR11=210011
INTEGER(KIND=JPIM) :: NGRBAERMR12=210012
INTEGER(KIND=JPIM) :: NGRBAERMR13=210013
INTEGER(KIND=JPIM) :: NGRBAERMR14=210014
INTEGER(KIND=JPIM) :: NGRBAERMR15=210015

INTEGER(KIND=JPIM) :: NGRBAERGN01=210016
INTEGER(KIND=JPIM) :: NGRBAERGN02=210017
INTEGER(KIND=JPIM) :: NGRBAERGN03=210018
INTEGER(KIND=JPIM) :: NGRBAERGN04=210019
INTEGER(KIND=JPIM) :: NGRBAERGN05=210020
INTEGER(KIND=JPIM) :: NGRBAERGN06=210021
INTEGER(KIND=JPIM) :: NGRBAERGN07=210022
INTEGER(KIND=JPIM) :: NGRBAERGN08=210023
INTEGER(KIND=JPIM) :: NGRBAERGN09=210024
INTEGER(KIND=JPIM) :: NGRBAERGN10=210025
INTEGER(KIND=JPIM) :: NGRBAERGN11=210026
INTEGER(KIND=JPIM) :: NGRBAERGN12=210027
INTEGER(KIND=JPIM) :: NGRBAERGN13=210028
INTEGER(KIND=JPIM) :: NGRBAERGN14=210029
INTEGER(KIND=JPIM) :: NGRBAERGN15=210030

INTEGER(KIND=JPIM) :: NGRBAERLS01  =210031
INTEGER(KIND=JPIM) :: NGRBAERLS02  =210032
INTEGER(KIND=JPIM) :: NGRBAERLS03  =210033
INTEGER(KIND=JPIM) :: NGRBAERLS04  =210034
INTEGER(KIND=JPIM) :: NGRBAERLS05  =210035
INTEGER(KIND=JPIM) :: NGRBAERLS06  =210036
INTEGER(KIND=JPIM) :: NGRBAERLS07  =210037
INTEGER(KIND=JPIM) :: NGRBAERLS08  =210038
INTEGER(KIND=JPIM) :: NGRBAERLS09   =210039
INTEGER(KIND=JPIM) :: NGRBAERLS10  =210040
INTEGER(KIND=JPIM) :: NGRBAERLS11  =210041
INTEGER(KIND=JPIM) :: NGRBAERLS12  =210042

INTEGER(KIND=JPIM) :: NGRBAERLS13=210043
INTEGER(KIND=JPIM) :: NGRBAERLS14=210044
INTEGER(KIND=JPIM) :: NGRBAERLS15=210045

INTEGER(KIND=JPIM) :: NGRBAERPR  =210046
INTEGER(KIND=JPIM) :: NGRBAERSM  =210047
INTEGER(KIND=JPIM) :: NGRBAERLG  =210048
INTEGER(KIND=JPIM) :: NGRBAODPR  =210049
INTEGER(KIND=JPIM) :: NGRBAODSM  =210050
INTEGER(KIND=JPIM) :: NGRBAODLG  =210051
INTEGER(KIND=JPIM) :: NGRBAERDEP =210052
INTEGER(KIND=JPIM) :: NGRBAERLTS =210053
INTEGER(KIND=JPIM) :: NGRBAERSCC =210054

INTEGER(KIND=JPIM) ::  NGRBMINERA    = 162100 
INTEGER(KIND=JPIM) ::  NGRBMAXERA    = 162113

!---------------------------------------------------
INTEGER(KIND=JPIM) :: NGRBCO2OF   = 210067
INTEGER(KIND=JPIM) :: NGRBCO2NBF  = 210068
INTEGER(KIND=JPIM) :: NGRBCO2APF  = 210069
INTEGER(KIND=JPIM) :: NGRBCO2FIRE = 210080
INTEGER(KIND=JPIM) :: NGRBCH4F    = 210070
INTEGER(KIND=JPIM) :: NGRBCH4FIRE = 210082

INTEGER(KIND=JPIM) :: NGRBNOXLOG = 210129

!---EC-Earth -- Table 126 --------------------------
INTEGER(KIND=JPIM) :: NGRBMINECE = 126001
INTEGER(KIND=JPIM) :: NGRBMAXECE = 126255

!  Aerosol-cloud interactions
INTEGER(KIND=JPIM) :: NGRBCDNC = 126020                    ! CDNC            Cloud Liquid Droplet Number Concentration  One component in CDNC computation
INTEGER(KIND=JPIM) :: NGRBREFF = 126021                    ! Re_liq          effective radius of the liquid droplets    This variable is not requested by CMIP6 AerChem, but it has an cmor name: reffclws 
INTEGER(KIND=JPIM) :: NGRBLIQCLDTIME = 126022              ! Liq cloud time  Liquid cloud time (needed for CDNC)        One component in CDNC computation

!  COSP outputs
INTEGER(KIND=JPIM) :: NGRB_CALIPSO_LOW_CLD_FRAC = 126040   ! CALIPSO_LCC
INTEGER(KIND=JPIM) :: NGRB_CALIPSO_MID_CLD_FRAC = 126041   ! CALIPSO_MCC
INTEGER(KIND=JPIM) :: NGRB_CALIPSO_HIGH_CLD_FRAC = 126042  ! CALIPSO_HCC
INTEGER(KIND=JPIM) :: NGRB_CALIPSO_TOTAL_CLD_FRAC = 126043 ! CALIPSO_TCC
INTEGER(KIND=JPIM) :: NGRB_ISCCP_TOTAL_CLD_FRAC = 126044   ! ISCCP_TOTALCLD
INTEGER(KIND=JPIM) :: NGRB_ISCCP_CLD_TOP_PRESSURE = 126045 ! ISCCP_MEANPTOP
INTEGER(KIND=JPIM) :: NGRB_ISCCP_CLD_ALBEDO = 126046       ! ISCCP_MEANALBCLD
INTEGER(KIND=JPIM) :: NGRB_MODIS_TOTAL_CLD_FRAC = 126047   ! MODIS CLDF_TOT                                             This variable is not requested by any CMIP6 data request in which EC-Earth3* participates
INTEGER(KIND=JPIM) :: NGRB_MODIS_WATER_CLD_FRAC = 126048   ! MODIS CLDF_WAT                                             This variable is not requested by any CMIP6 data request in which EC-Earth3* participates
INTEGER(KIND=JPIM) :: NGRB_MODIS_ICE_CLD_FRAC = 126049     ! MODIS CLDF_ICE                                             This variable is not requested by any CMIP6 data request in which EC-Earth3* participates
INTEGER(KIND=JPIM) :: NGRB_COSP_3D = 126050                !

!  Double call of radiation, ToA and surface radiative fluxes
INTEGER(KIND=JPIM) :: NGRB_SW_CS_TOA_CLN = 126068          ! clear SW TOA    (aerosol free)
INTEGER(KIND=JPIM) :: NGRB_SW_ALL_TOA_CLN = 126069         ! total SW TOA    (aerosol free)
INTEGER(KIND=JPIM) :: NGRB_SW_CS_SRF_CLN = 126070          ! clear SW surf   (aerosol free)                             This variable is not requested by any CMIP6 data request in which EC-Earth3* participates
INTEGER(KIND=JPIM) :: NGRB_SW_ALL_SRF_CLN = 126071         ! total SW surf   (aerosol free)                             This variable is not requested by any CMIP6 data request in which EC-Earth3* participates
INTEGER(KIND=JPIM) :: NGRB_LW_CS_TOA_CLN = 126072          ! clear LW TOA    (aerosol free)
INTEGER(KIND=JPIM) :: NGRB_LW_ALL_TOA_CLN = 126073         ! total LW TOA    (aerosol free)
INTEGER(KIND=JPIM) :: NGRB_LW_CS_SRF_CLN = 126074          ! clear LW surf   (aerosol free)                             This variable is not requested by any CMIP6 data request in which EC-Earth3* participates
INTEGER(KIND=JPIM) :: NGRB_LW_ALL_SRF_CLN = 126075         ! total LW surf   (aerosol free)                             This variable is not requested by any CMIP6 data request in which EC-Earth3* participates
!INTEGER(KIND=JPIM) :: NGRB_SW_UPW_ALL_TOA_CLN = 126076     ! total upwelling SW TOA clean (aerosol free)
!INTEGER(KIND=JPIM) :: NGRB_SW_UPW_CS_TOA_CLN = 126077      ! clear upwelling SW TOA clean (aerosol free)
!INTEGER(KIND=JPIM) :: NGRB_SW_DOWNW_CS_SRF_CLN = 126078    ! clear downwelling SW surf clean (aerosol free)
!INTEGER(KIND=JPIM) :: NGRB_SW_UPW_ALL_TOA = 126079         ! total upwelling SW TOA
!INTEGER(KIND=JPIM) :: NGRB_SW_UPW_CS_TOA = 126080          ! clear upwelling SW TOA
!INTEGER(KIND=JPIM) :: NGRB_SW_DOWNW_CS_SRF = 126081        ! clear downwelling SW surf
!  Double call of radiation, radiative heating rate
INTEGER(KIND=JPIM) :: NGRB_HR = 126076                     ! Temperature tentendency with aerosols                      This variable is not requested by any CMIP6 data request in which EC-Earth3* participates
INTEGER(KIND=JPIM) :: NGRB_HR_CLN = 126077                 ! Temperature tentendency clean                              This variable is not requested by any CMIP6 data request in which EC-Earth3* participates

! DynVarMIP variables
INTEGER(KIND=JPIM) :: NGRB_UTENDNOGW = 126120              ! u-tendency from NOGW
INTEGER(KIND=JPIM) :: NGRB_UTENDOGW  = 126121              ! u-tendency from OGW
INTEGER(KIND=JPIM) :: NGRB_VTENDNOGW = 126122              ! v-tendency from NOGW
INTEGER(KIND=JPIM) :: NGRB_VTENDOGW  = 126123              ! v-tendency from OGW
INTEGER(KIND=JPIM) :: NGRB_TNTMP     = 126124              ! t-tendency model physics
INTEGER(KIND=JPIM) :: NGRB_TNTRL     = 126125              ! t-tendency LW radiation
INTEGER(KIND=JPIM) :: NGRB_TNTRS     = 126126              ! t-tendency SW radiation
INTEGER(KIND=JPIM) :: NGRB_TNTRLCS   = 126127              ! t-tendency LW radiation (clear sky)
INTEGER(KIND=JPIM) :: NGRB_TNTRSCS   = 126128              ! t-tendency SW radiation (clear sky)
INTEGER(KIND=JPIM) :: NGRB_TNTC      = 126129              ! t-tendency convection                                      Same as 126.105
INTEGER(KIND=JPIM) :: NGRB_TNTSCP    = 126130              ! t-tendency large-scale precip
INTEGER(KIND=JPIM) :: NGRB_TNTNOGW   = 126131              ! t-tendency NOGW                                            CMIP6 data req ?
INTEGER(KIND=JPIM) :: NGRB_TNTOGW    = 126132              ! t-tendency OGW                                             CMIP6 data req ?
! --needed? appears to be internal
INTEGER(KIND=JPIM) :: NGRB_TNTVD      = 126133             !                                                            This variable is not requested by any CMIP6 data request in which EC-Earth3* participates

! Free use from here on
INTEGER(KIND=JPIM) :: NGRBECEFREE = 126134
!     ------------------------------------------------------------------
END MODULE YOM_GRIB_CODES
