/[MITgcm]/MITgcm/pkg/zonal_filt/zonal_filt_init.F
ViewVC logotype

Contents of /MITgcm/pkg/zonal_filt/zonal_filt_init.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Sun Feb 4 14:38:51 2001 UTC (23 years, 5 months ago) by cnh
Branch: MAIN
CVS Tags: checkpoint38, pre38tag1, c37_adj, pre38-close, checkpoint39, checkpoint37, checkpoint36, checkpoint35
Branch point for: pre38
Changes since 1.2: +2 -1 lines
Made sure each .F and .h file had
the CVS keywords Header and Name at its start.
Most had header but very few currently have Name, so
lots of changes!

1 C $Header: /u/gcmpack/models/MITgcmUV/pkg/zonal_filt/zonal_filt_init.F,v 1.2 2001/02/02 21:36:30 adcroft Exp $
2 C $Name: $
3
4 #include "ZONAL_FILT_OPTIONS.h"
5
6 SUBROUTINE ZONAL_FILT_INIT(myThid)
7
8 C /==========================================================\
9 C | S/R ZONAL_FILT_INIT |
10 C | o Initialise FFT filter for latitude circle. |
11 C |==========================================================|
12 C | The details of particular FFT libraries may differ. |
13 C | Changing to a different library may entail modifying the |
14 C | code here. However, the broad process is usually the |
15 C | same. |
16 C | Note - Fourier modes for sNx and sNx+1 are damped in the |
17 C | same way. This is because we have not implemented |
18 C | a scheme that sets the damping factor for the |
19 C | highest wave number for odd sNx. Instead the |
20 C | highest wave number for odd sNx. Instead only |
21 C | wave numbers 1:INT(sNx/2) are partially damped. |
22 C | Wave number sNx/2 (if it exists) is removed |
23 C | altogether. |
24 C \==========================================================/
25 IMPLICIT NONE
26
27 C == Global data ==
28 #include "SIZE.h"
29 #include "EEPARAMS.h"
30 #include "PARAMS.h"
31 #include "GRID.h"
32 #include "ZONAL_FILT.h"
33 #include "FFTPACK.h"
34
35 C == Routine arguments ==
36 C myThid - Thread number of this instance of FILTER_LATCIRC_FFT_INIT
37 INTEGER myThid
38
39 #ifdef ALLOW_ZONAL_FILT
40
41 C == Local variables ==
42 C alpha - Used to evaluate frequency and latitude dependent
43 C amplitude damping factor.
44 C wvNum - Wave number
45 C lat - Temporary holding latitude
46 C nWv - No. of waves that fit on grid.
47 _RL alpha, wvNum, lat
48 INTEGER I, J, bi, bj, nPoints, nWv
49 _RL one
50 PARAMETER( one = 1.0 )
51 _RS ampfact,Y
52 ampfact(Y,I) = min( one,
53 & ( cos( abs(Y)*deg2rad )
54 & /cos( zonal_filt_lat*deg2rad ) )**zonal_filt_cospow
55 & /(sin( PI*float(I)/float(Nx) ) )**zonal_filt_sinpow
56 & )
57
58 C o Initialise specific library FFT package
59 DO bj=1,nSy
60 C CALL R8FFTI( Nx, FFTPACKWS(1,bj) )
61 CALL R8FFTI1( Nx, FFTPACKWS2(1,bj), FFTPACKWS3(1,bj) )
62 ENDDO
63
64 C o Set amplitude scale factor as function of latitude and mode number
65 DO bj=1,nSy
66 DO bi=1,nSx
67 DO j=1-oLy,sNy+Oly
68 ampFactor(1,J,bi,bj) = one
69 ampFactorV(1,J,bi,bj) = one
70 DO i=1,Nx/2-1
71 ampFactor(2*I,J,bi,bj) = ampfact( yC(1,J,bi,bj) , I )
72 C IF (ampFactor(2*I,J,bi,bj).LE..9) ampFactor(2*I,J,bi,bj)=0.
73 ampFactor(2*I+1,J,bi,bj) = ampFactor(2*I,J,bi,bj)
74 ampFactorV(2*I,J,bi,bj) = ampfact( yG(1,J,bi,bj) , I )
75 C IF (ampFactorV(2*I,J,bi,bj).LE..9) ampFactorV(2*I,J,bi,bj)=0.
76 ampFactorV(2*I+1,J,bi,bj) = ampFactorV(2*I,J,bi,bj)
77 ENDDO
78 I=Nx/2
79 Cajatest
80 ampFactor(Nx,J,bi,bj) = 0.
81 ampFactorV(Nx,J,bi,bj) = 0.
82 C ampFactor(Nx,J,bi,bj) = ampfact( yC(1,J,bi,bj) , I )
83 C ampFactorV(Nx,J,bi,bj) = ampfact( yG(1,J,bi,bj) , I )
84 Cajatest
85 ENDDO
86 ENDDO
87 ENDDO
88
89 CALL WRITE_REC_XY_RL( 'ampFactor', ampFactor, 1, 0, myThid )
90
91 #endif /* ALLOW_ZONAL_FILT */
92
93 RETURN
94 END

  ViewVC Help
Powered by ViewVC 1.1.22