1 | /*************************************************************************** |
---|
2 | module classe solsor_flag.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) |
---|
9 | { |
---|
10 | /* 1 from solsor_gx2_x_r 2 i j k t |
---|
11 | 2 from solsor_flag 2 NX NY k-1 t |
---|
12 | 3 from solsor_flag 1 i-1 NY k t |
---|
13 | 4 from solsor_flag 1 i j-1 k t |
---|
14 | } |
---|
15 | output 1 : resmax |
---|
16 | oupput 2 : flag (0 -> continue; 1 -> stop) |
---|
17 | |
---|
18 | */ |
---|
19 | |
---|
20 | //jn (current iteration) = Yk |
---|
21 | |
---|
22 | if ( (Yk<=nmin) | (Yt==TU)) |
---|
23 | { |
---|
24 | YS1=0; |
---|
25 | YS2=0; |
---|
26 | } |
---|
27 | else { |
---|
28 | if (x2 == 1) { |
---|
29 | YS1=0; //plus besoin d'avoir la valeur du max |
---|
30 | YS2=1; |
---|
31 | } |
---|
32 | else { |
---|
33 | if ((Yk-nmin)%nmod != 0) { |
---|
34 | YS1=0; |
---|
35 | YS2=0; |
---|
36 | } |
---|
37 | else { |
---|
38 | if ( (Yi==0) & (Yj==0) ) { |
---|
39 | YS1=x1; |
---|
40 | } |
---|
41 | else { |
---|
42 | if (Yj==0) YS1= ((x3<x1) ? x1 : x3) ; //max(x1,x3) |
---|
43 | else YS1 = ((x4<x1) ? x1 : x4) ; // max(x1,x4) |
---|
44 | if ( ( (Yi==NX-1) & (Yj ==NY-1) ) & (YS1< resmax)) |
---|
45 | { |
---|
46 | YS2=1; |
---|
47 | // printf("FOR=======tniter(%d)=%d\n",Yt,Yk); |
---|
48 | } //moment de tester le maximum |
---|
49 | else YS2=0; |
---|
50 | |
---|
51 | } // Yi>0 || Yj>0 |
---|
52 | } //((Yk-nmin)%nmod == 0) |
---|
53 | } //x2==0 |
---|
54 | // printf("%d\t%d\t%d\t%e\t%e\t%e\t%e\t\n",Yk,Yj,Yi,x1,x2,x3,x4); |
---|
55 | // if (Yt==TU+2) printf("%d\t%d\t%d\t%e\t%d\n",Yk,Yj,Yi,YS1,(int)YS2); |
---|
56 | |
---|
57 | } //Yk>kmin |
---|
58 | } |
---|
59 | //=========================================================================== |
---|
60 | // methode backward |
---|
61 | |
---|
62 | backward (YREAL x1, YREAL x2, YREAL x3, YREAL x4) |
---|
63 | { |
---|
64 | } |
---|