robin wrote:
>
> Pierre Hugonnet wrote:
>
> > If you have a little moment, please could you write
> > for me a library containing the previously described example of "mysum",
> > with a generic interface, which is portable (assuming 24 digits
> > precision exists), and which does not use more
> > memory and CPU than necessary. I'm almost sure that you can
> > not meet all of these requirements, but let's see...
>
> What specifically is the requirement? It's a bit vague now that
> you've changed the specifications.
>
> And is that 24 decimal digits or binary digits? And is that
> default real?
>
The specifications are:
write a function which sums a 1D real array, using an accumulator
whose precision is large enough (let's say at least twice the precision
of the *original* array) to reduce round-off problems.
write several versions for the different possible real kinds.
in the calling program I have:
REAL(selected_real_kind(p=6)) :: a6(n)
REAL(selected_real_kind(p=12)) :: a12(n)
...
s6 = mysum(a6)
s12 = mysum(a12)
The library must:
-be portable (same code on any machine)
-have a generic interface for the routines
-be the more possible memory and CPU efficient
Let's assume for this example that a kind with at least
24 _decimal_ digits precision exist on all target machines.
Best regards, and good luck :-)
--
+-----------------------------------+----------------------------+
| Pierre Hugonnet | mail....CGG |
| | 1, rue Leon Migaux |
| Seismic Data Processing R&D | 91341 MASSY cedex |
| | FRANCE |
| COMPAGNIE GENERALE DE GEOPHYSIQUE | phone...(33) 164 47 45 59 |
| Massy processing centre (France) | fax.....(33) 164 47 32 49 |
| http://www.cgg.com | [log in to unmask] |
+-----------------------------------+----------------------------+
My opinions are not necessarily those of CGG
--------------------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|