Download XIOS User Guide - Forge

Transcript
CHAPTER 3.
21
FIELDS AND VARIABLES
</ f i l e >
</ f i l e _ d e f i n i t i o n>
</ c o n t e x t>
</ s i m u l a t i o n>
This example shows how to compute the minimum on 7 days of the daily average
of eld_A. In this context, the
freq_op
attribute denes the period of the
temporal operation for all elds pointed with the @ operator in the expression.
Another use of this feature is to do arithmetic operations on the result of temporal operations.
The following conguration le for example shows how to
output the standard deviation for a eld on a one day period:
<?
xml version=" 1 . 0 " ?>
< s i m u l a t i o n>
<c o n t e x t
i d=" t e s t ">
<c a l e n d a r
t y p e=" G r e g o r i a n "
t i m e s t e p=" 1 h "
/>
< g r i d _ d e f i n i t i o n>
i d=" grid_A ">< ! −−
<g r i d
Ç
ommited
−−></ g r i d
g r i d _ r e f=" grid_A "
operation
Definition
>
</ g r i d _ d e f i n i t i o n>
< f i e l d _ d e f i n i t i o n>
<f i e l d
Ç
i d=" f i e l d _ A "
=" a v e r a g e "
<f i e l d
Ç
/>
i d=" f i e l d _ A _ s q u a r e "
field_A
*
f i e l d _ r e f =" grid_A ">
f i e l d _ A</ f i e l d >
</ f i e l d _ d e f i n i t i o n>
< f i l e _ d e f i n i t i o n>
<f i l e
name=" o u t p u t "
<f i e l d
Ç
Ç
Ç
o u t p u t _ f r e q=" 1 d ">
name=" f i e l d _ A _ s t d _ d e v "
grid_A "
g r i d _ r e f="
o p e r a t i o n=" i n s t a n t "
"> s q r t ( @ f i e l d _ A _ s q u a r e
−
f r e q _ o p=" 1 d
@ f i e l d _ A ^ 2 )</
f i e l d>
</ f i l e >
</ f i l e _ d e f i n i t i o n>
</ c o n t e x t>
</ s i m u l a t i o n>
Note that since an
instant
operation is used,
freq_op
and
output_freq
are identical in this scenario.
3.7 How to access the data of a eld
In order not to waste memory, the instant data of a eld can be read from the
model only if:
ˆ
it is part of a le whose attribute
mode is read