Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / external / wavelet / idwtai_w.c
blobf0bd4008512d4bcd13bad9521af38267ed751792
1 // Author: Aime' Fournier
2 // E-mail: fournier@ucar.edu
4 #include <stdio.h>
5 #include "qf.h" // for pqf ...
6 #include "real.h"
8 // See 2009/8/4 e-mail from john@michalakes.us
9 #ifndef CRAY
10 # ifdef NOUNDERSCORE
11 # define IDWTAI_W idwtai_w
12 # else
13 # ifdef F2CSTYLE
14 # define IDWTAI_W idwtai_w__
15 # else
16 # define IDWTAI_W idwtai_w_
17 # endif
18 # endif
19 #endif
21 void IDWTAI_W (char *nam,// in: filter name
22 int *ran, // in: filter length
23 real *u, // in/out: data & transform
24 real *s, // scratch space
25 int *iv, // v-space lengths
26 int *iw, // w-space lengths
27 int *ia, // w-space starts
28 int *lm) { // maximum level
29 pqf *g,*h; // wavelet hpf & lpf
30 static int call1=1;
32 //printf("idwtai_w::idwtai_w(%s,%2d,{%6.3f,...},{%6.3f,...},{%2d,...},{%2d,...},%2d)\n",nam,*ran,*u,*s,*iv,*ia,*lm);
33 if( *ran ) {
34 h=qf(nam,*ran,0); // assign h
35 g=qf(nam,*ran,1); // assign g
36 // PrintFilter(nam,*ran,0,h);
37 // PrintFilter(nam,*ran,1,g);
39 idwtai(u,s,iv,iw,ia,*lm,h,g);
41 free(g->fp);free(g);free(h->fp);free(h);
42 }else{
43 if( call1 ) {
44 printf("idwtai_w: abort because *ran==0.\n");
45 call1=0;
46 abort();