[Thread Prev][Thread Next][Index]

[ferret_users]: time interpolation from files with different time axes fails

I am trying to use ferret to calculated downward longwave radiation from air-temperature, cloudiness and relative humidity. All data are given 6 hourly, but cloudiness times are shifted by 3 hours agains air-temperature and relative humidity.
I would like hourly radiation values and interpolate input data.

My script looks like follows:
use "/DATABASE/2000/cloud.dta.nc"
use "/DATABASE/2000/tair.dta.nc"
use "/DATABASE/2000/rhumi.dta.nc"

!Define a new time axis ( the input data cover dec 1999 and  jan 2001)
define axis/t=1-dec-1999:31-jan-2001:1/unit=hours/t0=1-jan-1955/cal=julian time
define grid/t=time tgrid
let tdummy=0*t[gt=tgrid]

! for shorter notation
let ta =   tair[d=2]
let rh =  rhumi[d=3]
let cl =  cloud[d=1]

!linearly interpolate to a hourly common time basis
let ta_net = ta[gt=tdummy@lin]-273.15
let rh_net = rh[gt=tdummy@lin]
let cloud_net = cl[gt=$1@lin]

Now these quantities are used to calculate the radiation by simple operations. Shading (l=something or x=something) prior writing to a file gives reasonable output. The problem is now, that the amount of data is huge. With a limited area output can be written in one step

sp rm lwdn_ber.mom.dta.nc
save/append/file="lwdn_ber.dta.nc" lwdn_ber

This gives reasonable results.

For the full data set I try to write time step after time step
sp rm lwdn_ber.dta.nc
let lmax=`tdummy,return=lend`
repeat/l=1:`lmax` (save/append/file="lwdn_ber.dta.nc" lwdn_ber)

This generates an output file of correct size. For some periods (days) data are correct, but there
are also periods, where every fourth dataset is filled with missing values.

Does anyone have an idea, what I am doing wrong?

Martin Schmidt

[Thread Prev][Thread Next][Index]

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

Privacy Policy | Disclaimer | Accessibility Statement