You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This briefly explains the method of using the State files of for a model in FEWS environment.

Generally all model requires only the state at the start of the run and writes the state at end of each run.

In FEWS, in an update run (sometimes refers to as Historical Run), the initial state of the model is copied from database to appropraite directory/file where the model expects it to be.
And at end of each run a state is copied back to FEWS database to be used again for the next (update/forecast) model run.

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". 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).

Preprocessor will then unzip tthis file so that the model state file Topkapi.stt is copied from zipped file to the ".\Topkapi\Reno\state" directory and rename this state file to appropraite name as accepted by the model - say for the model run starting at 04/10/2005 00:00 hrs - the state file should of named 200509210000.Stt. Preprocessor can name it accordingly using the period from Mapstack file.
Model is then runnned, using this state file, for a given period. The states files are written to the ".\Topkapi\Reno\state" directory at every simulation time step (in this case 1 hr).
After the model run is completed, the Postprocessor then renames the last state file say 200510040000.Stt to Topkapi.stt file and make a zipped file Topkapi.zip which contains this Topkapi.stt file. 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_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 will then accordingly act on the new pi_state file and stores the correct state to FEWS database.

best regards
Juzer

  • No labels