1 |
module phytrac_m |
module phytrac_m |
2 |
|
|
|
! This module is clean: no C preprocessor directive, no include line. |
|
|
|
|
3 |
IMPLICIT none |
IMPLICIT none |
4 |
|
|
5 |
private |
private |
7 |
|
|
8 |
contains |
contains |
9 |
|
|
10 |
SUBROUTINE phytrac(rnpb, itap, lmt_pas, julien, gmtime, firstcal, lafin, & |
SUBROUTINE phytrac(itap, lmt_pas, julien, gmtime, firstcal, lafin, pdtphys, & |
11 |
nqmax, pdtphys, u, v, t_seri, paprs, pplay, pmfu, pmfd, pen_u, & |
t_seri, paprs, pplay, pmfu, pmfd, pde_u, pen_d, coefh, fm_therm, & |
12 |
pde_u, pen_d, pde_d, coefh, fm_therm, entr_therm, yu1, yv1, ftsol, & |
entr_therm, yu1, yv1, ftsol, pctsrf, frac_impa, frac_nucl, da, phi, & |
13 |
pctsrf, frac_impa, frac_nucl, presnivs, pphis, & |
mp, upwd, dnwd, tr_seri, zmasse, ncid_startphy, nid_ins) |
|
pphi, albsol, rh, cldfra, rneb, diafra, cldliq, itop_con, & |
|
|
ibas_con, pmflxr, pmflxs, prfl, psfl, da, phi, mp, upwd, dnwd, tr_seri) |
|
14 |
|
|
15 |
! From phylmd/phytrac.F, version 1.15 2006/02/21 08:08:30 |
! From phylmd/phytrac.F, version 1.15 2006/02/21 08:08:30 (SVN revision 679) |
16 |
|
|
17 |
! Authors : Frédéric Hourdin, Abderrahmane Idelkadi, Marie-Alice |
! Authors: Fr\'ed\'eric Hourdin, Abderrahmane Idelkadi, Marie-Alice |
18 |
! Foujols, Olivia |
! Foujols, Olivia |
|
! Objet : moniteur général des tendances des traceurs |
|
19 |
|
|
20 |
! Remarques : |
! Objet : moniteur g\'en\'eral des tendances des traceurs |
|
! 1/ L'appel de "phytrac" se fait avec "nq-2" donc nous avons bien |
|
|
! les vrais traceurs (en nombre "nbtr", sans la vapeur d'eau ni l'eau |
|
|
! liquide) dans "phytrac". |
|
|
! 2/ Le choix du radon et du plomb se fait juste avec un "data" |
|
|
! (peu propre). |
|
|
! Pourrait-on avoir une variable qui indiquerait le type de traceur ? |
|
21 |
|
|
22 |
use dimens_m, only: iim, jjm, llm |
! L'appel de "phytrac" se fait avec "nqmx - 2" donc nous avons |
23 |
use indicesol, only: nbsrf |
! bien les vrais traceurs, sans la vapeur d'eau ni l'eau liquide. |
24 |
use dimphy, only: klon, nbtr |
|
25 |
|
! Modifications pour les traceurs : |
26 |
|
! - uniformisation des parametrisations dans phytrac |
27 |
|
! - stockage des moyennes des champs n\'ecessaires en mode traceur off-line |
28 |
|
|
29 |
|
use abort_gcm_m, only: abort_gcm |
30 |
use clesphys, only: ecrit_tra |
use clesphys, only: ecrit_tra |
31 |
use clesphys2, only: iflag_con |
use clesphys2, only: iflag_con |
32 |
use abort_gcm_m, only: abort_gcm |
use cltrac_m, only: cltrac |
33 |
use YOMCST, only: rg |
use cltracrn_m, only: cltracrn |
34 |
use ctherm, only: iflag_thermals |
use ctherm, only: iflag_thermals |
35 |
use regr_pr_comb_coefoz_m, only: regr_pr_comb_coefoz |
use cvltr_m, only: cvltr |
36 |
use phyetat0_m, only: rlat |
use dimens_m, only: llm, nqmx |
37 |
|
use dimphy, only: klon |
38 |
|
use indicesol, only: nbsrf |
39 |
|
use initrrnpb_m, only: initrrnpb |
40 |
|
use minmaxqfi_m, only: minmaxqfi |
41 |
|
use netcdf95, only: nf95_inq_varid, nf95_get_var, nf95_put_var |
42 |
|
use nflxtr_m, only: nflxtr |
43 |
|
use nr_util, only: assert |
44 |
use o3_chem_m, only: o3_chem |
use o3_chem_m, only: o3_chem |
45 |
|
use phyetat0_m, only: rlat |
46 |
|
use phyredem0_m, only: ncid_restartphy |
47 |
|
use press_coefoz_m, only: press_coefoz |
48 |
|
use radiornpb_m, only: radiornpb |
49 |
|
use regr_pr_comb_coefoz_m, only: regr_pr_comb_coefoz |
50 |
|
use SUPHEC_M, only: rg |
51 |
|
|
52 |
! Arguments: |
integer, intent(in):: itap ! number of calls to "physiq" |
|
|
|
|
! EN ENTREE: |
|
|
|
|
|
! divers: |
|
|
|
|
|
logical, intent(in):: rnpb |
|
|
|
|
|
integer, intent(in):: nqmax |
|
|
! (nombre de traceurs auxquels on applique la physique) |
|
|
|
|
|
integer, intent(in):: itap ! number of calls to "physiq" |
|
53 |
integer, intent(in):: lmt_pas ! number of time steps of "physics" per day |
integer, intent(in):: lmt_pas ! number of time steps of "physics" per day |
54 |
integer, intent(in):: julien !jour julien, 1 <= julien <= 360 |
integer, intent(in):: julien !jour julien, 1 <= julien <= 360 |
55 |
integer itop_con(klon) |
real, intent(in):: gmtime ! heure de la journ\'ee en fraction de jour |
56 |
integer ibas_con(klon) |
logical, intent(in):: firstcal ! first call to "calfis" |
57 |
real, intent(in):: gmtime ! heure de la journée en fraction de jour |
logical, intent(in):: lafin ! fin de la physique |
58 |
real, intent(in):: pdtphys ! pas d'integration pour la physique (s) |
real, intent(in):: pdtphys ! pas d'integration pour la physique (s) |
59 |
real, intent(in):: t_seri(klon, llm) ! temperature, in K |
real, intent(in):: t_seri(klon, llm) ! temperature, in K |
60 |
|
|
|
real tr_seri(klon, llm, nbtr) |
|
|
! (mass fractions of tracers, excluding water, at mid-layers) |
|
|
|
|
|
real u(klon, llm) |
|
|
real v(klon, llm) |
|
|
real rh(klon, llm) ! humidite relative |
|
|
real cldliq(klon, llm) ! eau liquide nuageuse |
|
|
real cldfra(klon, llm) ! fraction nuageuse (tous les nuages) |
|
|
|
|
|
real diafra(klon, llm) |
|
|
! (fraction nuageuse (convection ou stratus artificiels)) |
|
|
|
|
|
real rneb(klon, llm) ! fraction nuageuse (grande echelle) |
|
|
real albsol(klon) ! albedo surface |
|
|
|
|
61 |
real, intent(in):: paprs(klon, llm+1) |
real, intent(in):: paprs(klon, llm+1) |
62 |
! (pression pour chaque inter-couche, en Pa) |
! (pression pour chaque inter-couche, en Pa) |
63 |
|
|
64 |
real, intent(in):: pplay(klon, llm) |
real, intent(in):: pplay(klon, llm) |
65 |
! (pression pour le mileu de chaque couche, en Pa) |
! (pression pour le mileu de chaque couche, en Pa) |
66 |
|
|
67 |
real pphi(klon, llm) ! geopotentiel |
! convection: |
|
real pphis(klon) |
|
|
REAL, intent(in):: presnivs(llm) |
|
|
logical, intent(in):: firstcal ! first call to "calfis" |
|
|
logical, intent(in):: lafin ! fin de la physique |
|
|
|
|
|
integer nsplit |
|
|
REAL pmflxr(klon, llm+1), pmflxs(klon, llm+1) !--lessivage convection |
|
|
REAL prfl(klon, llm+1), psfl(klon, llm+1) !--lessivage large-scale |
|
68 |
|
|
69 |
! convection: |
REAL, intent(in):: pmfu(klon, llm) ! flux de masse dans le panache montant |
70 |
|
|
71 |
REAL pmfu(klon, llm) ! flux de masse dans le panache montant |
REAL, intent(in):: pmfd(klon, llm) |
72 |
REAL pmfd(klon, llm) ! flux de masse dans le panache descendant |
! flux de masse dans le panache descendant |
|
REAL pen_u(klon, llm) ! flux entraine dans le panache montant |
|
|
|
|
|
! thermiques: |
|
|
|
|
|
real fm_therm(klon, llm+1), entr_therm(klon, llm) |
|
73 |
|
|
74 |
REAL pde_u(klon, llm) ! flux detraine dans le panache montant |
REAL pde_u(klon, llm) ! flux detraine dans le panache montant |
75 |
REAL pen_d(klon, llm) ! flux entraine dans le panache descendant |
REAL pen_d(klon, llm) ! flux entraine dans le panache descendant |
76 |
REAL pde_d(klon, llm) ! flux detraine dans le panache descendant |
REAL coefh(klon, llm) ! coeff melange couche limite |
|
! KE |
|
|
real da(klon, llm), phi(klon, llm, llm), mp(klon, llm) |
|
|
REAL upwd(klon, llm) ! saturated updraft mass flux |
|
|
REAL dnwd(klon, llm) ! saturated downdraft mass flux |
|
77 |
|
|
78 |
! Couche limite: |
! thermiques: |
79 |
|
real fm_therm(klon, llm+1), entr_therm(klon, llm) |
80 |
|
|
81 |
|
! Couche limite: |
82 |
|
REAL yu1(klon) ! vents au premier niveau |
83 |
|
REAL yv1(klon) ! vents au premier niveau |
84 |
|
|
85 |
REAL coefh(klon, llm) ! coeff melange CL |
! Arguments n\'ecessaires pour les sources et puits de traceur : |
86 |
REAL yu1(klon) ! vents au premier niveau |
real, intent(in):: ftsol(klon, nbsrf) ! Temperature du sol (surf)(Kelvin) |
87 |
REAL yv1(klon) ! vents au premier niveau |
real pctsrf(klon, nbsrf) ! Pourcentage de sol f(nature du sol) |
88 |
|
|
89 |
! Lessivage: |
! Lessivage pour le on-line |
90 |
|
REAL frac_impa(klon, llm) ! fraction d'aerosols impactes |
91 |
|
REAL frac_nucl(klon, llm) ! fraction d'aerosols nuclees |
92 |
|
|
93 |
|
! Kerry Emanuel |
94 |
|
real, intent(in):: da(klon, llm), phi(klon, llm, llm), mp(klon, llm) |
95 |
|
REAL, intent(in):: upwd(klon, llm) ! saturated updraft mass flux |
96 |
|
REAL, intent(in):: dnwd(klon, llm) ! saturated downdraft mass flux |
97 |
|
|
98 |
! pour le ON-LINE |
real, intent(inout):: tr_seri(:, :, :) ! (klon, llm, nqmx - 2) |
99 |
|
! (mass fractions of tracers, excluding water, at mid-layers) |
100 |
|
|
101 |
REAL frac_impa(klon, llm) ! fraction d'aerosols impactes |
real, intent(in):: zmasse(:, :) ! (klon, llm) |
102 |
REAL frac_nucl(klon, llm) ! fraction d'aerosols nuclees |
! (column-density of mass of air in a cell, in kg m-2) |
103 |
|
|
104 |
! Arguments necessaires pour les sources et puits de traceur: |
integer, intent(in):: ncid_startphy, nid_ins |
105 |
|
|
106 |
real ftsol(klon, nbsrf) ! Temperature du sol (surf)(Kelvin) |
! Local: |
|
real pctsrf(klon, nbsrf) ! Pourcentage de sol f(nature du sol) |
|
107 |
|
|
108 |
real pftsol1(klon), pftsol2(klon), pftsol3(klon), pftsol4(klon) |
integer nsplit |
|
real ppsrf1(klon), ppsrf2(klon), ppsrf3(klon), ppsrf4(klon) |
|
109 |
|
|
110 |
! VARIABLES LOCALES TRACEURS |
! TRACEURS |
111 |
|
|
112 |
! Sources et puits des traceurs: |
! Sources et puits des traceurs: |
113 |
|
|
114 |
! Pour l'instant seuls les cas du rn et du pb ont ete envisages. |
! Pour l'instant seuls les cas du rn et du pb ont ete envisages. |
115 |
|
|
116 |
REAL source(klon) ! a voir lorsque le flux est prescrit |
REAL source(klon) ! a voir lorsque le flux est prescrit |
117 |
! |
! |
118 |
! Pour la source de radon et son reservoir de sol |
! Pour la source de radon et son reservoir de sol |
119 |
|
|
120 |
REAL, save:: trs(klon, nbtr) ! Concentration de radon dans le sol |
REAL, save:: trs(klon, nqmx - 2) ! Concentration de traceur dans le sol |
121 |
|
|
122 |
REAL masktr(klon, nbtr) ! Masque reservoir de sol traceur |
REAL masktr(klon, nqmx - 2) ! Masque reservoir de sol traceur |
123 |
! Masque de l'echange avec la surface |
! Masque de l'echange avec la surface |
124 |
! (1 = reservoir) ou (possible => 1 ) |
! (1 = reservoir) ou (possible => 1) |
125 |
SAVE masktr |
SAVE masktr |
126 |
REAL fshtr(klon, nbtr) ! Flux surfacique dans le reservoir de sol |
REAL fshtr(klon, nqmx - 2) ! Flux surfacique dans le reservoir de sol |
127 |
SAVE fshtr |
SAVE fshtr |
128 |
REAL hsoltr(nbtr) ! Epaisseur equivalente du reservoir de sol |
REAL hsoltr(nqmx - 2) ! Epaisseur equivalente du reservoir de sol |
129 |
SAVE hsoltr |
SAVE hsoltr |
130 |
REAL tautr(nbtr) ! Constante de decroissance radioactive |
REAL tautr(nqmx - 2) ! Constante de decroissance radioactive |
131 |
SAVE tautr |
SAVE tautr |
132 |
REAL vdeptr(nbtr) ! Vitesse de depot sec dans la couche Brownienne |
REAL vdeptr(nqmx - 2) ! Vitesse de depot sec dans la couche Brownienne |
133 |
SAVE vdeptr |
SAVE vdeptr |
134 |
REAL scavtr(nbtr) ! Coefficient de lessivage |
REAL scavtr(nqmx - 2) ! Coefficient de lessivage |
135 |
SAVE scavtr |
SAVE scavtr |
136 |
|
|
137 |
CHARACTER itn |
CHARACTER itn |
|
INTEGER, save:: nid_tra |
|
138 |
|
|
139 |
! nature du traceur |
! nature du traceur |
140 |
|
|
141 |
logical aerosol(nbtr) ! Nature du traceur |
logical aerosol(nqmx - 2) ! Nature du traceur |
142 |
! ! aerosol(it) = true => aerosol |
! ! aerosol(it) = true => aerosol |
143 |
! ! aerosol(it) = false => gaz |
! ! aerosol(it) = false => gaz |
144 |
logical clsol(nbtr) ! couche limite sol calculée |
logical clsol(nqmx - 2) ! couche limite sol calcul\'ee |
145 |
logical radio(nbtr) ! décroisssance radioactive |
logical radio(nqmx - 2) ! d\'ecroisssance radioactive |
146 |
save aerosol, clsol, radio |
save aerosol, clsol, radio |
147 |
|
|
148 |
! convection tiedtke |
! convection tiedtke |
154 |
! Variables locales pour effectuer les appels en serie |
! Variables locales pour effectuer les appels en serie |
155 |
|
|
156 |
REAL d_tr(klon, llm), d_trs(klon) ! tendances de traceurs |
REAL d_tr(klon, llm), d_trs(klon) ! tendances de traceurs |
157 |
REAL d_tr_cl(klon, llm, nbtr) ! tendance de traceurs couche limite |
REAL d_tr_cl(klon, llm, nqmx - 2) ! tendance de traceurs couche limite |
|
REAL d_tr_cv(klon, llm, nbtr) ! tendance de traceurs conv pour chq traceur |
|
|
REAL d_tr_th(klon, llm, nbtr) ! la tendance des thermiques |
|
|
REAL d_tr_dec(klon, llm, 2) ! la tendance de la decroissance |
|
|
! ! radioactive du rn - > pb |
|
|
REAL d_tr_lessi_impa(klon, llm, nbtr) ! la tendance du lessivage |
|
|
! ! par impaction |
|
|
REAL d_tr_lessi_nucl(klon, llm, nbtr) ! la tendance du lessivage |
|
|
! ! par nucleation |
|
|
REAL flestottr(klon, llm, nbtr) ! flux de lessivage |
|
|
! ! dans chaque couche |
|
158 |
|
|
159 |
real zmasse(klon, llm) |
REAL d_tr_cv(klon, llm, nqmx - 2) |
160 |
! (column-density of mass of air in a layer, in kg m-2) |
! tendance de traceurs conv pour chq traceur |
161 |
|
|
162 |
real ztra_th(klon, llm) |
REAL d_tr_th(klon, llm, nqmx - 2) ! la tendance des thermiques |
163 |
|
REAL d_tr_dec(klon, llm, 2) ! la tendance de la decroissance |
164 |
|
! ! radioactive du rn - > pb |
165 |
|
REAL d_tr_lessi_impa(klon, llm, nqmx - 2) ! la tendance du lessivage |
166 |
|
! ! par impaction |
167 |
|
REAL d_tr_lessi_nucl(klon, llm, nqmx - 2) ! la tendance du lessivage |
168 |
|
! ! par nucleation |
169 |
|
REAL flestottr(klon, llm, nqmx - 2) ! flux de lessivage |
170 |
|
! ! dans chaque couche |
171 |
|
|
172 |
character(len=20) modname |
real ztra_th(klon, llm) |
173 |
character(len=80) abort_message |
integer isplit, varid |
|
integer isplit |
|
174 |
|
|
175 |
! Controls: |
! Controls: |
176 |
logical:: couchelimite = .true. |
logical:: couchelimite = .true. |
180 |
|
|
181 |
!-------------------------------------- |
!-------------------------------------- |
182 |
|
|
183 |
modname='phytrac' |
call assert(shape(zmasse) == (/klon, llm/), "phytrac zmasse") |
184 |
|
call assert(shape(tr_seri) == (/klon, llm, nqmx - 2/), "phytrac tr_seri") |
185 |
|
|
186 |
if (firstcal) then |
if (firstcal) then |
187 |
print *, 'phytrac: pdtphys = ', pdtphys |
print *, 'phytrac: pdtphys = ', pdtphys |
188 |
PRINT *, 'Fréquence de sortie des traceurs : ecrit_tra = ', ecrit_tra |
PRINT *, 'Frequency of tracer output: ecrit_tra = ', ecrit_tra |
189 |
if (nbtr < nqmax) then |
inirnpb = .true. |
|
abort_message='See above' |
|
|
call abort_gcm(modname, abort_message, 1) |
|
|
endif |
|
|
inirnpb=rnpb |
|
|
|
|
|
! Initialisation des sorties : |
|
|
call ini_histrac(nid_tra, pdtphys, presnivs, nqmax, lessivage) |
|
190 |
|
|
191 |
! Initialisation de certaines variables pour le radon et le plomb |
! Initialisation de certaines variables pour le radon et le plomb |
192 |
! Initialisation du traceur dans le sol (couche limite radonique) |
! Initialisation du traceur dans le sol (couche limite radonique) |
193 |
trs(:, :) = 0. |
trs(:, 2:) = 0. |
194 |
|
|
195 |
open (unit=99, file='starttrac', status='old', err=999, & |
call nf95_inq_varid(ncid_startphy, "trs", varid) |
196 |
form='formatted') |
call nf95_get_var(ncid_startphy, varid, trs(:, 1)) |
|
read(unit=99, fmt=*) (trs(i, 1), i=1, klon) |
|
|
999 continue |
|
|
close(unit=99) |
|
197 |
|
|
198 |
! Initialisation de la fraction d'aerosols lessivee |
! Initialisation de la fraction d'aerosols lessivee |
199 |
|
|
200 |
d_tr_lessi_impa(:, :, :) = 0. |
d_tr_lessi_impa = 0. |
201 |
d_tr_lessi_nucl(:, :, :) = 0. |
d_tr_lessi_nucl = 0. |
202 |
|
|
203 |
! Initialisation de la nature des traceurs |
! Initialisation de la nature des traceurs |
204 |
|
|
205 |
DO it = 1, nqmax |
DO it = 1, nqmx - 2 |
206 |
aerosol(it) = .FALSE. ! Tous les traceurs sont des gaz par defaut |
aerosol(it) = .FALSE. ! Tous les traceurs sont des gaz par defaut |
207 |
radio(it) = .FALSE. ! par défaut pas de passage par "radiornpb" |
radio(it) = .FALSE. ! par d\'efaut pas de passage par "radiornpb" |
208 |
clsol(it) = .FALSE. ! Par defaut couche limite avec flux prescrit |
clsol(it) = .FALSE. ! Par defaut couche limite avec flux prescrit |
209 |
ENDDO |
ENDDO |
210 |
|
|
211 |
|
if (nqmx >= 5) then |
212 |
|
call press_coefoz ! read input pressure levels for ozone coefficients |
213 |
|
end if |
214 |
ENDIF |
ENDIF |
215 |
|
|
|
! Initialisation du traceur dans le sol (couche limite radonique) |
|
216 |
if (inirnpb) THEN |
if (inirnpb) THEN |
217 |
|
! Initialisation du traceur dans le sol (couche limite radonique) |
218 |
radio(1)= .true. |
radio(1)= .true. |
219 |
radio(2)= .true. |
radio(2)= .true. |
220 |
clsol(1)= .true. |
clsol(1)= .true. |
221 |
clsol(2)= .true. |
clsol(2)= .true. |
222 |
aerosol(2) = .TRUE. ! le Pb est un aerosol |
aerosol(2) = .TRUE. ! le Pb est un aerosol |
223 |
|
call initrrnpb(pctsrf, masktr, fshtr, hsoltr, tautr, vdeptr, scavtr) |
|
call initrrnpb(ftsol, pctsrf, masktr, fshtr, hsoltr, tautr, vdeptr, & |
|
|
scavtr) |
|
224 |
inirnpb=.false. |
inirnpb=.false. |
225 |
endif |
endif |
226 |
|
|
|
do i=1, klon |
|
|
pftsol1(i) = ftsol(i, 1) |
|
|
pftsol2(i) = ftsol(i, 2) |
|
|
pftsol3(i) = ftsol(i, 3) |
|
|
pftsol4(i) = ftsol(i, 4) |
|
|
|
|
|
ppsrf1(i) = pctsrf(i, 1) |
|
|
ppsrf2(i) = pctsrf(i, 2) |
|
|
ppsrf3(i) = pctsrf(i, 3) |
|
|
ppsrf4(i) = pctsrf(i, 4) |
|
|
|
|
|
enddo |
|
|
|
|
|
! Calcul de l'effet de la convection |
|
|
|
|
227 |
if (convection) then |
if (convection) then |
228 |
DO it=1, nqmax |
! Calcul de l'effet de la convection |
229 |
if (iflag_con.eq.2) then |
DO it=1, nqmx - 2 |
230 |
! tiedke |
if (iflag_con == 2) then |
231 |
CALL nflxtr(pdtphys, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, & |
! Tiedke |
232 |
paprs, tr_seri(1, 1, it), d_tr_cv(1, 1, it)) |
CALL nflxtr(pdtphys, pmfu, pmfd, pde_u, pen_d, paprs, & |
233 |
else if (iflag_con.eq.3) then |
tr_seri(:, :, it), d_tr_cv(:, :, it)) |
234 |
! KE |
else if (iflag_con == 3) then |
235 |
call cvltr(pdtphys, da, phi, mp, paprs, & |
! Emanuel |
236 |
tr_seri(1, 1, it), upwd, dnwd, d_tr_cv(1, 1, it)) |
call cvltr(pdtphys, da, phi, mp, paprs, tr_seri(:, :, it), upwd, & |
237 |
|
dnwd, d_tr_cv(:, :, it)) |
238 |
endif |
endif |
239 |
|
|
240 |
DO k = 1, llm |
DO k = 1, llm |
243 |
ENDDO |
ENDDO |
244 |
ENDDO |
ENDDO |
245 |
WRITE(unit=itn, fmt='(i1)') it |
WRITE(unit=itn, fmt='(i1)') it |
246 |
CALL minmaxqfi(tr_seri(:, :, it), 0., 1.e33, & |
CALL minmaxqfi(tr_seri(:, :, it), 0., 1e33, & |
247 |
'convection, tracer index = ' // itn) |
'convection, tracer index = ' // itn) |
248 |
ENDDO |
ENDDO |
249 |
endif |
endif |
250 |
|
|
|
forall (k=1: llm) zmasse(:, k) = (paprs(:, k)-paprs(:, k+1)) / rg |
|
|
|
|
251 |
! Calcul de l'effet des thermiques |
! Calcul de l'effet des thermiques |
252 |
|
|
253 |
do it=1, nqmax |
do it=1, nqmx - 2 |
254 |
do k=1, llm |
do k=1, llm |
255 |
do i=1, klon |
do i=1, klon |
256 |
d_tr_th(i, k, it)=0. |
d_tr_th(i, k, it)=0. |
257 |
tr_seri(i, k, it)=max(tr_seri(i, k, it), 0.) |
tr_seri(i, k, it)=max(tr_seri(i, k, it), 0.) |
258 |
tr_seri(i, k, it)=min(tr_seri(i, k, it), 1.e10) |
tr_seri(i, k, it)=min(tr_seri(i, k, it), 1e10) |
259 |
enddo |
enddo |
260 |
enddo |
enddo |
261 |
enddo |
enddo |
262 |
|
|
263 |
if (iflag_thermals > 0) then |
if (iflag_thermals > 0) then |
264 |
nsplit=10 |
nsplit=10 |
265 |
DO it=1, nqmax |
DO it=1, nqmx - 2 |
266 |
do isplit=1, nsplit |
do isplit=1, nsplit |
267 |
! Thermiques |
! Thermiques |
268 |
call dqthermcell(klon, llm, pdtphys/nsplit & |
call dqthermcell(klon, llm, pdtphys/nsplit & |
280 |
ENDDO |
ENDDO |
281 |
endif |
endif |
282 |
|
|
283 |
! Calcul de l'effet de la couche limite |
! Calcul de l'effet de la couche limite |
284 |
|
|
285 |
if (couchelimite) then |
if (couchelimite) then |
|
|
|
286 |
DO k = 1, llm |
DO k = 1, llm |
287 |
DO i = 1, klon |
DO i = 1, klon |
288 |
delp(i, k) = paprs(i, k)-paprs(i, k+1) |
delp(i, k) = paprs(i, k)-paprs(i, k+1) |
289 |
ENDDO |
ENDDO |
290 |
ENDDO |
ENDDO |
291 |
|
|
292 |
! MAF modif pour tenir compte du cas rnpb + traceur |
! MAF modif pour tenir compte du cas traceur |
293 |
DO it=1, nqmax |
DO it=1, nqmx - 2 |
294 |
if (clsol(it)) then |
if (clsol(it)) then |
295 |
! couche limite avec quantite dans le sol calculee |
! couche limite avec quantite dans le sol calculee |
296 |
CALL cltracrn(it, pdtphys, yu1, yv1, & |
CALL cltracrn(it, pdtphys, yu1, yv1, coefh, t_seri, ftsol, & |
297 |
coefh, t_seri, ftsol, pctsrf, & |
pctsrf, tr_seri(:, :, it), trs(:, it), paprs, pplay, delp, & |
298 |
tr_seri(1, 1, it), trs(1, it), & |
masktr(1, it), fshtr(1, it), hsoltr(it), tautr(it), & |
299 |
paprs, pplay, delp, & |
vdeptr(it), rlat, d_tr_cl(1, 1, it), d_trs) |
|
masktr(1, it), fshtr(1, it), hsoltr(it), & |
|
|
tautr(it), vdeptr(it), & |
|
|
rlat, & |
|
|
d_tr_cl(1, 1, it), d_trs) |
|
300 |
DO k = 1, llm |
DO k = 1, llm |
301 |
DO i = 1, klon |
DO i = 1, klon |
302 |
tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_cl(i, k, it) |
tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_cl(i, k, it) |
303 |
ENDDO |
ENDDO |
304 |
ENDDO |
ENDDO |
305 |
|
|
306 |
! Traceur ds sol |
trs(:, it) = trs(:, it) + d_trs |
307 |
|
else |
308 |
DO i = 1, klon |
! couche limite avec flux prescrit |
|
trs(i, it) = trs(i, it) + d_trs(i) |
|
|
END DO |
|
|
else ! couche limite avec flux prescrit |
|
309 |
!MAF provisoire source / traceur a creer |
!MAF provisoire source / traceur a creer |
310 |
DO i=1, klon |
DO i=1, klon |
311 |
source(i) = 0.0 ! pas de source, pour l'instant |
source(i) = 0. ! pas de source, pour l'instant |
312 |
ENDDO |
ENDDO |
313 |
|
|
314 |
CALL cltrac(pdtphys, coefh, t_seri, & |
CALL cltrac(pdtphys, coefh, t_seri, tr_seri(:, :, it), source, & |
315 |
tr_seri(1, 1, it), source, & |
paprs, pplay, delp, d_tr_cl(1, 1, it)) |
|
paprs, pplay, delp, & |
|
|
d_tr_cl(1, 1, it)) |
|
316 |
DO k = 1, llm |
DO k = 1, llm |
317 |
DO i = 1, klon |
DO i = 1, klon |
318 |
tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_cl(i, k, it) |
tr_seri(i, k, it) = tr_seri(i, k, it) + d_tr_cl(i, k, it) |
320 |
ENDDO |
ENDDO |
321 |
endif |
endif |
322 |
ENDDO |
ENDDO |
323 |
|
endif |
324 |
|
|
325 |
endif ! couche limite |
! Calcul de l'effet du puits radioactif |
|
|
|
|
! Calcul de l'effet du puits radioactif |
|
326 |
|
|
327 |
! MAF il faudrait faire une modification pour passer dans radiornpb |
! MAF il faudrait faire une modification pour passer dans radiornpb |
328 |
! si radio=true mais pour l'instant radiornpb propre au cas rnpb |
! si radio=true |
329 |
if (rnpb) then |
d_tr_dec = radiornpb(tr_seri, pdtphys, tautr) |
330 |
d_tr_dec(:, :, :) = radiornpb(tr_seri, pdtphys, tautr) |
DO it = 1, nqmx - 2 |
331 |
DO it=1, nqmax |
if (radio(it)) then |
332 |
if (radio(it)) then |
tr_seri(:, :, it) = tr_seri(:, :, it) + d_tr_dec(:, :, it) |
333 |
tr_seri(:, :, it) = tr_seri(:, :, it) + d_tr_dec(:, :, it) |
WRITE(unit=itn, fmt='(i1)') it |
334 |
WRITE(unit=itn, fmt='(i1)') it |
CALL minmaxqfi(tr_seri(:, :, it), 0., 1e33, 'puits rn it='//itn) |
335 |
CALL minmaxqfi(tr_seri(:, :, it), 0., 1.e33, 'puits rn it='//itn) |
endif |
336 |
endif |
ENDDO |
|
ENDDO |
|
|
endif ! rnpb decroissance radioactive |
|
337 |
|
|
338 |
if (nqmax >= 3) then |
if (nqmx >= 5) then |
339 |
! Ozone as a tracer: |
! Ozone as a tracer: |
340 |
if (mod(itap - 1, lmt_pas) == 0) then |
if (mod(itap - 1, lmt_pas) == 0) then |
341 |
! Once per day, update the coefficients for ozone chemistry: |
! Once per day, update the coefficients for ozone chemistry: |
347 |
! Calcul de l'effet de la precipitation |
! Calcul de l'effet de la precipitation |
348 |
|
|
349 |
IF (lessivage) THEN |
IF (lessivage) THEN |
350 |
d_tr_lessi_nucl(:, :, :) = 0. |
d_tr_lessi_nucl = 0. |
351 |
d_tr_lessi_impa(:, :, :) = 0. |
d_tr_lessi_impa = 0. |
352 |
flestottr(:, :, :) = 0. |
flestottr = 0. |
353 |
|
|
354 |
! tendance des aerosols nuclees et impactes |
! tendance des aerosols nuclees et impactes |
355 |
|
|
356 |
DO it = 1, nqmax |
DO it = 1, nqmx - 2 |
357 |
IF (aerosol(it)) THEN |
IF (aerosol(it)) THEN |
358 |
DO k = 1, llm |
DO k = 1, llm |
359 |
DO i = 1, klon |
DO i = 1, klon |
360 |
d_tr_lessi_nucl(i, k, it) = d_tr_lessi_nucl(i, k, it) + & |
d_tr_lessi_nucl(i, k, it) = d_tr_lessi_nucl(i, k, it) + & |
361 |
( 1 - frac_nucl(i, k) )*tr_seri(i, k, it) |
(1 - frac_nucl(i, k))*tr_seri(i, k, it) |
362 |
d_tr_lessi_impa(i, k, it) = d_tr_lessi_impa(i, k, it) + & |
d_tr_lessi_impa(i, k, it) = d_tr_lessi_impa(i, k, it) + & |
363 |
( 1 - frac_impa(i, k) )*tr_seri(i, k, it) |
(1 - frac_impa(i, k))*tr_seri(i, k, it) |
364 |
ENDDO |
ENDDO |
365 |
ENDDO |
ENDDO |
366 |
ENDIF |
ENDIF |
369 |
! Mises a jour des traceurs + calcul des flux de lessivage |
! Mises a jour des traceurs + calcul des flux de lessivage |
370 |
! Mise a jour due a l'impaction et a la nucleation |
! Mise a jour due a l'impaction et a la nucleation |
371 |
|
|
372 |
DO it = 1, nqmax |
DO it = 1, nqmx - 2 |
373 |
IF (aerosol(it)) THEN |
IF (aerosol(it)) THEN |
374 |
DO k = 1, llm |
DO k = 1, llm |
375 |
DO i = 1, klon |
DO i = 1, klon |
376 |
tr_seri(i, k, it)=tr_seri(i, k, it) & |
tr_seri(i, k, it) = tr_seri(i, k, it) * frac_impa(i, k) & |
377 |
*frac_impa(i, k)*frac_nucl(i, k) |
* frac_nucl(i, k) |
378 |
ENDDO |
ENDDO |
379 |
ENDDO |
ENDDO |
380 |
ENDIF |
ENDIF |
382 |
|
|
383 |
! Flux lessivage total |
! Flux lessivage total |
384 |
|
|
385 |
DO it = 1, nqmax |
DO it = 1, nqmx - 2 |
386 |
DO k = 1, llm |
DO k = 1, llm |
387 |
DO i = 1, klon |
DO i = 1, klon |
388 |
flestottr(i, k, it) = flestottr(i, k, it) - & |
flestottr(i, k, it) = flestottr(i, k, it) & |
389 |
( d_tr_lessi_nucl(i, k, it) + & |
- (d_tr_lessi_nucl(i, k, it) + d_tr_lessi_impa(i, k, it)) & |
390 |
d_tr_lessi_impa(i, k, it) ) * & |
* (paprs(i, k)-paprs(i, k+1)) / (RG * pdtphys) |
|
( paprs(i, k)-paprs(i, k+1) ) / & |
|
|
(RG * pdtphys) |
|
391 |
ENDDO |
ENDDO |
392 |
ENDDO |
ENDDO |
393 |
ENDDO |
ENDDO |
394 |
ENDIF |
ENDIF |
395 |
|
|
396 |
! Ecriture des sorties |
! Ecriture des sorties |
397 |
call write_histrac(lessivage, nqmax, itap, nid_tra) |
call write_histrac(lessivage, itap, nid_ins) |
398 |
|
|
399 |
if (lafin) then |
if (lafin) then |
400 |
print *, "C'est la fin de la physique." |
call nf95_inq_varid(ncid_restartphy, "trs", varid) |
401 |
open (unit=99, file='restarttrac', form='formatted') |
call nf95_put_var(ncid_restartphy, varid, trs(:, 1)) |
|
do i=1, klon |
|
|
write(unit=99, fmt=*) trs(i, 1) |
|
|
enddo |
|
|
PRINT *, 'Ecriture du fichier restarttrac' |
|
|
close(99) |
|
402 |
endif |
endif |
403 |
|
|
404 |
contains |
contains |
405 |
|
|
406 |
subroutine write_histrac(lessivage, nqmax, itap, nid_tra) |
subroutine write_histrac(lessivage, itap, nid_ins) |
407 |
|
|
408 |
! From phylmd/write_histrac.h, version 1.9 2006/02/21 08:08:30 |
! From phylmd/write_histrac.h, version 1.9 2006/02/21 08:08:30 |
409 |
|
|
410 |
use dimens_m, only: iim, jjm, llm |
use dimens_m, only: iim, jjm, llm |
411 |
use ioipsl, only: histwrite, histsync |
use histsync_m, only: histsync |
412 |
|
use histwrite_m, only: histwrite |
413 |
use temps, only: itau_phy |
use temps, only: itau_phy |
414 |
use advtrac_m, only: tnom |
use iniadvtrac_m, only: tname |
|
use comgeomphy, only: airephy |
|
415 |
use dimphy, only: klon |
use dimphy, only: klon |
416 |
|
use grid_change, only: gr_phy_write_2d |
417 |
|
use gr_phy_write_3d_m, only: gr_phy_write_3d |
418 |
|
|
419 |
logical, intent(in):: lessivage |
logical, intent(in):: lessivage |
420 |
|
integer, intent(in):: itap ! number of calls to "physiq" |
421 |
integer, intent(in):: nqmax |
integer, intent(in):: nid_ins |
|
! (nombre de traceurs auxquels on applique la physique) |
|
|
|
|
|
integer, intent(in):: itap ! number of calls to "physiq" |
|
|
integer, intent(in):: nid_tra |
|
422 |
|
|
423 |
! Variables local to the procedure: |
! Variables local to the procedure: |
|
INTEGER ndex2d(iim*(jjm+1)), ndex3d(iim*(jjm+1)*llm) |
|
424 |
integer it |
integer it |
425 |
integer itau_w ! pas de temps ecriture |
integer itau_w ! pas de temps ecriture |
|
REAL zx_tmp_2d(iim, jjm+1), zx_tmp_3d(iim, jjm+1, llm) |
|
|
logical, parameter:: ok_sync = .true. |
|
426 |
|
|
427 |
!----------------------------------------------------- |
!----------------------------------------------------- |
428 |
|
|
|
ndex2d = 0 |
|
|
ndex3d = 0 |
|
429 |
itau_w = itau_phy + itap |
itau_w = itau_phy + itap |
430 |
|
|
431 |
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pphis, zx_tmp_2d) |
CALL histwrite(nid_ins, "zmasse", itau_w, gr_phy_write_3d(zmasse)) |
|
CALL histwrite(nid_tra, "phis", itau_w, zx_tmp_2d, iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, airephy, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "aire", itau_w, zx_tmp_2d, iim*(jjm+1), ndex2d) |
|
432 |
|
|
433 |
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, zmasse, zx_tmp_3d) |
DO it=1, nqmx - 2 |
434 |
CALL histwrite(nid_tra, "zmasse", itau_w, zx_tmp_3d, iim*(jjm+1)*llm, & |
CALL histwrite(nid_ins, tname(it+2), itau_w, & |
435 |
ndex3d) |
gr_phy_write_3d(tr_seri(:, :, it))) |
|
|
|
|
DO it=1, nqmax |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, tr_seri(1, 1, it), zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, tnom(it+2), itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
436 |
if (lessivage) THEN |
if (lessivage) THEN |
437 |
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, flestottr(1, 1, it), & |
CALL histwrite(nid_ins, "fl"//tname(it+2), itau_w, & |
438 |
zx_tmp_3d) |
gr_phy_write_3d(flestottr(:, :, it))) |
|
CALL histwrite(nid_tra, "fl"//tnom(it+2), itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
439 |
endif |
endif |
440 |
|
CALL histwrite(nid_ins, "d_tr_th_"//tname(it+2), itau_w, & |
441 |
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, d_tr_th(1, 1, it), zx_tmp_3d) |
gr_phy_write_3d(d_tr_th(:, :, it))) |
442 |
CALL histwrite(nid_tra, "d_tr_th_"//tnom(it+2), itau_w, zx_tmp_3d, & |
CALL histwrite(nid_ins, "d_tr_cv_"//tname(it+2), itau_w, & |
443 |
iim*(jjm+1)*llm, ndex3d) |
gr_phy_write_3d(d_tr_cv(:, :, it))) |
444 |
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, d_tr_cv(1, 1, it), zx_tmp_3d) |
CALL histwrite(nid_ins, "d_tr_cl_"//tname(it+2), itau_w, & |
445 |
CALL histwrite(nid_tra, "d_tr_cv_"//tnom(it+2), itau_w, zx_tmp_3d, & |
gr_phy_write_3d(d_tr_cl(:, :, it))) |
|
iim*(jjm+1)*llm, ndex3d) |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, d_tr_cl(1, 1, it), zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "d_tr_cl_"//tnom(it+2), itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
446 |
ENDDO |
ENDDO |
447 |
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, yu1, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "pyu1", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, yv1, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "pyv1", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pftsol1, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "ftsol1", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pftsol2, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "ftsol2", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pftsol3, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "ftsol3", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, pftsol4, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "ftsol4", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, ppsrf1, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "psrf1", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, ppsrf2, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "psrf2", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, ppsrf3, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "psrf3", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
|
|
|
CALL gr_fi_ecrit(1, klon, iim, jjm+1, ppsrf4, zx_tmp_2d) |
|
|
CALL histwrite(nid_tra, "psrf4", itau_w, zx_tmp_2d, & |
|
|
iim*(jjm+1), ndex2d) |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, pplay, zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "pplay", itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
|
|
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, t_seri, zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "t", itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, pmfu, zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "mfu", itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, pmfd, zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "mfd", itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, pen_u, zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "en_u", itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, pen_d, zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "en_d", itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, pde_d, zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "de_d", itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, pde_u, zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "de_u", itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
|
CALL gr_fi_ecrit(llm, klon, iim, jjm+1, coefh, zx_tmp_3d) |
|
|
CALL histwrite(nid_tra, "coefh", itau_w, zx_tmp_3d, & |
|
|
iim*(jjm+1)*llm, ndex3d) |
|
|
|
|
|
! abder |
|
|
|
|
|
if (ok_sync) then |
|
|
call histsync(nid_tra) |
|
|
endif |
|
|
|
|
448 |
end subroutine write_histrac |
end subroutine write_histrac |
449 |
|
|
450 |
END SUBROUTINE phytrac |
END SUBROUTINE phytrac |
451 |
|
|
|
!************************************************* |
|
|
|
|
|
subroutine ini_histrac(nid_tra, pdtphys, presnivs, nqmax, lessivage) |
|
|
|
|
|
! From phylmd/ini_histrac.h, version 1.10 2006/02/21 08:08:30 |
|
|
|
|
|
use dimens_m, only: iim, jjm, llm |
|
|
use ioipsl, only: ymds2ju, histbeg_totreg, histvert, histdef, histend |
|
|
use temps, only: annee_ref, day_ref, itau_phy |
|
|
use advtrac_m, only: niadv, tnom, ttext |
|
|
use dimphy, only: klon |
|
|
use clesphys, only: ecrit_tra |
|
|
use grid_change, only: gr_phy_write |
|
|
use phyetat0_m, only: rlon, rlat |
|
|
|
|
|
INTEGER, intent(out):: nid_tra |
|
|
real, intent(in):: pdtphys ! pas d'integration pour la physique (s) |
|
|
REAL, intent(in):: presnivs(:) |
|
|
|
|
|
integer, intent(in):: nqmax |
|
|
! (nombre de traceurs auxquels on applique la physique) |
|
|
|
|
|
logical, intent(in):: lessivage |
|
|
|
|
|
! Variables local to the procedure: |
|
|
|
|
|
REAL zjulian |
|
|
REAL zx_lat(iim, jjm+1) |
|
|
INTEGER nhori, nvert |
|
|
REAL zsto, zout |
|
|
integer it, iq, iiq |
|
|
|
|
|
!--------------------------------------------------------- |
|
|
|
|
|
CALL ymds2ju(annee_ref, month=1, day=day_ref, sec=0.0, julian=zjulian) |
|
|
zx_lat(:, :) = gr_phy_write(rlat) |
|
|
CALL histbeg_totreg("histrac", iim, rlon(2:iim+1), jjm+1, zx_lat(1, :), & |
|
|
1, iim, 1, jjm+1, itau_phy, zjulian, pdtphys, nhori, nid_tra) |
|
|
CALL histvert(nid_tra, "presnivs", "Vertical levels", "mb", llm, & |
|
|
presnivs, nvert) |
|
|
|
|
|
zsto = pdtphys |
|
|
zout = pdtphys * REAL(ecrit_tra) |
|
|
|
|
|
CALL histdef(nid_tra, "phis", "Surface geop. height", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"once", zsto, zout) |
|
|
CALL histdef(nid_tra, "aire", "Grid area", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"once", zsto, zout) |
|
|
CALL histdef(nid_tra, "zmasse", "column density of air in cell", & |
|
|
"kg m-2", iim, jjm + 1, nhori, llm, 1, llm, nvert, 32, "ave(X)", & |
|
|
zsto, zout) |
|
|
|
|
|
DO it=1, nqmax |
|
|
! champ 2D |
|
|
iq=it+2 |
|
|
iiq=niadv(iq) |
|
|
CALL histdef(nid_tra, tnom(iq), ttext(iiq), "U/kga", iim, jjm+1, & |
|
|
nhori, llm, 1, llm, nvert, 32, "ave(X)", zsto, zout) |
|
|
if (lessivage) THEN |
|
|
CALL histdef(nid_tra, "fl"//tnom(iq), "Flux "//ttext(iiq), & |
|
|
"U/m2/s", iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
endif |
|
|
|
|
|
!---Ajout Olivia |
|
|
CALL histdef(nid_tra, "d_tr_th_"//tnom(iq), & |
|
|
"tendance thermique"// ttext(iiq), "?", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
CALL histdef(nid_tra, "d_tr_cv_"//tnom(iq), & |
|
|
"tendance convection"// ttext(iiq), "?", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
CALL histdef(nid_tra, "d_tr_cl_"//tnom(iq), & |
|
|
"tendance couche limite"// ttext(iiq), "?", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
!---fin Olivia |
|
|
|
|
|
ENDDO |
|
|
|
|
|
CALL histdef(nid_tra, "pyu1", "Vent niv 1", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
|
|
|
CALL histdef(nid_tra, "pyv1", "Vent niv 1", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "psrf1", "nature sol", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "psrf2", "nature sol", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "psrf3", "nature sol", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "psrf4", "nature sol", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "ftsol1", "temper sol", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "ftsol2", "temper sol", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "ftsol3", "temper sol", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "ftsol4", "temper sol", "-", & |
|
|
iim, jjm+1, nhori, 1, 1, 1, -99, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "pplay", "flux u mont", "-", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "t", "flux u mont", "-", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"inst(X)", zout, zout) |
|
|
CALL histdef(nid_tra, "mfu", "flux u mont", "-", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
CALL histdef(nid_tra, "mfd", "flux u decen", "-", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
CALL histdef(nid_tra, "en_u", "flux u mont", "-", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
CALL histdef(nid_tra, "en_d", "flux u mont", "-", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
CALL histdef(nid_tra, "de_d", "flux u mont", "-", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
CALL histdef(nid_tra, "de_u", "flux u decen", "-", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
CALL histdef(nid_tra, "coefh", "turbulent coef", "-", & |
|
|
iim, jjm+1, nhori, llm, 1, llm, nvert, 32, & |
|
|
"ave(X)", zsto, zout) |
|
|
|
|
|
CALL histend(nid_tra) |
|
|
|
|
|
end subroutine ini_histrac |
|
|
|
|
|
!************************************************* |
|
|
|
|
|
function radiornpb(tr_seri, pdtphys, tautr) |
|
|
|
|
|
! From phylmd/radiornpb.F, v 1.2 2005/05/25 13:10:09 |
|
|
|
|
|
! Auteurs: AA + CG (LGGE/CNRS) Date 24-06-94 |
|
|
! Objet: Decroissance radioactive d'un traceur dans l'atmosphere |
|
|
!G 24 06 94 : Pour un traceur, le radon |
|
|
!G 16 12 94 : Plus un 2eme traceur, le 210Pb. Le radon decroit en plomb. |
|
|
|
|
|
! Le pas de temps "pdtphys" est supposé beaucoup plus petit que la |
|
|
! constante de temps de décroissance. |
|
|
|
|
|
use dimens_m, only: llm |
|
|
use dimphy, only: klon, nbtr |
|
|
use numer_rec, only: assert |
|
|
|
|
|
IMPLICIT none |
|
|
|
|
|
REAL, intent(in):: tr_seri(:, :, :), pdtphys, tautr(:) |
|
|
real radiornpb(klon, llm, 2) |
|
|
|
|
|
! Variable local to the procedure: |
|
|
INTEGER it |
|
|
|
|
|
!----------------------------------------------- |
|
|
|
|
|
call assert(shape(tr_seri) == (/klon, llm, nbtr/), "radiornpb tr_seri") |
|
|
call assert(size(tautr) == nbtr, "radiornpb tautr") |
|
|
|
|
|
DO it = 1, 2 |
|
|
IF (tautr(it) > 0.) THEN |
|
|
radiornpb(:, :, it) = - tr_seri(:, :, it) * pdtphys / tautr(it) |
|
|
ELSE |
|
|
radiornpb(:, :, it) = 0. |
|
|
END IF |
|
|
END DO |
|
|
|
|
|
!G161294 : Cas particulier radon 1 => plomb 2 |
|
|
radiornpb(:, :, 2) = radiornpb(:, :, 2) - radiornpb(:, :, 1) |
|
|
|
|
|
END function radiornpb |
|
|
|
|
|
!************************************************* |
|
|
|
|
|
SUBROUTINE minmaxqfi(zq, qmin, qmax, comment) |
|
|
|
|
|
! From phylmd/minmaxqfi.F, version 1.1.1.1 2004/05/19 12:53:09 |
|
|
|
|
|
use dimens_m, only: llm |
|
|
use dimphy, only: klon |
|
|
use numer_rec, only: assert |
|
|
|
|
|
IMPLICIT none |
|
|
|
|
|
real, intent(in):: zq(:, :), qmin, qmax |
|
|
CHARACTER(len=*), intent(in):: comment |
|
|
|
|
|
! Variables local to the procedure: |
|
|
|
|
|
INTEGER jadrs(klon), jbad, k, i |
|
|
|
|
|
!--------------------------------- |
|
|
|
|
|
call assert(shape(zq) == (/klon, llm/), "minmaxqfi") |
|
|
|
|
|
DO k = 1, llm |
|
|
jbad = 0 |
|
|
DO i = 1, klon |
|
|
IF (zq(i, k) > qmax .OR. zq(i, k) < qmin) THEN |
|
|
jbad = jbad + 1 |
|
|
jadrs(jbad) = i |
|
|
ENDIF |
|
|
ENDDO |
|
|
IF (jbad > 0) THEN |
|
|
PRINT *, comment |
|
|
DO i = 1, jbad |
|
|
PRINT *, "zq(", jadrs(i), ", ", k, ") = ", zq(jadrs(i), k) |
|
|
ENDDO |
|
|
ENDIF |
|
|
ENDDO |
|
|
|
|
|
end SUBROUTINE minmaxqfi |
|
|
|
|
452 |
end module phytrac_m |
end module phytrac_m |