1 | ! |
---|
2 | ! $Id: phys_state_var_mod.F90 1670 2012-10-17 08:42:04Z idelkadi $ |
---|
3 | ! |
---|
4 | MODULE phys_state_var_mod |
---|
5 | ! Variables sauvegardees pour le startphy.nc |
---|
6 | !====================================================================== |
---|
7 | ! |
---|
8 | ! |
---|
9 | !====================================================================== |
---|
10 | ! Declaration des variables |
---|
11 | USE dimphy |
---|
12 | USE turb_mod |
---|
13 | ! INTEGER, SAVE :: radpas |
---|
14 | !!$OMP THREADPRIVATE(radpas) |
---|
15 | ! REAL, SAVE :: dtime |
---|
16 | !!$OMP THREADPRIVATE(dtime) |
---|
17 | |
---|
18 | REAL, ALLOCATABLE, SAVE :: ftsol(:) |
---|
19 | !$OMP THREADPRIVATE(ftsol) |
---|
20 | REAL, ALLOCATABLE, SAVE :: ftsoil(:,:) |
---|
21 | !$OMP THREADPRIVATE(ftsoil) |
---|
22 | REAL, ALLOCATABLE, SAVE :: falbe(:) |
---|
23 | !$OMP THREADPRIVATE(falbe) |
---|
24 | |
---|
25 | !clesphy0 param physiq |
---|
26 | ! |
---|
27 | ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM): |
---|
28 | ! |
---|
29 | REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:) |
---|
30 | !$OMP THREADPRIVATE(zmea, zstd, zsig, zgam) |
---|
31 | REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:) |
---|
32 | !$OMP THREADPRIVATE(zthe, zpic, zval) |
---|
33 | ! REAL tabcntr0(100) |
---|
34 | REAL, ALLOCATABLE, SAVE :: rugoro(:) |
---|
35 | !$OMP THREADPRIVATE(rugoro) |
---|
36 | REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:) |
---|
37 | !$OMP THREADPRIVATE(t_ancien, q_ancien) |
---|
38 | REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:) |
---|
39 | !$OMP THREADPRIVATE(u_ancien, v_ancien) |
---|
40 | LOGICAL, SAVE :: ancien_ok |
---|
41 | !$OMP THREADPRIVATE(ancien_ok) |
---|
42 | ! pressure level |
---|
43 | REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:) |
---|
44 | !$OMP THREADPRIVATE(zuthe,zvthe) |
---|
45 | ! |
---|
46 | ! composition for upper atmosphere |
---|
47 | REAL,ALLOCATABLE,SAVE :: co2vmr_gcm(:,:) |
---|
48 | !$OMP THREADPRIVATE(co2vmr_gcm) |
---|
49 | REAL,ALLOCATABLE,SAVE :: ovmr_gcm(:,:) |
---|
50 | !$OMP THREADPRIVATE(ovmr_gcm) |
---|
51 | REAL,ALLOCATABLE,SAVE :: n2vmr_gcm(:,:) |
---|
52 | !$OMP THREADPRIVATE(n2vmr_gcm) |
---|
53 | REAL,ALLOCATABLE,SAVE :: nvmr_gcm(:,:) |
---|
54 | !$OMP THREADPRIVATE(nvmr_gcm) |
---|
55 | REAL,ALLOCATABLE,SAVE :: covmr_gcm(:,:) |
---|
56 | !$OMP THREADPRIVATE(covmr_gcm) |
---|
57 | |
---|
58 | ! photochemistry and microphysics |
---|
59 | REAL,ALLOCATABLE,SAVE :: d_tr_chem(:,:,:), d_tr_sed(:,:,:) |
---|
60 | !$OMP THREADPRIVATE(d_tr_chem,d_tr_sed) |
---|
61 | INTEGER,ALLOCATABLE,SAVE :: iter(:,:) |
---|
62 | !$OMP THREADPRIVATE(iter) |
---|
63 | |
---|
64 | ! Tendencies due to radiative scheme [K/s] |
---|
65 | ! heat : chauffage solaire |
---|
66 | ! heat0: chauffage solaire ciel clair |
---|
67 | ! cool : refroidissement infrarouge |
---|
68 | ! cool0 : refroidissement infrarouge ciel clair |
---|
69 | REAL,ALLOCATABLE,SAVE :: heat(:,:) |
---|
70 | !$OMP THREADPRIVATE(heat) |
---|
71 | REAL,ALLOCATABLE,SAVE :: heat0(:,:) |
---|
72 | !$OMP THREADPRIVATE(heat0) |
---|
73 | REAL,ALLOCATABLE,SAVE :: cool(:,:) |
---|
74 | !$OMP THREADPRIVATE(cool) |
---|
75 | REAL,ALLOCATABLE,SAVE :: cool0(:,:) |
---|
76 | !$OMP THREADPRIVATE(cool0) |
---|
77 | REAL,ALLOCATABLE,SAVE :: dtsw(:,:) |
---|
78 | !$OMP THREADPRIVATE(dtsw) |
---|
79 | REAL,ALLOCATABLE,SAVE :: dtlw(:,:) |
---|
80 | !$OMP THREADPRIVATE(dtlw) |
---|
81 | REAL,ALLOCATABLE,SAVE :: d_t_rad(:,:),d_t_euv(:,:) |
---|
82 | !$OMP THREADPRIVATE(d_t_rad,d_t_euv) |
---|
83 | REAL,ALLOCATABLE,SAVE :: d_t_nirco2(:,:),d_t_nlte(:,:) |
---|
84 | !$OMP THREADPRIVATE(d_t_nirco2,d_t_nlte) |
---|
85 | |
---|
86 | ! Case for Newtonian cooling (physideal=.true.) |
---|
87 | REAL,ALLOCATABLE,SAVE :: zt_eq(:,:) |
---|
88 | !$OMP THREADPRIVATE(zt_eq) |
---|
89 | |
---|
90 | ! Fluxes (W/m2) |
---|
91 | ! sollwdown : downward LW flux at surface |
---|
92 | ! sollwdownclr : downward CS LW flux at surface |
---|
93 | ! toplwdown : downward CS LW flux at TOA |
---|
94 | ! toplwdownclr : downward CS LW flux at TOA |
---|
95 | REAL,ALLOCATABLE,SAVE :: swnet(:,:) |
---|
96 | !$OMP THREADPRIVATE(swnet) |
---|
97 | REAL,ALLOCATABLE,SAVE :: lwnet(:,:) |
---|
98 | !$OMP THREADPRIVATE(lwnet) |
---|
99 | REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:) |
---|
100 | !$OMP THREADPRIVATE(topsw,toplw) |
---|
101 | REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:) |
---|
102 | !$OMP THREADPRIVATE(solsw, sollw) |
---|
103 | REAL, ALLOCATABLE, SAVE :: radsol(:) |
---|
104 | !$OMP THREADPRIVATE(radsol) |
---|
105 | REAL,ALLOCATABLE,SAVE :: sollwdown(:) |
---|
106 | !$OMP THREADPRIVATE(sollwdown) |
---|
107 | REAL,ALLOCATABLE,SAVE :: sollwdownclr(:) |
---|
108 | !$OMP THREADPRIVATE(sollwdownclr) |
---|
109 | REAL,ALLOCATABLE,SAVE :: toplwdown(:) |
---|
110 | !$OMP THREADPRIVATE(toplwdown) |
---|
111 | REAL,ALLOCATABLE,SAVE :: toplwdownclr(:) |
---|
112 | !$OMP THREADPRIVATE(toplwdownclr) |
---|
113 | REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:) |
---|
114 | !$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0) |
---|
115 | REAL,save,allocatable :: dlw(:) ! derivee infra rouge |
---|
116 | REAL,save,allocatable :: fder(:) ! Derive de flux (sensible et latente) |
---|
117 | !$OMP THREADPRIVATE(dlw,fder) |
---|
118 | CONTAINS |
---|
119 | |
---|
120 | !====================================================================== |
---|
121 | SUBROUTINE phys_state_var_init |
---|
122 | |
---|
123 | IMPLICIT NONE |
---|
124 | #include "dimsoil.h" |
---|
125 | |
---|
126 | ALLOCATE(ftsol(klon)) ! temperature de surface |
---|
127 | ALLOCATE(ftsoil(klon,nsoilmx)) ! temperature dans le sol |
---|
128 | ALLOCATE(falbe(klon)) ! albedo |
---|
129 | ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM): |
---|
130 | ! |
---|
131 | !zmea(:) ! orographie moyenne |
---|
132 | !zstd(:) ! deviation standard de l'OESM |
---|
133 | !zsig(:) ! pente de l'OESM |
---|
134 | !zgam(:) ! anisotropie de l'OESM |
---|
135 | !zthe(:) ! orientation de l'OESM |
---|
136 | !zpic(:) ! Maximum de l'OESM |
---|
137 | !zval(:) ! Minimum de l'OESM |
---|
138 | !rugoro(:) ! longueur de rugosite de l'OESM |
---|
139 | ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon)) |
---|
140 | ALLOCATE(zthe(klon), zpic(klon), zval(klon)) |
---|
141 | ALLOCATE(rugoro(klon)) |
---|
142 | |
---|
143 | ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev)) |
---|
144 | ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev)) |
---|
145 | |
---|
146 | ALLOCATE(zuthe(klon),zvthe(klon)) |
---|
147 | |
---|
148 | ALLOCATE(ovmr_gcm(klon,klev),covmr_gcm(klon,klev)) |
---|
149 | ALLOCATE(co2vmr_gcm(klon,klev),n2vmr_gcm(klon,klev)) |
---|
150 | ALLOCATE(nvmr_gcm(klon,klev)) |
---|
151 | |
---|
152 | ALLOCATE(d_tr_chem(klon,klev,nqmax),d_tr_sed(klon,klev,nqmax)) |
---|
153 | ALLOCATE(iter(klon,klev)) |
---|
154 | |
---|
155 | ALLOCATE(heat(klon,klev), heat0(klon,klev)) |
---|
156 | ALLOCATE(cool(klon,klev), cool0(klon,klev)) |
---|
157 | ALLOCATE(dtlw(klon,klev),dtsw(klon,klev)) |
---|
158 | ALLOCATE(d_t_rad(klon,klev),d_t_euv(klon,klev)) |
---|
159 | ALLOCATE(d_t_nirco2(klon,klev),d_t_nlte(klon,klev)) |
---|
160 | ALLOCATE(zt_eq(klon,klev)) |
---|
161 | |
---|
162 | ALLOCATE(swnet(klon,klev+1), lwnet(klon,klev+1)) |
---|
163 | ALLOCATE(topsw(klon), toplw(klon)) |
---|
164 | ALLOCATE(solsw(klon), sollw(klon)) |
---|
165 | ALLOCATE(radsol(klon)) ! bilan radiatif au sol calcule par code radiatif |
---|
166 | ALLOCATE(sollwdown(klon), sollwdownclr(klon)) |
---|
167 | ALLOCATE(toplwdown(klon), toplwdownclr(klon)) |
---|
168 | ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon)) |
---|
169 | ALLOCATE(dlw(klon), fder(klon)) |
---|
170 | allocate(sens(klon)) |
---|
171 | allocate(q2(klon,klev+1)) |
---|
172 | allocate(l0(klon)) |
---|
173 | allocate(wstar(klon)) |
---|
174 | allocate(yustar(klon)) |
---|
175 | allocate(tstar(klon)) |
---|
176 | allocate(hfmax_th(klon)) |
---|
177 | allocate(zmax_th(klon)) |
---|
178 | |
---|
179 | END SUBROUTINE phys_state_var_init |
---|
180 | |
---|
181 | !====================================================================== |
---|
182 | SUBROUTINE phys_state_var_end |
---|
183 | |
---|
184 | IMPLICIT NONE |
---|
185 | |
---|
186 | deallocate(ftsol, ftsoil, falbe) |
---|
187 | deallocate(zmea, zstd, zsig, zgam) |
---|
188 | deallocate(zthe, zpic, zval) |
---|
189 | deallocate(rugoro, t_ancien, q_ancien) |
---|
190 | deallocate( u_ancien, v_ancien) |
---|
191 | deallocate(zuthe, zvthe) |
---|
192 | |
---|
193 | deallocate(ovmr_gcm,covmr_gcm) |
---|
194 | deallocate(co2vmr_gcm,n2vmr_gcm) |
---|
195 | deallocate(nvmr_gcm) |
---|
196 | |
---|
197 | deallocate(d_tr_chem,d_tr_sed) |
---|
198 | deallocate(iter) |
---|
199 | |
---|
200 | deallocate(heat, heat0) |
---|
201 | deallocate(cool, cool0) |
---|
202 | deallocate(dtlw,dtsw) |
---|
203 | deallocate(d_t_rad,d_t_euv) |
---|
204 | deallocate(d_t_nirco2,d_t_nlte) |
---|
205 | deallocate(zt_eq) |
---|
206 | |
---|
207 | deallocate(swnet, lwnet) |
---|
208 | deallocate(solsw, sollw, radsol) |
---|
209 | deallocate(topsw, toplw) |
---|
210 | deallocate(sollwdown, sollwdownclr) |
---|
211 | deallocate(toplwdown, toplwdownclr) |
---|
212 | deallocate(topsw0,toplw0,solsw0,sollw0) |
---|
213 | deallocate(dlw, fder) |
---|
214 | deallocate(sens) |
---|
215 | deallocate(q2) |
---|
216 | deallocate(l0) |
---|
217 | deallocate(wstar) |
---|
218 | deallocate(yustar) |
---|
219 | deallocate(tstar) |
---|
220 | deallocate(hfmax_th) |
---|
221 | deallocate(zmax_th) |
---|
222 | END SUBROUTINE phys_state_var_end |
---|
223 | |
---|
224 | END MODULE phys_state_var_mod |
---|