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 |
---|
11 | forward (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 ztimemax1 = ((5.*30.)+21.)* 24.;// ! 21th june at 24h in hours |
---|
30 | double ztimemin1 = ztimemax1 + rjjhh * raajj / 2.;// ! 21th december in hours |
---|
31 | double ztimemax2 = ((6.*30.)+21.)* 24.;// ! 21th july at 24h in hours |
---|
32 | double ztimemin2 = ztimemax2 - rjjhh * raajj / 2;// ! 21th january in hours |
---|
33 | // ! ! NB: rjjhh * raajj / 4 = one seasonal cycle in hours |
---|
34 | |
---|
35 | // ! amplitudes |
---|
36 | double zTstar = 28.3;// ! intemsity from 28.3 a -5 deg |
---|
37 | |
---|
38 | // ! 1/2 period between 21th June and 21th December and between 21th July and 21th January |
---|
39 | double zcos_sais1 = cos( (ztime - ztimemax1) / (ztimemin1 - ztimemax1) * rpi ); |
---|
40 | double zcos_sais2 = cos( (ztime - ztimemax2) / (ztimemax2 - ztimemin2) * rpi ); |
---|
41 | |
---|
42 | double ztrp= - 40.e0; // ! retroaction term on heat fluxes (W/m2/K) |
---|
43 | // double zconv = 3.16e-5; //! convertion factor: 1 m/yr => 3.16e-5 mm/s |
---|
44 | double t_star = zTstar*(1+1./50.*zcos_sais2)*cos(rpi*(gphit(Yi,Yj)-5.)/(53.5*(1.+11./53.5*zcos_sais2)*2.)); |
---|
45 | // ! 23.5 deg : tropics |
---|
46 | YS1 = 230*cos(3.1415*(gphit(Yi,Yj)-23.5*zcos_sais1)/(0.9*180.)); |
---|
47 | YS2 = ztrp*(x1-t_star)-YS1; // on s'est permi ceci (YS1) car YS1 ne retropropage pas de gradient |
---|
48 | if(Yi==9 && Yj==1 && Yt==3){ |
---|
49 | /* printf("gphit(Yi,Yj)=%25.16e\n",gphit(Yi,Yj)); |
---|
50 | printf("zcos_sais1=%25.16e\n",zcos_sais1); |
---|
51 | printf("YS1=%25.16e\n",YS1);*/ |
---|
52 | } |
---|
53 | } |
---|
54 | // |
---|
55 | } |
---|
56 | |
---|
57 | //=========================================================================== |
---|
58 | // methode backward |
---|
59 | |
---|
60 | backward (YREAL x1) |
---|
61 | { |
---|
62 | if(Yt==TU){ |
---|
63 | YJ1I1=0.; |
---|
64 | YJ2I1=0.; |
---|
65 | } |
---|
66 | else{ |
---|
67 | double ztrp= - 40.e0; // ! retroaction term on heat fluxes (W/m2/K) |
---|
68 | YJ1I1=0.; |
---|
69 | YJ2I1=ztrp; |
---|
70 | } |
---|
71 | // |
---|
72 | |
---|
73 | } |
---|
74 | |
---|
75 | //=========================================================================== |
---|
76 | //********************* FIN DU MODULE sbc_gyre_qsr_qns ********************** |
---|
77 | |
---|