Re: Interpolating hourly values from a monthly value

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 24 Sep 2007 22:18:16 -0600

No. This will not work.

[1] How can you interpolate in time when you give it
     one time value? You must have at least two points
     for interpolation.

[2] clmMon2clmDay works *only* on climatologies.

http://www.ncl.ucar.edu/Document/Functions/Contributed/clmMon2clmDay.shtml

     It requires that the leftmost dimension [time] be 12.
     Clearly, your
        zDay = clmMon2clmDay(TSOI(0,:,:,:), 1, 0)
     does not satisfy this requirement.

[3] You could probably try something like

     x6hr = new ( (/nlevsoi,nlat,mlon,ntime/), typeof(TSOI) )
     x6hr(:,:,:,2::4) = (/ TSOI /) ; fill every 4th value
     x6hr = linmsg( x6hr , 1)

good luck

Tummuri, Spandana wrote:
> Hello everyone,
>
> I am trying to interpolate 6-hourly values using a monthly value. The file SOIL-2020-01.nc has TSOI as a function of (time,levsoi,lat,lon). In the given file, variable TSOI is written for one timestep, 10 levels, several latitudes and longitudes. TSOI is considered as a monthly average for entire month and I need to interpolate 6-hourly values for the month from the single value. Can anyone please check the code below and tell me if I got it correct?
>
> Thanks in advance
> Spandana
>
> 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"
>
> begin
>
> fn ="/home/stummuri/CCSM-INPUTS/SOIL-2020-01.nc"
>
> in = addfile(fn, "r")
>
> lat = in->lat
>
> lon = in->lon
>
> time = in->time
>
> levsoi = in->levsoi
>
> tsoi = in->TSOI
>
> nlat = dimsizes(lat)
>
> mlon = dimsizes(lon)
>
> ntime = dimsizes(time)
>
> nlevsoi = dimsizes(levsoi)
>
> zDay = clmMon2clmDay(TSOI(0,:,:,:), 1, 0)
>
> x6hr = new ( (/nlevsoi,nlat,mlon,4*31/), typeof(zDay) )
>
> x6hr(:,:,:,::4) = (/ zDay /) ; fill every 4th value
>
> x6hr = linmsg(x6hr, 4)
>
> end
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 24 2007 - 22:18:16 MDT

This archive was generated by hypermail 2.2.0 : Wed Sep 26 2007 - 10:02:41 MDT