source: trunk/src/sbcgyre_qsr_qns.h

Last change on this file was 64, checked in by jbrlod, 13 years ago

make kt the effective time step

  • Property svn:eol-style set to native
File size: 3.4 KB
Line 
1
2/***************************************************************************
3                 module classe sbcgyre_qsr_qns.h  -  description
4***************************************************************************/
5// Mohamed Berrada
6// locean-ipsl.upmc, Paris, Mars 16, 2009
7// (jul) Qns : non solar heat flux (non penetrative)
8// (jul) Qrs : solar heat flux (penetrative)
9//===========================================================================
10//                          methode forward
11forward (YREAL x1)
12{/*     1       from    ta                      1  i    j    1    t-2*/
13
14  /* verification code au 1er pas de temps, Mohamed, April 3, 2009
15     norm(qsrY-qsrF)=     9.774031241559886e-13
16     norm(qsrY-qsrF)/norm(qsrF)=     3.299060245612050e-16
17     norm(qnsY-qnsF)= 4.640102485953581e-12
18     norm(qnsY-qnsF)/norm(qsrF)=3.428336393249552e-16
19  */
20  if(Yt==TU){
21    YS1=0.;
22    YS2=0.;
23  }
24  else{
25    //      ! current day (in hours) since january the 1st of the current year
26    /*    double  ztime = double(Yt-TU) * rdt / (rmmss * rhhmm)  //       !  total incrementation (in hours)
27          - (nyear  - 1) * rjjhh * raajj;  //           !  minus years since beginning of experiment (in hours)
28    */
29    double  ztime = kt * rdt / (rmmss * rhhmm)  //       !  total incrementation (in hours)
30      - (nyear  - 1) * rjjhh * raajj;  //           !  minus years since beginning of experiment (in hours)
31    double  ztimemax1 = ((5.*30.)+21.)* 24.;//                     ! 21th june     at 24h in hours
32    double  ztimemin1 = ztimemax1 + rjjhh * raajj / 2.;//            ! 21th december        in hours
33    double  ztimemax2 = ((6.*30.)+21.)* 24.;//                      ! 21th july     at 24h in hours
34    double  ztimemin2 = ztimemax2 - rjjhh * raajj / 2;//            ! 21th january         in hours
35    // !                                                    ! NB: rjjhh * raajj / 4 = one seasonal cycle in hours
36   
37    //  ! amplitudes
38    double  zTstar    = 28.3;//      ! intemsity from 28.3 a -5 deg
39   
40    //      ! 1/2 period between 21th June and 21th December and between 21th July and 21th January
41    double  zcos_sais1 = cos( (ztime - ztimemax1) / (ztimemin1 - ztimemax1) * rpi );
42    double  zcos_sais2 = cos( (ztime - ztimemax2) / (ztimemax2 - ztimemin2) * rpi );
43   
44    double  ztrp= - 40.e0;       // ! retroaction term on heat fluxes (W/m2/K)
45    //  double  zconv = 3.16e-5;      //! convertion factor: 1 m/yr => 3.16e-5 mm/s
46    double  t_star = zTstar*(1+1./50.*zcos_sais2)*cos(rpi*(gphit(Yi,Yj)-5.)/(53.5*(1.+11./53.5*zcos_sais2)*2.));
47    //   ! 23.5 deg : tropics
48    YS1 = 230*cos(3.1415*(gphit(Yi,Yj)-23.5*zcos_sais1)/(0.9*180.));
49    YS2 = ztrp*(x1-t_star)-YS1; // on s'est permi ceci (YS1) car YS1 ne retropropage pas de gradient
50    if(Yi==9 && Yj==1 && Yt==3){
51      /*     printf("gphit(Yi,Yj)=%25.16e\n",gphit(Yi,Yj));
52      printf("zcos_sais1=%25.16e\n",zcos_sais1);
53      printf("YS1=%25.16e\n",YS1);*/
54    }
55  }
56  //
57}
58
59//===========================================================================
60//                         methode  backward
61
62backward (YREAL x1)
63{
64  if(Yt==TU){
65    YJ1I1=0.;
66    YJ2I1=0.;
67  }
68  else{
69    double  ztrp= - 40.e0;       // ! retroaction term on heat fluxes (W/m2/K)
70    YJ1I1=0.;
71    YJ2I1=ztrp;
72  }
73  //
74 
75}
76
77  //===========================================================================
78//********************* FIN DU MODULE sbc_gyre_qsr_qns **********************
79
Note: See TracBrowser for help on using the repository browser.