Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:44:41 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
42c525bfb4 Alis*0001 #include "ZONAL_FILT_OPTIONS.h"
                0002 
                0003       SUBROUTINE ZONAL_FILT_POSTSMOOTH( 
                0004      I                           holeMask, 
                0005      U                           field, 
                0006      O                           avgField,
                0007      I                           lField,
                0008      I                           myThid )
                0009 C     /==========================================================\
                0010 C     | S/R ZONAL_FILT_POSTSMOOTH                                |
                0011 C     | o After FFT filtering processing.                        |
                0012 C     |==========================================================|
                0013 C     | Restore the mean value that was removed prior to FFT.    |
                0014 C     \==========================================================/
                0015       IMPLICIT NONE
                0016 
                0017 C     == Global data ==
                0018 #include "SIZE.h"
                0019 #include "EEPARAMS.h"
                0020 #include "PARAMS.h"
                0021 #include "GRID.h"
                0022 
                0023 C     == Routine arguments ==
                0024 C     holeMask - Array with 0 for holes and != 0 for valid data.
                0025 C     lField   - Length of field to smooth (assumed periodic)
                0026 C     field    - Field smoothed.
                0027 C     avgField - Mean value of the field.
                0028 C     myThid   - Thread number of this instance of FFT_PRESMOOTH_IN_X
                0029       INTEGER lField
                0030       Real*8  holeMask(lField)
                0031       Real*8  field(lField)
                0032       Real*8  avgField
                0033       INTEGER myThid
                0034 
                0035 #ifdef ALLOW_ZONAL_FILT
                0036 
                0037 C     == Local variables ====
                0038 C     I         - Loop counter
                0039 C 
                0040       INTEGER I
                0041 
                0042 C
                0043 C     Add fields mean value back in.
                0044       DO I=1,lField
                0045        IF ( holeMask(I) .NE. 0. ) THEN 
                0046         field(I) = field(I) + avgField
                0047        ELSE
                0048         field(I) = 0.
                0049        ENDIF
                0050       ENDDO
                0051 
                0052 #endif /* ALLOW_ZONAL_FILT */
                0053 
                0054       RETURN
                0055       END