declread (09/03/02)

CRHM

declread - process observation variable defined in header of Observation file.

void declread(string module, string name, long cnt, long offset, ClassData * FileData, string Comment)

where

string module - hard coded as "obs" in ClassData::DataReadFile.

string name - name used in observation file header.

long cnt - size of variable, usually one.

long offset - order of definition starting at 0.  Same as order in file data line.

ClassData * FileData // object handling file

string Comment // balance of line.

Operations

  1. If cnt is greater than current Global::maxobs update NOBS to allow the observation variable to display properly.
  2. Check if observation variable exists in Global::MapVars. If the variable already exists and has a varType >= Read then throw 'duplicate observation variable error' otherwise assign parameter values to this variable and return.
  3. Otherwise create a new 'Read' variable with these qualities and insert it into Global::MapVars.

Notes

    Observation variables are instantiated by either declread or by ClassModule::declvar depending upon whether the observation file or the model modules are loaded first.