![](media/image1.emf){width="0.20833333333333334in"
height="0.1527777777777778in"}![](media/image1.emf){width="0.20833333333333334in"
height="0.1527777777777778in"}![](media/image1.emf){width="0.20833333333333334in"
height="0.1527777777777778in"}

Common LDAS Outputs

![](media/image2.emf){width="0.0in" height="2.0833333333333332e-2in"}

**COMMON NLDAS OUTPUTS**

**(Version 3.3 - 15 Sep 00)**

(Author Ken Mitchell of NCEP/EMC at Kenneth.Mitchell@noaa.gov)

**I. Introduction**

This document provides the current consensus by LDAS principals on the
common Land Surface Model (LSM) outputs to be generated by the LSMs
participating in the LDAS project. Reaching such a consensus is a
difficult and painstaking process. This consensus represents at least
the third major iteration on common LDAS output over the last year or
more. Although this consensus will undoubtedly evolve further in the
future, the LDAS group has decided to freeze the consensus at this point
until the three initial participating LSMs (NOAH, MOSAIC, VIC) have
achieved a baseline of producing common output in this Version 3.

**II. Influence of ALMA LSM output standards**

The Version 3 consensus here was arrived at during the quasi-monthly
LDAS meeting on 09 Jun 00. The previous Version 2 consensus was reached
at the previous monthly LDAS meeting on 05 May 00 (see posting of
Version 2 at end of those meeting minutes at the LDAS web site \--
http://ldas.gsfc.nasa.gov). Both of these iterations were prompted by a
desire by the LDAS group to adhere to a reasonable extent to the
proposed LSM output standards emerging in the new GEWEX LSM initiative
known as

A\) [GLASS]{.underline} (Global Land Atmosphere System Study):

http://hydro.iis.u-tokyo.ac.jp/GLASS/

> and its sub-initiative

B\) [ALMA]{.underline} (Assistance for Land Surface Modeling Activities)

http://www.lmd.jussieu.fr/\~polcher/ALMA/dataex_main.html

The common LSM output standards proposed by ALMA are available from

http://www.lmd.jussieu.fr/\~polcher/ALMA/convention_output.html

At the latter site, the ALMA output standards are classified into [three
priorities]{.underline}:

1\) mandatory (\"man\")

2\) recommended (\"rec\")

3\) optional (\"opt\")

Additionally, the ALMA output standards are grouped in the following
[seven categories]{.underline}:

1\) Energy balance components

2\) Water balance components

3\) Surface state variables

4\) Sub-surface state variables

5\) evaporation components

6\) streamflow

7\) cold season processes

One challenge is that the present ALMA LSM output standards are beta
versions and are themselves presently evolving and subject to change.
The earlier Version 2 iteration (05 May 00) on common LDAS output
succeeded in the inclusion of all ALMA [mandatory]{.underline} output
variables posted at the ALMA site at the end of April. By early June,
the posted ALMA standards had changed notably, and the Version 3
iteration on common LDAS outputs here is in response to these ALMA
changes. [However, the LDAS group has some notable concerns with the
June 00 changes in ALMA standards and our Version 3 is not inclusive of
all the latest ALMA mandatory outputs .]{.underline} Generally below, we
note where Version 3 departs from June 00 ALMA mandatory standards, and
we discuss the reasons why. LDAS principals will meet with ALMA
principals at NCEP on 10 Aug 00 to discuss these reasons and related
issues.

**III. Format of LDAS common output**

The common LDAS LSM output will be [hourly]{.underline} gridded output,
on the common [LDAS grid]{.underline} (a uniform 0.125-degree lat/lon
grid), utilizing the common LDAS [land mask]{.underline} and common LDAS
[terrain heights]{.underline}, which are available from the LDAS web
site. The common output format will be the WMO International standard
for gridded fields known as GRIB (Gridded Binary). The GRIB format was
also chosen by the LDAS group for the common LDAS hourly input forcing
files, which have been generated in realtime by NCEP/EMC since mid-Apr
99. NASA/GSFC is reconstructing common LDAS input forcing in GRIB going
back to 1996.

GRIB is utilized by the major NWP centers worldwide, as well as by
widely used global reanalysis databases (e.g. NCEP/NCAR, ECMWF). GRIB
files internally include complete meta-data \"headers\" that describe
both the grid and physical field. These meta-data headers are known,
respectively, as the GDS (Grid Definition Section) and PDS (Product
Definition Section). Thus GRIB adheres to the general ALMA standard
requiring complete meta-data internally in each output file.

The GRIB PDS adheres to published GRIB standards for physical units. For
energy quantities like surface energy fluxes, the unit in both GRIB and
ALMA is watts/m\*\*2. However, for fluxes of water quantities
(precipitation, runoff, snowmelt), the GRIB unit is an
[accumulation]{.underline} (Kg/M\*\*2, i.e. mm of water depth) over the
output interval, which is at odds with the ALMA convention of an
[average rate]{.underline}. We keep to the GRIB accumulation convention
here, but the conversion of LDAS hourly accumulations to average rates
is a simple division by 3600 seconds (1 hour).

Public domain GRIB manuals and GRIB library software for a wide variety
of platforms can be obtained at the NCEP site at
http://www.emc.ncep.noaa.gov/mmb/gcp/grbunpk.html.

The LDAS web site will post the GDS for the common LDAS grid, as well as
the PDS for each physical field in the common LDAS output files.

The ALMA initiative itself is adopting a meta-data convention known as
GDT and a binary data compression scheme known as netCDF. ALMA is also
adopting choices of physical units that differ from the GRIB standards.
Thus in due time, the LDAS project will likely develop and post software
to convert LDAS GRIB output files to GDT/netCDF format of ALMA.

The hourly GRIB files of common LDAS output for Version 3 will each
consist of about 50-60 physical fields (records), described in the next
section.

**IV. Output variables in Version 3 of common LDAS output**

The common output list below is grouped into the seven ALMA physical
categories given in Sec. II above. For each chosen variable we list its
priority as one of the three ALMA priorities given in Sec. II. If the
given priority is preceded with the prefix \"A\" (\"L\"), this indicates
an ALMA (LDAS) priority. An LDAS prefix means a) the LDAS principals
have decided to add this output variable, despite its omission from the
ALMA output tables, or b) raise the priority above that indicated by
ALMA.

All output will consist of one value per grid point. For those LSMs such
as MOSAIC that carry sub-grid tiles, a single averaged value will be
output.

Energy fluxes will be time-averaged values over the one-hour LDAS output
interval. Water accumulations will be one hour accumulations.

The table entries below give the GRIB convention. The corresponding ALMA
convention will be added in a later update.

The tables will define the variable, give the GRIB variable name, the
unique GRIB variable identifier number (known as the GRIB parameter
number, or PDS Octet 9), the GRIB units, the GRIB sign convention, the
variable type as either averaged (avg), accumulated (acm), or
instantaneous (ins), and the priority.

**NOTE 1:** The **GRIB sign convention** for **fluxes** is **positive
upward** (e.g. a positive net flux would be an upward flux, i.e.
**typically an energy source to the [atmosphere]{.underline}**),
**unless** the direction of flux is indicated in the **name** of the
variable (e.g. the variable name \"downward solar radiation\"), in which
case the variable is always positive (or zero). The designation below of
\"Always\" under the positive sign-convention column strictly means
never negative (i.e. positive or zero).

**NOTE 2**: For quantities like precipitation, runoff, and snowmelt, the
**GRIB** convention is to provide **accumulations**, rather than the
ALMA convention of providing rates. Here the accumulations will be over
the LDAS hourly output interval.

**NOTE 3**: Any entry in the table denoted by \"\*\*\" means the entity
was assigned by the LDAS group, and not available from the GRIB tables.
**In particular, this means that the LDAS project has
[redefined]{.underline} the meaning of a given [GRIB parameter
number]{.underline}**. This was necessary because all possible GRIB
parameter numbers (limited to the allowable range of 1-255) had already
been pre-defined and did not include needed land-state entities.

**1.) [Energy balance components]{.underline}** (8 fields)

[Definition]{.underline} [Variable]{.underline} [GRIB#]{.underline}
[Positive]{.underline} [Unit]{.underline} [Type]{.underline}
[Priority]{.underline}

Net sfc shortwave radiation NSWRS 111 Upward W/m^2^ Avg A-man

Net sfc longwave radiation NLWRS 112 Upward W/m^2^ Avg A-man

Latent heat flux LHTFL 121 Upward W/m^2^ Avg A-man

Sensible heat flux SHTFL 122 Upward W/m^2^ Avg A-man

Ground heat flux GFLUX 155 Upward W/m^2^ Avg A-man

Snow phase change heat flux SNOHF 229 Solid to Liquid W/m^2^ Avg A-rec

Downward Sfc shortwave rad DSWRF 204 Always W/m^2^ Avg L-man

Downward Sfc longwave rad DLWRF 205 Always W/m^2^ Avg L-man

Since the GRIB flux sign convention is \"atmospheric-centric\" rather
than \"land-centric\" (i.e., land energy sources are negative rather
than positive) some examples are in order. Given the above sign
convention, the energy balance residual, say denoted by RES and ideally
zero, would be expressed as

RES = NSWRS+ NLWRS + LHTFL + SHTFL - GFLUX + SNOHF

All right-hand variable names are positive (upward flux) when
representing an energy sink to the land surface and negative when
representing a land surface energy source, except GFLUX and hence GFLUX
is subtracted. Given these sign conventions, during typical mid-day
solar heating, we would find all right-hand terms (including minus
GFLUX) to be positive (land surface energy sinks), except the large
negative net solar radiation (land surface energy source).

The above table includes all mandatory ALMA energy balance components,
plus the ALMA optional \"energy of fusion\" (denoted by GRIB name SNOHF
above), but omits all other energy components designated by ALMA as
\"recommended\" or \"optional\", as given in the Jun 00 version of the
ALMA tables.

**2.) [Water balance components]{.underline}** (8 fields)

[Definition]{.underline} [Variable]{.underline} [GRIB#]{.underline}
[Positive]{.underline} [Unit]{.underline} [Type]{.underline}
[Priority]{.underline}

Snowfall (frozen precipitation)^1^ ASNOW\*\* 131\*\* Always Kg/m^2^ Acm
A-man

Rainfall (unfrozen precipitation) ARAIN\*\* 132\*\* Always Kg/m~2~ Acm
A-man

Total evaporation (all sources) EVP 057 upward Kg/m^2^ Acm A-man

Surface runoff^2^ SSRUN 235 exit grid box Kg/m^2^ Acm A-man

Subsurface runoff^3^ BGRUN 234 exit grid box Kg/m^2^ Acm A-man

Snowmelt SNOM 099 solid to liquid Kg/m^2^ Acm A-man

Groundwater Recharge^4^ GWREC\*\* 133\*\* exit grid box Kg/m^2^ Acm
L-opt

Flood plain Recharge^5^ QREC\*\* 134\*\* enter grid box Kg/m^2^ Acm
A-opt

[Note]{.underline}: Individual sub-components of the total evaporation
are included in a table below.

[Note]{.underline}: The above table omits 2 ALMA mandatory and 2 ALMA
optional outputs. These four omitted outputs are the output
time-interval [change]{.underline} in 1) total active soil column
moisture, 2) snowpack water-equivalent, 3) canopy interception storage,
and 4) surface water storage (non-soil, non-snowpack, non-canopy \--
i.e. depressions, puddles, ponds, lakes, streambeds, river channels).
The rationale for omission is that the instantaneous state-variable
counterparts of these four entities are included as outputs in later
tables below, and hence their temporal changes can be simply calculated
by subtracting successive outputs.

[Footnote 1]{.underline}: Snowfall and rainfall in the common LDAS
output will be mutually exclusive at any given grid point. Specifically,
in the common LDAS [input forcing,]{.underline} the input precipitation
is a total precipitation without regard to frozen or unfrozen.
Furthermore, all LDAS models will use a common threshold of surface air
temperature to distinguish between rainfall (unfrozen precipitation) and
snowfall (frozen precipitation). Hence all LDAS models should have
identical and pointwise mutually exclusive rainfall and snowfall
outputs.

[Footnote 2]{.underline}: Here surface runoff is defined following ALMA:
runoff from the land-surface (non-infiltration) or fast response
subsurface storm-event runoff.

[Footnote 3]{.underline}: Here sub-surface runoff is defined following
ALMA: gravity drainage out the bottom of the active soil column or slow
response lateral flow, both of which enter the streambed.

[Footnote 4]{.underline}: Groundwater recharge is defined as the water
lost out the bottom of the active soil column to deep aquifer ground
water. This output is not an ALMA designated output, but it is needed to
close the water budget in those models that have water loss to deep
groundwater (e.g. the Sacramento Model), i.e., subsurface water exiting
active soil column but not entering streambed via surface or subsurface
runoff.

[Footnote 5]{.underline}: Flood plain recharge follows the ALMA
definition as recharge from the streams or rivers to the surrounding
flood plain.

**3.) [Surface State Variables:]{.underline}** (8 fields)

[Definition]{.underline} [Variable]{.underline} [GRIB#]{.underline}
[Positive]{.underline} [Unit]{.underline} [Type]{.underline}
[Priority]{.underline}

Snow temperature, depth-avg SNOWT\*\* 135\*\* Always K ins A-man^1^

Vegetation canopy temperature VEGT\*\* 136\*\* Always K ins A-man^1^

Bare soil surface temperature BARET\*\* 137\*\* Always K ins A-man^1^

Average surface temperature AVSFT\*\* 138\*\* Always K ins A-man

Effective radiative surface temp RADT\*\* 139\*\* Always K ins A-man^1^

Surface albedo, all wavelengths ALBDO 084 Always % ins A-man

Snowpack water equivalent WEASD 065 Always Kg/m^2^ ins A-man

Surface water storage^2^ SSTOR\*\* 150\*\* Always Kg/m^2^ ins A-man

Plant canopy sfc water storage^3^ CWAT 223 Always Kg/m^2^ ins L-man

[Note]{.underline}: The above table includes all ALMA output for this
category (surface states).

[Footnote 1]{.underline}: Output only if distinct from average surface
temperature (AVGSFCT). Many land models do not carry this temperature.

[Footnote 2]{.underline}: Defined in ALMA as total water storage other
than soil, snowpack, canopy (i.e. depressions, puddles, ponds, lakes,
streambed, river channel). Many land models do not define or carry this
storage.

[Footnote 3]{.underline}: We chose to list the canopy storage here in
the surface state variable section and flag it as an LDAS mandatory
variable. In the ALMA tables, this variable is listed in the evaporation
components table and flagged only as recommended.

**4.) [Subsurface State Variables:]{.underline}** (4 + N x 3 fields, N=#
soil layers)

[Definition]{.underline} [Variable]{.underline} [GRIB#]{.underline}
[Positive]{.underline} [Unit]{.underline} [Type]{.underline}
[Priority]{.underline}

Soil temperature each layer SOILT 085 Always K ins L-man

Total column soil moisture^1^ SOILM 086 Always Kg/m^2^ ins L-man

Root zone soil moisture^2^ SOILM 086 Always Kg/m^2^ ins A-man

Top 1-meter soil moisture^2^ SOILM 086 Always Kg/m^2^ ins L-man

Soil moisture in each layer^3^ SOILM 086 Always Kg/m^2^ ins A-man

Liquid soil moist each layer^4^ LSOIL\*\* 151\*\* Always Kg/m2 ins A-opt

Total soil column wetness^5^ MSTAV 207 Always % ins A-man

Root zone wetness^6^ MSTAV 207 Always % ins L-man

[Note]{.underline}: The above table includes all ALMA variables, plus
three LDAS-added variables.

[Note]{.underline}: The GRIB PDS will explicitly define the soil layer
depth or thickness over which each variable in the above list is
defined. From the layer thickness, volumetric soil moisture is easily
derived from the soil moisture content in above table.

[Footnote 1]{.underline}: Total soil moisture (liquid and frozen) in
entire active soil column.

[Footnote 2]{.underline}: Total soil moisture (liquid and frozen) in top
1-meter of soil column.

[Footnote 3]{.underline}: Total soil moisture (liquid and frozen) in
each model defined soil layer.

[Footnote 4]{.underline}: Liquid soil moisture (unfrozen) in each model
defined soil layer.

[Footnote 5]{.underline}: Over the entire active soil column, the
vertically integrated soil moisture divided by the maximum allowable
soil moisture.

[Footnote 6]{.underline}: Over the root zone, the vertically integrated
soil moisture divided by the maximum allowable soil moisture, both
exceeding the wilting point.

**5.) [Evaporation components:]{.underline}** (14 fields)

[Definition]{.underline} [Variable]{.underline} [GRIB#]{.underline}
[Positive]{.underline} [Unit]{.underline} [Type]{.underline}
[Priority]{.underline}

Canopy sfc water evaporation EVCW 200 Upward W/m^2^ avg L-man

Canopy transpiration TRANS 210 Upward W/m^2^ avg A-man

Bare soil evaporation EVBS 199 Upward W/m^2^ avg A-man

Open water evaporation EWATR\*\* 152\*\* Upward W/m^2^ avg A-rec

Snow evap (sublimation) SBSNO\*\* 173\*\* Upward W/m^2^ avg A-rec

Potential evaporation PEVPR 145 Upward W/m^2^ avg L-rec

Aerodynamic conductance ACOND\*\* 174\*\* Always M/S ins A-man

Canopy conductance CCOND\*\* 181\*\* Always M/S ins L-opt

Vegetation greenness VEG 087 Always % ins L-opt

LAI LAI\*\* 182\*\* Always \-- ins L-opt

sfc momentum roughness length SFCR 083 Always M ins L-opt

sfc heat roughness length SFCRH\*\* 183\*\* Always M ins L-opt

[Note]{.underline}: The above table includes all ALMA variables (though
canopy water storage was moved to table of surface state variables).

[Footnote 1]{.underline}: Total soil moisture (frozen and unfrozen)
available for transpiration (i.e. integrated over the entire root zone)

[Footnote 2]{.underline}: Over the root zone, the vertically integrated
soil moisture divided by the maximum allowable soil moisture, both
exceeding the wilting point.

**6.) [Streamflow :]{.underline}** (0 fields)

In the common LDAS output, streamflow will [not]{.underline} be output
as a gridded field. Rather it will be generated in a separate
post-processing step for chosen basins from the common gridded runoff
output, using the common LDAS streamflow routing code.

**7.) [Cold season processes:]{.underline}** (4 fields)

[Definition]{.underline} [Variable]{.underline} [GRIB#]{.underline}
[Positive]{.underline} [Unit]{.underline} [Type]{.underline}
[Priority]{.underline}

Snow depth SNOD 066 Always M ins A-rec

Snow cover SNOC 238 Always % ins A-opt

Snow albedo SALBD\*\* 184\*\* Always % ins A-rec

[Note]{.underline}: The LDAS project chooses not to carry the four
optional ALMA outputs related to freezing/thawing soil depths and sea
ice fraction and thickness.

**8. [Fixed fields:]{.underline}** (fields)

[Definition]{.underline} [Variable]{.underline} [GRIB#]{.underline}
[Positive]{.underline} [Unit]{.underline} [Type]{.underline}
[Priority]{.underline}

LDAS grid common land mask LAND 081 1-land/0-sea \-- fix L-rec

LDAS grid common terrain hgt HGT 007 Always M fix L-rec

Porosity^1^ POROS\*\* 218\*\* Always \-- fix L-rec

Wilting point^2^ WILT\*\* 219\*\* Always \-- fix L-rec

Field capacity^3^ FLDCP\*\* 220\*\* Always \-- fix L-rec

Plant stress threshold^4^ SMREF\*\* 221\*\* Always \-- fix L-rec

Bare soil evap cessation^5^ SMDRY\*\* 222\*\* Always \-- fix L-rec

Soil class index SOTYP 224 Always \-- fix L-rec

Vegetation class index VGTYP 225 Always \-- fix L-rec

[Note]{.underline}: These fixed fields would be output one time, rather
than hourly.

[Footnote 1]{.underline}: Volumetric soil moisture at soil saturation.

[Footnote 2]{.underline}: Volumetric soil moisture at which
transpiration ceases.

[Footnote 3]{.underline}: Volumetric soil moisture at hydraulic
conductivity = xxx.

[Footnote 4]{.underline}: Volumetric soil moisture at onset of
transpiration stress.

[Footnote 5]{.underline}: Volumetric soil moisture at which bare soil
evaporation ceases.

**V. GRIB conventions for \"GDS\" and \"PDS\" Arrays**

Calls to read/write routines in the Fortran GRIB library require the

pre-definition of the 1) Grid Definition Section (GDS) array and the 2)
Product Definition Section (PDS) array. The subroutine called from the
driving program for producing GRIB output is **putgb.f**. The PDS and
GDS information are passed as integer arrays into this routine. Below is
a portion of the documentation block at the top of subroutine
**putgb.f,** which describes these arrays.

C\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--

SUBROUTINE PUTGB(LUGB,KF,KPDS,KGDS,LB,F,IRET)

C\$\$\$ SUBPROGRAM DOCUMENTATION BLOCK

C

C NOTE: FOR MORE INFORMATION ON GRIB (WRITING, READING, ETC\...)

C see: http://www.emc.ncep.noaa.gov/mmb/gcp/grbunpk.html

C

C SUBPROGRAM: PUTGB PACKS AND WRITES A GRIB MESSAGE

C PRGMMR: IREDELL ORG: W/NMC23 DATE: 94-04-01

C

C ABSTRACT: PACK AND WRITE A GRIB MESSAGE.

C THIS SUBPROGRAM IS NEARLY THE INVERSE OF GETGB.

C

C PROGRAM HISTORY LOG:

C 94-04-01 IREDELL

C 95-10-31 IREDELL REMOVED SAVES AND PRINTS

C 00-07-28 MARSHALL PROVIDE MORE INFO IN DOC BLOCK FOR LDAS USERS

C

C USAGE: CALL PUTGB(LUGB,KF,KPDS,KGDS,LB,F,IRET)

C INPUT ARGUMENTS:

C LUGB INTEGER UNIT OF THE UNBLOCKED GRIB DATA FILE

C KF INTEGER NUMBER OF DATA POINTS (i.e, \# of LDAS gridpoints)

C KPDS INTEGER (25) PDS PARAMETERS

C KGDS INTEGER (22) GDS PARAMETERS (DOES NOT CHANGE!)

C LB LOGICAL\*1(KF) LAND/SEA MASK (0=.false., 1=.true.)

C F REAL(KF) RAW BINARY DATA FIELD OF LDAS OUTPUT

C

C OUTPUT:

C IRET RETURN CODE SIGNIFYING SUCCESS OF FAILURE OF

C PUTGB.f IN WRITING YOUR GRIB MESSAGE:

C 0 = ALL OK!

C

C

C

C THE 25 ELEMENTS OF THE KPDS ARRAY. FOR EACH FIELD WRITTEN AS

C A SINGLE GRIB MESSAGE, THE NON-CHANGING ELEMENTS (i.e, THE

C ELEMENTS THAT DO NOT SUPPLY VALID TIME INFORMATION) ARE SUPPLIED

C IN THE ACCOMPANYING TABLE.

C

C (1) - ID OF CENTER

C (2) - GENERATING PROCESS ID NUMBER

C (3) - GRID DEFINITION

C (4) - GDS/BMS FLAG (RIGHT ADJ COPY OF OCTET 8)

C (5) - INDICATOR OF PARAMETER

C (6) - TYPE OF LEVEL

C (7) - HEIGHT/PRESSURE , ETC OF LEVEL

C (8) - YEAR INCLUDING (CENTURY-1)

C (9) - MONTH OF YEAR

C (10) - DAY OF MONTH

C (11) - HOUR OF DAY

C (12) - MINUTE OF HOUR

C (13) - INDICATOR OF FORECAST TIME UNIT

C (14) - TIME RANGE 1

C (15) - TIME RANGE 2

C (16) - TIME RANGE FLAG

C (17) - NUMBER INCLUDED IN AVERAGE

C (18) - VERSION NR OF GRIB SPECIFICATION

C (19) - VERSION NR OF PARAMETER TABLE

C (20) - NR MISSING FROM AVERAGE/ACCUMULATION

C (21) - CENTURY OF REFERENCE TIME OF DATA

C (22) - UNITS DECIMAL SCALE FACTOR

C (23) - SUBCENTER NUMBER

C (24) - PDS BYTE 29, FOR NMC ENSEMBLE PRODUCTS

C 128 IF FORECAST FIELD ERROR

C 64 IF BIAS CORRECTED FCST FIELD

C 32 IF SMOOTHED FIELD

C WARNING: CAN BE COMBINATION OF MORE THAN 1

C (25) - PDS BYTE 30, NOT USED

C

C THE 22 ELEMENTS OF THE KGDS ARRAY FOR LAT/LON GRIDS.

C THIS ARRAY IS FIXED AND NEEDS ONLY TO BE DEFINED ONCE FOR PUTGB

C

C KGDS INTEGER (200) GDS PARAMETERS

C (1) - DATA REPRESENTATION TYPE

C (19) - NUMBER OF VERTICAL COORDINATE PARAMETERS

C (20) - OCTET NUMBER OF THE LIST OF VERTICAL COORDINATE

C PARAMETERS

C OR

C OCTET NUMBER OF THE LIST OF NUMBERS OF POINTS

C IN EACH ROW

C OR

C 255 IF NEITHER ARE PRESENT

C (21) - FOR GRIDS WITH PL, NUMBER OF POINTS IN GRID

C (22) - NUMBER OF WORDS IN EACH ROW

C LATITUDE/LONGITUDE GRIDS

C (2) - N(I) NR POINTS ON LATITUDE CIRCLE

C (3) - N(J) NR POINTS ON LONGITUDE MERIDIAN

C (4) - LA(1) LATITUDE OF ORIGIN

C (5) - LO(1) LONGITUDE OF ORIGIN

C (6) - RESOLUTION FLAG (RIGHT ADJ COPY OF OCTET 17)

C (7) - LA(2) LATITUDE OF EXTREME POINT

C (8) - LO(2) LONGITUDE OF EXTREME POINT

C (9) - DI LATITUDINAL DIRECTION OF INCREMENT

C (10) - DJ LONGITUDINAL DIRECTION INCREMENT

C (11) - SCANNING MODE FLAG (RIGHT ADJ COPY OF OCTET 28)

C

C END OF DOC BLOCK FOR LDAS PURPOSES

**1. Grid Definition Section (GDS)**

The 22 element GDS (KGDS in putgb.f) need only be defined once. Unlike
the PDS, it does not vary from parameter to parameter in the hourly
output file nor does it vary in time. The LDAS grid is not an
"officially" sanctioned grid in NCEP or WMO GRIB tables. If it were,
defining it would be a matter of giving its grid number to PDS element
(3). Rather, since it is a user defined grid, KPDS(3) = 255, the and the
22 elements of the KGDS array are defined by the user. At NCEP, the
w3lib routine w3fi71.f is a routine where these "unofficial" grids are
defined (in data statements) and assiged a number (other than 255). The
driving Fortran subroutine (named GRIBLDAS) for producing hourly GRIB
output for LDAS is given next in Section VI and it includes a call to
subroutine MAKGDS, which reads the KGDS info from w3fi71.f (defined
there as grid #236) for use in the later call to putgb.f. The 22
elements of the KGDS that defines the LDAS grid are listed below in data
statement format. Note that elements which do not apply to the Lat/Lon
LDAS grid or elements that are defined internally in w3lib routines are
defined as zero here.

DATA GRD236 /0, 464, 224, 25036, -124938, 128, 52938, -67063, 125, 125,
64, 0, 0,

0, 0, 0, 0, 0, 0. 0, 0, 0/

**2. Product Definition Section (PDS)**

The 25-element PDS array corresponding to each variable given in Tables
1-8 in Section IV (i.e. for each GRIB# in Tables 1-8) will be defined in
the LDAS GRIB output subroutine named GRIBLDAS in Section VI, by that
routine's internal logic (for time-stamp information especially).

Some elements of the PDS array do not change, regardless of the output
field (output record). These will be defined once in routine GRIBLDAS.

Those elements which are specific to each individual field listed in
tables 1-8 will be specified by routine GRIBLDAS from the table below,
referred to as file \"KPDS.TBL\"

in subroutine GRIBLDAS in Section VI.

**2.a File \"KPDS.TBL\" for subroutine GRIBLDAS**

**[NOTE]{.underline}: each LDAS participating model will need to modify
table below to**

**1) delete each field (line in table) which does not apply to that
particular**

**LDAS model**

> **2)** **re-order the lines of the table to agree with the order of
> fields in the hourly binary output file of a given LDAS**
>
> **3) for each field corresponding to a soil layer or column (i.e.
> having KPDS element \# 6 equal to 112,), reassign soil layer or column
> depth in KPDS element #7, which is given an undefined default value of
> 999 below.**

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

\* \*

\* LOOKUP TABLE FOR FIXED PDS ELEMENTS FOR LDAS OUTPUT POST-PROCESSOR \*

\* ROUTINE NAMED GRIBLDAS \*

\* AUTHOR: MARSHALL \*

\*\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\*

\* \*

\* KPDS ELEMENTS THAT CHANGE WITH TIME OR MODEL THAT ARE DEFINED IN \*

\* POST-PROCESSOR ROUTINE GRIBLDAS: \*

\* \*

\* KPDS(2) NOAH=221, MOSAIC=222, VIC=223, SACRAMENTO=224 \*

\* KPDS(8) FROM POST-PROCESSOR LOGIC \*

\* KPDS(9) FROM POST-PROCESSOR LOGIC \*

\* KPDS(10) FROM POST-PROCESSOR LOGIC \*

\* KPDS(11) FROM POST-PROCESSOR LOGIC \*

\* KPDS(12) FROM POST-PROCESSOR LOGIC \*

\* KPDS(17) DETERMINED BY INDIVIDUAL MODEL\'S TIME STEP \*

\* KPDS(21) FROM POST-PROCESSOR LOGIC \*

\* \*

\* \*

\* KPDS ELEMENTS THAT REMAIN FIXED (DO NOT VARY BY LDAS MODEL, TIME \*

\* STEP, OR AMONG THE OUTPUT PARAMTERS) AND ARE DEFINED NOT IN THIS \*

\* TABLE, BUT IN THE OUTPUT POST-PROCESSOR ROUTINE: \*

\* \*

\* KPDS(1) 7 (NCEP) \*

\* KPDS(3) 255 (SPECIAL GRID, DEFINED IN w3fi71.f) \*

\* KPDS(4) 192 (ALWAYS) \*

\* KPDS(13) 1 (HOURLY OUTPUT) \*

\* KPDS(18) CUSTOMARILY SET TO 0 IN NCEP OPERATIONS \*

\* KPDS(19) VERSION \# OF SPECIAL LDAS PARAMETER TABLE (1 TO START)\*

\* KPDS(20) SHOULD BE 0 FOR LDAS PURPOSES \*

\* KPDS(23) 4 (EMC) \*

\* KPDS(24) NOT APPLICABLE TO ANY LDAS OUTPUT \*

\* KPDS(25) NOT APPLICABLE TO ANY LDAS OUTPUT \*

\* \*

\* REVISION HISTORY: 27 JULY 2000 MARSHALL ORIGINAL VERSION \*

\* \*

**LDAS PARAMETER TABLE \"KPDS.TBL\": (VERSION 1, 27 JUL 00)**

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

ABBREVIATION KPDS ELEMENT(N): (5) (6) (7) (14) (15) (16) (22)

\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\--

NSWRS 111 001 000 000 001 003 001

NLWRS 112 001 000 000 001 003 001

LHTFL 121 001 000 000 001 003 001

SHTFL 122 001 000 000 001 003 001

GFLUX 155 001 000 000 001 003 001

SNOHF 229 001 000 000 001 003 001

DSWRF 204 001 000 000 001 003 001

DLWRF 205 001 000 000 001 003 001

ASNOW 131 001 000 000 001 004 004

ARAIN 132 001 000 000 001 004 004

EVP 057 001 000 000 001 004 004

SSRUN 235 001 000 000 001 004 004

BGRUN 234 001 000 000 001 004 004

SNOM 099 001 000 000 001 004 004

GWREC 133 001 000 000 001 004 004

QREC 134 001 000 000 001 004 004

SNOWT 135 001 000 000 000 000 002

VEGT 136 001 000 000 000 000 002

BARET 137 001 000 000 000 000 002

AVSFT 138 001 000 000 000 000 002

RADT 139 001 000 000 000 000 002

ALBDO 084 001 000 000 000 000 001

WEASD 065 001 000 000 000 000 004

SSTOR 150 001 000 000 000 000 004

CWAT 223 001 000 000 000 000 004

SOILT-LAYERS 085 112 999 000 000 000 002

SOILM-TOTAL COLUMN 086 112 999 000 000 000 004

SOILM-ROOT ZONE 086 112 999 000 000 000 004

SOILM-TOP ONE METER 086 112 999 000 000 000 004

SOILM-LAYERS 086 112 999 000 000 000 004

LSOIL-LAYER LIQUID ONLY 151 112 999 000 000 000 004

MSTAV-TOTAL COLUMN 207 112 999 000 000 000 001

MSTAV-ROOT ZONE 207 112 999 000 000 000 001

EVCW 200 001 000 000 001 003 001

TRANS 210 001 000 000 001 003 001

EVBS 199 001 000 000 001 003 001

EWATR 152 001 000 000 001 003 001

SBSNO 173 001 000 000 001 003 001

PEVPR 145 001 000 000 001 003 001

ACOND 174 001 000 000 000 000 003

CCOND 181 001 000 000 000 000 003

VEG 087 001 000 000 000 000 001

LAI 182 001 000 000 000 000 001

SFCR 083 001 000 000 000 000 003

SFCRH 183 001 000 000 000 000 006

SNOD 066 001 000 000 000 000 007

SNOC 238 001 000 000 000 000 001

SALBD 184 001 000 000 000 000 001

**2.b Definition of KPDS elements 6 and 7**

KPDS elements 6 and 7 are used to define whether the output field is a
surface field (at interface of atmosphere and ground) or a subsurface
field (soil layer or soil column).

KPDS(6) = 1 specifies surface of earth (atmosphere/ground interface)

KPDS(6) = 112 specifies a subsurface soil layer or column

KPDS(7) = 0 if KPDS(6) = 1

KPDS(7) = Y below if KPDS(6) = 112

[Definition of Y value for KPDS (7)]{.underline}

The international GRIB convention for KPDS(7), known in GRIB manuals as
PDS Octets 11 and 12, does not allow for the necessary flexibility in
defining soil column or soil layer thicknesses that we need in the LDAS
project.

So we define our own LDAS-project conventions for KPDS(7) here. But in
any case, GRIB constrains the value of KPDS(7) to be less than
(2\*\*16-1), i.e. the range of a two-byte integer, or INTEGER\*2.

As described below, using the MOD function, our LDAS convention for the
Y value will allow one to specify both a [layer index]{.underline} (in
the range 1-99), and a [layer thickness]{.underline} in whole
[centimeters]{.underline} (in the range 1-600).

The specific layer index value of 99 is reserved to indicate a [soil
column]{.underline} (starting at the earth\'s surface), such as the
\"root zone\" or total active soil column, denoting a soil column entity
that is not part of an ordered successive sequence of soil layers.

Finally, our convention below will allow one to define a layer index or
\"reservoir\" index, without defining a corresponding layer thickness
(for those cases where the layer thickness is not constant across the
LDAS grid, or those cases where the subsurface entity is a storage
\"reservoir\" with no physical thickness \-- in these cases the user
will have to contact the LSM model developer directly to get specific
information on layer or reservoir definitions and their water holding
capacities).

Y must be assigned values in the range 1- 60099.

The information in Y is extracted as follows:

Layer index \# = MOD(Y,100) (this allows index range of 1-99)

Layer thickness = (Y - Layer #) / 100 (thickness in whole cm from 0-600)

[NOTE]{.underline}: A thickness value of zero (i.e. Y in range of 1-99)
means the soil layer thickness or soil column depth is a) not constant
across the LDAS domain, or b) physically undefined (as in the case of a
sub-surface water holding \"reservoir\"). In any case, when layer
thickness is zero, user must contact LSM model developer directly to
obtain definition, meaning, or interpretation of this layer.

**VI. Template Fortran Source Code for Common LDAS GRIB Output**

(Version 1.0 \-- Curtis Marshall, 15 Sep 00)

PROGRAM GRIBLDAS

C

C\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

C PROGRAM: GRIBLDAS WRITE LDAS OUTPUT IN GRIB FORMAT

C PRGMMR: MARSHALL ORG: W/NP20

C

C ABSTRACT: TAKES HOURLY OUTPUT FILES FROM LDAS MODELS (IN BINARY

C FORMAT (BIG ENDIAN) AND MAKE GRIB RECORDS FOR ALL FIELDS

C IN THE FILE. NOTE ORDER OF FIELDS IN EACH BINARY FILE

C MUST CORRESPOND TO ORDER OF FIELDS IN KPDS.TBL. TIME

C STAMP INFORMATION MUST ALSO APPEAR (YYYYMMDDHH) IN THE

C TITLE OF EACH BINARY HOURLY OUTPUT FILE. THIS INFO IS

C USED IN CONSTRUCTING THE TIME-RELATED PDS OCTETS WHICH

C DO NOT APPEAR IN KPDS.TBL

C

C PROGRAM HISTORY LOG:

C 00-08-28 MARSHALL ORIGINAL CODING

C\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

C

C DECLARATIONS, ETC\...

C

IMPLICIT NONE

FILL IN WHEN CODE COMPLETE

C

C READ TODAY\'S DATE (YYYYMMDD) FROM \"LDASDATE\" FILE LOCATED IN

C PARMS SUBDIRECTORY. THIS FILE IS GENERATED BY THE SCRIPT THAT

C DRIVES THE EXECUTABLE THAT CALLS THIS SUBROUTINE (GRIBLDAS)

C

OPEN (UNIT = 10, FILE = \'LDASDATE\'

READ (1, 5) KPDS(21), KPDS(8), KPDS(9), KPDS(10)

CLOSE (10)

5 FORMAT (4(I2))

C

C DEFINE THE GDS FOR THE LDAS GRID (THIS ARRAY NEVER CHANGES FROM

C FIELD TO FIELD\... ONLY HAS TO BE DEFINED ONCE, UNLIKE THE PDS).

C

CALL MAKGDS (\...)

C

C READ EACH BINARY DATA FIELD FROM HOURLY OUTPUT FILES. OUTSIDE

C LOOP (I) IS OVER 24 HOURLY FILES. INSIDE LOOP (J) IS OVER THE NUMBER
OF

C FIELDS (N) IN EACH HOURLY FILE. FIRST, SET SOME TIME-RELATED KPDS

C OCTETS

C

IF (KPDS(8) .EQ. 0) THEN

KPDS(8) = 100

ELSE

KPDS(21) = KPDS(21) + 1

END IF

DO I = 1, 24 ! loop over the hourly files

KPDS(11) = I + 12

LEAP = (MOD(KPDS(8),4).EQ.0)

IF (KPDS(11) .EQ. 24) THEN

CALL UPDATE (KPDS, LEAP)

END IF

IF (KPDS(11) .GT. 24) THEN

KPDS(11) = KPDS(11) - 24

END IF

WRITE (CENT, \'(i2.2)\') KPDS(21) - 1

IF (KPDS(8) .EQ. 100) THEN

WRITE (CYR, \'(i2.2)\') 0

ELSE

WRITE (CYR, \'(i2.2)\') KPDS(8)

WRITE (CMON, \'(i2.2)\') KPDS(9)

WRITE (CDAY, \'(i2.2)\') KPDS(10)

WRITE (CHOUR, \'(i2.2)\') KPDS(11)

BINFILE = //CENT//CYR//CMON//CDAY//CHOUR//\'.LDASBIN\'

C

C NOW OPEN THE LDAS OUTPUT BINARY FILE. WHEN EACH FIELD IS READ, ALSO

C READ THE CORRESPONDING LINE OF DATA FROM KPDS.TBL. THESE DATA ARE

C THE PDS ELEMENTS THAT ARE NOT TIME-RELATED (LIKE THOSE DEFINED ABOVE).

C

OPEN (UNIT = 20, FILE = BINFILE, FORM = \'UNFORMATTED\')

OPEN (UNIT = 30, FILE = \'KPDS.TBL\')

GRIBFILE = //CENT//CYR//CMON//CDAY//CHOUR//\'.LDASGRIB\'

LUGB = 40 + I

CALL BAOPEN (LUGB, GRIBFILE, IRET)

IF (IRET. NE. 0) THEN

PRINT\*, \'OH S\*%T, BAOPEN FAILED\'

END IF

DO J = 1, NFIELDS !loop over all the fields in an hourly file

READ (30, 15) KPDS(1), KPDS(2), KPDS(3), etc\...

READ (20) (VALUE(K), K = 1, NLDAS)

C

C WRITE EACH FIELD (IN GRIB) TO HOURLY OUTPUT FIELD

C

CALL PUTGB (LUGB,NLDAS,KPDS,KGDS,LDASMASK,VALUE,IRET)

IF (IRET .NE. 0) THEN

PRINT\*, \'PUTGB FAILED FOR HOUR=\',I,\',\',,\'FIELD=\',J

END IF

CALL BACLOSE (LUGB, JRET)

END DO !end loop over fields in each hourly file

CLOSE (20)

CLOSE (30)

C

END DO !end loop over the 24 hours in a day

STOP

END