source: trunk/src/sshb.h @ 49

Last change on this file since 49 was 1, checked in by jbrlod, 13 years ago

Import initial

  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1
2/***************************************************************************
3                 module classe sshb.h  -  description
4***************************************************************************/
5// Mohamed Berrada
6// locean-ipsl.upmc, Paris, April 24, 2009
7//===========================================================================
8//                          methode forward
9forward (YREAL x1,YREAL x2,YREAL x3,YREAL x4)
10{ /*    1       from    sshb                    1  i    j         t-1
11        2       from    sshn                    1  i    j         t-1
12        3       from    sshn                    1  i    j         t
13        4       from    sshn_c                  1  i    j   */
14
15  /* YS1  */
16  /*     A
17         R */
18  if(Yt==TU){
19#ifdef YE_sshn_c
20    if( ndiag_rst==0)
21      YS1=x4;
22    else{
23      if( neuler == 0)
24        YS1=x4;
25      else 
26        YS1=sshb_neuler1(Yi,Yj);
27    }
28#else
29    if( neuler == 0)//   ! Euler 1st time step : swap only
30      YS1=x4;//sshn_neuler0(Yi,Yj);
31    else
32      YS1=sshb_neuler1(Yi,Yj); // valeur chargee depuis restart (neuler=1)
33    //    YS1=0.;
34#endif
35  }
36  else{
37#ifdef YE_sshn_c
38      if( Yt == TU+1 && ndiag_rst == 0)//   ! Euler 1st time step : swap only
39#else
40    if(Yt==TU+1 && neuler == 0)//      ! Euler (forward) time stepping, no time filter
41      //! swap of arrays
42#endif
43      YS1=x2;
44   
45    else{//                                          ! Leap-frog time stepping and time filter
46      //! time filter and array swap
47      YS1= atfp * ( x1 + x3) + atfp1 * x2;
48    }
49}
50  //
51}
52
53//===========================================================================
54//                         methode  backward
55
56backward (YREAL x1,YREAL x2,YREAL x3,YREAL x4)
57{
58  YJ1I1=0.;     YJ1I2=0.;    YJ1I3=0.;    YJ1I4=0.;
59 
60  if(Yt==TU){
61 #ifdef YE_sshn_c
62    YJ1I4=1.;
63#else
64    if( neuler == 0)//   ! Euler 1st time step : swap only
65      YJ1I4=1.;
66    else
67      YJ1I4=0.;
68#endif
69 }
70  else{
71#ifdef YE_sshn_c
72    if( Yt == TU+1){//   ! Euler 1st time step : swap only
73      YJ1I1=0.;     YJ1I2=1.;    YJ1I3=0.;    YJ1I4=0.;
74    }
75#else
76    if(Yt==TU+1 && neuler == 0){//      ! Euler (forward) time stepping, no time filter
77      YJ1I1=0.;     YJ1I2=1.;    YJ1I3=0.;    YJ1I4=0.;
78    }
79    //! swap of arrays
80#endif
81    else{//                                          ! Leap-frog time stepping and time filter
82      //! time filter and array swap
83      YS1= atfp * ( x1 + x3) + atfp1 * x2;
84      YJ1I1=atfp;
85      YJ1I2=atfp1;
86      YJ1I3=atfp;
87    }
88  }
89  //
90 
91}
92
93//===========================================================================
94//**************************  FIN DU MODULE sshb   **************************
95
Note: See TracBrowser for help on using the repository browser.