/[MITgcm]/MITgcm_contrib/gael/pkg/smooth2/smooth_correl3D.F
ViewVC logotype

Annotation of /MITgcm_contrib/gael/pkg/smooth2/smooth_correl3D.F

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


Revision 1.2 - (hide annotations) (download)
Mon Feb 15 23:14:46 2010 UTC (15 years, 5 months ago) by gforget
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +23 -23 lines
change IO calls

1 gforget 1.2 C $Header: /u/gcmpack/MITgcm_contrib/gael/pkg/smooth2/smooth_correl3D.F,v 1.1 2009/10/25 21:24:03 gforget Exp $
2 gforget 1.1 C $Name: $
3    
4     #include "CPP_OPTIONS.h"
5    
6     subroutine smooth_correl3D (
7     U fld_in,smoothOpNb,mythid)
8    
9     C *==========================================================*
10     C | SUBROUTINE smooth_correl3D
11     C | o Routine that applies spatial correlation
12     C | operator to a 3D 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    
24     _RL fld_in(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nR,nSx,nSy)
25     integer smoothOpNb
26     integer nbt_in
27     character*( 80) fnamegeneric
28     integer i,j,k,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     & 'smooth3Doperator',smoothOpNb
43 gforget 1.2 CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
44     & Nr,smooth3D_Kwx,1, 1, myThid )
45     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
46     & Nr,smooth3D_Kwy,2, 1, myThid )
47     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
48     & Nr,smooth3D_Kwz,3, 1, myThid )
49     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
50     & Nr,smooth3D_Kux,4, 1, myThid )
51     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
52     & Nr,smooth3D_Kvy,5, 1, myThid )
53     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
54     & Nr,smooth3D_Kuz,6, 1, myThid )
55     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
56     & Nr,smooth3D_Kvz,7, 1, myThid )
57     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
58     & Nr,smooth3D_Kuy,8, 1, myThid )
59     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
60     & Nr,smooth3D_Kvx,9, 1, myThid )
61     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
62     & Nr,smooth3D_kappaR,10, 1, myThid )
63 gforget 1.1 _EXCH_XYZ_RL ( smooth3D_Kwx, myThid )
64     _EXCH_XYZ_RL ( smooth3D_Kwy, myThid )
65     _EXCH_XYZ_RL ( smooth3D_Kwz, myThid )
66     _EXCH_XYZ_RL ( smooth3D_Kux, myThid )
67     _EXCH_XYZ_RL ( smooth3D_Kvy, myThid )
68     _EXCH_XYZ_RL ( smooth3D_Kuz, myThid )
69     _EXCH_XYZ_RL ( smooth3D_Kvz, myThid )
70     _EXCH_XYZ_RL ( smooth3D_Kuy, myThid )
71     _EXCH_XYZ_RL ( smooth3D_Kvx, myThid )
72     _EXCH_XYZ_RL ( smooth3D_kappaR, myThid )
73    
74     c read normalization field [i.e. 1/sqrt(var(filter))]:
75     write(fnamegeneric(1:80),'(1a,i3.3)')
76     & 'smooth3Dnorm',smoothOpNb
77 gforget 1.2 CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
78     & Nr, smooth3Dnorm,1,1,mythid)
79 gforget 1.1 _EXCH_XYZ_RL ( smooth3Dnorm, myThid )
80    
81     c division by ~sqrt(volume):
82     DO bj=jtlo,jthi
83     DO bi=itlo,ithi
84     DO k=1,Nr
85     DO j=1,sNy
86     DO i=1,sNx
87     fld_in(i,j,k,bi,bj)=fld_in(i,j,k,bi,bj)
88     & *sqrt(recip_rA(i,j,bi,bj)*recip_drF(k))
89     ENDDO
90     ENDDO
91     ENDDO
92     ENDDO
93     ENDDO
94     _EXCH_XYZ_RL ( fld_in , myThid )
95    
96     c do the smoothing:
97     nbt_in=smooth3Dnbt(smoothOpNb)/2
98     call smooth_diff3D(fld_in,nbt_in,mythid)
99    
100     c division by ~sqrt(var(filter)):
101     do bj = jtlo,jthi
102     do bi = itlo,ithi
103     DO j = 1,sNy
104     DO i = 1,sNx
105     DO k = 1,nR
106     fld_in(i,j,k,bi,bj)=fld_in(i,j,k,bi,bj)
107     & *smooth3Dnorm(i,j,k,bi,bj)
108     ENDDO
109     ENDDO
110     ENDDO
111     ENDDO
112     ENDDO
113     _EXCH_XYZ_RL ( fld_in , myThid )
114    
115     end

  ViewVC Help
Powered by ViewVC 1.1.22