[MITgcm-support] precision difference between freshwater flux bin file generated with Matlab and EXFempmr diagnostics

Martin Losch Martin.Losch at awi.de
Mon Jan 8 11:40:22 EST 2018


Sandy,

- is the masking the same?

- when you compute the net flux in matlab do you first save the fields to your files and then read them again? There’s always some extra precision (in excess of the 64bits)  in the “online” fields that you loose when you save them to disk. Very often that’s the the reason for these differences.

Martin

> On 5. Jan 2018, at 23:31, <Sandy.Gregorio at uqar.ca> <Sandy.Gregorio at uqar.ca> wrote:
> 
> Hi everyone,
> 
> I use mnc/exf/seaice packages. I want to "control" my freshwater flux, sflux, so I prescribe the precipitation and evaporation fields such that my sflux (=evap-precip) integrates to zero (or at least integrates to an order of 10^(-11)) at the surface. 
> 
> If I look at my results, my salt in my basin increases all the time during my simulation. I compared the sflux I generate with Matlab in binary file (that is evap-precip) with my EXFempmr diag and they differ to an order of 10^(-23) (my sflux generated with Matlab integrates to 10^(-11) while my sflux from EXF integrates to 10^(-9)). 
> 
> To generate my forcing files, I have tried:
> fid=fopen('precip.bin','w','ieee-be.l64'); fwrite(fid,precip,'real*8'); fclose(fid);
> and
> fid=fopen('precip.bin','w','ieee-be'); fwrite(fid,precip,'real*8'); fclose(fid);
> 
> In data, PARM01, I have:
> readBinaryPrec=64,
> writeBinaryPrec=64, 
> 
> In data.exf, EXF_NML_01, I have:
> exf_iprec         = 64,
> 
> I have to admit that my difference is smaller since I have used double precision (first I was using real*4 and precision 32, and my EXFempmr integrated to 10^(-3) which is very bad!) but I was wondering if I could get exactly in my diags what I generated with Matlab, and where does this difference between my sflux generated with Matlab and my diags comes from.
> 
> If you have ideas/suggestions it would be very cool! By the way, I compile with ifort v15 using build-option/linux_ia64_ifort.
> 
> I wish you a wonderful year 2018 :)
> 
> Sandy
> 
> ps: I get same difference without mnc package
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support



More information about the MITgcm-support mailing list