/*************************************************************************** module classe sshb.h - description ***************************************************************************/ // Mohamed Berrada // locean-ipsl.upmc, Paris, April 24, 2009 //=========================================================================== // methode forward forward (YREAL x1,YREAL x2,YREAL x3,YREAL x4) { /* 1 from sshb 1 i j t-1 2 from sshn 1 i j t-1 3 from sshn 1 i j t 4 from sshn_c 1 i j */ /* YS1 */ /* A R */ if(Yt==TU){ #ifdef YE_sshn_c if( ndiag_rst==0) YS1=x4; else{ if( neuler == 0) YS1=x4; else YS1=sshb_neuler1(Yi,Yj); } #else if( neuler == 0)// ! Euler 1st time step : swap only YS1=x4;//sshn_neuler0(Yi,Yj); else YS1=sshb_neuler1(Yi,Yj); // valeur chargee depuis restart (neuler=1) // YS1=0.; #endif } else{ #ifdef YE_sshn_c if( Yt == TU+1 && ndiag_rst == 0)// ! Euler 1st time step : swap only #else if(Yt==TU+1 && neuler == 0)// ! Euler (forward) time stepping, no time filter //! swap of arrays #endif YS1=x2; else{// ! Leap-frog time stepping and time filter //! time filter and array swap YS1= atfp * ( x1 + x3) + atfp1 * x2; } } // } //=========================================================================== // methode backward backward (YREAL x1,YREAL x2,YREAL x3,YREAL x4) { YJ1I1=0.; YJ1I2=0.; YJ1I3=0.; YJ1I4=0.; if(Yt==TU){ #ifdef YE_sshn_c YJ1I4=1.; #else if( neuler == 0)// ! Euler 1st time step : swap only YJ1I4=1.; else YJ1I4=0.; #endif } else{ #ifdef YE_sshn_c if( Yt == TU+1){// ! Euler 1st time step : swap only YJ1I1=0.; YJ1I2=1.; YJ1I3=0.; YJ1I4=0.; } #else if(Yt==TU+1 && neuler == 0){// ! Euler (forward) time stepping, no time filter YJ1I1=0.; YJ1I2=1.; YJ1I3=0.; YJ1I4=0.; } //! swap of arrays #endif else{// ! Leap-frog time stepping and time filter //! time filter and array swap YS1= atfp * ( x1 + x3) + atfp1 * x2; YJ1I1=atfp; YJ1I2=atfp1; YJ1I3=atfp; } } // } //=========================================================================== //************************** FIN DU MODULE sshb **************************