[MITgcm-support] output files from the FLT package to netcdf

钱钰坤 qianyk at mail3.sysu.edu.cn
Tue May 2 08:24:42 EDT 2017


Hi Camille,


I'm pretty sure the strange value of tmp is due to the incorrect big_endian/little_endian format that you have specified in the fortran program.  I'm not familiar with fortran but I know you can alter the format using compiler argument.  For matlab, you can change the format as:


fid=fopen('data.dat','r','ieee-le'); % for little-endian
fid=fopen('data.dat','r','ieee-be'); % for big-endian


If you are not clear which one is used, just try both format and you'll get the right numbers for only one format.

------------------
 Best regards 
 
Yu-Kun Qian (钱钰坤) 
Center for Monsoon and Environment Research 
 Department of Atmospheric Sciences
School of Environmental Science and Engineering 
 Sun Yat-sen University 
No. 135 Xingang West Road, Haizhu District 
Guangzhou, 510275, P.R. China 
Tel; 020-84115227 
Email: qianyk at mail3.sysu.edu.cn      


 
 
 
------------------ 原始邮件 ------------------
发件人: "Camille Mazoyer"<mazoyer at univ-tln.fr>;
发送时间: 2017年5月2日(星期二) 下午5:59
收件人: "mitgcm-support"<mitgcm-support at mitgcm.org>; 

主题: [MITgcm-support] output files from the FLT package to netcdf

 
Dear all,

I would like to compare read drifters trajectories (surface buoys) to my 
simulation. For that, I see that I can use flt package.  So I start with 
the flt example and try to understand how it works.

I would like to transform outputs float_trajectories.* from the example, 
to netcdf files. I see that they are two ways to do that:

- cvfloat.F90 from the extra directory of flt example

- a python toolbox named floater

I'm trying both manners, and I encounter problems with both ... For 
floater toolbox, I'm asking for help in they github url.  For 
cvfloat.f90, I would like to know if the script should work with the 
example without doing nothing? Is it the last version? flt output are in 
float32 (according to the meta files), so I had to change some double 
precision into single precision in cvfloat.F90, and I change a flag for 
the grid:

  For the flt example, theses lines:

   logical :: usingSphericalPolarGrid=.true.

   real*8, dimension(:), allocatable ::  tmp

   ilen=IMAX*8

become :

   logical :: usingSphericalPolarGrid=.false.

    real*4, dimension(:), allocatable ::  tmp

   ilen=IMAX*4


Now, the error for me is when I try to read the first record tmp. If I 
write tmp at line

  tmp:  7.1838967E-41  3.4893733E-41  1.7646863E-38 3.4893733E-41  
2.3048557E-41
   4.3986759E-42  2.8789677E-41  0.0000000E+00  0.0000000E+00 0.0000000E+00
   0.0000000E+00  0.0000000E+00  0.0000000E+00

Where, according to the matlab script read_flt_traj.m,  I should read   
100,  3600, 10800, 3600, 3, 140, 13, 0, 0,  0,  0, 0, 0

I am stuck here, so any advices is welcome,

Thank you very much for your help,

Camille

-- 
------------------------------------------
Camille Mazoyer
Phd Student
Mediterranean Institute of Oceanography (MIO)
Institut de Mathématiques de Toulon (IMATH)
Université de TOULON
Bat X - CS 60584
83041 TOULON cedex 9
France
tel: +33.4.94.14.24.50
Email: mazoyer at univ-tln.fr
http://mio.pytheas.univ-amu.fr/
http://imath.fr/


_______________________________________________
MITgcm-support mailing list
MITgcm-support at mitgcm.org
http://mitgcm.org/mailman/listinfo/mitgcm-support
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20170502/56713656/attachment.htm>


More information about the MITgcm-support mailing list