[MITgcm-devel] diagnostics: fixing variances
Jean-Michel Campin
jmc at ocean.mit.edu
Mon May 9 13:17:59 EDT 2005
Hello Ed,
I don't understand exactly this "elegant" solution,
and I have seen 2 recent modifications that were
supposed to fix this precision problem:
1) the new "fflags" (to write 1 file in real*8).
2) new diagnostics: SALTanom and SALTSQan
my question is what is the problem with those 2 solutions ?
Thanks,
Jean-Michel
On Sun, May 08, 2005 at 12:55:35AM -0400, Ed Hill wrote:
>
> Hi Jean-Michel, Andrea, Gael, & Dimitris,
>
> Heres an idea for improving the diagnostics package that will, I think,
> elegantly solve the output-precision problem for variances.
>
> The problem is: if one wants to compute variances within diagnostics,
> one currently has to choose between doubling the size of the output
> using REAL*8, facing very serious (catastrophic as Gael has seen w/
> SALT) precision loss using REAL*4 output, or messing with some sort of
> scaling to try to subtract a mean. All are bad choices. But there is a
> deeply satisfying fix! Instead of computing a mean and a mean-of-
> squares as we currently do (eg. SALT, SALTSQ) and then squashing them
> into REAL*4 for the output, we should instead compute a mean and a
> standard deviation together within the model
>
> VAR_STD = sqrt( mean(VAR^2) - (mean(VAR))^2 )
>
> as another kind of "pair-wise" diagnostic. The benefits are:
>
> - its the *same* information but with absolutely minimal loss
> of precision since the rounding occurs ***after*** the critical
> bits are computed
> - it adds no additional storage to either the model or the output
> - Dimitris (and others with huge simulations) get to use the
> more compact REAL*4 for all output
>
> The only down-side is that we need to re-work the code a bit. But its
> not a massive re-write. The diagnostics package can certainly handle
> this sort of thing within its design.
>
> Attached is an example plot and a MatLAB script used to draw it. It
> shows how this approach can maintain precision over 4+ additional orders
> of magnitude (green line) over what we currently do (red line).
>
> Ed
>
> --
> Edward H. Hill III, PhD
> office: MIT Dept. of EAPS; Rm 54-1424; 77 Massachusetts Ave.
> Cambridge, MA 02139-4307
> emails: eh3 at mit.edu ed at eh3.com
> URLs: http://web.mit.edu/eh3/ http://eh3.com/
> phone: 617-253-0098
> fax: 617-253-4464
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list