4 |
|
|
5 |
contains |
contains |
6 |
|
|
7 |
SUBROUTINE phystokenc(pdtphys, rlon, rlat, pt, pmfu, pmfd, pen_u, pde_u, & |
SUBROUTINE phystokenc(pdtphys, pt, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, & |
8 |
pen_d, pde_d, pfm_therm, pentr_therm, pcoefh, yu1, yv1, ftsol, pctsrf, & |
pfm_therm, pentr_therm, pcoefh, yu1, yv1, ftsol, pctsrf, frac_impa, & |
9 |
frac_impa, frac_nucl, pphis, paire, dtime, itap) |
frac_nucl, pphis, paire, dtime) |
10 |
|
|
11 |
! From phylmd/phystokenc.F, version 1.2 2004/06/22 11:45:35 |
! From phylmd/phystokenc.F, version 1.2, 2004/06/22 11:45:35 |
12 |
! Author: Frédéric Hourdin |
! Author: Fr\'ed\'eric Hourdin |
13 |
! Objet: moniteur général des tendances traceurs |
! Objet : \'ecriture des variables pour transport offline |
14 |
|
|
15 |
USE histwrite_m, ONLY : histwrite |
use gr_phy_write_m, only: gr_phy_write |
16 |
USE histcom, ONLY : histsync |
USE histwrite_m, ONLY: histwrite |
17 |
USE dimens_m, ONLY : iim, jjm, nqmx |
USE histsync_m, ONLY: histsync |
18 |
USE indicesol, ONLY : nbsrf |
USE indicesol, ONLY: nbsrf |
19 |
USE dimphy, ONLY : klev, klon |
use initphysto_m, only: initphysto |
20 |
USE tracstoke, ONLY : istphy |
USE dimphy, ONLY: klev, klon |
21 |
|
use time_phylmdz, only: itap |
22 |
|
USE tracstoke, ONLY: istphy |
23 |
|
|
24 |
! Arguments: |
REAL, INTENT (IN):: pdtphys ! pas d'integration pour la physique (seconde) |
25 |
|
REAL, intent(in):: pt(klon, klev) |
26 |
|
|
27 |
! EN ENTREE: |
! convection: |
28 |
|
|
29 |
! divers: |
REAL, INTENT (IN):: pmfu(klon, klev) ! flux de masse dans le panache montant |
30 |
|
|
31 |
REAL, INTENT (IN) :: pdtphys ! pas d'integration pour la physique (seconde) |
REAL, intent(in):: pmfd(klon, klev) |
32 |
INTEGER, INTENT (IN) :: itap |
! flux de masse dans le panache descendant |
33 |
|
|
34 |
! convection: |
REAL, intent(in):: pen_u(klon, klev) ! flux entraine dans le panache montant |
35 |
|
REAL, intent(in):: pde_u(klon, klev) ! flux detraine dans le panache montant |
36 |
|
|
37 |
REAL pmfu(klon, klev) ! flux de masse dans le panache montant |
REAL, intent(in):: pen_d(klon, klev) |
38 |
REAL pmfd(klon, klev) ! flux de masse dans le panache descendant |
! flux entraine dans le panache descendant |
|
REAL pen_u(klon, klev) ! flux entraine dans le panache montant |
|
|
REAL pde_u(klon, klev) ! flux detraine dans le panache montant |
|
|
REAL pen_d(klon, klev) ! flux entraine dans le panache descendant |
|
|
REAL pde_d(klon, klev) ! flux detraine dans le panache descendant |
|
|
REAL pt(klon, klev) |
|
39 |
|
|
40 |
REAL, INTENT (IN) :: rlon(klon), rlat(klon) |
REAL, intent(in):: pde_d(klon, klev) |
41 |
REAL, INTENT (IN) :: dtime |
! flux detraine dans le panache descendant |
42 |
|
|
43 |
! Les Thermiques |
! Les Thermiques |
44 |
REAL pfm_therm(klon, klev+1) |
REAL, intent(in):: pfm_therm(klon, klev+1) |
45 |
REAL pentr_therm(klon, klev) |
REAL, intent(in):: pentr_therm(klon, klev) |
46 |
|
|
47 |
! Couche limite: |
! Couche limite: |
48 |
|
REAL, intent(in):: pcoefh(klon, klev) ! coeff melange Couche limite |
49 |
|
REAL, intent(in):: yu1(klon) |
50 |
|
REAL, intent(in):: yv1(klon) |
51 |
|
|
52 |
REAL yv1(klon) |
! Arguments necessaires pour les sources et puits de traceur |
|
REAL yu1(klon), pphis(klon), paire(klon) |
|
|
REAL pcoefh(klon, klev) ! coeff melange Couche limite |
|
53 |
|
|
54 |
! Arguments necessaires pour les sources et puits de traceur |
REAL, intent(in):: ftsol(klon, nbsrf) ! Temperature du sol (surf)(Kelvin) |
55 |
|
REAL, intent(in):: pctsrf(klon, nbsrf) ! Pourcentage de sol f(nature du sol) |
56 |
|
|
57 |
REAL ftsol(klon, nbsrf) ! Temperature du sol (surf)(Kelvin) |
! Coefficients de lessivage: |
58 |
REAL pctsrf(klon, nbsrf) ! Pourcentage de sol f(nature du sol) |
REAL, intent(in):: frac_impa(klon, klev) ! facteur d'impaction |
59 |
|
REAL, intent(in):: frac_nucl(klon, klev) ! facteur de nucleation |
60 |
|
|
61 |
! Lessivage: |
REAL, INTENT(IN):: pphis(klon) |
62 |
|
real, intent(in):: paire(klon) |
63 |
|
REAL, INTENT (IN):: dtime |
64 |
|
|
65 |
REAL frac_impa(klon, klev) |
! Local: |
|
REAL frac_nucl(klon, klev) |
|
|
|
|
|
! Variables local to the procedure: |
|
66 |
|
|
67 |
real t(klon, klev) |
real t(klon, klev) |
68 |
INTEGER, SAVE:: physid |
INTEGER, SAVE:: physid |
|
REAL zx_tmp_3d(iim, jjm+1, klev), zx_tmp_2d(iim, jjm+1) |
|
69 |
|
|
70 |
! Les Thermiques |
! Les Thermiques |
71 |
|
|
72 |
REAL fm_therm1(klon, klev) |
REAL fm_therm1(klon, klev) |
73 |
REAL entr_therm(klon, klev) |
REAL entr_therm(klon, klev) |
75 |
|
|
76 |
INTEGER i, k |
INTEGER i, k |
77 |
|
|
78 |
REAL mfu(klon, klev) ! flux de masse dans le panache montant |
REAL, save:: mfu(klon, klev) ! flux de masse dans le panache montant |
79 |
REAL mfd(klon, klev) ! flux de masse dans le panache descendant |
REAL mfd(klon, klev) ! flux de masse dans le panache descendant |
80 |
REAL en_u(klon, klev) ! flux entraine dans le panache montant |
REAL en_u(klon, klev) ! flux entraine dans le panache montant |
81 |
REAL de_u(klon, klev) ! flux detraine dans le panache montant |
REAL de_u(klon, klev) ! flux detraine dans le panache montant |
90 |
|
|
91 |
REAL dtcum |
REAL dtcum |
92 |
|
|
93 |
INTEGER iadvtr, irec |
INTEGER:: iadvtr = 0, irec = 1 |
|
REAL zmin, zmax |
|
|
LOGICAL ok_sync |
|
94 |
|
|
95 |
SAVE t, mfu, mfd, en_u, de_u, en_d, de_d, coefh, dtcum |
SAVE t, mfd, en_u, de_u, en_d, de_d, coefh, dtcum |
96 |
SAVE fm_therm, entr_therm |
SAVE fm_therm, entr_therm |
|
SAVE iadvtr, irec |
|
97 |
SAVE pyu1, pyv1, pftsol, ppsrf |
SAVE pyu1, pyv1, pftsol, ppsrf |
98 |
|
|
|
DATA iadvtr, irec/0, 1/ |
|
|
|
|
99 |
!------------------------------------------------------ |
!------------------------------------------------------ |
100 |
|
|
101 |
! Couche limite: |
! Couche limite: |
|
|
|
|
ok_sync = .TRUE. |
|
|
|
|
|
IF (iadvtr==0) THEN |
|
|
CALL initphysto('phystoke', rlon, rlat, dtime, dtime*istphy, & |
|
|
dtime*istphy, nqmx, physid) |
|
|
END IF |
|
102 |
|
|
103 |
i = itap |
IF (iadvtr==0) CALL initphysto('phystoke', dtime, dtime * istphy, & |
104 |
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pphis, zx_tmp_2d) |
dtime * istphy, physid) |
|
CALL histwrite(physid, 'phis', i, zx_tmp_2d) |
|
|
|
|
|
i = itap |
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, paire, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'aire', i, zx_tmp_2d) |
|
105 |
|
|
106 |
|
CALL histwrite(physid, 'phis', itap, gr_phy_write(pphis)) |
107 |
|
CALL histwrite(physid, 'aire', itap, gr_phy_write(paire)) |
108 |
iadvtr = iadvtr + 1 |
iadvtr = iadvtr + 1 |
109 |
|
|
110 |
IF (mod(iadvtr, istphy)==1 .OR. istphy==1) THEN |
IF (mod(iadvtr, istphy) == 1 .OR. istphy == 1) THEN |
111 |
PRINT *, 'reinitialisation des champs cumules a iadvtr=', iadvtr |
PRINT *, 'reinitialisation des champs cumules a iadvtr =', iadvtr |
112 |
DO k = 1, klev |
DO k = 1, klev |
113 |
DO i = 1, klon |
DO i = 1, klon |
114 |
mfu(i, k) = 0. |
mfu(i, k) = 0. |
139 |
|
|
140 |
DO k = 1, klev |
DO k = 1, klev |
141 |
DO i = 1, klon |
DO i = 1, klon |
142 |
mfu(i, k) = mfu(i, k) + pmfu(i, k)*pdtphys |
mfu(i, k) = mfu(i, k) + pmfu(i, k) * pdtphys |
143 |
mfd(i, k) = mfd(i, k) + pmfd(i, k)*pdtphys |
mfd(i, k) = mfd(i, k) + pmfd(i, k) * pdtphys |
144 |
en_u(i, k) = en_u(i, k) + pen_u(i, k)*pdtphys |
en_u(i, k) = en_u(i, k) + pen_u(i, k) * pdtphys |
145 |
de_u(i, k) = de_u(i, k) + pde_u(i, k)*pdtphys |
de_u(i, k) = de_u(i, k) + pde_u(i, k) * pdtphys |
146 |
en_d(i, k) = en_d(i, k) + pen_d(i, k)*pdtphys |
en_d(i, k) = en_d(i, k) + pen_d(i, k) * pdtphys |
147 |
de_d(i, k) = de_d(i, k) + pde_d(i, k)*pdtphys |
de_d(i, k) = de_d(i, k) + pde_d(i, k) * pdtphys |
148 |
coefh(i, k) = coefh(i, k) + pcoefh(i, k)*pdtphys |
coefh(i, k) = coefh(i, k) + pcoefh(i, k) * pdtphys |
149 |
t(i, k) = t(i, k) + pt(i, k)*pdtphys |
t(i, k) = t(i, k) + pt(i, k) * pdtphys |
150 |
fm_therm(i, k) = fm_therm(i, k) + pfm_therm(i, k)*pdtphys |
fm_therm(i, k) = fm_therm(i, k) + pfm_therm(i, k) * pdtphys |
151 |
entr_therm(i, k) = entr_therm(i, k) + pentr_therm(i, k)*pdtphys |
entr_therm(i, k) = entr_therm(i, k) + pentr_therm(i, k) * pdtphys |
152 |
END DO |
END DO |
153 |
END DO |
END DO |
154 |
DO i = 1, klon |
DO i = 1, klon |
155 |
pyv1(i) = pyv1(i) + yv1(i)*pdtphys |
pyv1(i) = pyv1(i) + yv1(i) * pdtphys |
156 |
pyu1(i) = pyu1(i) + yu1(i)*pdtphys |
pyu1(i) = pyu1(i) + yu1(i) * pdtphys |
157 |
END DO |
END DO |
158 |
DO k = 1, nbsrf |
DO k = 1, nbsrf |
159 |
DO i = 1, klon |
DO i = 1, klon |
160 |
pftsol(i, k) = pftsol(i, k) + ftsol(i, k)*pdtphys |
pftsol(i, k) = pftsol(i, k) + ftsol(i, k) * pdtphys |
161 |
ppsrf(i, k) = ppsrf(i, k) + pctsrf(i, k)*pdtphys |
ppsrf(i, k) = ppsrf(i, k) + pctsrf(i, k) * pdtphys |
162 |
END DO |
END DO |
163 |
END DO |
END DO |
164 |
|
|
165 |
dtcum = dtcum + pdtphys |
dtcum = dtcum + pdtphys |
166 |
|
|
167 |
IF (mod(iadvtr, istphy)==0) THEN |
IF (mod(iadvtr, istphy) == 0) THEN |
168 |
! normalisation par le temps cumule |
! normalisation par le temps cumule |
169 |
DO k = 1, klev |
DO k = 1, klev |
170 |
DO i = 1, klon |
DO i = 1, klon |
171 |
mfu(i, k) = mfu(i, k)/dtcum |
mfu(i, k) = mfu(i, k)/dtcum |
175 |
en_d(i, k) = en_d(i, k)/dtcum |
en_d(i, k) = en_d(i, k)/dtcum |
176 |
de_d(i, k) = de_d(i, k)/dtcum |
de_d(i, k) = de_d(i, k)/dtcum |
177 |
coefh(i, k) = coefh(i, k)/dtcum |
coefh(i, k) = coefh(i, k)/dtcum |
|
! Unitel a enlever |
|
178 |
t(i, k) = t(i, k)/dtcum |
t(i, k) = t(i, k)/dtcum |
179 |
fm_therm(i, k) = fm_therm(i, k)/dtcum |
fm_therm(i, k) = fm_therm(i, k)/dtcum |
180 |
entr_therm(i, k) = entr_therm(i, k)/dtcum |
entr_therm(i, k) = entr_therm(i, k)/dtcum |
197 |
ppsrf2(i) = ppsrf(i, 2) |
ppsrf2(i) = ppsrf(i, 2) |
198 |
ppsrf3(i) = ppsrf(i, 3) |
ppsrf3(i) = ppsrf(i, 3) |
199 |
ppsrf4(i) = ppsrf(i, 4) |
ppsrf4(i) = ppsrf(i, 4) |
|
|
|
200 |
END DO |
END DO |
201 |
END DO |
END DO |
202 |
|
|
203 |
! ecriture des champs |
! \'Ecriture des champs |
204 |
|
|
205 |
irec = irec + 1 |
irec = irec + 1 |
206 |
|
|
207 |
!cccc |
CALL histwrite(physid, 't', itap, gr_phy_write(t)) |
208 |
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, t, zx_tmp_3d) |
CALL histwrite(physid, 'mfu', itap, gr_phy_write(mfu)) |
209 |
CALL histwrite(physid, 't', itap, zx_tmp_3d) |
CALL histwrite(physid, 'mfd', itap, gr_phy_write(mfd)) |
210 |
|
CALL histwrite(physid, 'en_u', itap, gr_phy_write(en_u)) |
211 |
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, mfu, zx_tmp_3d) |
CALL histwrite(physid, 'de_u', itap, gr_phy_write(de_u)) |
212 |
CALL histwrite(physid, 'mfu', itap, zx_tmp_3d) |
CALL histwrite(physid, 'en_d', itap, gr_phy_write(en_d)) |
213 |
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, mfd, zx_tmp_3d) |
CALL histwrite(physid, 'de_d', itap, gr_phy_write(de_d)) |
214 |
CALL histwrite(physid, 'mfd', itap, zx_tmp_3d) |
CALL histwrite(physid, 'coefh', itap, gr_phy_write(coefh)) |
|
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, en_u, zx_tmp_3d) |
|
|
CALL histwrite(physid, 'en_u', itap, zx_tmp_3d) |
|
|
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, de_u, zx_tmp_3d) |
|
|
CALL histwrite(physid, 'de_u', itap, zx_tmp_3d) |
|
|
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, en_d, zx_tmp_3d) |
|
|
CALL histwrite(physid, 'en_d', itap, zx_tmp_3d) |
|
|
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, de_d, zx_tmp_3d) |
|
|
CALL histwrite(physid, 'de_d', itap, zx_tmp_3d) |
|
|
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, coefh, zx_tmp_3d) |
|
|
CALL histwrite(physid, 'coefh', itap, zx_tmp_3d) |
|
|
|
|
|
! ajou... |
|
215 |
DO k = 1, klev |
DO k = 1, klev |
216 |
DO i = 1, klon |
DO i = 1, klon |
217 |
fm_therm1(i, k) = fm_therm(i, k) |
fm_therm1(i, k) = fm_therm(i, k) |
218 |
END DO |
END DO |
219 |
END DO |
END DO |
220 |
|
|
221 |
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, fm_therm1, zx_tmp_3d) |
CALL histwrite(physid, 'fm_th', itap, gr_phy_write(fm_therm1)) |
222 |
CALL histwrite(physid, 'fm_th', itap, zx_tmp_3d) |
CALL histwrite(physid, 'en_th', itap, gr_phy_write(entr_therm)) |
223 |
|
CALL histwrite(physid, 'frac_impa', itap, gr_phy_write(frac_impa)) |
224 |
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, entr_therm, zx_tmp_3d) |
CALL histwrite(physid, 'frac_nucl', itap, gr_phy_write(frac_nucl)) |
225 |
CALL histwrite(physid, 'en_th', itap, zx_tmp_3d) |
CALL histwrite(physid, 'pyu1', itap, gr_phy_write(pyu1)) |
226 |
!ccc |
CALL histwrite(physid, 'pyv1', itap, gr_phy_write(pyv1)) |
227 |
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, frac_impa, zx_tmp_3d) |
CALL histwrite(physid, 'ftsol1', itap, gr_phy_write(pftsol1)) |
228 |
CALL histwrite(physid, 'frac_impa', itap, zx_tmp_3d) |
CALL histwrite(physid, 'ftsol2', itap, gr_phy_write(pftsol2)) |
229 |
|
CALL histwrite(physid, 'ftsol3', itap, gr_phy_write(pftsol3)) |
230 |
CALL gr_fi_ecrit(klev, klon, iim, jjm+1, frac_nucl, zx_tmp_3d) |
CALL histwrite(physid, 'ftsol4', itap, gr_phy_write(pftsol4)) |
231 |
CALL histwrite(physid, 'frac_nucl', itap, zx_tmp_3d) |
CALL histwrite(physid, 'psrf1', itap, gr_phy_write(ppsrf1)) |
232 |
|
CALL histwrite(physid, 'psrf2', itap, gr_phy_write(ppsrf2)) |
233 |
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pyu1, zx_tmp_2d) |
CALL histwrite(physid, 'psrf3', itap, gr_phy_write(ppsrf3)) |
234 |
CALL histwrite(physid, 'pyu1', itap, zx_tmp_2d) |
CALL histwrite(physid, 'psrf4', itap, gr_phy_write(ppsrf4)) |
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pyv1, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'pyv1', itap, zx_tmp_2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pftsol1, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'ftsol1', itap, zx_tmp_2d) |
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pftsol2, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'ftsol2', itap, zx_tmp_2d) |
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pftsol3, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'ftsol3', itap, zx_tmp_2d) |
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pftsol4, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'ftsol4', itap, zx_tmp_2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, ppsrf1, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'psrf1', itap, zx_tmp_2d) |
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, ppsrf2, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'psrf2', itap, zx_tmp_2d) |
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, ppsrf3, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'psrf3', itap, zx_tmp_2d) |
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, ppsrf4, zx_tmp_2d) |
|
|
CALL histwrite(physid, 'psrf4', itap, zx_tmp_2d) |
|
|
|
|
|
IF (ok_sync) CALL histsync(physid) |
|
|
! if (ok_sync) call histsync |
|
|
|
|
|
|
|
|
!AA Test sur la valeur des coefficients de lessivage |
|
|
|
|
|
zmin = 1E33 |
|
|
zmax = -1E33 |
|
|
DO k = 1, klev |
|
|
DO i = 1, klon |
|
|
zmax = max(zmax, frac_nucl(i, k)) |
|
|
zmin = min(zmin, frac_nucl(i, k)) |
|
|
END DO |
|
|
END DO |
|
|
PRINT *, '------ coefs de lessivage (min et max) --------' |
|
|
PRINT *, 'facteur de nucleation ', zmin, zmax |
|
|
zmin = 1E33 |
|
|
zmax = -1E33 |
|
|
DO k = 1, klev |
|
|
DO i = 1, klon |
|
|
zmax = max(zmax, frac_impa(i, k)) |
|
|
zmin = min(zmin, frac_impa(i, k)) |
|
|
END DO |
|
|
END DO |
|
|
PRINT *, 'facteur d impaction ', zmin, zmax |
|
235 |
|
|
236 |
|
CALL histsync(physid) |
237 |
END IF |
END IF |
238 |
|
|
239 |
END SUBROUTINE phystokenc |
END SUBROUTINE phystokenc |