[ncl-talk] how to spectrally filter the field by the Sardeshmukh and Hoskins approach

Hui Ding hding101 at googlemail.com
Tue Jun 15 19:06:07 MDT 2021


Dear Sir or Madam,
I am trying to filter out some small-scale waves using the method by the
Sardeshmukh and Hoskins approach. Unfortunately, there is no change at all
after filtering out the field. Did I miss anything or did I do anything
wrong? Please see my code of filtering below.
Thank you very much!
Best regards,
Hui


; spectrally filter out the field, which is prime    dims=dimsizes(prime)

nt=dims(0)

nlev=dims(1)

nlat=dims(2)

nlon=dims(3)


N = nlat

if (nlon%2 .eq.0) then    ; note % is NCL's modulus operator
                                 N = min((/ nlat, (nlon+2)/2 /))

else                      ; nlon must be odd            N = min((/ nlat,
(nlon+1)/2 /))

end if


T  = 31

a = new ( (/nt,nlev,nlat,N/), float)

b = new ( (/nt,nlev,nlat,N/), float)

h = new ( (/nt,nlev,nlat,nlon/), typeof(prime))

copy_VarMeta(prime,h)


shaec(prime,a(:,:,:,0:N-1),b(:,:,:,0:N-1))

exp_tapersh (a, b, T, 5)

shsec(a(:,:,:,0:N-1),b(:,:,:,0:N-1),h)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210615/b1a11499/attachment.html>


More information about the ncl-talk mailing list