/[lmdze]/trunk/dyn3d/iniadvtrac.f
ViewVC logotype

Contents of /trunk/dyn3d/iniadvtrac.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 129 - (show annotations)
Fri Feb 13 18:22:38 2015 UTC (9 years, 3 months ago) by guez
File size: 3926 byte(s)
Removed arguments day0, anne0 of procedures initdynav and
inithist. Use directly day_ref, annee_ref instead.

Moved variables annee_ref, day_ref of module temps to module
dynetat0_m. Deleted variables dayref and anneeref of module conf_gcm_m
and removed them from namelist conf_gcm_nml. These variables were
troubling intermediary on the way to annee_ref and day_ref. Gave as
default values to annee_ref and day_ref the default values of dayref
and anneeref. Moved the test on raz_date from main unit gcm to
procedure dynetat0. Created namelist dynetat0_nml. Read annee_ref and
day_ref from standard input in dynetat0 and redefine them from
"start.nc" if not raz_date. Rationale: 1 - Choose the best programming
from the point of view of program gcm only, forgetting program ce0l. 2
- The normal case is to define annee_ref and day_ref from "start.nc"
so put them in module dynetat0_m rather than in conf_gcm_m. 3 - Try to
always read the same namelists in the same order regardless of choices
in previous namelists. Downsides: 1 -We now need the file "dynetat0.f"
for the program ce0l, because dynetat0_m is used by dynredem0. 2 - We
need to define annee_ref and day_ref from procedure etat0.

Removed useless variable day_end of module temps.

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 character(len=8) tnom(nqmx) ! nom court du traceur
34 character(len=10) tname(nqmx) ! nom du traceur pour restart
35 character(len=13) ttext(nqmx) ! nom long du traceur pour sorties
36
37 contains
38
39 subroutine iniadvtrac
40
41 ! From dyn3d/iniadvtrac.F, version 1.3 2005/04/13 08:58:34
42
43 ! Authors: P. Le Van, L. Fairhead, F. Hourdin, F. Codron,
44 ! F. Forget, M.-A. Filiberti
45
46 ! Initialisation des traceurs
47 ! Choix du schéma pour l'advection dans le fichier "traceur.def"
48
49 use nr_util, only: assert
50 use jumble, only: new_unit
51
52 ! Variables local to the procedure:
53
54 character(len=3) descrq(18)
55 integer iq, iostat, nq_local, unit
56
57 !-----------------------------------------------------------------------
58
59 print *, "Call sequence information: iniadvtrac"
60
61 ! Initializations:
62 descrq(10)='VL1'
63 descrq(11)='VLP'
64 descrq(12)='FH1'
65 descrq(13)='FH2'
66 descrq(14)='VLH'
67 descrq(16)='PPM'
68 descrq(17)='PPS'
69 descrq(18)='PPP'
70
71 ! Choix du schéma pour l'advection dans fichier "traceur.def"
72 call new_unit(unit)
73 open(unit, file='traceur.def', status='old', action="read", &
74 position="rewind", iostat=iostat)
75 if (iostat == 0) then
76 print *, 'Ouverture de "traceur.def" ok'
77 read(unit, fmt=*) nq_local
78 print *, 'nombre de traceurs ', nq_local
79 call assert(nq_local == nqmx, "iniadvtrac nq_local")
80
81 do iq=1, nqmx
82 read(unit, fmt=*) hadv(iq), vadv(iq), tnom(iq)
83 if (.not. any(hadv(iq) == allowed_adv) &
84 .or. .not. any(vadv(iq) == allowed_adv)) then
85 print *, "bad number for advection scheme"
86 stop 1
87 end if
88 end do
89 close(unit)
90 else
91 print *, 'Problème à l''ouverture de "traceur.def"'
92 print *, 'Attention : on prend des valeurs par défaut.'
93 call assert(nqmx == 4, "iniadvtrac nqmx")
94 hadv(:4) = (/14, 10, 10, 10/)
95 vadv(:4) = hadv(:4)
96 tnom(1) = 'H2Ov'
97 tnom(2) = 'H2Ol'
98 tnom(3) = 'RN'
99 tnom(4) = 'PB'
100 do iq = 1, nqmx
101 print *, hadv(iq), vadv(iq), tnom(iq)
102 end do
103 ENDIF
104
105 tname = tnom
106
107 ! À partir du nom court du traceur et du schéma d'advection, on
108 ! détermine le nom long :
109 do iq = 1, nqmx
110 if (hadv(iq) /= vadv(iq)) then
111 if (hadv(iq) == 10 .and. vadv(iq) == 16) then
112 iadv(iq) = 11
113 else
114 print *, "Bad combination for hozizontal and vertical schemes."
115 stop 1
116 endif
117 else
118 iadv(iq) = hadv(iq)
119 endif
120
121 IF (iadv(iq) == 0) THEN
122 ttext(iq) = tnom(iq)
123 ELSE
124 ttext(iq)=trim(tnom(iq)) // descrq(iadv(iq))
125 endif
126 end do
127
128 END subroutine iniadvtrac
129
130 end module iniadvtrac_m

  ViewVC Help
Powered by ViewVC 1.1.21