temporal interpolation with linint1_n_Wrap

From: Montane Caminal, Francesc <fmontane_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 25 2013 - 12:03:31 MST

Hello NCL users,
I need to do a temporal interpolation of my climate variable of interest from 6-h in the original file to 3-h in the new file.
Attached is a file that includes temperature values for 2 times measured in 6-hours interval (total time 12 hours). I was trying to interpolate temperature values using “linint1_n_Wrap” to get 4 measures of temperature, one every 3-h (interpolate temperature values from 6-h to 3-h in the new file, for the total time of 12 hours), but the new created file after interpolating has empty values of temperature.
I attach my original netcdf file and also the script I used to do the temporal interpolation using “linint1_n_Wrap”. Is there a more recommended function than “linint1_n_Wrap” to do this? 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?
Any help will be very appreciated!
Thanks.
Francesc

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)

a = addfile("cruncep_tair_2010_1x1_2time.nc","r")

temp=a->y

printVarSummary(temp)

temp@_FillValue = -9.99999979021477e+33

temp@missing_value = temp@_FillValue<mailto:temp@_FillValue>

;reverse the latitude values

temp = temp (:,::-1,:)

;create a sequence for the new values of time, which has to be a double precision variable

tNew=fspan(21600.00,43200.00,4)

tNew@units = "seconds since December 31, 2009 21:00:00"

 

time2=a->time

 

tair1=linint1_n_Wrap(time2, temp, False, tNew, 0, 0)

printVarSummary(tair1)

print("tair1: min="+min(tair1)+" max="+max(tair1))

tair1!0 = "time"

tair1!1 = "lat"

tair1!2 = "lon"

 

 

 

fout=addfile("cruncep_tairnew_2010_1x1_3h_2time.nc", "c")

fout@title="Temperature interpolated into 3-h resolution for 12-h in January 2010"

fout->y=tair1

 

end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Mon Feb 25 12:03:54 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 28 2013 - 14:47:31 MST