1 |
gforget |
1.1 |
#include "CPP_OPTIONS.h" |
2 |
|
|
|
3 |
|
|
subroutine smooth_init2D ( mythid ) |
4 |
|
|
|
5 |
|
|
IMPLICIT NONE |
6 |
|
|
#include "SIZE.h" |
7 |
|
|
#include "EEPARAMS.h" |
8 |
|
|
#include "PARAMS.h" |
9 |
|
|
#include "GRID.h" |
10 |
|
|
#include "smooth.h" |
11 |
|
|
|
12 |
|
|
integer i,j,k, bi, bj |
13 |
|
|
integer itlo,ithi |
14 |
|
|
integer jtlo,jthi |
15 |
|
|
integer myThid |
16 |
|
|
character*( 80) fnamegeneric |
17 |
|
|
|
18 |
|
|
c wc01_norm : |
19 |
|
|
c 1) in the 2D isotropic case without boundaries, wc01_norm is known |
20 |
|
|
c analytically ~ sqrt(2*3.1415*wc01_L*wc01_L) |
21 |
|
|
c 2) in general case: need to compute the filter variance |
22 |
|
|
|
23 |
|
|
jtlo = mybylo(mythid) |
24 |
|
|
jthi = mybyhi(mythid) |
25 |
|
|
itlo = mybxlo(mythid) |
26 |
|
|
ithi = mybxhi(mythid) |
27 |
|
|
|
28 |
|
|
|
29 |
|
|
wc01_2D_dt=1. |
30 |
|
|
wc01_2D_T=wc01_2D_nbt(smoothOpNbCur)*wc01_2D_dt |
31 |
|
|
|
32 |
|
|
if ((smooth2Dtype(smoothOpNbCur).NE.0).AND. |
33 |
|
|
& (smooth2Dsize(smoothOpNbCur).EQ.2)) then |
34 |
|
|
write(fnamegeneric(1:80),'(1a,i3.3)') |
35 |
|
|
& 'wc01_2Dscales',smoothOpNbCur |
36 |
|
|
call mdsreadfield(fnamegeneric,64,'RL',1, |
37 |
|
|
& wc01_2D_Lx,1,mythid) |
38 |
|
|
call mdsreadfield(fnamegeneric,64,'RL',1, |
39 |
|
|
& wc01_2D_Ly,2,mythid) |
40 |
gforget |
1.2 |
_EXCH_XY_RL ( wc01_2D_Lx, myThid ) |
41 |
|
|
_EXCH_XY_RL ( wc01_2D_Ly, myThid ) |
42 |
gforget |
1.1 |
else |
43 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
44 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
45 |
|
|
DO j=1-OLy,sNy+OLy |
46 |
|
|
DO i=1-OLx,sNx+OLx |
47 |
|
|
wc01_2D_Lx(i,j,bi,bj)=wc01_2D_Lx0(smoothOpNbCur) |
48 |
|
|
wc01_2D_Ly(i,j,bi,bj)=wc01_2D_Ly0(smoothOpNbCur) |
49 |
|
|
ENDDO |
50 |
|
|
ENDDO |
51 |
|
|
ENDDO |
52 |
|
|
ENDDO |
53 |
|
|
endif |
54 |
|
|
|
55 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
56 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
57 |
|
|
DO j=1-OLy,sNy+OLy |
58 |
|
|
DO i=1-OLx,sNx+OLx |
59 |
|
|
diffKhwc01_2D_x(i,j,bi,bj)=wc01_2D_Lx(i,j,bi,bj)* |
60 |
|
|
& wc01_2D_Lx(i,j,bi,bj)/wc01_2D_T/2 |
61 |
|
|
diffKhwc01_2D_y(i,j,bi,bj)=wc01_2D_Ly(i,j,bi,bj)* |
62 |
|
|
& wc01_2D_Ly(i,j,bi,bj)/wc01_2D_T/2 |
63 |
|
|
ENDDO |
64 |
|
|
ENDDO |
65 |
|
|
ENDDO |
66 |
|
|
ENDDO |
67 |
|
|
|
68 |
gforget |
1.2 |
_EXCH_XY_RL ( diffKhwc01_2D_x , myThid ) |
69 |
|
|
_EXCH_XY_RL ( diffKhwc01_2D_y , myThid ) |
70 |
gforget |
1.1 |
|
71 |
|
|
WRITE(standardMessageUnit,'(A,2I4,/,2f5.2)') |
72 |
|
|
& 'smooth 2D default parameters: ', |
73 |
|
|
& wc01_2D_nbt(smoothOpNbCur),wc01_2D_T, |
74 |
|
|
& wc01_2D_Lx0(smoothOpNbCur),wc01_2D_Ly0(smoothOpNbCur) |
75 |
|
|
|
76 |
|
|
cgf write the diffusion operator in files |
77 |
|
|
cgf ... that will eventually be indexed |
78 |
|
|
c write(fnamegeneric(1:80),'(1a)') |
79 |
|
|
c & 'wc01_2Doperator' |
80 |
|
|
write(fnamegeneric(1:80),'(1a,i3.3)') |
81 |
|
|
& 'wc01_2Doperator',smoothOpNbCur |
82 |
|
|
call mdswritefield(fnamegeneric,64,.false.,'RL', |
83 |
|
|
& 1,diffKhwc01_2D_x,1,1,mythid) |
84 |
|
|
call mdswritefield(fnamegeneric,64,.false.,'RL', |
85 |
|
|
& 1,diffKhwc01_2D_y,2,1,mythid) |
86 |
|
|
|
87 |
|
|
end |