Back to home page

MITgcm

 
 

    


File indexing completed on 2022-01-06 06:13:24 UTC

view on githubraw file Latest commit 9f5240b5 on 2022-01-05 15:24:45 UTC
978885f3e8 Gael*0001 #include "SMOOTH_OPTIONS.h"
                0002 
9f5240b52a Jean*0003       SUBROUTINE SMOOTH_HETERO2D(
                0004      &           fld_in, mask_in, dist_file, nbt_in, myThid )
978885f3e8 Gael*0005 
                0006 C     *==========================================================*
                0007 C     | SUBROUTINE smooth_hetero2D
                0008 C     | o this routine smoothes a 2D field isotropically (except for
7b8b86ab99 Timo*0009 C     |   the land mask) to a space variable length scale. It mostly
978885f3e8 Gael*0010 C     |   calls smooth_diff2D.F.
                0011 C     *==========================================================*
                0012 
                0013       IMPLICIT NONE
                0014 #include "SIZE.h"
                0015 #include "EEPARAMS.h"
                0016 #include "GRID.h"
                0017 #include "PARAMS.h"
                0018 #include "SMOOTH.h"
                0019 
                0020       _RL fld_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
7b8b86ab99 Timo*0021       _RS mask_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
9f5240b52a Jean*0022       CHARACTER*(MAX_LEN_FNAM) dist_file
                0023       INTEGER nbt_in
                0024       INTEGER myThid
978885f3e8 Gael*0025 
9f5240b52a Jean*0026       _RL dist_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0027       INTEGER i,j,bi,bj
978885f3e8 Gael*0028 
9f5240b52a Jean*0029       smooth2DtotTime = nbt_in*smooth2DdelTime
978885f3e8 Gael*0030 
9f5240b52a Jean*0031       CALL READ_REC_3D_RL( dist_file, smoothprec,
                0032      &                     1, dist_in, 1, 1, myThid )
978885f3e8 Gael*0033 
                0034       DO bj=myByLo(myThid),myByHi(myThid)
                0035        DO bi=myBxLo(myThid),myBxHi(myThid)
9f5240b52a Jean*0036         DO j=1-OLy,sNy+OLy
                0037          DO i=1-OLx,sNx+OLx
                0038           smooth2D_Lx(i,j,bi,bj) = dist_in(i,j,bi,bj)
                0039           smooth2D_Ly(i,j,bi,bj) = dist_in(i,j,bi,bj)
978885f3e8 Gael*0040          ENDDO
9f5240b52a Jean*0041         ENDDO
978885f3e8 Gael*0042        ENDDO
                0043       ENDDO
                0044 
                0045       DO bj=myByLo(myThid),myByHi(myThid)
                0046        DO bi=myBxLo(myThid),myBxHi(myThid)
9f5240b52a Jean*0047         DO j=1-OLy,sNy+OLy
                0048          DO i=1-OLx,sNx+OLx
                0049           smooth2D_Kux(i,j,bi,bj) = smooth2D_Lx(i,j,bi,bj)
                0050      &            *smooth2D_Lx(i,j,bi,bj)/smooth2DtotTime/2
                0051           smooth2D_Kvy(i,j,bi,bj) = smooth2D_Ly(i,j,bi,bj)
                0052      &            *smooth2D_Ly(i,j,bi,bj)/smooth2DtotTime/2
978885f3e8 Gael*0053          ENDDO
9f5240b52a Jean*0054         ENDDO
978885f3e8 Gael*0055        ENDDO
                0056       ENDDO
                0057 
9f5240b52a Jean*0058       CALL EXCH_XY_RL( smooth2D_Kux, myThid )
                0059       CALL EXCH_XY_RL( smooth2D_Kvy, myThid )
978885f3e8 Gael*0060 
9f5240b52a Jean*0061       CALL SMOOTH_DIFF2D( fld_in, mask_in, nbt_in, myThid )
978885f3e8 Gael*0062 
9f5240b52a Jean*0063       CALL EXCH_XY_RL( fld_in, myThid )
7b8b86ab99 Timo*0064 
9f5240b52a Jean*0065       RETURN
                0066       END