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