1 | /*************************************************************************** |
---|
2 | module classe solsor_gc1_x_r.h - description |
---|
3 | ***************************************************************************/ |
---|
4 | // Julien Brajard |
---|
5 | // locean-ipsl.upmc, Paris, April 25, 2011 |
---|
6 | //=========================================================================== |
---|
7 | // methode forward |
---|
8 | forward (YREAL x1, YREAL x2, YREAL x3, YREAL x4, YREAL x5, YREAL x6, YREAL x7, YREAL x8) |
---|
9 | { |
---|
10 | /* 1 from gcx_dynspg_flt 1 i j t |
---|
11 | 2 from gcb_dynspg_flt 1 i j t |
---|
12 | 3 from solsor_gc2_x_r 1 i j-1 k-1 t |
---|
13 | 4 from solsor_gc2_x_r 1 i-1 j k-1 t |
---|
14 | 5 from solsor_gc2_x_r 1 i+1 j k-1 t |
---|
15 | 6 from solsor_gc2_x_r 1 i j+1 k-1 t |
---|
16 | 7 from solsor_gc2_x_r 1 i j k-1 t |
---|
17 | 8 from solsor_flag 2 NX NY k-1 t |
---|
18 | } |
---|
19 | output 1 : gcx |
---|
20 | oupput 2 : gcr (pour l'arrêt des itérations |
---|
21 | |
---|
22 | */ |
---|
23 | if(Yt==TU) |
---|
24 | { |
---|
25 | YS1=0; |
---|
26 | YS2=0; |
---|
27 | } |
---|
28 | else { |
---|
29 | int t; |
---|
30 | if(Yt==TU+1 && neuler==0) |
---|
31 | t=0; |
---|
32 | else |
---|
33 | t=1; |
---|
34 | |
---|
35 | if (x8==1) |
---|
36 | { |
---|
37 | YS1=x7; |
---|
38 | YS2=0; |
---|
39 | } |
---|
40 | else |
---|
41 | { |
---|
42 | if (Yk==0) { |
---|
43 | if ( ( (Yi==0) | (Yj==0) ) | ( (Yi==NX-1) | (Yj==NY-1) )) { |
---|
44 | YS1=0; |
---|
45 | YS2=0; |
---|
46 | } |
---|
47 | else { |
---|
48 | YS1=x1; |
---|
49 | YS2=0; |
---|
50 | } |
---|
51 | } //Yk=0; |
---|
52 | else { |
---|
53 | YREAL ztmp,zres; |
---|
54 | int ishift=Yj%2; |
---|
55 | if ((Yi+1)%2==ishift) { //! Guess black update |
---|
56 | ztmp = x2 |
---|
57 | - gcp(Yi,Yj,0,t) * x3 |
---|
58 | - gcp(Yi,Yj,1,t) * x4 |
---|
59 | - gcp(Yi,Yj,2,t) * x5 |
---|
60 | - gcp(Yi,Yj,3,t) * x6; |
---|
61 | // ! Estimate of the residual |
---|
62 | zres = ztmp - x7; |
---|
63 | YS2 = zres * gcdmat(Yi,Yj,t) * zres; |
---|
64 | // ! Guess update |
---|
65 | YS1 = sor * ztmp + (1.-sor) * x7; |
---|
66 | } |
---|
67 | else |
---|
68 | { |
---|
69 | YS2=0; |
---|
70 | YS1=x7; |
---|
71 | } |
---|
72 | |
---|
73 | |
---|
74 | } // Yk>0 |
---|
75 | } //if x8==0 |
---|
76 | if (Yt==TU+1) |
---|
77 | printf("%d\t%d\t%d\t%e\t%e (1)\n",Yk,Yj,Yi,YS1,YS2); |
---|
78 | } //Yt>TU |
---|
79 | } |
---|
80 | |
---|
81 | //=========================================================================== |
---|
82 | // methode backward |
---|
83 | |
---|
84 | backward (YREAL x1, YREAL x2, YREAL x3, YREAL x4, YREAL x5, YREAL x6, YREAL x7, YREAL x8) { |
---|
85 | } |
---|