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 | use nonoro_gwd_ran_mod, only: ini_nonoro_gwd_ran, end_nonoro_gwd_ran |
---|
14 | ! INTEGER, SAVE :: radpas |
---|
15 | !!$OMP THREADPRIVATE(radpas) |
---|
16 | ! REAL, SAVE :: dtime |
---|
17 | !!$OMP THREADPRIVATE(dtime) |
---|
18 | |
---|
19 | REAL, ALLOCATABLE, SAVE :: ftsol(:) ! surface temperature (K) |
---|
20 | !$OMP THREADPRIVATE(ftsol) |
---|
21 | REAL, ALLOCATABLE, SAVE :: ftsoil(:,:) ! soil temperatures (K) |
---|
22 | !$OMP THREADPRIVATE(ftsoil) |
---|
23 | REAL, ALLOCATABLE, SAVE :: falbe(:) ! surface albedo |
---|
24 | !$OMP THREADPRIVATE(falbe) |
---|
25 | |
---|
26 | !clesphy0 param physiq |
---|
27 | ! |
---|
28 | ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM): |
---|
29 | ! |
---|
30 | REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:) |
---|
31 | !$OMP THREADPRIVATE(zmea, zstd, zsig, zgam) |
---|
32 | REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:) |
---|
33 | !$OMP THREADPRIVATE(zthe, zpic, zval) |
---|
34 | ! REAL tabcntr0(100) |
---|
35 | REAL, ALLOCATABLE, SAVE :: rugoro(:) |
---|
36 | !$OMP THREADPRIVATE(rugoro) |
---|
37 | REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:) |
---|
38 | !$OMP THREADPRIVATE(t_ancien, q_ancien) |
---|
39 | REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:) |
---|
40 | !$OMP THREADPRIVATE(u_ancien, v_ancien) |
---|
41 | LOGICAL, SAVE :: ancien_ok |
---|
42 | !$OMP THREADPRIVATE(ancien_ok) |
---|
43 | ! pressure level |
---|
44 | REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:) |
---|
45 | !$OMP THREADPRIVATE(zuthe,zvthe) |
---|
46 | ! |
---|
47 | ! composition for upper atmosphere |
---|
48 | REAL,ALLOCATABLE,SAVE :: co2vmr_gcm(:,:) |
---|
49 | !$OMP THREADPRIVATE(co2vmr_gcm) |
---|
50 | REAL,ALLOCATABLE,SAVE :: ovmr_gcm(:,:) |
---|
51 | !$OMP THREADPRIVATE(ovmr_gcm) |
---|
52 | REAL,ALLOCATABLE,SAVE :: n2vmr_gcm(:,:) |
---|
53 | !$OMP THREADPRIVATE(n2vmr_gcm) |
---|
54 | REAL,ALLOCATABLE,SAVE :: nvmr_gcm(:,:) |
---|
55 | !$OMP THREADPRIVATE(nvmr_gcm) |
---|
56 | REAL,ALLOCATABLE,SAVE :: covmr_gcm(:,:) |
---|
57 | !$OMP THREADPRIVATE(covmr_gcm) |
---|
58 | |
---|
59 | ! photochemistry and microphysics |
---|
60 | REAL,ALLOCATABLE,SAVE :: d_tr_chem(:,:,:), d_tr_sed(:,:,:) |
---|
61 | !$OMP THREADPRIVATE(d_tr_chem,d_tr_sed) |
---|
62 | INTEGER,ALLOCATABLE,SAVE :: iter(:,:) |
---|
63 | !$OMP THREADPRIVATE(iter) |
---|
64 | |
---|
65 | ! Tendencies due to radiative scheme [K/s] |
---|
66 | ! heat : chauffage solaire |
---|
67 | ! heat0: chauffage solaire ciel clair |
---|
68 | ! cool : refroidissement infrarouge |
---|
69 | ! cool0 : refroidissement infrarouge ciel clair |
---|
70 | REAL,ALLOCATABLE,SAVE :: heat(:,:) |
---|
71 | !$OMP THREADPRIVATE(heat) |
---|
72 | REAL,ALLOCATABLE,SAVE :: heat0(:,:) |
---|
73 | !$OMP THREADPRIVATE(heat0) |
---|
74 | REAL,ALLOCATABLE,SAVE :: cool(:,:) |
---|
75 | !$OMP THREADPRIVATE(cool) |
---|
76 | REAL,ALLOCATABLE,SAVE :: cool0(:,:) |
---|
77 | !$OMP THREADPRIVATE(cool0) |
---|
78 | REAL,ALLOCATABLE,SAVE :: dtsw(:,:) |
---|
79 | !$OMP THREADPRIVATE(dtsw) |
---|
80 | REAL,ALLOCATABLE,SAVE :: dtlw(:,:) |
---|
81 | !$OMP THREADPRIVATE(dtlw) |
---|
82 | REAL,ALLOCATABLE,SAVE :: d_t_rad(:,:),d_t_euv(:,:) |
---|
83 | !$OMP THREADPRIVATE(d_t_rad,d_t_euv) |
---|
84 | REAL,ALLOCATABLE,SAVE :: d_t_nirco2(:,:),d_t_nlte(:,:) |
---|
85 | !$OMP THREADPRIVATE(d_t_nirco2,d_t_nlte) |
---|
86 | |
---|
87 | ! Case for Newtonian cooling (physideal=.true.) |
---|
88 | REAL,ALLOCATABLE,SAVE :: zt_eq(:,:) |
---|
89 | !$OMP THREADPRIVATE(zt_eq) |
---|
90 | |
---|
91 | ! Fluxes (W/m2) |
---|
92 | ! sollwdown : downward LW flux at surface |
---|
93 | ! sollwdownclr : downward CS LW flux at surface |
---|
94 | ! toplwdown : downward CS LW flux at TOA |
---|
95 | ! toplwdownclr : downward CS LW flux at TOA |
---|
96 | REAL,ALLOCATABLE,SAVE :: swnet(:,:) |
---|
97 | !$OMP THREADPRIVATE(swnet) |
---|
98 | REAL,ALLOCATABLE,SAVE :: lwnet(:,:) |
---|
99 | !$OMP THREADPRIVATE(lwnet) |
---|
100 | REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:) |
---|
101 | !$OMP THREADPRIVATE(topsw,toplw) |
---|
102 | REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:) |
---|
103 | !$OMP THREADPRIVATE(solsw, sollw) |
---|
104 | REAL, ALLOCATABLE, SAVE :: radsol(:) |
---|
105 | !$OMP THREADPRIVATE(radsol) |
---|
106 | REAL,ALLOCATABLE,SAVE :: sollwdown(:) |
---|
107 | !$OMP THREADPRIVATE(sollwdown) |
---|
108 | REAL,ALLOCATABLE,SAVE :: sollwdownclr(:) |
---|
109 | !$OMP THREADPRIVATE(sollwdownclr) |
---|
110 | REAL,ALLOCATABLE,SAVE :: toplwdown(:) |
---|
111 | !$OMP THREADPRIVATE(toplwdown) |
---|
112 | REAL,ALLOCATABLE,SAVE :: toplwdownclr(:) |
---|
113 | !$OMP THREADPRIVATE(toplwdownclr) |
---|
114 | REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:) |
---|
115 | !$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0) |
---|
116 | REAL,save,allocatable :: dlw(:) ! derivee infra rouge |
---|
117 | REAL,save,allocatable :: fder(:) ! Derive de flux (sensible et latente) |
---|
118 | !$OMP THREADPRIVATE(dlw,fder) |
---|
119 | CONTAINS |
---|
120 | |
---|
121 | !====================================================================== |
---|
122 | SUBROUTINE phys_state_var_init(nqmax) |
---|
123 | |
---|
124 | IMPLICIT NONE |
---|
125 | include "dimsoil.h" |
---|
126 | |
---|
127 | integer :: nqmax |
---|
128 | |
---|
129 | ALLOCATE(ftsol(klon)) ! temperature de surface |
---|
130 | ALLOCATE(ftsoil(klon,nsoilmx)) ! temperature dans le sol |
---|
131 | ALLOCATE(falbe(klon)) ! albedo |
---|
132 | ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM): |
---|
133 | ! |
---|
134 | !zmea(:) ! orographie moyenne |
---|
135 | !zstd(:) ! deviation standard de l'OESM |
---|
136 | !zsig(:) ! pente de l'OESM |
---|
137 | !zgam(:) ! anisotropie de l'OESM |
---|
138 | !zthe(:) ! orientation de l'OESM |
---|
139 | !zpic(:) ! Maximum de l'OESM |
---|
140 | !zval(:) ! Minimum de l'OESM |
---|
141 | !rugoro(:) ! longueur de rugosite de l'OESM |
---|
142 | ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon)) |
---|
143 | ALLOCATE(zthe(klon), zpic(klon), zval(klon)) |
---|
144 | ALLOCATE(rugoro(klon)) |
---|
145 | |
---|
146 | ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev)) |
---|
147 | ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev)) |
---|
148 | |
---|
149 | ALLOCATE(zuthe(klon),zvthe(klon)) |
---|
150 | |
---|
151 | ALLOCATE(ovmr_gcm(klon,klev),covmr_gcm(klon,klev)) |
---|
152 | ALLOCATE(co2vmr_gcm(klon,klev),n2vmr_gcm(klon,klev)) |
---|
153 | ALLOCATE(nvmr_gcm(klon,klev)) |
---|
154 | |
---|
155 | ALLOCATE(d_tr_chem(klon,klev,nqmax),d_tr_sed(klon,klev,nqmax)) |
---|
156 | ALLOCATE(iter(klon,klev)) |
---|
157 | |
---|
158 | ALLOCATE(heat(klon,klev), heat0(klon,klev)) |
---|
159 | ALLOCATE(cool(klon,klev), cool0(klon,klev)) |
---|
160 | ALLOCATE(dtlw(klon,klev),dtsw(klon,klev)) |
---|
161 | ALLOCATE(d_t_rad(klon,klev),d_t_euv(klon,klev)) |
---|
162 | ALLOCATE(d_t_nirco2(klon,klev),d_t_nlte(klon,klev)) |
---|
163 | ALLOCATE(zt_eq(klon,klev)) |
---|
164 | |
---|
165 | ALLOCATE(swnet(klon,klev+1), lwnet(klon,klev+1)) |
---|
166 | ALLOCATE(topsw(klon), toplw(klon)) |
---|
167 | ALLOCATE(solsw(klon), sollw(klon)) |
---|
168 | ALLOCATE(radsol(klon)) ! bilan radiatif au sol calcule par code radiatif |
---|
169 | ALLOCATE(sollwdown(klon), sollwdownclr(klon)) |
---|
170 | ALLOCATE(toplwdown(klon), toplwdownclr(klon)) |
---|
171 | ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon)) |
---|
172 | ALLOCATE(dlw(klon), fder(klon)) |
---|
173 | |
---|
174 | ! allocate turb_mod module variables |
---|
175 | CALL ini_turb_mod(klon,klev) |
---|
176 | ! allocate arrays in "nonoro_gwd_ran_mod" |
---|
177 | call ini_nonoro_gwd_ran(klon,klev) |
---|
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 | |
---|
215 | ! deallocate turb_mod module variables |
---|
216 | CALL end_turb_mod |
---|
217 | ! deallocate arrays in "nonoro_gwd_ran_mod" |
---|
218 | call end_nonoro_gwd_ran |
---|
219 | |
---|
220 | END SUBROUTINE phys_state_var_end |
---|
221 | |
---|
222 | END MODULE phys_state_var_mod |
---|