Using the ExtData component: Difference between revisions

Bmauer (talk | contribs)
Bmauer (talk | contribs)
Line 57: Line 57:


==== Refresh Template ====
==== Refresh Template ====
The refresh template allows quite a bit of flexibility in how the data can be distributed in the files and when the data is updated.
The refresh template allows quite a bit of flexibility in how the data can be distributed in the files and when the data is updated. [[In all cases, ExtData will try to time interpolate to the current model time or the time evaluated by applying the current application time to the fresh template if it is a grads style entry with tokens]].


If you enter '-' the field will be updated only the first time ExtData runs. It will take the current model time, apply that to the file template provided and finally try to find data on the file at the current model time to fill the variable. It will not do time interpolation.
If you enter '-' the field will be updated only the first time ExtData runs. It will take the current model time and try to interpolate to that time using the available data.  


If you enter a refresh template to update at a certain time each day, month, etc ... as described above there are a few considerations. When ExtData trieds to fill the field at the time described by the template it will once again apply the current model time to the file template, and then try to find data on file at that time. It will not do time interpolation.
If you enter a refresh template to update at a certain time each day, month, etc ... as described above there are a few considerations. When ExtData tries to fill the field at the time described by the template it will once again apply the current model time to the file template, then interpolate to that time using the available data. For example if your have a refresh template that is


The most complex case is if you enter '0' for the refresh template. In this case the field gets updated every step and ExtData will try to interpolate to that time using the data on file and can interpolate between data points in different files. In order to accomplish this if you select a refresh template of '0' ExtData tries to find two times that bracket the start time the first time ExtData runs. These get updated as time advances in your application. But how does it know what time to apply to the file template if the data is spread across multiple files? This is where the idea of a file frequency and reference time comes in. The user can specify a file frequency and a reference time either with the 3 optional key words to the primary export or by letting ExtData "guess" from the file template. The idea is that starting from a reference time and the given frequency ExtData tries to find the bracketing data on the file with the time closest to the current time. If it does not find the data there it checks the next time. The user can specify a reference time and the frequency. If these are not given it tries to guess this from the file template. For example if the last token in the template is an hour then the frequency is an hour and the reference time is whatever the current data is with anything after the hour set to zero. If the file template is myfile_%y4%m2%d2_%h2.nc4 and ExtData will assume the frequency is 1 hour and the reference time is the top of the hour on whatever date you start the application. The following picture illustrates another example.
If you enter '0' for the refresh template the field gets updated every step and ExtData will try to interpolate to the application time using the data on file.
 
Let me repeat, ExtData always tries to interpolate to the time you tell it too using the data. To do this is
 
 
These get updated as time advances in your application. But how does it know what time to apply to the file template if the data is spread across multiple files? This is where the idea of a file frequency and reference time comes in. The user can specify a file frequency and a reference time either with the 3 optional key words to the primary export or by letting ExtData "guess" from the file template. The idea is that starting from a reference time and the given frequency ExtData tries to find the bracketing data on the file with the time closest to the current time. If it does not find the data there it checks the next time. The user can specify a reference time and the frequency. If these are not given it tries to guess this from the file template. For example if the last token in the template is an hour then the frequency is an hour and the reference time is whatever the current data is with anything after the hour set to zero. If the file template is myfile_%y4%m2%d2_%h2.nc4 and ExtData will assume the frequency is 1 hour and the reference time is the top of the hour on whatever date you start the application. The following picture illustrates another example.
[[File:Bracketing_data.png]]
[[File:Bracketing_data.png]]