Hello,
I need to do a temporal (linear) interpolation of my climate variable of interest from 6-h in the original file to 3-h in the new file. What is the best function to do this in NCL? Do you recommend me to use $B!H(Blinint1_n_Wrap$B!I(B or another function?
I was trying to do this interpolation for temperature values using $B!H(Blinint1_n_Wrap$B!I(B, but the new created file after interpolating has empty values for temperature. I tried to upload my netcdf in the ftp site (incoming) but it seems that I was not allowed to do it (let me know if there is an alternative way for me to upload my data file). So, I attach a pic of an ncdump of my original file (in case it may help) and also the script I used to do the temporal interpolation using $B!H(Blinint1_n_Wrap$B!I(B. Do I need to reverse the latitude of my original file to use the $B!H(Blinint1_n_Wrap$B!I(B function (in case this function wants the grid to be south-to-north)? Is the new time properly created with the "fspan" function (it should be a sequence of 2920 timesteps because the file is 1 year, with time as a double precision variable)? Can anyone, please tell me what do I need to modify in the script to get the right output with the interpolated values in 3-h instead of 6-h?
Thanks.
Francesc
ORIGINAL FILE INFORMATION:
[cid:41983df9-febe-4ba0-bf3f-0309016b4816]
SCRIPT:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
begin
print("reading the variables")
setfileoption("nc","MissingToFillValue",False)
d = addfile("cruncep_tair_2010.nc","r")
setfileoption("nc","Format","LargeFile")
tair=d->tair
printVarSummary(tair)
tair@_FillValue = -9.99999979021477e+33
tair@missing_value = tair@_FillValue
tair = tair (:,::-1,:)
;create a sequence for the new values of time, which has to be a double precision variable
tNew=fspan(21600.00,31536000.00,2920)
tNew@units = "seconds since December 31, 2009 21:00:00"
time=tair&time
$B!!(B
tair1=linint1_n_Wrap(time, tair, True, tNew, 0, 0)
printVarSummary(tair1)
tair1!0 = "time"
tair1!1 = "lat"
tair1!2 = "lon"$B!!(B
$B!!(B
$B!!(B
fout=addfile("cruncep_tairnew_2010.nc", "c")
fout@title="Temperature interpolated into 3-h resolution"
fout->tair=tair1
$B!!(B
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2.1.8 : Fri Feb 22 2013 - 17:42:16 MST