Extending fews with external functionalities
Download
1 / 90

Extending FEWS with External functionalities - PowerPoint PPT Presentation


  • 80 Views
  • Uploaded on

Extending FEWS with External functionalities. Zhengtao Cui NOAA National Weather Services Office of Hydrologic Development. Outline. Day 1 FEWS Workflow (Page 3-7) The FEWS General Adapter Concept(Pages 8 – 19) OHD FEWS adapter framework (Pages 20 – 60) Examples (Pages 61 - 90) Day 2

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Extending FEWS with External functionalities' - paiva


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Extending fews with external functionalities

Extending FEWS with External functionalities

Zhengtao Cui

NOAA National Weather Services

Office of Hydrologic Development


Outline
Outline

  • Day 1

    • FEWS Workflow (Page 3-7)

    • The FEWS General Adapter Concept(Pages 8 – 19)

    • OHD FEWS adapter framework (Pages 20 – 60)

    • Examples (Pages 61 - 90)

  • Day 2

    • Hands on Examples


Fews workflow module and model
FEWS workflow, module and model

  • A workflow specifies a sequence of other workflows or modules to execute

    • Usually executed to generate a forecast

  • A module is a unit of execution

    • Can be a FEWS provided internal module, for example, the import module

      • Flow of data/files is hidden from the user

      • http://publicwiki.deltares.nl/display/FEWSDOC/05+Configuring+the+available+DELFT-FEWS+modules

    • A General Adapter is a reference to an external model

      • A FEWS General Adapter connects workflow with external models

      • Flow of data/files is visible to the user

      • Can have multiple execution units

  • Model/External model

    • Numerical code (source, binary, scripts, etc.) that does some kinds of calculations based a particular physical process,

    • Rainfall-runoff, routing, snow melt, etc.

    • Java model

      • NWSRFS models written in Java

    • Legacy model

      • NWSRFS models written in C++/C/Fortran

    • http://publicwiki.deltares.nl/display/FEWSDOC/Models+linked+to+Delft-Fews




Model example
Model example

  • SAC-SMA

  • SNOW-17

  • ……


Quiz

  • Describe the relationship of FEWS workflow and module.

    Answer:A module is a part of a workflow.

  • Which of the following could be listed inside a workflow?

    • A FEWS internal module

    • Another workflow

    • A general adapter module

    • A binary executable of Snow-17

      Answer:1,2, and 3.


The fews general adapter concept
The FEWS General Adapter Concept

  • The general adapter invokes an external model allowing for FEWS workflow to execute that model

    • preAdapter, postAdapter, Model

    • The user must provide a model adapter to run an external model

  • The general adapter communicates with external model using the Published Interface (PI)

    • PI is an XML based data exchange schema

    • Pre/Post adapter converts PI to/from native format

FEWS

Model Adapter/External Model


The fews published interface pi
The FEWS Published Interface (PI)

  • FEWS has no knowledge of any external models

    • Initiate by the FEWS General Adapter

  • An external model has no knowledge about FEWS or any other external models

    • Read/Write PI XML data

      • Including diagnostic information and model states

    • physical model calculations

  • Communication between FEWS and external models is done through PI

    • XML data files on disk


Fews configuration files
FEWS Configuration Files

  • Module Configuration

    • Provides unique information about the module (name, input/output data, properties, parameter filename, external model, etc.)

  • Module Instance Descriptors

    • Defines each module ( e.g. module name, type). Type can be FEWSTransformationor GeneralAdapter

      • FEWSTransformationare modules that come with FEWS

      • GeneralAdapterare modules developed by FEWS users

  • Workflows

    • Controls and defines the order in which to execute a series of workflows or modules

  • Workflow Descriptors

    • Defines each workflow’s characteristics

    • Such as a descriptive name for a workflow


WorkflowDescriptor.xml

<workflowDescriptor … id=“workflow_file”

</workflowDescriptor>

Workflow_file.xml

<activity>

<moduleInstanceId>moduleConfigFile</moduleInstanceId>

</activity>

ModuleInstanceDescriptors.xml

<moduleInstanceDescriptor id = “moduleConfigFile”>

<moduleId>GeneralAdapter</moduleId>

</ModuleInstanceDescriptor>

moduleConfigFile.xml

FEWS

Adapter

< executeActivity>

<command>cmd</command>

</executeActivity>


Structure of General Adapter Module Configuration File

‘general’ section defines several some common

tags that will be used by other sections.

‘startUpActivity’ defines activities that are run

prior to a module run and export any data.

‘exportActivities’ defines all items to be exported

through the PI XML to the external module.

‘executeActivities’ defines external executables

or Java classes to be run.

‘importActivities’ defines all items to be imported

Following successful completion of the module run.


Example basic dummy adapter dummyadapter
Example: Basic Dummy AdapterDummyAdapter

  • Has only one “main” method.

  • Prints “Hello World!” to the screen.

  • No input/output, parameters, properties, etc.

  • No external model is executed.

package dummy;

public class DummyAdapter

{

public static void main(final String[] args)

{

System.out.println("Hello World");

}

}



Example basic dummy adapter dummyadapter2
Example: Basic Dummy AdapterDummyAdapter2

  • Has only one “main” method.

  • Copy the output file in a property file to another file named “rootDir/output/outputs.xml”.

  • No external model is executed.

args.file

rootDirectory=Modules/dummy_module/dummy_basin2

outputFile=output_benchmark.xml


DummyAdapter2.java

package dummy;

import java.io.BufferedInputStream;

import java.io.File;

import java.io.FileInputStream;

import java.io.FileNotFoundException;

import java.io.IOException;

import java.util.Properties;

import org.apache.commons.io.FileUtils;

public class DummyAdapter2

{

public static void main(final String[] args)

{

final File propertyFile = new File(args[0]);

BufferedInputStreambis = null;

try

{

bis= new BufferedInputStream(new FileInputStream(propertyFile));

}

catch(final FileNotFoundException e)

{

e.printStackTrace();

}

final Properties prop = new Properties();

try

{

prop.load(bis);

}

catch(final IOException e)

{

e.printStackTrace();

}

//get property identifying root directory

final String rootDir = prop.getProperty("rootDirectory");

//get property identifying output file

final String outputFile = prop.getProperty("outputFile");

//copy output file to output directory under root dir

try

{

FileUtils.copyFile(new File(rootDir, outputFile), new File(rootDir + "/output/outputs.xml"));

}

catch(final IOException e)

{

e.printStackTrace();

}

}

2

1




Quiz

  • How does FEWS exchange information with external modules?

    Answer:Published Interface XML.

  • Which configuration file specifies the model to run?

    Answer:The module configuration file.

  • FEWS must have some knowledge about external modules, true or false?

    Answer:False.

  • What method a Java model adapter must implement?

    Answer:The main method.


Ohd fews adapter framework
OHD FEWS Adapter Framework

  • An instance of the FEWS General Adapter concept.

  • Conforms the latest version of FEWS PI XML schema

  • Abstracts some common tasks for all OHD models.

    • Encourage code reuse

    • Leveraging the effort of creating an adapter for each of the models.

  • Can be used for both Java based model or legacy C/FORTRAN based model (a prebuilt binary executable).

  • Configured through the general adapter configuration

    • Need a run info file to pass information to the OHD model, such as input/output file locations, diagnostics files, etc.

    • The run info file is created by the <exportRunFileActivity> activity in the module configuration file.

  • Has an executable jar in the <binDir> folder.


Ohd nwsrfs java and non java legacy models
OHD NWSRFS Java and non-Java (legacy) models

Java models

Non-Java (Legacy) models

CHANLOSS(FORTRAN)

BASEFLOW(FORTRAN)

SARROUTE(FORTRAN)

CONSUSE(FORTRAN)

APICONT(FORTRAN)

gridded APICONT for MARFC's FFG application(PCRASTER)

RESSNGL(FORTRAN)

RESJ(C++)

SSARRESV(FORTRAN)

  • SACSMA

  • UNITHG

  • SNOW17

  • gridded SNOW17 for MARFC's FFG application

  • TATUN

  • RSNWELEV

  • MUSKROUT

  • GLACIER

  • LAYCOEF

  • LAGK


Data flow java model
Data Flow (Java model)

PI

params.xml

OHDFewsAdapter

Model specific files

Loaded into

OHDFewsAdapter

PI

input.xml

PI

mods.xml

ModelDriver

Extends

xxxModelDriver

FEWS

states.xml

PI

Data are exchanged

in memory.

stateI.txt

PI

output.xml

PI

diag.xml

Model output files

are PI XML files


Model parameter file example
Model Parameter File Example

Follow the pi_moduleParameter.xsd schema

XML tags are used to identify the parameter

Use basic data types, string, double, int, table


Model state files
Model State files

  • states.xml

  • statesI.txt/statesO.txt


Important java classes 1
Important Java Classes (1)

  • OHDFewsAdapter

    • Entry point of OHD models

    • Executed by the FEWS general adapter.

    • Invoke OHD model execution

      • Read in model configuration, timeseries, parameters, and states

      • Calls the ModelDriver.executeDriver() method

    • Can be executed independent of FEWS

      • Given all necessary information


Important java classes 2
Important Java Classes (2)

  • The ModelDriverAbstract Class

    • Abstracts all NWSRFS models

    • All models must implement the ‘execute()’ method

      • Executed by the ModelDriver.executeDriver() method

      • Output results and the diagnostics file in PI XML format

      • Execute the model using common data structures (RegularTimeSeries, ModelState, ModelParameters)


Important java classes 3
Important Java Classes (3)

  • Common xml handling classes for

    • Parsing FEWS pi files

      • Input time series

      • Input states meta data

      • Input model parameters

    • Writing FEWS pi files

      • Output time series


How is it implemented
How is it implemented?

<executeActivity>

<className>ohd.model.util.fews.OHDFewsAdapter</className>

</executeActivity>

<exportRunFileActivity>

<properties>

<string key=“model” value=“ohd.model.foo”/>

</properties>

</exportRunFileActivity>

XML

class OHDFewsAdapter

{

void main()

{

//instantiate

modelDriver= Class.forName( “ohd.model.foo”);

modelDriver.executeDriver();

}

}

class ModelDriver

{

void executeDriver()

{

//the physical model

//starts

execute();

}

}

Java

Java


Class hierarchy
Class Hierarchy

IDriver

Interface

Abstract class

Implements

User class

Driver

OHD class

Extends

ModelDriver

Extends

Instantiate

OHDFewsAdapter

XXModelDriver


The modeldriver abstract class 1
The ModelDriver Abstract Class (1)


The modeldriver abstract class 2
The ModelDriver Abstract Class(2)


The modeldriver abstract class 3
The ModelDriver Abstract Class(3)




If rootDir is defined as the

%TEMP_DIR%, the directory

is temporary; will be

removed after the adapter

run. This behavior can be

modified by the F12 menu.


How to configure ohdfewsadapter 1
How to configure OHDFewsAdapter(1)

  • Header Info

Every external module is a generalAdapterRun

Can be missing.

Set <ignoreDiagnostics> in <executeAcitvity>


How to configure ohdfewsadapter 2
How to configure OHDFewsAdapter(2)

  • Startup activity

Create working directories

if they don’t exist

Most are standard directories that

must be cleaned out prior to model

execution.


How to configure ohdfewsadapter 3
How to configure OHDFewsAdapter(3)

  • Export activity: Export States

In order to use relative dating,

states must be exported. States

can be empty.


How to configure ohdfewsadapter 4
How to configure OHDFewsAdapter(4)

  • Export activity: Input Time Series

Id of module that generated the needed data

Relative dating requires states be exported


How to configure ohdfewsadapter 5
How to configure OHDFewsAdapter(5)

  • Export activity: Parameters

If not specified, current module instance id is used.


How to configure ohdfewsadapter 6
How to configure OHDFewsAdapter(6)

  • Export activity: run info file

  • Pass general information to the Adapter

  • Read by the OHDFewsAdapter


Example of ohdfewsadapter runinfo file
Example of OHDFewsAdapterRuninfo File

This is the <properites> entry in the model configure file.


Runinfo properties
Runinfo properties

  • “model” entry

    • The name of the Java class that implements the ModelDriver interface

  • “printDebugInfo” entry

    • Controls how detailed messages are printed to the diagnostic file.

    • Five levels (0 to 4).

    • Higher values mean more detailed information

    • Do not to be confused with the “Error Levels” in diag.xml

      • 0 – fatal level, when an exception occurs

      • 1 – error level, similar to the fatal level

      • 2 - warning level, warning messages are printed

      • 3 – the regular level

      • 4 – debug level, the most detailed information about the execution of the model.

  • All other entries are model specific.


How to configure ohdfewsadapter 7
How to configure OHDFewsAdapter(7)

  • Execute activity

The runinfo file is passed as an argument to the adapter.


How to configure ohdfewsadapter 8
How to configure OHDFewsAdapter(8)

  • Import Activity: Import model output time series

The module instance ID of this module.


Example basin dummy model dummy model
Example: Basin Dummy ModelDummy Model

  • Use the OHDFewsAdapter to drive the dummy model.

    • The dummy model is written in Java

    • Extends the OHD ModelDriver abstract class

    • Input a time series, add a value, and then subtract a value from the time series

    • Configure the OHDFewsAdapter in FEWS

      • Set input time series

      • The value to be added

      • The value to be subtracted


package dummy.models;

import java.util.List;

import ohd.hseb.measurement.Measurement;

import ohd.hseb.measurement.MeasuringUnit;

import ohd.hseb.measurement.RegularTimeSeries;

import ohd.hseb.ohdmodels.ModelDriver;

import ohd.hseb.util.fews.FewsRegularTimeSeries;

public class DummyModelDriverextends ModelDriver

{

public DummyModelDriver()

{

super._state = new ModelState();

super._parameters = new ModelParameters();

}

@Override

protected void execute() throws Exception

{

// get list of input time Series

final List<RegularTimeSeries> inputTsList= getTsList();

_drivingTs= inputTsList.get(0);

super.runModelDriverValidation();

final long startTime = _drivingTs.getStartTime();

final long endTime = _drivingTs.getEndTime();

final int interval = _drivingTs.getIntervalInHours();

final MeasuringUnitmeasuringUnit = _drivingTs.getMeasuringUnit();

// get measurement list; just a copy of input values

final List<Measurement> measurementList = _drivingTs.getMeasurementList();

// create an output time series using properties of input time series

final FewsRegularTimeSeriestempTimeseries = new FewsRegularTimeSeries(startTime, endTime, nterval, measuringUnit);

// copy values in input time series to output time series

final FewsRegularTimeSeriesoutputTimeSeries = new FewsRegularTimeSeries(tempTimeseries, _drivingTs);

// get run info properties

final Properties runInfoProperties = getDriverProperties();

// get some properties in run_info.xml file

final intvalueToAdd = Integer.parseInt(runInfoProperties.getProperty("valueToAdd"));

final intvalueToSubtract = Integer.parseInt(runInfoProperties.getProperty("valueToSubtract"));

for(int index = 0; index < measurementList.size(); index++)

{

final Measurement measurement = easurementList.get(index);

final double newValue = measurement.getValue() + valueToAdd - valueToSubtract;

measurementList.set(index, new Measurement(newValue, measurement.getUnit()));

}

outputTimeSeries.setMeasurementList(measurementList);

super.addTStoResultMap(outputTimeSeries);

// each model driver must set the end state time in the states.xml file

// this is important for validating that the state time is updated for the end of the run

super._state.setDateTime(endTime);

}

}

DummModelDriver.Java


Dummy model configuration
Dummy Model Configuration

<exportRunFileActivity>

<exportFile>%ROOT_DIR%/run_info.xml</exportFile>

<properties>

<string key="model" value="dummy.models.DummyModelDriver"/>

<string key=“outputLocationId" value=“SELWE"/>

<int key=“valueToAdd” value=8/>

<int key=“valueToSubstract” value=8/>

<int key="printDebugInfo" value="1"/>

</properties>

</exportRunFileActivity>

<executeActivities>

<executeActivity>

<command>

<className>ohd.hseb.ohdfewsadapter.OHDFewsAdapter</className>

<binDir>$OHDBINDIR$</binDir>

</command>

<arguments>

<argument>%ROOT_DIR%/run_info.xml</argument>

</arguments>

<timeOut>300000</timeOut>

</executeActivity>

</executeActivities>

Set name of the Java class

that implements the model.

Explicitly set the location ID for

model output time series


Ohd legacy models
OHD Legacy Models

  • Uses the OHDFewsAdapter

  • Extends the ModelDriver

  • A framework has been developed to alleviate the effort

    • Uses the LegacyModelAdapter to execute the legacy model

      • Aseparate System Process (called from Java)

    • LegacyModelAdapter has many helper methods such as writeStandAloneFiles().


Legacy model parameter pi xml file
Legacy Model Parameter PI XML File

  • All parameters are defined in one XML parameter element.

  • The OHD legacy adapter framework will export the parameters in native format and pass the filename to the model.


Class hierarchy1
Class Hierarchy

IDriver

Interface

Abstract class

Implements

Driver

User class

OHD class

Extends

LegacyAdapter

ModelDriver

Extends

Extends

Instantiate

OHDFewsAdapter

LegacyModelAdapter

XXXLegacyModelDriver

Instantiate


How is it implemented1
How is it implemented?

className>ohd.model.util.fews.OHDFewsAdapter</className>

</executeActivity>

<exportRunFileActivity>

<properties>

<string key=“model” value=“ohd.model.foo”/>

<string key=“legacyLocation”, value=“executable”/>

</properties>

</exportRunFileActivity>

XML

class OHDFewsAdapter

{

void main()

{

//instantiate

modelDriver= Class.forName( “ohd.model.foo”);

modelDriver.executeDriver();

}

}

class ModelDriver

{

void executeDriver()

{

LegacyModelAdapter adapter = new LegacyModelAdapter();

adapter.executeModel( “executable”, args );

}

}

Java

Java


These are model specific functions.

The framework helps wrap the existing models that are C or Fortran subroutines.


Example dummy legacy model
Example: Dummy Legacy Model

  • The example legacy model

    • Is a shell script

    • Uses the OHD legacy framework

      • Configured as a OHDFewsAdapter

      • Executed by the OHD LegacyModelAdapter.executeModel()

    • Takes an input time series and copies it to the output directory.

    • Write diagnostic messages to the text file, diag.txt

      • The OHD LegacyAdapter will convert the text file to PI XML file, diag.txt for FEWS to ingest.

      • ‘diag.txt’ has to be in a specific format.

        • For example, 4| this is a log message


public class DummyLegacyModelDriver extends ModelDriver

{

@Override

protected void execute() throws Exception

{

/**

* Every legacy model needs to identify a driving time series from the time series read in the inputs.xml file.

* This time series usually controls the run length and time step for executions In this example there is only

* "1" input time series. Another approach is to search by time series type (e.g. parameterId)

*/

_drivingTs = getTsList().get(0);

final LegacyModelAdapterdummyAdapter = new LegacyModelAdapter(this, getWorkDir(), _logger);

dummyAdapter.writeStandAloneFiles();

/**

* The line below is used to execute a stand alone program (separate executable) if there are any model specific

* arguments to be sent, fill in a SortedProperties object and send to executeModel as last argument. Make sure the

* executable returns a '0' exit code. The arguments will be inserted into a text file named arguments.txt and passed

* as an argument to the executable.

*/

dummyAdapter.executeModel(getDriverProperties().getProperty(OHDConstants.LEGACY_LOCATION_DIR) + "/"

+ "dummy_executable", null);

getState().setDateTime(getComputationEndTime());

final List<RegularTimeSeries> resultsList = dummyAdapter.readFromFlatFileToRegularTimeSeriesList();

for(inti = 0; i < resultsList.size(); i++)

{

addTStoResultMap(resultsList.get(i));

}

}

}

Arguments will be written to a text file,

arguments.txt. The file is passed to the

Executable as an argument.


Dummy legacy model configuration
Dummy Legacy Model Configuration

<exportRunFileActivity>

<exportFile>%ROOT_DIR%/run_info.xml</exportFile>

<properties>

<string key="model" value="dummy.models.DummyLegacyModelDriver"/>

<string key=“legacyLocation" value=“Modules/bin"/>

<string key=“outputLocationId" value=“SELWE"/>

<int key="printDebugInfo" value="1"/>

</properties>

</exportRunFileActivity>

<executeActivities>

<executeActivity>

<command>

<className>ohd.hseb.ohdfewsadapter.OHDFewsAdapter</className>

<binDir>$OHDBINDIR$</binDir>

</command>

<arguments>

<argument>%ROOT_DIR%/run_info.xml</argument>

</arguments>

<timeOut>300000</timeOut>

</executeActivity>

</executeActivities>

Set the location of

the binary executable.

Explicitly set the location ID for

model output time series


Quiz

  • OHDFewsAdapter is an executable Java class, true or false?

    Answer:True

  • What ModelDriver method does the OHDFewsAdapter invoke?

    Answer:executeDriver()

  • List at least three differences between an OHD model and an OHD legacy model.

    Answer: One possible answer 1) Java vs. C/Fortran binary; 2) Legacy model reads/writes text files; 3) Legacy model uses the LegacyModelAdapter

  • What argument is passed to the OHDFewsAdapter?

    Answer: run_info.xml

  • Which property in the runinfo file specifies the class name for the model?

    Answer: The “model” property.

  • The runinfo file shall be created by the user, true or false?

    Answer: False.

  • Which ModelDriver method must be implemented by a model

    Answer: The “execute” method.


Nwsrfs models sacsma
NWSRFS Models: SACSMA

  • Rewrite in Java

ModelDriver

Abstract class

User class

Extends

Instantiate

SacSmaModelDriver

OHDFewsAdapter

Used by

SacSmaRainfallRunoffModelAdapter

SacSmaRainfallRunoffModel

Used by







Example sacsma configuration 4
Example SACSMA Configuration 4

SACSMA can accept state modifications as separate input time series.




Sacsma runinfo example
SACSMA runinfo example



Sacsma state files
SACSMA state files

  • states.xml

  • statesI.txt/statesO.txt


Nwsrfs models lagk
NWSRFS Models: LAGK

  • A native binary executable

ModelDriver

Abstract class

User class

Extends

LegacyAdapter

Instantiate

LagKModelDriver

OHDFewsAdapter

Extends

Used by

LegacyModelAdapter

Binary

executable

Executed by


Lagk java code 1
LagK Java Code (1)


Lagk java code 2
LagK Java Code (2)


Lagk configuration 1
LagK Configuration(1)


Lagk configuration 2
LagK Configuration(2)


Lagk configuration 3
LagK Configuration(3)


Lagk configuration 4
LagK Configuration(4)


Lagk runinfo
LagKruninfo


Lagk parameter pi xml files
LagK parameter PI XML files


Lagk state files
LagK state files

  • states.xml

  • statesI.txt/statesO.txt


Lagk directories

lagk

`-- ctwc1

|-- input

| |-- inputs.xml

| `-- params.xml

|-- output

| |-- diag.xml

| |-- outputs.xml

| `-- statesO.txt

|-- run_info.xml

|-- states

| |-- states.xml

| `-- statesI.txt

`-- work

|-- arguments.txt

|-- diag.txt

|-- nwsrfs_datatype_mapping_file.txt

|-- nwsrfs_dataunit_file.txt

|-- outputs.txt

|-- params.txt

|-- run_info.xml

|-- states.xml

|-- statesI.txt

|-- statesO.txt

`-- ts.txt

LagK directories


Hl rdhm
HL-RDHM

  • A software package for NWS distributed hydrologic models

    • Stand-alone tool for distributed hydrologic modeling research and development.

    • A prototype for validating technique in NWS field offices prior to operational software development

  • Written in C++/C/Fortran

  • Distributed models

    • SACSMA, SAC-HT, SACHTET, Snow-17, and Hill slope/channel routing, DHMTF

    • Auto-calibration

    • Models can be run in sequence

  • Incorporated HL-RDHM functionalities into CHPS


Approaches
Approaches

  • Develop a FEWS distributed model general adapter

  • Develop a HL-RDHM model driver

  • Port HL-RDHM components as FEWS external modules

    • If a feature exists in FEWS, use FEWS otherwise use HL-RDHM component

    • Use Java Native Interface (JNI) to link HL-RDHM component with the model driver

  • Develop an external FEWS module that converts NetCDF gridded time series to XMRG files

  • Reuse OHD code if possible




Ohddistfewsadapter java
OHDDistFewsAdapter.java

public class OHDDistFewsAdapter

{

……

public static void main( final String[] args )

{

if( all necessary data are not present or checks are not OK )

{

throw exception

}

else

{

//start logger

defineModelRunInfoAndSetupModels()

Call the ModelDriver'sexecuteDriver() method // execute the model

//write logger

}

}

……

}


Distmodeldriver
DistModelDriver

public class DistModelDriver extends ModelDriver

{

……

public void executeDriver( ) throw Exception

{

……

execute()

……

}

……

}

public class RDHMDriver extends DistModelDriver

{

……

public void execute( ) throw Exception

{

……

getRunInfo()

modelFactory

registerModels

setupDomain

call hlrms_algo()

……

}

……

}



ad