# Presentation: 663356

## DHM: Operational Distributed Hydrologic Model

- Lecture 5
- DHM/HL-RDHM Workshop
- ABRFC
- June 5 -7, 2007

- Lee Cajina
- OHD/HL
- Hydrologic Software Engineering Branch

## Background

- Goal – Port the RDHM features ready for operations into AWIPS
- DHM in OB7.2 (At RFCs)
- Executes coupled SAC-SMA and Kinematic Routing grid-based model in NWSRFS batch (OFS/FCST) and GUI (IFP) modes (Only Rating Curve Kinematic Routing Method)
- Displays the outlet hydrograph in IFP
- Can use the DHM hydrograph as input to other NWSRFS operations and/or segments
- Generates state grids as part of NWSRFS carryover runs for continuous modeling
- Generate grids for viewing in D2D (netCdf files)
- Channel flow [cfs]
- Sac and Routing states
- Generate grids for viewing in XDMS (xmrg-like files)
- Channel flow [cms]
- Sac and Routing states
- Parameters
- Pet
- Can use QPF xmrg grids for forecast period
- Some glitches when running through IFP (disk space and speed)
- No automated tool for moving from RDHM to DHM
- Limited modeling of downstream basins (only 1 inflow)

## Background

- DHM in OB8.1 (At RFC Beta Sites)
- Minor change to determine RFC boundary using rfc coord file                                  (consistent with other OHD applications)
- IFP glitches **mostly** fixed
- DHM in OB8.2 (Regular Deployment Jan 2008)
- Performance improvement - DHM now runs faster
- IFP glitches with disk space and speed fixed
- Automated tool to transition from RDHM to DHM (DHMGSE)
- More complete modeling of downstream basins (up to 5 inflows)
- Precipitation and Sac State scalar multiplier modifications (mods)
- Grid output while running IFP at user requested times (for viewing in XDMS not D2D)
- Channel flow [cms]
- Sac and Routing states
- Total Runoff [mm]
- DHM in OB8.3 (~ Jun 2008)
- TBD

## Transitioning From RDHM to DHM

- Two Main Steps
- Define DHM-OP(s) in existing or new segment definitions (using NWSRFS-fcinit)
- Convert RDHM calibration data into operational DHM data (using DHM Grid Scalar Editor **New**)

## DHM-OP ( NWSRFS Operation)

- Headwater Segments
**DHM-OP**      *operationID*
-   **OUTLET:**  *timeSeriesId*   SQIN    1   *basinId*
**DHM-OP*** – *identifier for new DHM operation
*operationId - *8 character id for operation; just like all other NWSRFS operations
**OUTLET:** - DHM-OP keyword used to denote the outlet  time series
*timeSeriesId – 8 character id for time series used to store outlet hydrograph; must be defined in DEF-TS portion of segment definition*
*SQIN – data type of outlet hydrograph (must be SQIN)*
- 1 – time interval in hour for outlet hydrograph (must be 1)
*basinId – 8 character id of basin modeled by this DHM-OP; must be an id in Connnectivity file*

- Downstream Segments
**DHM-OP**      *operationId*
-   **INFLOW:** *upTimeSeriesId  *SQIN   1  *upBasinId*
-   **OUTLET:** *timeSeriesId*    SQIN    1   *basinId*
**INFLOW:** - keyword used to denote an upstream inflow for current basin
- Can have up to 5 INFLOW: lines
- Data type can be SQIN or QINE
- Time interval must be 1 hour
*upBasinId must be defined in Connectivity file*
*upTimeSeriresId must be defined in DEF-TS portion of segment definition*
- Rest is the same
- *Definition is free format and order of INFLOW and OUTLET lines does not matter

## Headwater and Downstream DHM-OP 

- BASINA

- SegmentA
- DEF-TS
- BASINA      SQIN   1             OUTPUT        FPDB
- BASINA SQIN     41.53    108.59     DESCRIPTION LINE
- BASINA      QINE   1             OUTPUT        FPDB
- BASINA SQIN     41.53    108.59     DESCRIPTION LINE
- END
**DHM-OP      BASINA**
**  ****OUTLET:  BASINA   SQIN    1   BASINA**
- ADJUST-Q    BLASE
- BLANTYRE                1    0    0
- BLASE      QIN     6
- BLASE      SQIN    6
- BLASE      QINE
-     6
-     1
- STOP

- SegmentB
- DEF-TS
- BASINB      SQIN   1             OUTPUT        FPDB
- BASINB    SQIN     41.53    108.59     DESCRIPTION LINE
- BASINA      QINE   1             INPUT        FPDB
- BASINA      QINE
- END
**DHM-OP      BASINA**
**OUTLET:  BASINB   SQIN    1   BASINB**
**INFLOW:  BASINA   QINE    1   BASINA**
- STOP

- Headwater Segment A feeds
- DHM-OP in Downstream Segment B
- With 1 Adjusted flow (QINE).  Only
- local area modeled.

- BASINB

- Time series produced
- by DHM-OP adjusted
- for passing downstream

## Multiple Inflows for Downstream DHM-OP

- BASINA

- BASINB

- BASINC

- SEGMENTA
- .
- .
- DEF-TS
- BASINA      SQIN   1             OUTPUT        FPDB
- BASINA SQIN     41.53    108.59     DESCRIPTION LINE
- END
**DHM-OP      BASINA**
**  ****OUTLET:  BASINA   SQIN    1   BASINA**
- STOP

- SegmentC
- .
- .
- DEF-TS
- BASINC      SQIN   1             OUTPUT        FPDB
- BASINC    SQIN     41.53    108.59     DESCRIPTION LINE
- BASINB      SQIN   1             INPUT        FPDB
- BASINB      SQIN
- BASINA      SQIN   1             INPUT        FPDB
- BASINA      SQIN
- END
**DHM-OP      BASINA**
**OUTLET:  BASINC   SQIN    1   BASINC**
**INFLOW:   BASINA   SQIN    1   BASINA**
**INFLOW:   BASINB   SQIN    1   BASINB**
- STOP

- Headwater Segments A and B
- Feed Downstream Segment C with
- Simulated Flows – SQIN*
- * can use QINE also

- SEGMENTB just like SEGMENTA

## Using DHM-OP with Lumped Operations

- BASINA

- BASINB

- BASINC

- UpstreamSegment
- DEF-TS
- BASINA      SQIN   1             OUTPUT        FPDB
- BASINA    SQIN     41.53    108.59     DESCRIPTION LINE
- BASINB      SQIN   1             OUTPUT        FPDB
- BASINB      SQIN     41.53    107.59     DESCRIPTION LINE
- END
**DHM-OP      BASINA**
**  ****OUTLET:  BASINA   SQIN    1   BASINA**
**DHM-OP      BASINB**
**  ****OUTLET:  BASINB   SQIN    1   BASINB**
- STOP

- DownstreamSegment
- DEF-TS
- BASINB      SQIN   1             INPUT        FPDB
- BASINB      SQIN
- BASINA      SQIN   1             INPUT        FPDB
- BASINA      SQIN
- END
**SOME_LUMPED_MODEL (e.g. LAG/K)**
- STOP

- DHM-OPs feeding an existing
- Lumped downstream Segment

## Multiple Downstream DHM-OPs    

- BASINA

- DEF-TS
- BASINB      SQIN   1             OUTPUT        FPDB
- BASINB    SQIN     41.53    108.59     DESCRIPTION LINE
- BASINA      QINE   1             INPUT        FPDB
- BASINA      QINE
- END
**DHM-OP      BASINA**
**OUTLET:  BASINB   SQIN    1   BASINB**
**INFLOW:   BASINA   QINE    1   BASINA**
**DHM-OP      BASINB**
**OUTLET:  BASINB   SQIN    1   BASINB**
- STOP

- Downstream BASINB modeled using multiple DHM-Ops (with and without upstream flow)
- without – produces just local flow
- with – produces total flow

- BASINB

- *Note: 1 grid created for the entire RFC; when
- Modeling the same basin multiple times, the values
- In the grid will show results from the last DHM-OP

## Converting RDHM Calibrations into DHM Data

- DHM Grid Scalar Editor (DHMGSE):
- Converts RDHM grids and scalars into operational DHM grids
- Can initialize scalars from an existing RDHM input file
- Allows for multiplier and constant scalars (also % for SAC-SMA states)
- Ensures the latest Connectivity file is available for DHM

##  RDHM calibrations  DHM dataset

- DHM input data organized under directory pointed to by $dhm_data_dir token
- parameters (directory) grids include scalar adjustments
- SAC-SMA and Routing parameters (21 grids)
- states (directory) initial state grids
- SAC-SMA and Routing states (7-10 grids)
- pet (directory) result of multiplying non adjusted and adjustments and any scalars
- Daily PET on 16th of the Month (12 grids)
- Connectivity (file)
- DHMGSE creates the grids and puts them and connectivity file in the proper location

## DHM Grid Scalar Editor (DHMGSE)

- 3.  Merges new basin definitions into existing set of operational DHM data

## Merging States With DHMGSE

- Original State Grid

- New Calibrated Basin State Grid

- New Operational State Grid

- Experience with DMS 1.0 showed
- basins are added to forecast
- mode incrementally.  The user
- needs a way to add new
- calibrated states to the
- current operational state
- grids.

## Using DHM-OP in IFP (background info)

- /awips/hydroapps/lx/rfc/nwsrfs/ofs/files/$ofs_level/

**ofs_level usually=oper**
**dhmdata located using $dhm_data_dir**

- fs5files

**griddb**

- mods

**dhmdata**

- OTHER_DIRS

**parameters**

**states**

**pet**

- /data/dhm/$LOGNAME/

- parameters

- states

- pet

- precip

**channelflow**

- channelflow

- runoff

- Directories for Output

- DHM data for IFP
- uses same approach
- as fs5files.  When
- Using IFP, each user
- gets a local copy of
- data.  **Only Mods are **
**sent back.  **

- IFP

- Data from **highlighted **
- directories used to create
- a temporary local copy
- For DHM in IFP.

- DHM root dir (/data/dhm/$LOGNAME)
- located using $ifp_dhm_data_dir
- Precip xmrgs located usinng
- $ifp_griddb_dir

## DHM-Mods

**Precipitation Mod (DPRECIP)**
-  Basin Multiplier
-  Applied over specified window
-  Multiple Mods supported (cumulative)
-  Only for observed period
-  Like RIMULT mod

**SAC-State Mod (DSACST)**
-  Basin Multiplier
-  Applied on the given date
-  Multiple Mods supported (cumulative)
-  By default applied to start of run (carryover)
-  Values capped at MAX parameter values
-  Like SACCO mod

##  Grid Output

- In Batch Mode grids for viewing in XDMS and D2D are created during carryover save runs for the carryover save dates  (i.e. at 12Z on a give day)
- D2D grids are only created for carryover save dates from today to -5 days
- In IFP grids are created on user requested date(s)
- Only for viewing in XDMS

## Requesting Grid Output Through IFP

- Grid output created for the times defined by:
- Start Date
- End Date
- Time Interval

- Grid output created for Selected Layers:
- Channel Flow
- Sac State
- Kinematic State
- Total Runoff

- Grid output settings apply for:
- All DHM-Ops
- Next DHM-OP modeled
- No DHM-OP (no grid output)
- Settings are saved across IFP sessions

## Specifying QPF

- QPF is taken from XMRG 6hour total grids created from (NMAP and Mountain Mapper)?
- QPF specifications for DHM model runs uses existing FUTPRECP technique
- FUTPRECP *numberOfHours *(where numberOfHours represents how much of the forecast period to use actual data)
- -1 option (use all available qpf not supported)
- In batch mode through HCL
- In IFP through Universal Techniques interface