source: LMDZ4/trunk/libf/dyn3dpar/iniadvtrac.F @ 790

Last change on this file since 790 was 764, checked in by Laurent Fairhead, 17 years ago

Merge entre la version V3_conv et le HEAD
YM, JG, LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.1 KB
Line 
1!
2! $Header$
3!
4c
5c
6      subroutine iniadvtrac(nq)
7      USE ioipsl
8      IMPLICIT NONE
9c=======================================================================
10c
11c   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
12c   -------
13c   Modif special traceur F.Forget 05/94
14c   Modif M-A Filiberti 02/02 lecture de traceur.def
15c
16c   Objet:
17c   ------
18c
19c   GCM LMD nouvelle grille
20c
21c=======================================================================
22c   ... modification de l'integration de q ( 26/04/94 ) ....
23c-----------------------------------------------------------------------
24c   Declarations:
25c   -------------
26C
27#include "dimensions.h"
28#include "advtrac.h"
29
30c   local
31      character*3 descrq(30)
32      character*1 txts(3)
33      character*2 txtp(9)
34      character*13 str1,str2,str3
35
36      integer nq,iq,iiq,iiiq,ierr,ii
37      integer lnblnk
38      external lnblnk
39
40      data txts/'x','y','z'/
41      data txtp/'x','y','z','xx','xy','xz','yy','yz','zz'/
42
43c-----------------------------------------------------------------------
44c   Initialisations:
45c   ----------------
46      descrq(14)='VLH'
47      descrq(10)='VL1'
48      descrq(11)='VLP'
49      descrq(12)='FH1'
50      descrq(13)='FH2'
51      descrq(16)='PPM'
52      descrq(17)='PPS'
53      descrq(18)='PPP'
54      descrq(20)='SLP'
55      descrq(30)='PRA'
56
57#ifdef INCA
58
59      CALL init_transport(
60     $     hadv_flg,
61     $     vadv_flg,
62     $     conv_flg,
63     $     pbl_flg,
64     $     tracnam)
65#endif
66
67c-----------------------------------------------------------------------
68c        Choix  des schemas d'advection pour l'eau et les traceurs
69c
70c     iadv = 1    schema  transport type "humidite specifique LMD"
71c     iadv = 2    schema   amont
72c     iadv = 14    schema  Van-leer + humidite specifique
73c                            Modif F.Codron
74c     iadv = 10   schema  Van-leer (retenu pour l'eau vapeur et liquide)
75c     iadv = 11   schema  Van-Leer pour hadv et version PPM (Monotone) pour vadv
76c     iadv = 12   schema  Frederic Hourdin I
77c     iadv = 13   schema  Frederic Hourdin II
78c     iadv = 16   schema  PPM Monotone(Collela & Woodward 1984)
79c     iadv = 17   schema  PPM Semi Monotone (overshoots autorisés)
80c     iadv = 18   schema  PPM Positif Defini (overshoots undershoots autorisés)
81c     iadv = 20   schema  Slopes
82c     iadv = 30   schema  Prather
83c
84c        Dans le tableau q(ij,l,iq) : iq = 1  pour l'eau vapeur
85c                                     iq = 2  pour l'eau liquide
86c        Et eventuellement            iq = 3,nqmx pour les autres traceurs
87c
88c        iadv(1): choix pour l'eau vap. et  iadv(2) : choix pour l'eau liq.
89C------------------------------------------------------------------------
90c     Choix du schema d'advection
91c------------------------------------------------------------------
92c choix par defaut = van leer pour tous les traceurs
93      do iq=1,nqmx
94       iadv(iq)=10
95       str1(1:1)='q'
96       if (nqmx.le.99) then
97       WRITE(str1(2:3),'(i2.2)') iq
98       else
99       WRITE(str1(2:4),'(i3.3)') iq
100       endif
101       tnom(iq)=str1
102       tname(iq)=tnom(iq)
103       str2=tnom(iq)
104       ttext(iq)=str2(1:lnblnk(str2))//descrq(iadv(iq))
105      end do
106      nq=nqmx
107c------------------------------------------------------------------
108c     Choix du schema pour l'advection
109c    dans fichier traceur.def
110c------------------------------------------------------------------
111#ifdef INCA
112C le module de chimie fournit les noms des traceurs
113C et les schemas d'advection associes.
114      tnom(1)='H2Ov'
115      tnom(2)='H2Ol'
116      nq=nbtrac+2
117     
118       if (nq.gt.nqmx) then
119       print*,'nombre de traceurs incompatible INCA/LMDZT', nq, nbtrac
120       stop
121       endif
122      do iq =3,nq
123      tnom(iq)=tracnam(iq-2)
124      end do
125      do iq =1,nq
126      hadv(iq)= hadv_flg(iq)
127      vadv(iq)= vadv_flg(iq)
128      end do
129#else
130      print*,'ouverture de traceur.def'
131      open(90,file='traceur.def',form='formatted',status='old',
132     s     iostat=ierr)
133      if(ierr.eq.0) then
134        print*,'ouverture de traceur.def ok'
135        read(90,*) nq
136        print*,'nombre de traceurs ',nq
137        if (nq.gt.nqmx) then
138          print*,'nombre de traceurs trop important'
139          print*,'verifier traceur.def'
140          stop
141        endif
142C
143        do iq=1,nq
144          read(90,999) hadv(iq),vadv(iq),tnom(iq)
145        end do
146        close(90) 
147        PRINT*,'lecture de traceur.def :'   
148        do iq=1,nq
149          write(*,*) hadv(iq),vadv(iq),tnom(iq)
150        end do       
151      else
152        print*,'pb ouverture traceur.def'
153        print*,'ATTENTION on prend des valeurs par defaut'
154        nq = 4
155        hadv(1) = 14
156        vadv(1) = 14
157        tnom(1) = 'H2Ov'
158        hadv(2) = 10
159        vadv(2) = 10
160        tnom(2) = 'H2Ol'
161        hadv(3) = 10
162        vadv(3) = 10
163        tnom(3) = 'RN'
164        hadv(4) = 10
165        vadv(4) = 10
166        tnom(4) = 'PB'
167      ENDIF
168      PRINT*,'Valeur de traceur.def :'
169      do iq=1,nq
170        write(*,*) hadv(iq),vadv(iq),tnom(iq)
171      end do       
172
173#endif
174c a partir du nom court du traceur et du schema d'advection au detemine le nom long.
175        iiq=0
176        ii=0
177        do iq=1,nq
178         iiq=iiq+1
179         if (hadv(iq).ne.vadv(iq)) then
180           if (hadv(iq).eq.10.and.vadv(iq).eq.16) then
181             iadv(iiq)=11
182           else
183             print*,'le choix des schemas d''advection H et V'
184             print*, 'est non disponible actuellement'
185             stop
186           endif
187         else
188          iadv(iiq)=hadv(iq)
189         endif
190c verification nombre de traceurs
191          if (iadv(iiq).lt.20) then
192             ii=ii+1
193          elseif (iadv(iiq).eq.20) then
194             ii=ii+4
195          elseif (iadv(iiq).eq.30) then
196             ii=ii+10
197          endif
198 
199         str1=tnom(iq)
200         tname(iiq)=tnom(iq)
201         IF (iadv(iiq).eq.0) THEN
202           ttext(iiq)=str1(1:lnblnk(str1))
203         ELSE
204           ttext(iiq)=str1(1:lnblnk(str1))//descrq(iadv(iiq))
205         ENDIF
206         str2=ttext(iiq)
207c   schemas tenant compte des moments d'ordre superieur.
208          if (iadv(iiq).eq.20) then
209             do iiiq=1,3
210               iiq=iiq+1
211               iadv(iiq)=-20
212               ttext(iiq)=str2(1:lnblnk(str2))//txts(iiiq)
213               tname(iiq)=str1(1:lnblnk(str1))//txts(iiiq)
214              enddo
215            elseif (iadv(iiq).eq.30) then
216              do iiiq=1,9
217               iiq=iiq+1
218               iadv(iiq)=-30
219               ttext(iiq)=str2(1:lnblnk(str2))//txtp(iiiq)
220               tname(iiq)=str1(1:lnblnk(str1))//txtp(iiiq)
221              enddo
222           endif
223        end do
224       if(ii.ne.nqmx) then
225       print*,'WARNING'
226       print*,'le nombre de traceurs et de moments eventuels'
227       print*,'est inferieur a nqmx '
228       endif
229       if (iiq.gt.nqmx) then
230       print*,'le choix des schemas est incompatible avec '
231       print*,'la dimension nqmx (nombre de traceurs)'
232       print*,'verifier traceur.def ou la namelist INCA'
233       print*,'ou recompiler avec plus de traceurs'
234       stop
235       endif
236      iiq=0
237      do iq=1,nqmx
238         if(iadv(iq).ge.0) then
239             iiq=iiq+1
240             niadv(iiq)=iq
241         endif
242      end do
243      return
244999   format (i2,1x,i2,1x,a8)
245      END
Note: See TracBrowser for help on using the repository browser.