[Thread Prev][Thread Next][Index]

Re: [ferret_users] to combine daily file to monthly



Hi Jaya,
First try removing the /CLOBBER qualifier from your SAVE commands. /CLOBBER will delete the file before writing, and /APPEND will keep the file, and add to it.

The individual files have a time axis already.  Are the times in each file correct?  For instance, if you open one of the files and execute the command
yes? SHOW GRID sst
do you see the correct time for that day? If the times in the files are correct then you should be able to just append them without defining a time axis and using a time stamp. NetCDF files can be appended in time.

! Get rid of the file you will be writing to, if it exists
yes? sp rm -f sst_0801.nc

yes? repeat/l=1:31 (define symbol fname =  200801`l`.nc ; set data ($fname) ;  save/file=sst_0801.nc/append SST; cancel data ($fname)  ; cancel memory )

yes? cancel cata/all
yes? use sst_0801.nc
yes? show data

jaya kumar A wrote:
dear users,
2008011.nc,2008012.nc
i want to combine daily file like
2008011.nc,2008012.nc,2008011.nc,2008013.nc...............................20080131.nc files

i want to combine this file to make monthly file , i tried like this

set memory/size=300
define axis/T="1-jan-2008":"31-jan-2008":1/units=days TIME
LET tstamp = T[GT=TIME] * 0
repeat/l=1:31 (define symbol fname =  200801`l`.nc ; set data ($fname) ; Let SST1=SST +tstamp ; save/file=sst_0801.nc/CLOBBER/append SST1; cancel data ($fname)  ; cancel memory )
cancel data/all

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! but i am getting like this |||||||||||||||||||||||||||||


repeat/l=1:31 (define symbol fname =  200801`l`.nc ; set data ($fname) ; Let SST1=SST +tstamp ; save/file=sst_0801.nc/CLOBBER/append SST1; cancel data ($fname)  ; cancel memory )
 !-> repeat/l=1:31 (define symbol fname =  200801`l`.nc ; set data ($fname) ; Let SST1=SST +tstamp ; save/file=sst_0801.nc/CLOBBER/append SST1; cancel data ($fname)  ; cancel memory )
!-> REPEAT: L=1
 !-> define symbol fname =  2008011.nc
 !-> set data 2008011.nc
 *** NOTE: Ambiguous coordinates on T axis: SST +TSTAMP
 LISTing to file sst_0801.nc
 !-> cancel data 2008011.nc*** NOTE: Ambiguous coordinates on T axis: SST +TSTAMP
  LISTing to file sst_0801.nc
 !-> cancel data 2008011.nc
 TEMPORARY data cleared from memory
!-> REPEAT: L=2
 !-> define symbol fname =  2008012.nc
 !-> set data 2008012.nc
 *** NOTE: Ambiguous coordinates on T axis: SST +TSTAMP
 **ERROR: illegal limits: "SST1" is not in the range L=2
          Axis extremes are L=1
LIST/FORMAT=CDF/file=sst_0801.nc/CLOBBER/append SST1
Command file, command group, or REPEAT execution aborted
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
my netcdf description of one file are given

dimensions:
        time = 1 ;
        zlev = 1 ;
        lat = 720 ;
        lon = 1440 ;
variables:
        float time(time) ;
                time:long_name = "Center time of the day" ;
                time:units = "days since 1978-01-01 00:00:00" ;
        float zlev(zlev) ;
                zlev:long_name = "Sea surface height" ;
                zlev:units = "meters" ;
                zlev:actual_range = "0, 0" ;
        float lat(lat) ;
                lat:long_name = "Latitude" ;
                lat:units = "degrees_north" ;
                lat:grids = "Uniform grid from -89.875 to 89.875 by 0.25" ;
        float lon(lon) ;
                lon:long_name = "Longitude" ;
                lon:units = "degrees_east" ;
                lon:grids = "Uniform grid from 0.125 to 359.875 by 0.25" ;
        short sst(time, zlev, lat, lon) ;
                sst:long_name = "Daily sea surface temperature" ;
                sst:units = "degrees C" ;
                sst:_FillValue = -999s ;
                sst:add_offset = 0.f ;
                sst:scale_factor = 0.01f ;
                sst:valid_min = -300s ;
                sst:valid_max = 4500s ;

// global attributes:
                :title = "Daily optimum interpolation(OI) SST: AVHRR only;" ;
                :History = "Version 1.0" ;
                :Description = "Reynolds, et al.(2006) Daily High-resolution Blended Analyses. Available at ftp://eclipse.ncdc.noaa.gov/pub/OI-daily/daily-sst.pdf  Climatology is based on 1971-2000 OI.v2 SST, Satellite data: Navy NOAA17 NOAA18 AVHRR, Ice data: NCEP ice" ;
                :Source = "NOAA/National Climatic Data Center" ;
                :Contact = "Dick Reynolds, email: Richard.W.Reynolds@xxxxxxxx &
Chunying Liu, email: Chunying.liu@xxxxxxxx" ;
                :netcdf_Convention = "COARDS" ;
data:

 time = 10958 ;

 zlev = 0 ;

thankful for all helps

-
JAYAKUMAR A
Junior Research Fellow,
Theoretical Studies Division
IITM, Pune-8

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement