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

Annotation of /trunk/dyn3d/iniadvtrac.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 254 - (hide annotations)
Mon Feb 5 10:39:38 2018 UTC (6 years, 3 months ago) by guez
File size: 2771 byte(s)
Move Sources/* to root directory.
1 guez 18 module iniadvtrac_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 3 use dimens_m, only: nqmx
10    
11     implicit none
12    
13     private nqmx
14    
15 guez 177 INTEGER iadv(nqmx) ! indice du sch\'ema d'advection pour l'eau et les traceurs
16 guez 62
17 guez 131 character(len=10) tname(nqmx)
18     ! nom du traceur pour fichiers restart et historiques
19    
20 guez 3 character(len=13) ttext(nqmx) ! nom long du traceur pour sorties
21    
22     contains
23    
24 guez 23 subroutine iniadvtrac
25 guez 3
26     ! From dyn3d/iniadvtrac.F, version 1.3 2005/04/13 08:58:34
27    
28 guez 78 ! Authors: P. Le Van, L. Fairhead, F. Hourdin, F. Codron,
29 guez 62 ! F. Forget, M.-A. Filiberti
30 guez 3
31 guez 129 ! Initialisation des traceurs
32 guez 177 ! Choix du sch\'ema pour l'advection dans le fichier "traceur.def"
33 guez 129
34 guez 36 use nr_util, only: assert
35 guez 62 use jumble, only: new_unit
36 guez 3
37 guez 177 ! Local:
38     character(len=3) descrq(0:14)
39 guez 62 integer iq, iostat, nq_local, unit
40 guez 3
41 guez 178 integer, parameter:: allowed_adv(5) = (/0, 10, 12, 13, 14/)
42 guez 177 ! 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 guez 3 !-----------------------------------------------------------------------
49    
50     print *, "Call sequence information: iniadvtrac"
51    
52     ! Initializations:
53 guez 177 descrq(0)=''
54 guez 3 descrq(10)='VL1'
55     descrq(12)='FH1'
56     descrq(13)='FH2'
57 guez 62 descrq(14)='VLH'
58 guez 3
59 guez 177 ! Choix du sch\'ema pour l'advection dans fichier "traceur.def"
60 guez 62 call new_unit(unit)
61     open(unit, file='traceur.def', status='old', action="read", &
62     position="rewind", iostat=iostat)
63     if (iostat == 0) then
64 guez 3 print *, 'Ouverture de "traceur.def" ok'
65 guez 62 read(unit, fmt=*) nq_local
66 guez 5 print *, 'nombre de traceurs ', nq_local
67 guez 23 call assert(nq_local == nqmx, "iniadvtrac nq_local")
68 guez 3
69 guez 23 do iq=1, nqmx
70 guez 177 read(unit, fmt=*) iadv(iq), tname(iq)
71     if (.not. any(iadv(iq) == allowed_adv)) then
72 guez 62 print *, "bad number for advection scheme"
73     stop 1
74     end if
75 guez 3 end do
76 guez 62 close(unit)
77 guez 3 else
78 guez 178 print *, 'Could not open "traceur.def".'
79     print *, 'Using default values.'
80 guez 23 call assert(nqmx == 4, "iniadvtrac nqmx")
81 guez 177 iadv(:4) = (/14, 10, 10, 10/)
82 guez 131 tname(1) = 'H2Ov'
83     tname(2) = 'H2Ol'
84     tname(3) = 'RN'
85     tname(4) = 'PB'
86 guez 62 do iq = 1, nqmx
87 guez 177 print *, iadv(iq), tname(iq)
88 guez 62 end do
89 guez 3 ENDIF
90    
91 guez 177 ! \`A partir du nom court du traceur et du sch\'ema d'advection, on
92     ! d\'etermine le nom long :
93 guez 78 do iq = 1, nqmx
94 guez 177 ttext(iq)=trim(tname(iq)) // descrq(iadv(iq))
95 guez 3 end do
96    
97     END subroutine iniadvtrac
98    
99 guez 18 end module iniadvtrac_m

  ViewVC Help
Powered by ViewVC 1.1.21