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

Annotation of /MITgcm/pkg/smooth/smooth_init2d.F

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


Revision 1.1 - (hide annotations) (download)
Mon Feb 15 23:46:04 2010 UTC (14 years, 3 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint62c, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62l
smooth package -- going to the main repository

1 gforget 1.1 C $Header: /u/gcmpack/MITgcm_contrib/gael/pkg/smooth2/smooth_init2D.F,v 1.1 2009/10/25 21:24:04 gforget Exp $
2     C $Name: $
3    
4     #include "SMOOTH_OPTIONS.h"
5    
6     subroutine smooth_init2D (smoothOpNb, mythid )
7    
8     C *==========================================================*
9     C | SUBROUTINE smooth_init2D
10     C | o Routine that initializes one 2D smoothing/correlation operator
11     C | by computing/writing the corresponding diffusion operator
12     C *==========================================================*
13    
14     cgf the choices of smooth2Dtype and smooth2Dsize need comments...
15    
16     IMPLICIT NONE
17     #include "SIZE.h"
18     #include "EEPARAMS.h"
19     #include "PARAMS.h"
20     #include "GRID.h"
21     #include "SMOOTH.h"
22    
23     integer i,j,k, bi, bj
24     integer itlo,ithi
25     integer jtlo,jthi
26     integer myThid
27     character*( 80) fnamegeneric
28     integer smoothOpNb
29    
30     jtlo = mybylo(mythid)
31     jthi = mybyhi(mythid)
32     itlo = mybxlo(mythid)
33     ithi = mybxhi(mythid)
34    
35    
36     smooth2DtotTime=smooth2Dnbt(smoothOpNb)*smooth2DdelTime
37    
38     if ((smooth2Dtype(smoothOpNb).NE.0).AND.
39     & (smooth2Dsize(smoothOpNb).EQ.2)) then
40     write(fnamegeneric(1:80),'(1a,i3.3)')
41     & 'smooth2Dscales',smoothOpNb
42     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
43     & 1, smooth2D_Lx,1,1,mythid)
44     CALL READ_REC_3D_RL(fnamegeneric,smoothprec,
45     & 1, smooth2D_Ly,2,1,mythid)
46     _EXCH_XY_RL ( smooth2D_Lx, myThid )
47     _EXCH_XY_RL ( smooth2D_Ly, myThid )
48     else
49     DO bj=myByLo(myThid),myByHi(myThid)
50     DO bi=myBxLo(myThid),myBxHi(myThid)
51     DO j=1-OLy,sNy+OLy
52     DO i=1-OLx,sNx+OLx
53     smooth2D_Lx(i,j,bi,bj)=smooth2D_Lx0(smoothOpNb)
54     smooth2D_Ly(i,j,bi,bj)=smooth2D_Ly0(smoothOpNb)
55     ENDDO
56     ENDDO
57     ENDDO
58     ENDDO
59     endif
60    
61     DO bj=myByLo(myThid),myByHi(myThid)
62     DO bi=myBxLo(myThid),myBxHi(myThid)
63     DO j=1-OLy,sNy+OLy
64     DO i=1-OLx,sNx+OLx
65     smooth2D_Kux(i,j,bi,bj)=smooth2D_Lx(i,j,bi,bj)*
66     & smooth2D_Lx(i,j,bi,bj)/smooth2DtotTime/2
67     smooth2D_Kvy(i,j,bi,bj)=smooth2D_Ly(i,j,bi,bj)*
68     & smooth2D_Ly(i,j,bi,bj)/smooth2DtotTime/2
69     ENDDO
70     ENDDO
71     ENDDO
72     ENDDO
73    
74     _EXCH_XY_RL ( smooth2D_Kux , myThid )
75     _EXCH_XY_RL ( smooth2D_Kvy , myThid )
76    
77     WRITE(standardMessageUnit,'(A,2I4,/,2f5.2)')
78     & 'smooth 2D default parameters: ',
79     & smooth2Dnbt(smoothOpNb),smooth2DtotTime,
80     & smooth2D_Lx0(smoothOpNb),smooth2D_Ly0(smoothOpNb)
81    
82     c write diffusion operator to file
83     write(fnamegeneric(1:80),'(1a,i3.3)')
84     & 'smooth2Doperator',smoothOpNb
85     CALL WRITE_REC_3D_RL(fnamegeneric,smoothprec,
86     & 1,smooth2D_Kux,1,1,mythid)
87     CALL WRITE_REC_3D_RL(fnamegeneric,smoothprec,
88     & 1,smooth2D_Kvy,2,1,mythid)
89    
90     end

  ViewVC Help
Powered by ViewVC 1.1.22