[Thread Prev][Thread Next][Index]

Re: [ferret_users] converting binary to netCDF: memory insufficient?



Hi Ryo,

Unlike netCDF, reading binary data requires reading in the whole grid at once. That's one of the big advantages of netCDF. So you're not gaining anything with the repeat loop.  To read it in segments you would need to define a smaller grid to read a subset of records and write that out, the do a second read, skipping those first records, and so on.

-Ansley

On 5/1/2020 1:03 AM, Ryo Furue wrote:
Dear Ferret users,

I seem to be missing something, but I can't even list a single point of my 4D variable:

yes? save/clobber/i=1:1/j=1:1/k=1:1/l=1:1/file=tmp.nc temp[i=1,j=1,k=1,l=1]
. . . memory error . . . 
yes? list/i=1/j=1/k=1/l=1 temp
. . . memory error . . . 

(Some more details are at the end of this message).

Basically, I just want to convert a 4D variable in a raw-binary format to a netCDF file.

Is there any fundamental limit to the size of the underlying raw binary file?

The array is in the regular Fortran order of (i, j, k, l) and because i=1:500 and j=1:400, the x-y plane (500 x 400) isn't so large.  It's just 1.5 MB in double precision.  So, I thought saving by

repeat/L=1:73 ( \
    repeat/K=1:67 ( \
        save/append/klimits=1:67/file=output.nc temp ) )

would be manageable.

Regards,
Ryo
---------
  NOAA/PMEL TMAP
  PyFerret v7.5 (optimized)
  Linux 4.15.0-1061-azure - 11/14/19
   1-May-20 16:40
[. . . ]
yes? file/form=STREAM/type=r8/var=temp/grid=grid_xt_yt_zt_ctime\
 temp-pntd.bin
yes? set memory/size=300
yes? save/clobber/i=1:1/j=1:1/k=1:1/l=1:1/file=tmp.nc temp[i=1,j=1,k=1,l=1]
 **ERROR: request exceeds memory setting
    To fulfill this request would exceed the current SET MEMORY/SIZE= limit of 300 megawords
    At the moment that the memory limit was reached
    memory was committed as follows:
        - to objects used in computation: : 0 (0%)
    The size of the requested object was: : 978200000 (326%)
yes? show grid temp
    GRID GRID_XT_YT_ZT_CTIME
 name       axis              # pts   start                end                 subset
 XT        LONGITUDE          500mr   105.05E              154.95E(154.95)     full
 YT        LATITUDE           400 r   44.95S               5.05S               full
 ZT        Z (METERS)          67 i   2.5                  767.22              full
 CTIME     TIME                73mr   06-JAN 00:00         01-JAN 00:00        full
yes?
-- 
Ansley Manke
Science Data Integration Group
NOAA Pacific Marine Environmental Laboratory
7600 Sand Point Way NE
Seattle WA 98115

I am currently teleworking and am available Tue-Wed-Thu.

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement