1 |
C $Header: /u/gcmpack/models/MITgcmUV/pkg/zonal_filt/zonal_filt_postsmooth.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_POSTSMOOTH( |
7 |
I holeMask, |
8 |
U field, |
9 |
O avgField, |
10 |
I lField, |
11 |
I myThid ) |
12 |
C /==========================================================\ |
13 |
C | S/R ZONAL_FILT_POSTSMOOTH | |
14 |
C | o After FFT filtering processing. | |
15 |
C |==========================================================| |
16 |
C | Restore the mean value that was removed prior to FFT. | |
17 |
C \==========================================================/ |
18 |
IMPLICIT NONE |
19 |
|
20 |
C == Global data == |
21 |
#include "SIZE.h" |
22 |
#include "EEPARAMS.h" |
23 |
#include "PARAMS.h" |
24 |
#include "GRID.h" |
25 |
|
26 |
C == Routine arguments == |
27 |
C holeMask - Array with 0 for holes and != 0 for valid data. |
28 |
C lField - Length of field to smooth (assumed periodic) |
29 |
C field - Field smoothed. |
30 |
C avgField - Mean value of the field. |
31 |
C myThid - Thread number of this instance of FFT_PRESMOOTH_IN_X |
32 |
INTEGER lField |
33 |
Real*8 holeMask(lField) |
34 |
Real*8 field(lField) |
35 |
Real*8 avgField |
36 |
INTEGER myThid |
37 |
|
38 |
#ifdef ALLOW_ZONAL_FILT |
39 |
|
40 |
C == Local variables ==== |
41 |
C I - Loop counter |
42 |
C |
43 |
INTEGER I |
44 |
|
45 |
C |
46 |
C Add fields mean value back in. |
47 |
DO I=1,lField |
48 |
IF ( holeMask(I) .NE. 0. ) THEN |
49 |
field(I) = field(I) + avgField |
50 |
ELSE |
51 |
field(I) = 0. |
52 |
ENDIF |
53 |
ENDDO |
54 |
|
55 |
#endif /* ALLOW_ZONAL_FILT */ |
56 |
|
57 |
RETURN |
58 |
END |