| 1 |
C $Header: /u/gcmpack/MITgcm_contrib/gael/pkg/smooth2/smooth_basic2D.F,v 1.1 2009/10/24 23:27:24 gforget Exp $ |
| 2 |
C $Name: $ |
| 3 |
|
| 4 |
#include "CPP_OPTIONS.h" |
| 5 |
|
| 6 |
subroutine smooth_basic2D ( |
| 7 |
U fld_in,mask_in,dist_in,nbt_in,mythid) |
| 8 |
|
| 9 |
C *==========================================================* |
| 10 |
C | SUBROUTINE smooth_basic2D |
| 11 |
C | o this routine smoothes a 2D field isotropically (except for |
| 12 |
C | the land mask) to a constant length scale. It mostly |
| 13 |
C | calls smooth_diff2D.F. |
| 14 |
C *==========================================================* |
| 15 |
|
| 16 |
IMPLICIT NONE |
| 17 |
#include "SIZE.h" |
| 18 |
#include "EEPARAMS.h" |
| 19 |
#include "GRID.h" |
| 20 |
#include "PARAMS.h" |
| 21 |
c#include "tamc.h" |
| 22 |
#include "smooth.h" |
| 23 |
|
| 24 |
_RL mask_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy) |
| 25 |
_RL fld_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
| 26 |
_RL dist_in |
| 27 |
integer nbt_in |
| 28 |
integer i,j,bi,bj |
| 29 |
integer itlo,ithi |
| 30 |
integer jtlo,jthi |
| 31 |
integer myThid |
| 32 |
|
| 33 |
|
| 34 |
jtlo = mybylo(mythid) |
| 35 |
jthi = mybyhi(mythid) |
| 36 |
itlo = mybxlo(mythid) |
| 37 |
ithi = mybxhi(mythid) |
| 38 |
|
| 39 |
smooth2DtotTime=nbt_in*smooth2DdelTime |
| 40 |
|
| 41 |
DO bj=myByLo(myThid),myByHi(myThid) |
| 42 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
| 43 |
DO j=1-OLy,sNy+OLy |
| 44 |
DO i=1-OLx,sNx+OLx |
| 45 |
smooth2D_Lx(i,j,bi,bj)=dist_in |
| 46 |
smooth2D_Ly(i,j,bi,bj)=dist_in |
| 47 |
ENDDO |
| 48 |
ENDDO |
| 49 |
ENDDO |
| 50 |
ENDDO |
| 51 |
|
| 52 |
DO bj=myByLo(myThid),myByHi(myThid) |
| 53 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
| 54 |
DO j=1-OLy,sNy+OLy |
| 55 |
DO i=1-OLx,sNx+OLx |
| 56 |
smooth2D_Kux(i,j,bi,bj)=smooth2D_Lx(i,j,bi,bj)* |
| 57 |
& smooth2D_Lx(i,j,bi,bj)/smooth2DtotTime/2 |
| 58 |
smooth2D_Kvy(i,j,bi,bj)=smooth2D_Ly(i,j,bi,bj)* |
| 59 |
& smooth2D_Ly(i,j,bi,bj)/smooth2DtotTime/2 |
| 60 |
ENDDO |
| 61 |
ENDDO |
| 62 |
ENDDO |
| 63 |
ENDDO |
| 64 |
|
| 65 |
_EXCH_XY_RL ( smooth2D_Kux , myThid ) |
| 66 |
_EXCH_XY_RL ( smooth2D_Kvy , myThid ) |
| 67 |
|
| 68 |
call smooth_diff2D(fld_in,mask_in,nbt_in,mythid) |
| 69 |
|
| 70 |
_EXCH_XY_RL ( fld_in , myThid ) |
| 71 |
|
| 72 |
end |