/[MITgcm]/MITgcm/pkg/smooth/smooth_correl2d.F
ViewVC logotype

Contents of /MITgcm/pkg/smooth/smooth_correl2d.F

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


Revision 1.1 - (show annotations) (download)
Mon Feb 15 23:46:03 2010 UTC (14 years, 2 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, checkpoint65h, checkpoint65i, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
smooth package -- going to the main repository

1 C $Header: /u/gcmpack/MITgcm_contrib/gael/pkg/smooth2/smooth_correl2D.F,v 1.1 2009/10/25 21:24:03 gforget Exp $
2 C $Name: $
3
4 #include "SMOOTH_OPTIONS.h"
5
6 subroutine smooth_correl2D (
7 U fld_in,mask_in,smoothOpNb,mythid)
8
9 C *==========================================================*
10 C | SUBROUTINE smooth_correl2D
11 C | o Routine that applies spatial correlation
12 C | operator to a 2D control field
13 C *==========================================================*
14
15 IMPLICIT NONE
16 #include "SIZE.h"
17 #include "EEPARAMS.h"
18 #include "GRID.h"
19 #include "PARAMS.h"
20 c#include "tamc.h"
21 #include "SMOOTH.h"
22
23 _RL mask_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy)
24 _RL fld_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
25 integer smoothOpNb
26 integer nbt_in
27 character*( 80) fnamegeneric
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
40 c read smoothing [i.e diffusion] operator:
41 write(fnamegeneric(1:80),'(1a,i3.3)')
42 & 'smooth2Doperator',smoothOpNb
43 CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
44 & 1, smooth2D_Kux,1,1,mythid)
45 CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
46 & 1, smooth2D_Kvy,2,1,mythid)
47 _EXCH_XY_RL ( smooth2D_Kux, myThid )
48 _EXCH_XY_RL ( smooth2D_Kvy, myThid )
49
50 c read normalization field [i.e. 1/sqrt(var(filter))]:
51 write(fnamegeneric(1:80),'(1a,i3.3)')
52 & 'smooth2Dnorm',smoothOpNb
53 CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
54 & 1, smooth2Dnorm,1,1,mythid)
55 _EXCH_XY_RL ( smooth2Dnorm, myThid )
56
57 c division by ~sqrt(area):
58 DO bj = jtlo,jthi
59 DO bi = itlo,ithi
60 DO j = 1,sNy
61 DO i = 1,sNx
62 fld_in(i,j,bi,bj)=fld_in(i,j,bi,bj)
63 & *sqrt(recip_rA(i,j,bi,bj))
64 ENDDO
65 ENDDO
66 ENDDO
67 ENDDO
68 _EXCH_XY_RL ( fld_in , myThid )
69
70 c do the smoothing:
71 nbt_in=smooth2Dnbt(smoothOpNb)/2
72 call smooth_diff2D(fld_in,mask_in,nbt_in,mythid)
73
74 c division by ~sqrt(var(filter)):
75 do bj = jtlo,jthi
76 do bi = itlo,ithi
77 DO j = 1,sNy
78 DO i = 1,sNx
79 fld_in(i,j,bi,bj)=fld_in(i,j,bi,bj)
80 & *smooth2Dnorm(i,j,bi,bj)
81 ENDDO
82 ENDDO
83 ENDDO
84 ENDDO
85 _EXCH_XY_RL ( fld_in , myThid )
86
87 end

  ViewVC Help
Powered by ViewVC 1.1.22