1 | SUBROUTINE SWMAIN ( KDLON, KFLEV, |
---|
2 | $ PCST, albedo, |
---|
3 | $ PRMU0, PDP, PPLEV, aerosol,PFRACT, |
---|
4 | $ PHEAT, PFLUXD,PFLUXU) |
---|
5 | |
---|
6 | IMPLICIT NONE |
---|
7 | |
---|
8 | #include "dimensions.h" |
---|
9 | #include "dimphys.h" |
---|
10 | #include "dimradmars.h" |
---|
11 | |
---|
12 | #include "yomaer.h" |
---|
13 | #include "yomlw.h" |
---|
14 | #include "callkeys.h" |
---|
15 | c |
---|
16 | c PURPOSE. |
---|
17 | c -------- |
---|
18 | c |
---|
19 | c This routine computes the shortwave (solar wavelength) |
---|
20 | c radiation fluxes in two spectral intervals |
---|
21 | c and heating rate on the first "nlaylte" layers. |
---|
22 | C |
---|
23 | c Francois Forget (2000), adapted from |
---|
24 | C Fouquart and Bonnel's ECMWF program |
---|
25 | c |
---|
26 | C IMPLICIT ARGUMENTS : |
---|
27 | C -------------------- |
---|
28 | C |
---|
29 | C ==== INPUTS === |
---|
30 | c |
---|
31 | c KDLON : number of horizontal grid points |
---|
32 | c PCST : Solar constant on Mars (W.m-2) |
---|
33 | c albedo hemispheric surface albedo |
---|
34 | c albedo (i,1) : mean albedo for solar band#1 |
---|
35 | c (see below) |
---|
36 | c albedo (i,2) : mean albedo for solar band#2 |
---|
37 | c (see below) |
---|
38 | c PRMU0 : cos of solar zenith angle (=1 when sun at zenith) |
---|
39 | c PDP : Layer thickness (Pa) |
---|
40 | c PPLEV pressure (Pa) at boundaries of each layer |
---|
41 | c aerosol aerosol extinction optical depth |
---|
42 | c at reference wavelength "longrefvis" set |
---|
43 | c in dimradmars.h , in each layer, for one of |
---|
44 | c the "naerkind" kind of aerosol optical properties. |
---|
45 | c Pfract : day fraction of the time interval |
---|
46 | c =1 during the full day ; =0 during the night |
---|
47 | C ==== OUTPUTS === |
---|
48 | c PHEAT : Heating rate (K/s) |
---|
49 | c PFLUXD : SW downward flux at boundaries of each layer (W.m-2) |
---|
50 | c PFLUXU : SW upward flux at boundaries of each layer (W.m-2) |
---|
51 | C |
---|
52 | C ---------- |
---|
53 | C |
---|
54 | C----------------------------------------------------------------------- |
---|
55 | C |
---|
56 | C |
---|
57 | C----------------------------------------------------------------------- |
---|
58 | C |
---|
59 | C ARGUMENTS |
---|
60 | C --------- |
---|
61 | |
---|
62 | INTEGER KDLON, KFLEV |
---|
63 | REAL ZPSOL(NDLO2), aerosol(NDLO2,KFLEV,naerkind),PRMU0(NDLO2) |
---|
64 | real PCST |
---|
65 | REAL albedo(NDLO2,2) |
---|
66 | REAL PDP(NDLO2,KFLEV) |
---|
67 | REAL PPLEV(NDLO2,KFLEV+1) |
---|
68 | REAL PHEAT(NDLO2,KFLEV) |
---|
69 | REAL PFRACT(NDLO2) |
---|
70 | real PFLUXD(NDLON,NFLEV+1,2) |
---|
71 | real PFLUXU(NDLON,NFLEV+1,2) |
---|
72 | |
---|
73 | C LOCAL ARRAYS |
---|
74 | C ------------ |
---|
75 | |
---|
76 | REAL ZDSIG(NDLON,NFLEV), ZFACT(NDLON) |
---|
77 | S , ZFD(NDLON,NFLEV+1) |
---|
78 | S , ZFU(NDLON,NFLEV+1) |
---|
79 | S , ZRMU(NDLON), ZSEC(NDLON) |
---|
80 | S , ZUD(NDLON,3,NFLEV+1), ZUM(NDLON,NFLEV+1) |
---|
81 | REAL ZSIGN(NDLON), ZSIGO(NDLON) |
---|
82 | |
---|
83 | c following line has been changed, kflev--->nflev (to avoid error message |
---|
84 | c when compiling on NASA Ames Sun) |
---|
85 | REAL ZFDOWN(NDLO2,NFLEV+1),ZFUP(NDLO2,NFLEV+1) |
---|
86 | |
---|
87 | integer jl, jk, jkp1, jkl |
---|
88 | integer INU |
---|
89 | real zdfnet |
---|
90 | |
---|
91 | C ------------------------------------------------------------------ |
---|
92 | C Initializations : |
---|
93 | C ------------------------------------------------------------------ |
---|
94 | |
---|
95 | c Incident Solar flux and corrected angle in the atmosphere |
---|
96 | c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
97 | DO JL = 1 , KDLON |
---|
98 | c Incident Flux at the top of the atmosphere |
---|
99 | ZFACT(JL)= PRMU0(JL) * PCST * PFRACT(JL) |
---|
100 | |
---|
101 | c Cos of solar zenith angle CORRECTED for high zenith angle |
---|
102 | if (PRMU0(JL).GT.0) then |
---|
103 | ZRMU(JL)=SQRT(1224.* PRMU0(JL) * PRMU0(JL) + 1.) / 35. |
---|
104 | else |
---|
105 | ZRMU(JL)= 1. / 35. |
---|
106 | endif |
---|
107 | ZSEC(JL)=1./ZRMU(JL) |
---|
108 | END DO |
---|
109 | |
---|
110 | c Calcul of ZDSIG (thickness of layers in sigma coordinates) |
---|
111 | c ~~~~~~~~~~~~~~~ |
---|
112 | DO JL = 1 , KDLON |
---|
113 | ZSIGO(JL) = 1.0 |
---|
114 | ZPSOL(JL) = PPLEV(JL,1) |
---|
115 | END DO |
---|
116 | DO JK = 1 , nlaylte |
---|
117 | JKP1 = JK + 1 |
---|
118 | JKL = nlaylte+1 - JK |
---|
119 | DO JL = 1 , KDLON |
---|
120 | ZSIGN(JL) = PPLEV(JL,JKP1) / PPLEV(JL,1) |
---|
121 | ZDSIG(JL,JK) = ZSIGO(JL) - ZSIGN(JL) |
---|
122 | ZSIGO(JL) = ZSIGN(JL) |
---|
123 | END DO |
---|
124 | END DO |
---|
125 | |
---|
126 | C------------------------------------------------------------------ |
---|
127 | C LOOP ON SPECTRAL INTERVAL in solar spectrum |
---|
128 | C------------------------------------------------------------------ |
---|
129 | c 2 spectral interval in solar spectrum : |
---|
130 | c - INU=1: between wavelength "long1vis" and "long2vis" set in dimradmars.h |
---|
131 | c - INU=2: between wavelength "long2vis" and "long3vis" set in dimradmars.h |
---|
132 | |
---|
133 | DO INU = 1,2 |
---|
134 | CALL SWR ( KDLON, kflev, INU |
---|
135 | S , aerosol,albedo,ZDSIG,ZPSOL,ZRMU,ZSEC |
---|
136 | S , ZFD,ZFU ) |
---|
137 | |
---|
138 | DO JK = 1 , nlaylte+1 |
---|
139 | DO JL = 1 , KDLON |
---|
140 | PFLUXD(JL,JK,INU)=ZFD(JL,JK)*ZFACT(JL) |
---|
141 | PFLUXU(JL,JK,INU)=ZFU(JL,JK)*ZFACT(JL) |
---|
142 | END DO |
---|
143 | END DO |
---|
144 | END DO |
---|
145 | |
---|
146 | C ------------------------------------------------------ |
---|
147 | C HEATING RATES |
---|
148 | C ------------------------------------------------------ |
---|
149 | |
---|
150 | DO JK = 1 , nlaylte+1 |
---|
151 | DO JL = 1 , KDLON |
---|
152 | c wavelength integrated flux at every level: |
---|
153 | ZFUP(JL,JK)= (PFLUXU(JL,JK,1)+ PFLUXU(JL,JK,2)) |
---|
154 | ZFDOWN(JL,JK)= (PFLUXD(JL,JK,1)+ PFLUXD(JL,JK,2)) |
---|
155 | END DO |
---|
156 | END DO |
---|
157 | |
---|
158 | DO JK = 1 , nlaylte |
---|
159 | DO JL = 1 , KDLON |
---|
160 | ZDFNET = ZFUP (JL,JK ) - ZFDOWN(JL,JK ) |
---|
161 | S -ZFUP (JL,JK+1) + ZFDOWN(JL,JK+1) |
---|
162 | c Heating rate |
---|
163 | PHEAT(JL,JK) = gcp * ZDFNET / PDP(JL,JK) |
---|
164 | c TEST pour diminuer erreur eddington pour diffuseurs simples |
---|
165 | c if (activice) then |
---|
166 | c if(aerosol(JL,JK,2)/aerosol(JL,JK,1).gt.1) |
---|
167 | c s PHEAT(JL,JK) =PHEAT(JL,JK)/10. |
---|
168 | c endif |
---|
169 | END DO |
---|
170 | END DO |
---|
171 | |
---|
172 | RETURN |
---|
173 | END |
---|