1 | subroutine stelang(kgrid,psilon,pcolon,psilat,pcolat, |
---|
2 | & ptim1,ptim2,ptim3,pmu0,pfract) |
---|
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 |
---|
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 | c----- AF24: replaced flat param by 0 |
---|
86 | |
---|
87 | rap = 1./((1.-0)**2) |
---|
88 | |
---|
89 | 100 CONTINUE |
---|
90 | C |
---|
91 | DO jl=1,kgrid |
---|
92 | pmu0(jl)=0. |
---|
93 | pfract(jl)=0. |
---|
94 | ENDDO |
---|
95 | C |
---|
96 | C* 1.1 COMPUTATION OF THE SOLAR ANGLE |
---|
97 | C ------------------------------ |
---|
98 | C |
---|
99 | DO jl=1,kgrid |
---|
100 | ztim1=psilat(jl)*ptim1*rap |
---|
101 | ztim2=pcolat(jl)*ptim2 |
---|
102 | ztim3=pcolat(jl)*ptim3 |
---|
103 | pmu0(jl)=ztim1+ztim2*pcolon(jl)+ztim3*psilon(jl) |
---|
104 | pmu0(jl)=pmu0(jl)/SQRT(pcolat(jl)**2+(rap**2)*(psilat(jl)**2)) |
---|
105 | |
---|
106 | ENDDO |
---|
107 | C |
---|
108 | C* 1.2 DISTINCTION BETWEEN DAY AND NIGHT |
---|
109 | C --------------------------------- |
---|
110 | C |
---|
111 | DO jl=1,kgrid |
---|
112 | IF (pmu0(jl).gt.0.) THEN |
---|
113 | pfract(jl)=1. |
---|
114 | c pmu0(jl)=sqrt(1224.*pmu0(jl)*pmu0(jl)+1.)/35. |
---|
115 | ELSE |
---|
116 | c pmu0(jl)=0. |
---|
117 | pfract(jl)=0. |
---|
118 | ENDIF |
---|
119 | ENDDO |
---|
120 | C |
---|
121 | RETURN |
---|
122 | END |
---|