Skip to content

specl: UVQUAN (parser and code) #107

@rburghol

Description

@rburghol

Tasks

UVQUAN is a pointer to a memory location, representing some HSPF register. See also UVNAME

  • Data Model
  • Parser: ParseTable.csv entry under way, not tested with code yet. See: https://github.com/HARPgroup/HSPsquared/blob/uvquan/HSP2tools/data/ParseTable.csv
  • class handler (turns table data into linked and integrated executable runtime)
  • Executable Code
  • Unit Tests
  • Performance Tests
  • See also SPEC-ACTIONS - UVQUAN as action value #173
  • Questions/concepts:
    • Differences between UVNAME and UVQUAN? Is UVNAME a variable applied/created in all segments, whereas UVQUAN is a single variable created for a specific segment?
    • Cross-domain UVQUAN, i.e., in example below, IF (precx1 > 6.000) THEN, can precx1 which is based on PERLND 1 be used by some other element, like RCHRES 1? (hypothetical to understand full life-cycle)

UCI

  • Note: Definitions in HSPF manual "Details of User-defined Variable Quantity line" gives a variable named ADDR, but:
    • This does not appear in the actual UCI. (not in example, or in test UCI from CBP)
    • Instead, it appears to be a meta-column, the "VNAME" + "CSUB1" ("vari" and ""s1" in manual and CBP examples)

UCI Data Structure

image

UCI Examples

Example from HSPF_v12.2_manual

*** User-Defined Variable Quantity Lines
***                           addr
***                        <------>
*** kwd  varnam optyp  opn  vari  s1 s2 s3 tp multiply  lc ls ac as agfn ***
  <****> <----> <----> <-> <----><-><-><-><-><--------> <><-> <><-> <--> ***
  UVQUAN prec   PERLND   1 PREC             3                 DY  1 SUM

TEST13.UCI

From fortran HSPF base tests:

Hurricane Isabel

***Iuvquan User-Defined Variable Quantity Line
*** kwd  varnam optyp  opn  vari  s1 s2 s3 tp multiply  lc ls ac as agfn ***
  <****> <----> <----> <-> <----><-><-><-><-><--------> <><-> <><-> <--> ***
  UVQUAN precx1 PERLND   1 PREC             3                 DY 14 SUM

***Action Lines for INFEXP
IF (precx1 >  6.000) THEN
  PERLND  1                            3  INFEXP          =  8.0000000
ELSE
  PERLND  1                            3  INFEXP          =  2.0000000
END IF

hdf5 Data Model

  • hdf5 Path: /SPEC_ACTIONS/UVQUAN/table
    • Column Names (see DEF below): UVQNAM, OPTYP, OPTNO, VNAME, CSUB1, CSUB2, CSUB3, ADDR, TYPCOD, UVQMUL, CTCODE1, TSTEP1, CTCODE2, TSTEP2, CTRAN

DEF: Table Definition

index UVQNAM OPTYP OPTNO VNAME CSUB1 CSUB2 CSUB3 TYPCOD UVQMUL CTCODE1 TSTEP1 CTCODE2 TSTEP2 CTRAN
0 prec PERLND 1 PREC 3 DY 1 SUM

Execution Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions