1 | subroutine stelang(kgrid,psilon,pcolon,psilat,pcolat, |
---|
2 | & ptim1,ptim2,ptim3,pmu0,pfract, pflat) |
---|
3 | IMPLICIT NONE |
---|
4 | |
---|
5 | C |
---|
6 | C**** *LW* - ORGANIZES THE LONGWAVE CALCULATIONS |
---|
7 | C |
---|
8 | C PURPOSE. |
---|
9 | C -------- |
---|
10 | C CALCULATES THE STELLAR ANGLE FOR ALL THE POINTS OF THE GRID |
---|
11 | C |
---|
12 | C** INTERFACE. |
---|
13 | C ---------- |
---|
14 | C SUBROUTINE STELANG ( KGRID ) |
---|
15 | C |
---|
16 | C EXPLICIT ARGUMENTS : |
---|
17 | C -------------------- |
---|
18 | C ==== INPUTS === |
---|
19 | C |
---|
20 | C PSILON(KGRID) : SINUS OF THE LONGITUDE |
---|
21 | C PCOLON(KGRID) : COSINUS OF THE LONGITUDE |
---|
22 | C PSILAT(KGRID) : SINUS OF THE LATITUDE |
---|
23 | C PCOLAT(KGRID) : COSINUS OF THE LATITUDE |
---|
24 | C PTIM1 : SIN(DECLI) |
---|
25 | C PTIM2 : COS(DECLI)*COS(TIME) |
---|
26 | C PTIM3 : SIN(DECLI)*SIN(TIME) |
---|
27 | C |
---|
28 | C ==== OUTPUTS === |
---|
29 | C |
---|
30 | C PMU0 (KGRID) : SOLAR ANGLE |
---|
31 | C PFRACT(KGRID) : DAY FRACTION OF THE TIME INTERVAL |
---|
32 | C |
---|
33 | C IMPLICIT ARGUMENTS : NONE |
---|
34 | C -------------------- |
---|
35 | C |
---|
36 | C METHOD. |
---|
37 | C ------- |
---|
38 | C |
---|
39 | C EXTERNALS. |
---|
40 | C ---------- |
---|
41 | C |
---|
42 | C NONE |
---|
43 | C |
---|
44 | C REFERENCE. |
---|
45 | C ---------- |
---|
46 | C |
---|
47 | C RADIATIVE PROCESSES IN METEOROLOGIE AND CLIMATOLOGIE |
---|
48 | C PALTRIDGE AND PLATT |
---|
49 | C |
---|
50 | C AUTHOR. |
---|
51 | C ------- |
---|
52 | C FREDERIC HOURDIN |
---|
53 | C |
---|
54 | C MODIFICATIONS. |
---|
55 | C -------------- |
---|
56 | C ORIGINAL :90-01-14 |
---|
57 | C 92-02-14 CALCULATIONS DONE THE ENTIER GRID (J.Polcher) |
---|
58 | C----------------------------------------------------------------------- |
---|
59 | C |
---|
60 | C ------------------------------------------------------------------ |
---|
61 | |
---|
62 | C----------------------------------------------------------------------- |
---|
63 | C |
---|
64 | C* 0.1 ARGUMENTS |
---|
65 | C --------- |
---|
66 | C |
---|
67 | INTEGER,INTENT(IN) :: kgrid |
---|
68 | REAL,INTENT(IN) :: ptim1,ptim2,ptim3, pflat |
---|
69 | REAL,INTENT(IN) :: psilon(kgrid),pcolon(kgrid) |
---|
70 | REAL,INTENT(IN) :: psilat(kgrid), pcolat(kgrid) |
---|
71 | REAL,INTENT(OUT) :: pmu0(kgrid),pfract(kgrid) |
---|
72 | C |
---|
73 | INTEGER jl |
---|
74 | REAL ztim1,ztim2,ztim3, rap |
---|
75 | C------------------------------------------------------------------------ |
---|
76 | C------------------------------------------------------------------------ |
---|
77 | C------------------------------------------------------------------------ |
---|
78 | C |
---|
79 | C------------------------------------------------------------------------ |
---|
80 | C |
---|
81 | C* 1. INITIALISATION |
---|
82 | C -------------- |
---|
83 | C |
---|
84 | c----- SG: geometry adapted to a flattened planet (Feb2014) |
---|
85 | |
---|
86 | rap = 1./((1.-pflat)**2) |
---|
87 | |
---|
88 | 100 CONTINUE |
---|
89 | C |
---|
90 | DO jl=1,kgrid |
---|
91 | pmu0(jl)=0. |
---|
92 | pfract(jl)=0. |
---|
93 | ENDDO |
---|
94 | C |
---|
95 | C* 1.1 COMPUTATION OF THE SOLAR ANGLE |
---|
96 | C ------------------------------ |
---|
97 | C |
---|
98 | DO jl=1,kgrid |
---|
99 | ztim1=psilat(jl)*ptim1*rap |
---|
100 | ztim2=pcolat(jl)*ptim2 |
---|
101 | ztim3=pcolat(jl)*ptim3 |
---|
102 | pmu0(jl)=ztim1+ztim2*pcolon(jl)+ztim3*psilon(jl) |
---|
103 | pmu0(jl)=pmu0(jl)/SQRT(pcolat(jl)**2+(rap**2)*(psilat(jl)**2)) |
---|
104 | |
---|
105 | ENDDO |
---|
106 | C |
---|
107 | C* 1.2 DISTINCTION BETWEEN DAY AND NIGHT |
---|
108 | C --------------------------------- |
---|
109 | C |
---|
110 | DO jl=1,kgrid |
---|
111 | IF (pmu0(jl).gt.0.) THEN |
---|
112 | pfract(jl)=1. |
---|
113 | c pmu0(jl)=sqrt(1224.*pmu0(jl)*pmu0(jl)+1.)/35. |
---|
114 | ELSE |
---|
115 | c pmu0(jl)=0. |
---|
116 | pfract(jl)=0. |
---|
117 | ENDIF |
---|
118 | ENDDO |
---|
119 | C |
---|
120 | RETURN |
---|
121 | END |
---|