next up previous
Next: 7. Model physics Up: 6. Grids etc Previous: 6.1 Zooming

6.2 Slopes and moments

The tracer mass is $rm$ (kg) and the air mass is $m$ (kg) The mixing ratio is then $f=rm/m$ (kg tracer/kg air).

A tracer field is defined by 1, 4, or 10 three-dimensional arrays:

array unit description
rm kg toal tracer mass in cell
rxm, rym, rzm kg/(half grid cel) first order moments (slopes)
rxxm, ryym, rzzm
rxym, rxzm, ryzm
kg/(half grid cel)$^2$ second order moments

The slopes and moments are properties of the concentration gradient inside the cell.

Consider a cell volumne $[0,X]\times[0,Y]\times[0,Z]$. The convention for the length scales is that a half cell has lenght $1$, thus $X=Y=Z=2$. We would like to know the concentration in a point $(x,y,z)$ in the cell. From equations (7) and (9) in [Prather, 1986] we find that the tracer mass mixing ratio (kg tracer/kg air) is given by:

$\displaystyle f(x,y,z)$ $\textstyle =$ $\displaystyle \left[~ {rm} \right.$ (6.1)
    $\displaystyle ~+~ {rm}_x\ (x - X/2)
~+~ {rm}_y\ (y - Y/2)
~+~ {rm}_z\ (z - Z/2)$ (6.2)
    $\displaystyle ~+~ {rm}_{xx}\ ( x^2 - X x + X^2/6 )
~+~ {rm}_{yy}\ ( y^2 - Y y + Y^2/6 )
~+~ {rm}_{zz}\ ( z^2 - Z z + Z^2/6 )$ (6.3)
    $\displaystyle \left. ~+~ {rm}_{xy}\ (x-X/2)(y-Y/2)
~+~ {rm}_{xz}\ (x-X/2)(z-Z/2)
~+~ {rm}_{yz}\ (y-Y/2)(z-Z/2) ~\right]\ /\ m$ (6.4)

\begin{figure}\centering
\psfig{file=fig/slopes.eps,scale=0.8}
\end{figure}

Coding of slopes and second moments

The best way to implement slopes/second moments is to have them compiled only if certain preprocessor macro's are defined.

In cy3, at least macro 'slopes' should be defined; in addition, 'secmom' might be defined to.

      ! at least slopes should be defined:
      #ifndef slopes
        stop 'slopes not defined'
      #endif

      ! second moments as extension of slopes:
      #ifdef slopes
        rxm = 0.0
      #ifdef secmom
        rxxm = 0.0
      #endif
      #endif

      ! different codes:
      #ifdef slopes
      #ifndef secmom
        call adv_slopes
      #else
        call adv_secmom
      #endif
      #endif


next up previous
Next: 7. Model physics Up: 6. Grids etc Previous: 6.1 Zooming
Created at IMAU on Tue Mar 3 05:00:05 CET 2009 by a slave chained in the basement