/[lmdze]/trunk/dyn3d/infotrac_init.f90
ViewVC logotype

Annotation of /trunk/dyn3d/infotrac_init.f90

Parent Directory Parent Directory | Revision Log Revision Log


Revision 321 - (hide annotations)
Tue Dec 11 22:48:09 2018 UTC (5 years, 6 months ago) by guez
Original Path: trunk/dyn3d/infotrac_init.f
File size: 2871 byte(s)
Rename iniadvtrac to infotrac_init, to be closer to LMDZ.

1 guez 321 module infotrac_init_m
2 guez 3
3 guez 62 ! From advtrac.h, version 1.1.1.1 2004/05/19 12:53:06
4 guez 3
5 guez 62 ! iq = 1 pour l'eau vapeur
6     ! iq = 2 pour l'eau liquide
7 guez 177 ! et \'eventuellement iq = 3, ..., nqmx pour les autres traceurs
8 guez 62
9 guez 265 use dimensions, only: nqmx
10 guez 3
11     implicit none
12    
13     private nqmx
14    
15 guez 320 INTEGER, protected:: iadv(nqmx)
16     ! indice du sch\'ema d'advection pour l'eau et les traceurs
17 guez 62
18 guez 320 character(len = 10), protected:: tname(nqmx)
19 guez 131 ! nom du traceur pour fichiers restart et historiques
20    
21 guez 320 character(len = 13), protected:: ttext(nqmx)
22     ! nom long du traceur pour sorties
23 guez 3
24     contains
25    
26 guez 321 subroutine infotrac_init
27 guez 3
28     ! From dyn3d/iniadvtrac.F, version 1.3 2005/04/13 08:58:34
29    
30 guez 78 ! Authors: P. Le Van, L. Fairhead, F. Hourdin, F. Codron,
31 guez 62 ! F. Forget, M.-A. Filiberti
32 guez 3
33 guez 129 ! Initialisation des traceurs
34 guez 177 ! Choix du sch\'ema pour l'advection dans le fichier "traceur.def"
35 guez 129
36 guez 36 use nr_util, only: assert
37 guez 62 use jumble, only: new_unit
38 guez 3
39 guez 177 ! Local:
40 guez 320 character(len = 3) descrq(0:14)
41 guez 62 integer iq, iostat, nq_local, unit
42 guez 3
43 guez 178 integer, parameter:: allowed_adv(5) = (/0, 10, 12, 13, 14/)
44 guez 177 ! Allowed values for iadv:
45     ! 10: schema Van-leer (retenu pour l'eau vapeur et liquide)
46     ! 12: schema Frederic Hourdin I
47     ! 13: schema Frederic Hourdin II
48     ! 14: schema Van-leer + humidite specifique
49    
50 guez 3 !-----------------------------------------------------------------------
51    
52 guez 321 print *, "Call sequence information: infotrac_init"
53 guez 3
54     ! Initializations:
55 guez 320 descrq(0) = ''
56     descrq(10) = 'VL1'
57     descrq(12) = 'FH1'
58     descrq(13) = 'FH2'
59     descrq(14) = 'VLH'
60 guez 3
61 guez 177 ! Choix du sch\'ema pour l'advection dans fichier "traceur.def"
62 guez 62 call new_unit(unit)
63 guez 320 open(unit, file = 'traceur.def', status = 'old', action = "read", &
64     position = "rewind", iostat = iostat)
65 guez 62 if (iostat == 0) then
66 guez 3 print *, 'Ouverture de "traceur.def" ok'
67 guez 320 read(unit, fmt = *) nq_local
68 guez 5 print *, 'nombre de traceurs ', nq_local
69 guez 321 call assert(nq_local == nqmx, "infotrac_init nq_local")
70 guez 3
71 guez 320 do iq = 1, nqmx
72     read(unit, fmt = *) iadv(iq), tname(iq)
73 guez 177 if (.not. any(iadv(iq) == allowed_adv)) then
74 guez 62 print *, "bad number for advection scheme"
75     stop 1
76     end if
77 guez 3 end do
78 guez 62 close(unit)
79 guez 3 else
80 guez 178 print *, 'Could not open "traceur.def".'
81     print *, 'Using default values.'
82 guez 321 call assert(nqmx == 4, "infotrac_init nqmx")
83 guez 177 iadv(:4) = (/14, 10, 10, 10/)
84 guez 131 tname(1) = 'H2Ov'
85     tname(2) = 'H2Ol'
86     tname(3) = 'RN'
87     tname(4) = 'PB'
88 guez 62 do iq = 1, nqmx
89 guez 177 print *, iadv(iq), tname(iq)
90 guez 62 end do
91 guez 3 ENDIF
92    
93 guez 177 ! \`A partir du nom court du traceur et du sch\'ema d'advection, on
94     ! d\'etermine le nom long :
95 guez 78 do iq = 1, nqmx
96 guez 320 ttext(iq) = trim(tname(iq)) // descrq(iadv(iq))
97 guez 3 end do
98    
99 guez 321 END subroutine infotrac_init
100 guez 3
101 guez 321 end module infotrac_init_m

  ViewVC Help
Powered by ViewVC 1.1.21