More than 2 Dimensions for "fft2df "

From: Ghassan J. Alaka, Jr. <gusalaka_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 27 2014 - 08:22:32 MDT

Good morning,

I'm running into an efficiency issue with my NCL script. I'm trying to
filter time and longitude using "fft2df", but the variable that I want to
filter contains 4 total dimensions (time, level, lat, lon), so I am
currently looping over level and lat. then filtering each 2d time-lon slice
using fft2df. This, of course, takes a long time when there are 37 levels
and 86 latitudes (plus I need to do this for 20 different variables!).

Is there any way to feed more than 2 dimensions to fft2df, with time and
lon as the 2 rightmost dimensions? If not, is there another way I can
filter using FFT and not have to loop over other dimensions? Perhaps there
is a way to use "wgt_runave" to filter both time and longitude using a
boxcar filter?

Below is the code snippet where I loop (I forgot to mention that I also
have to loop over several daily files to build the time series in the fist
place):
* do kk = 0,levsz-1*
* do jj = 0,latsz-1*
* do ff = 0,filesz-1*
* f = addfile(filelist(ff),"r")*
* Vfft((ntpd*ff)+0:(ntpd*ff)+(ntpd-1),:) \*
* = (/f->$Vars(vv)$(:,kk,{lat(jj)},:)/)*
* end do*
* print(" Filtering selection "+kk+" "+jj)*
* Vfft = kf_box_filter(Vfft, ntpd, tMin, tMax, kMin, kMax, inFlag)*
* V(:,kk,jj,:) = (/Vfft(:,{sub_lon(0):sub_lon(1)})/)*
* end do*
* end do*

The function "kf_box_filter.ncl" is adapted from kf_filter.ncl (I removed
the options for filtering along specific dispersion curves for various
equatorial waves). I've attached that here so you can see how I am calling
fft2df... nothing complicated.

Thanks for your help!
Gus

-- 
Ghassan J. Alaka, Jr., Ph.D. Candidate
Department of Atmospheric Science
Colorado State University
1371 Campus Delivery
Fort Collins, CO 80523-1371
E: gusalaka@atmos.colostate.edu
P: (970) 491-1487
Web: http://maloney.atmos.colostate.edu/galaka/index.php


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

Received on Thu Mar 27 08:22:44 2014

This archive was generated by hypermail 2.1.8 : Thu Apr 03 2014 - 13:36:27 MDT