Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

To facilitiate this, the following steps are followed in FEWS
FEWS copies the model state file (say: Model.zip) from database to a model directory say ".\Model\state". The model state can be a zipped file which can then be unzipped by Preprocessor will and copy it to the appropraite model state directory. This zipped file may contain one or more state files depending on a model (for example HBV, model has number of state file which is equivalent to number of of districts). The information of state locations and date and time of state is written to a PI State XML file. An example is shown below.

No Format

<?xml version="1.0" encoding="UTF-8"?>
<State
    xsi:schemaLocation="http://www.wldelft.nl/fews/PI http://fews.wldelft.nl/schemas/version1.0/pi-schemas/pi_state.xsd"
    version="1.2" xmlns="http://www.wldelft.nl/fews/PI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <stateId>warm</stateId>
    <timeZone>0.0</timeZone>
    <dateTime date="2008-02-10" time="00:00:00"/>
    <stateLoc type="file">
        <readLocation>D:\Fews\App\po_sa\Modules\Topkapi\Trebbia\Fews_in\State\Topkapi_in.stt</readLocation>
        <writeLocation>D:\Fews\App\po_sa\Modules\Topkapi\Trebbia\Fews_in\State\Topkapi_in.stt</writeLocation>
    </stateLoc>
</State>

...

Model is then runnned, using this state file, for a given period. The states files are written back to the state directory say ".\Model\state" directory at endof the end of simulation.
After the model run is completed, the Postprocessor then renames and copies the state file ( or files ) back to the zip model state zipped file (say:Model.zip)

The last state file can be determined easily using the period from mapstack file.
FEWS then copies this new zipped file back to its database and give it a time stamp equal to the end of simulation run.

Hope the above points would serve as a guideline to update the Pre / Post processors of TopKapi model.

According to Micha the general adapter does renaming of the state file hence the steps to be followed are as under.. (and no need for the read / write state file to have same name )

Example of pi_state (few lines only.) :

(Please note: you can select the name of state whatever you want - I have selected Topkapi_in.stt)

<dateTime date="2006-06-28" time="00:00:00"/>
<stateLoc type="file">
<readLocation>D:\FewsPO\Modules\Topkapi\Reno\States\Topkapi_in.stt</readLocation>
<writeLocation>D:\FewsPO\Modules\Topkapi\Reno\States\200606280000.stt</writeLocation>

Step to Follow ..

1 ) The Preprocessor reads the pi_state file and copies the TopKapi.stt file to proper name based on the dateTime (start time of the model).
(Please Note: If TopKapi model can use as input the given file TopKapi.stt then the renaming is not necessary)

In above example it should be 200606280000.stt which is same as date and time in the <dateTime> field in the pi_state xml file as shown above.

2) The Postprocessor updates the pi_Postprocessor not onlyu copy back the state file but also updates the pi state file with the last state file and changes the <dataTime> field to appropraite date time

For example , if the model is runned till 2006-06-30 00:00,

  • then the date and time in the <dateTime> field should be changed to <dateTime date="2006-06-30" time="00:00:00"/> and
  • the file name under <writeLocation> should be changed to
    <writeLocation>D:\FewsPO\Modules\Topkapi\Reno\States\200606300000.stt</writeLocation>

GA The General Adapter will then accordingly act on the new pi _ state file and stores the correct state to FEWS database.best regards
Juzer