1 |
module iniadvtrac_m |
2 |
|
3 |
! From advtrac.h, version 1.1.1.1 2004/05/19 12:53:06 |
4 |
|
5 |
! iq = 1 pour l'eau vapeur |
6 |
! iq = 2 pour l'eau liquide |
7 |
! et éventuellement iq = 3, ..., nqmx pour les autres traceurs |
8 |
|
9 |
use dimens_m, only: nqmx |
10 |
|
11 |
implicit none |
12 |
|
13 |
private nqmx |
14 |
|
15 |
INTEGER iadv(nqmx) ! indice du schéma d'advection pour l'eau et les traceurs |
16 |
! 11 means Van-Leer scheme for hadv et monotonous PPM for vadv |
17 |
|
18 |
integer, parameter:: allowed_adv(10) = (/0, 1, 2, 10, 12, 13, 14, 16, 17, 18/) |
19 |
! Allowed values for hadv and vadv: |
20 |
! 1: schema transport type "humidite specifique LMD" |
21 |
! 2: schema amont |
22 |
! 10: schema Van-leer (retenu pour l'eau vapeur et liquide) |
23 |
! 12: schema Frederic Hourdin I |
24 |
! 13: schema Frederic Hourdin II |
25 |
! 14: schema Van-leer + humidite specifique |
26 |
! 16: schema PPM Monotone(Collela & Woodward 1984) |
27 |
! 17: schema PPM Semi Monotone (overshoots autorisés) |
28 |
! 18: schema PPM Positif Defini (overshoots undershoots autorisés) |
29 |
! Pour Van-Leer plus vapeur d'eau saturée : iadv(1)=4 |
30 |
|
31 |
INTEGER hadv(nqmx) ! indice schéma transport horizontal |
32 |
INTEGER vadv(nqmx) ! indice schéma transport vertical |
33 |
INTEGER niadv(nqmx) ! équivalent dynamique / physique |
34 |
character(len=8) tnom(nqmx) ! nom court du traceur |
35 |
character(len=10) tname(nqmx) ! nom du traceur pour restart |
36 |
character(len=13) ttext(nqmx) ! nom long du traceur pour sorties |
37 |
|
38 |
contains |
39 |
|
40 |
subroutine iniadvtrac |
41 |
|
42 |
! From dyn3d/iniadvtrac.F, version 1.3 2005/04/13 08:58:34 |
43 |
|
44 |
! Authors: P. Le Van, L. Fairhead, F. Hourdin, F. Codron, |
45 |
! F. Forget, M.-A. Filiberti |
46 |
|
47 |
use nr_util, only: assert |
48 |
use jumble, only: new_unit |
49 |
|
50 |
! Variables local to the procedure: |
51 |
|
52 |
character(len=3) descrq(18) |
53 |
integer iq, iostat, nq_local, unit |
54 |
|
55 |
!----------------------------------------------------------------------- |
56 |
|
57 |
print *, "Call sequence information: iniadvtrac" |
58 |
|
59 |
! Initializations: |
60 |
descrq(10)='VL1' |
61 |
descrq(11)='VLP' |
62 |
descrq(12)='FH1' |
63 |
descrq(13)='FH2' |
64 |
descrq(14)='VLH' |
65 |
descrq(16)='PPM' |
66 |
descrq(17)='PPS' |
67 |
descrq(18)='PPP' |
68 |
|
69 |
! Choix du schéma pour l'advection dans fichier "traceur.def" |
70 |
call new_unit(unit) |
71 |
open(unit, file='traceur.def', status='old', action="read", & |
72 |
position="rewind", iostat=iostat) |
73 |
if (iostat == 0) then |
74 |
print *, 'Ouverture de "traceur.def" ok' |
75 |
read(unit, fmt=*) nq_local |
76 |
print *, 'nombre de traceurs ', nq_local |
77 |
call assert(nq_local == nqmx, "iniadvtrac nq_local") |
78 |
|
79 |
do iq=1, nqmx |
80 |
read(unit, fmt=*) hadv(iq), vadv(iq), tnom(iq) |
81 |
if (.not. any(hadv(iq) == allowed_adv) & |
82 |
.or. .not. any(vadv(iq) == allowed_adv)) then |
83 |
print *, "bad number for advection scheme" |
84 |
stop 1 |
85 |
end if |
86 |
end do |
87 |
close(unit) |
88 |
else |
89 |
print *, 'Problème à l''ouverture de "traceur.def"' |
90 |
print *, 'Attention : on prend des valeurs par défaut.' |
91 |
call assert(nqmx == 4, "iniadvtrac nqmx") |
92 |
hadv(:4) = (/14, 10, 10, 10/) |
93 |
vadv(:4) = hadv(:4) |
94 |
tnom(1) = 'H2Ov' |
95 |
tnom(2) = 'H2Ol' |
96 |
tnom(3) = 'RN' |
97 |
tnom(4) = 'PB' |
98 |
do iq = 1, nqmx |
99 |
print *, hadv(iq), vadv(iq), tnom(iq) |
100 |
end do |
101 |
ENDIF |
102 |
|
103 |
tname = tnom |
104 |
|
105 |
! À partir du nom court du traceur et du schéma d'advection, on |
106 |
! détermine le nom long : |
107 |
do iq = 1, nqmx |
108 |
if (hadv(iq) /= vadv(iq)) then |
109 |
if (hadv(iq) == 10 .and. vadv(iq) == 16) then |
110 |
iadv(iq) = 11 |
111 |
else |
112 |
print *, "Bad combination for hozizontal and vertical schemes." |
113 |
stop 1 |
114 |
endif |
115 |
else |
116 |
iadv(iq) = hadv(iq) |
117 |
endif |
118 |
|
119 |
IF (iadv(iq) == 0) THEN |
120 |
ttext(iq) = tnom(iq) |
121 |
ELSE |
122 |
ttext(iq)=trim(tnom(iq)) // descrq(iadv(iq)) |
123 |
endif |
124 |
end do |
125 |
|
126 |
forall (iq = 1: nqmx) niadv(iq)=iq |
127 |
|
128 |
END subroutine iniadvtrac |
129 |
|
130 |
end module iniadvtrac_m |