[Thread Prev][Thread Next][Index]

Re: memory problem

Hello Ramish,
To read all your data at once would require over 415 words, which
would require you to SET MEMORY/SIZ=416, say, in order to read
your data. It might be
better to do the problem in pieces, appending time steps, or groups
of time steps, to the NetCDF file. There is section on file conversions
in Chapter 10 of the Users Guide: Ch 10, sec 2 (look up "NetCDF,
converting to" in the index). Example 3 in that section shows how to
append time steps to a NetCDF file. You would need to define a shorter
time axis for each group of time steps and skip records in the input file to
get to the correct point in the file.
Ansley Manke

ramesh wrote:

Dear Ferret users,

I tried to convert a binary file into  netcdf file
using  the Ferret Script - given below.  It did
not work due to MEMORY SIZE problem.   We
are using SOLARIS-7  Operating System, with
512 MB RAM  and the available hard-disk
space is  2GB.

Thank you for your help.

The error message is as follows:
set r/i=1:192/j=1:128/k=1:32/l=1:528
save/file=ptemp5801.nc ptemp
**ERROR: insufficient memory: 415236096 words were requested.
LIST/FORMAT=CDF/file=ptemp5801.nc ptemp
Command file, command group, or REPEAT execution aborted
*** NOTE: You can use SET MEMORY/SIZE=xxx to increase memory.
*** NOTE: The "Memory use" section of the FERRET Users Guide has
further tips.

The  Ferret Script is below:
Set state
set mode desperate
can/all data
can/all var

! Define depths grid
def axis/x=1:32:1/unit="levels" dax
def grid/x=dax dg

! Read depths data
file/grid=dg/var=depths depths.dat
set var/tit="Standard Depths"/unit=m depths

! Define axes
def axis/x=180.0W:178.125E/npoints=192/unit=deg xax
def axis/y=90.0S:88.5938N/npoints=128/unit=deg yax
DEF AXIS/T0=1-JAN-0000/T=1:528:1/npoints=528/units=months tax1
alias daxis def axis/depth/from_data/z/npoints=32/name=zax
daxis/unit=meters depths[d=1,i=1:32]

! Read data
def grid/x=xax/y=yax/z=zax/t=tax1 tg
file/form=stream/order=xyzt/grid=tg/var="ptemp" ptemp58_01.bin
set var/tit="Potential Temperature"/unit="deg Cel" ptemp

! clean up
can data 1

! Set state for netCDF file writing
can memory
set memory/size=100.0                             ! MegaWords

! Write netCDF file
set r/i=1:192/j=1:128/k=1:32/l=1:528
save/file=ptemp5801.nc ptemp

! Set state
set memory/size=50.0
can/a data

set mode verify
can/all data
can/all var

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement