Re: calculating daily SST anomaies

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 23 2014 - 07:28:19 MDT

? ... "but the results are still very strange." This does not give ncl-talk
much information. What is "very strange"?

Also, including the output from printVarSummary(...) is often helpful.

--
[1] Uncomment your '; climoHarm = smthClmDayTLL( climo, 3 )' section
[2]

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

undef("smthClmDayTLL")
function smthClmDayTLL (clmDay[*][*][*]:numeric, nHarm:integer)
;
local nFill, dn, z, cf, clmDaySmth
begin

 ;if (isatt(clmDay, "_FillValue")) then
 ; nFill = num(ismissing(clmDay))
 ; if (nFill.gt.0) then
 ; print("smthClmDay_TLL: No missing values allowed: ezfftf does not
allow")
 ; print("smthClmDay_TLL: nFill="+nFill)
 ; exit
 ; end if
 ;end if

  dn = getvardims(clmDay) ; get dimension names
  if (dn(0).ne."year_day") then
      print("smthClmDayTLL: Warning: Usually expect year_day to be the
dimension name")
  end if

  z = clmDay($dn(1)$|:,$dn(2)$|:,$dn(0)$|:); reorder make time fastest
varying dimension
  cf = ezfftf( z ) ; [2] x [nlat] x [mlon] x
[nday/2+1]

                                            ; remember NCL is 0-based
                                            ; cf(:,0:nHarm-1) are retained
unaltered
  cf(:,:,:,nHarm ) = 0.5*cf(:,:,:,nHarm) ; mini-taper
  cf(:,:,:,nHarm+1:) = 0.0 ; set all higher coef to 0.0

  z = ezfftb( cf, cf@xbar) ; reconstructed series

  clmDaySmth = z($dn(0)$|:,$dn(1)$|:,$dn(2)$|:)
  clmDaySmth@information = "Smoothed daily climatological averages"
  clmDaySmth@smoothing = "FFT: "+nHarm+" harmonics were retained."

  return(clmDaySmth)
end
====

Run your code



On Sat, Jun 21, 2014 at 12:31 AM, antonio avio <antonioavio@googlemail.com>
wrote:

> Hi NCL,
>
> I tried to calculate the SST anomalies by the following commands:
>
> data = f->sst(iStrt:iLast,{20:90},:)
> printVarSummary(data)
> data@_FillValue=-999
>
> climo = clmDayTLL( data, yyyyddd )
> copy_VarAtts( data, climo )
> printVarSummary( climo )
>
> climoHarm = smthClmDayTLL( climo, 3 )
> copy_VarAtts( data, climoHarm )
> printVarSummary( climoHarm )
> delete(climo)
>
> data = calcDayAnomTLL( data, yyyyddd, climo )
> printVarSummary(data)
> ;delete(climoHarm)
>
> I got the following errors:
>
> (0) smthClmDay_TLL: No missing values allowed: ezfftf does not allow
> (0) smthClmDay_TLL: nFill=607560
>
> I do realize this issue due to missing data over the land/continent (of
> course), then I turn of these lines:
>
> ; climoHarm = smthClmDayTLL( climo, 3 )
> ; copy_VarAtts( data, climoHarm )
> ; printVarSummary( climoHarm )
> ; delete(climo)
>
> and calculated the anomlies directly from the daily climatology, but the
> results are still very strange..
> anyone can suggest me the best way to calculate sst daily anomalies? do i
> have to mask the file prior to calculation?
>
> thanks
> Antonio
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

Received on Mon Jun 23 01:28:25 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT