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

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

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


Revision 1.4.2.1 - (show annotations) (download)
Tue Feb 26 16:04:50 2002 UTC (22 years, 2 months ago) by adcroft
Branch: release1
CVS Tags: release1_p13_pre, release1_p13, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, release1_chkpt44d_post, release1_p12, release1_p10, release1_p11, release1_p16, release1_p17, release1_p14, release1_p15, release1_p12_pre
Branch point for: release1_50yr
Changes since 1.4: +9 -2 lines
Merging changes on MAIN between checkpoint43 and checkpoint43a-release1mods
Command: cvs -q update -jcheckpoint43 -jcheckpoint43a-release1mods -d -P

These changes are most of the changes between c43 and c44 except those
that occured after "12:45 11 Jan 2002". As far as I can tell it is
checkpoint43 with the following mods:

  o fix bug in mom_vi_del2uv
  o select when filters are applied ; add options to zonal_filter (data.zonfilt)  o gmredi: fix Pb in the adiabatic form ; add options (.e.g. Bolus advection)
  o update AIM experiments (NCEP input files)
  o improve and extend diagnostics (Monitor, TimeAve with NonLin-FrSurf)
  o added some stuff for AD
  o Jamar wet-points

This update does not contain the following mods that are in checkpoint44

  o bug fix in pkg/generic_advdiff/
    - thread related bug, bi,bj arguments in vertical advection routines
  o some changes to pkg/autodiff, pkg/cost, pkg/exf, pkg/ecco,
    verification/carbon and model/src/ related to adjoint
  o some new Matlab scripts for diagnosing model density
    - utils/matlab/dens_poly3.m and ini_poly3.m

The list of exclusions is accurate based on a "cvs diff". The list of
inclusions is based on the record in doc/tag-index which may not be complete.

1 C $Header: /u/gcmpack/MITgcm/pkg/zonal_filt/zonal_filter.F,v 1.5 2001/12/11 14:50:14 jmc Exp $
2 C $Name: $
3
4 #include "ZONAL_FILT_OPTIONS.h"
5
6 SUBROUTINE ZONAL_FILTER(
7 U field, fieldMask,
8 I jMin, jMax, kMin, kMax, bi, bj, gridLoc, myThid )
9 C /==========================================================\
10 C | S/R ZONAL_FILTER |
11 C | o Apply FFT filter to a latitude circle. |
12 C \==========================================================/
13 IMPLICIT NONE
14
15 C == Global data ==
16 #include "SIZE.h"
17 #include "EEPARAMS.h"
18 #include "PARAMS.h"
19 #include "GRID.h"
20 #include "ZONAL_FILT.h"
21 #include "FFTPACK.h"
22
23 C == Routine arguments ==
24 C jMin - Range of points to filter
25 C jMax
26 C kMin
27 C kMax
28 C bi
29 C bj
30 C myThid - Thread number of this instance of FILTER_LATCIRC_FFT_APPLY
31 C field - Field to filter
32 C gridLoc - Orientation (U or V) of field.
33 INTEGER myThid
34 INTEGER gridLoc
35 Real*8 field(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
36 Real*8 fieldMask(1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
37 INTEGER jMin, jMax, kMin, kMax, bi, bj
38
39 #ifdef ALLOW_ZONAL_FILT
40
41 C == Local data ==
42 Real*8 phi(Nx)
43 Real*8 phiMask(Nx)
44 Real*8 avPhi
45 INTEGER I, J, K
46
47 DO k=kMin, kMax
48 DO j=jMin, jMax
49 IF ( (gridLoc.EQ.1 .AND.ABS(yC(1,j,bi,bj)).GE.zonal_filt_lat)
50 & .OR.(gridLoc.EQ.2 .AND.ABS(yG(2,j,bi,bj)).GE.zonal_filt_lat)
51 & .OR. zonal_filt_mode2dx.EQ.2 ) THEN
52
53 C o Copy zonal line of field into local workspace
54 DO i=1,sNx
55 phi(I) = field(i,j,k,bi,bj)
56 phiMask(I) = fieldMask(i,j,k,bi,bj)
57 ENDDO
58
59 C Interpolate through land
60 CALL ZONAL_FILT_PRESMOOTH( phiMask,phi,avPhi,sNx,myThid )
61
62 C o Forward transform (using specific FFT package)
63 C CALL R8FFTF( Nx, phi, FFTPACKWS(1,bj) )
64 CALL R8FFTF1( Nx, phi,
65 & FFTPACKWS1(1,bj), FFTPACKWS2(1,bj),FFTPACKWS3(1,bj) )
66
67 C o Apply amplitude filter and normalize
68 IF (gridLoc .EQ. 1) THEN
69 DO i=1, Nx
70 phi(i)=phi(i)*ampFactor(i,j,bi,bj)/float(Nx)
71 ENDDO
72 ELSEIF (gridLoc .EQ. 2) THEN
73 DO i=1, Nx
74 phi(i)=phi(i)*ampFactorV(i,j,bi,bj)/float(Nx)
75 ENDDO
76 ELSE
77 WRITE(*,*) 'Error: gridLoc = ',gridLoc
78 STOP 'Error: gridLoc has illegal value'
79 ENDIF
80
81 C o Backward transform (using specific FFT package)
82 C CALL R8FFTB( Nx, phi, FFTPACKWS(1,bj) )
83 CALL R8FFTB1( Nx, phi,
84 & FFTPACKWS1(1,bj), FFTPACKWS2(1,bj),FFTPACKWS3(1,bj) )
85
86 C De-interpolate through land
87 CALL ZONAL_FILT_POSTSMOOTH(phiMask,phi,avPhi,sNx,myThid)
88
89 C o Do periodic wrap around by hand
90 DO i=1-OLx,0
91 field(i,j,k,bi,bj) = phi(sNx+i)
92 ENDDO
93 DO i=1,sNx
94 field(i,j,k,bi,bj) = phi(I)
95 ENDDO
96 DO i=sNx+1,sNx+OLx
97 field(i,j,k,bi,bj) = phi(i-sNx)
98 ENDDO
99
100 ENDIF
101 ENDDO
102 ENDDO
103
104 #endif /* ALLOW_ZONAL_FILT */
105
106 RETURN
107 END

  ViewVC Help
Powered by ViewVC 1.1.22