18   CHARACTER(len=20), 
ALLOCATABLE, 
DIMENSION(:), 
SAVE :: 
tname  
   19   CHARACTER(len=23), 
ALLOCATABLE, 
DIMENSION(:), 
SAVE :: 
ttext  
   22   INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE    :: 
iadv 
   26   INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE    :: 
niadv  
   29   INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE    :: 
nqfils 
   30   INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE    :: 
nqdesc  
   32   INTEGER, 
ALLOCATABLE, 
DIMENSION(:,:), 
SAVE    :: 
iqfils 
   33   INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE    :: 
iqpere 
   36   INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE  :: 
conv_flg 
   38   INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE  :: 
pbl_flg 
   41   CHARACTER(len=8),
DIMENSION(:),
ALLOCATABLE, 
SAVE :: 
solsym 
   48     LOGICAL, 
DIMENSION(niso_possibles),
SAVE ::  
use_iso 
   49     INTEGER, 
ALLOCATABLE, 
DIMENSION(:,:), 
SAVE ::  
iqiso  
   50     INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE ::  
iso_num  
   51     INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE ::  
iso_indnum  
   52     INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE ::  
zone_num  
   53     INTEGER, 
ALLOCATABLE, 
DIMENSION(:), 
SAVE ::  
phase_num  
   55     INTEGER, 
ALLOCATABLE, 
DIMENSION(:,:), 
SAVE ::  
index_trac  
   63     USE chem_rep
, ONLY : init_chem_rep_trac
 
   82     include 
"dimensions.h" 
   86     INTEGER, 
ALLOCATABLE, 
DIMENSION(:) :: hadv  
 
   87     INTEGER, 
ALLOCATABLE, 
DIMENSION(:) :: vadv  
 
   89     CHARACTER(len=15), 
ALLOCATABLE, 
DIMENSION(:) :: tnom_0  
 
   90     CHARACTER(len=15), 
ALLOCATABLE, 
DIMENSION(:) :: tnom_transp 
 
   91     CHARACTER(len=3), 
DIMENSION(30) :: descrq
 
   92     CHARACTER(len=1), 
DIMENSION(3)  :: txts
 
   93     CHARACTER(len=2), 
DIMENSION(9)  :: txtp
 
   94     CHARACTER(len=23)               :: str1,str2
 
   97     INTEGER :: iq, new_iq, iiq, jq, ierr
 
   99     LOGICAL :: continu,nouveau_traceurdef
 
  101     CHARACTER(len=15) :: tchaine    
 
  103     character(len=*),
parameter :: modname=
"infotrac_init" 
  108     txtp=(/
'x ',
'y ',
'z ',
'xx',
'xy',
'xz',
'yy',
'yz',
'zz'/)
 
  124        WRITE(
lunout,*) 
'You have choosen to couple with INCA chemestry model : type_trac=', &
 
  127           WRITE(
lunout,*) 
'Incoherence between type_trac and config_inca. Model stops. Modify run.def' 
  128           CALL abort_gcm(
'infotrac_init',
'Incoherence between type_trac and config_inca',1)
 
  131        WRITE(
lunout,*) 
'To run this option you must add cpp key INCA and compile with INCA code' 
  132        CALL abort_gcm(
'infotrac_init',
'You must compile with cpp key INCA',1)
 
  135        WRITE(
lunout,*) 
'You have choosen to couple with REPROBUS chemestry model : type_trac=', 
type_trac 
  137        WRITE(
lunout,*) 
'To run this option you must add cpp key REPROBUS and compile with REPRPBUS code' 
  138        CALL abort_gcm(
'infotrac_init',
'You must compile with cpp key REPROBUS',1)
 
  141        WRITE(
lunout,*) 
'Tracers are treated in LMDZ only : type_trac=', 
type_trac 
  144        CALL abort_gcm(
'infotrac_init',
'bad parameter',1)
 
  150        WRITE(
lunout,*) 
'config_inca will now be changed to none as you do not couple with INCA model' 
  162        OPEN(90,file=
'traceur.def',form=
'formatted',status=
'old', iostat=ierr)
 
  164           WRITE(
lunout,*) trim(modname),
': Open traceur.def : ok' 
  166           write(
lunout,*) 
'nqtrue=',nqtrue
 
  168           WRITE(
lunout,*) trim(modname),
': Problem in opening traceur.def' 
  169           WRITE(
lunout,*) trim(modname),
': WARNING using defaut values' 
  190        OPEN(90,file=
'traceur.def',form=
'formatted',status=
'old', iostat=ierr)
 
  192           WRITE(
lunout,*) trim(modname),
': Open traceur.def : ok' 
  195           WRITE(
lunout,*) trim(modname),
': Using default value for nqo' 
  198        IF (
nqo /= 2 .AND. 
nqo /= 3 ) 
THEN 
  199           WRITE(
lunout,*) trim(modname),
': nqo=',
nqo, 
' is not allowded. Only 2 or 3 water phases allowed' 
  200           CALL abort_gcm(
'infotrac_init',
'Bad number of water phases',1)
 
  204        CALL init_chem_inca_trac(
nbtr) 
 
  211        WRITE(
lunout,*) trim(modname),
': nqtrue=',nqtrue, 
' is not allowded. 2 tracers is the minimum' 
  212        CALL abort_gcm(
'infotrac_init',
'Not enough tracers',1)
 
  227     ALLOCATE(tnom_0(nqtrue), hadv(nqtrue), vadv(nqtrue),tnom_transp(nqtrue))
 
  266              write(*,*) 
'infotrac 237: iq=',iq
 
  269              READ(90,
'(I2,X,I2,X,A)',iostat=iostatus) hadv(iq),vadv(iq),tchaine
 
  270              write(
lunout,*) 
'iq,hadv(iq),vadv(iq)=',iq,hadv(iq),vadv(iq)
 
  271              write(
lunout,*) 
'tchaine=',trim(tchaine)
 
  272              write(*,*) 
'infotrac 238: IOstatus=',iostatus
 
  273              if (iostatus.ne.0) 
then 
  274                 CALL abort_gcm(
'infotrac_init',
'Pb dans la lecture de traceur.def',1)
 
  279              nouveau_traceurdef=.
false.
 
  282                 if (tchaine(iiq:iiq).eq.
' ') 
then 
  283                   nouveau_traceurdef=.
true.
 
  285                 else if (iiq.lt.len_trim(tchaine)) 
then 
  291              write(*,*) 
'iiq,nouveau_traceurdef=',iiq,nouveau_traceurdef
 
  292              if (nouveau_traceurdef) 
then 
  293                 write(
lunout,*) 
'C''est la nouvelle version de traceur.def' 
  294                 tnom_0(iq)=tchaine(1:iiq-1)
 
  295                 tnom_transp(iq)=tchaine(iiq+1:15)
 
  297                 write(
lunout,*) 
'C''est l''ancienne version de traceur.def' 
  298                 write(
lunout,*) 
'On suppose que les traceurs sont tous d''air' 
  300                 tnom_transp(iq) = 
'air' 
  302              write(
lunout,*) 
'tnom_0(iq)=<',trim(tnom_0(iq)),
'>' 
  303              write(
lunout,*) 
'tnom_transp(iq)=<',trim(tnom_transp(iq)),
'>' 
  314           tnom_transp(1) = 
'air' 
  318           tnom_transp(2) = 
'air' 
  322           tnom_transp(3) = 
'air' 
  326           tnom_transp(4) = 
'air' 
  331           tnom_transp(1) = 
'dummy' 
  335        WRITE(
lunout,*) trim(modname),
': Valeur de traceur.def :' 
  336        WRITE(
lunout,*) trim(modname),
': nombre de traceurs ',nqtrue
 
  338           WRITE(
lunout,*) hadv(iq),vadv(iq),tnom_0(iq),tnom_transp(iq)
 
  343          if (tnom_0(3) == 
'H2Oi') 
then 
  362        CALL init_chem_rep_trac(
nbtr)
 
  380        CALL init_transport( &
 
  388        tnom_transp(1) = 
'air' 
  390        tnom_transp(2) = 
'air' 
  393           tnom_transp(3) = 
'air' 
  397        DO iq = 
nqo+1, nqtrue
 
  399           tnom_transp(iq) = 
'air' 
  418        IF (hadv(iq)<20 .AND. vadv(iq)<20 ) 
THEN 
  420        ELSE IF (hadv(iq)==20 .AND. vadv(iq)==20 ) 
THEN 
  422        ELSE IF (hadv(iq)==30 .AND. vadv(iq)==30 ) 
THEN 
  425           WRITE(
lunout,*) trim(modname),
': This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
 
  426           CALL abort_gcm(
'infotrac_init',
'Bad choice of advection schema - 1',1)
 
  430     IF (new_iq /= nqtrue) 
THEN 
  435        WRITE(
lunout,*) trim(modname),
': The choice of advection schema for one or more tracers' 
  436        WRITE(
lunout,*) 
'makes it necessary to add tracers' 
  437        WRITE(
lunout,*) trim(modname)//
': ',nqtrue,
' is the number of true tracers' 
  438        WRITE(
lunout,*) trim(modname)//
': ',
nqtot, 
' is the total number of tracers needed' 
  461        IF (hadv(iq)==vadv(iq)) 
THEN 
  462           iadv(new_iq)=hadv(iq)
 
  463        ELSE IF (hadv(iq)==10 .AND. vadv(iq)==16) 
THEN 
  466           WRITE(
lunout,*)trim(modname),
': This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
 
  468           CALL abort_gcm(
'infotrac_init',
'Bad choice of advection schema - 2',1)
 
  472        tname(new_iq)= tnom_0(iq)
 
  473        IF (
iadv(new_iq)==0) 
THEN 
  474           ttext(new_iq)=trim(str1)
 
  476           ttext(new_iq)=trim(tnom_0(iq))//descrq(
iadv(new_iq))
 
  481        IF (
iadv(new_iq)==20) 
THEN 
  485              ttext(new_iq)=trim(str2)//txts(jq)
 
  486              tname(new_iq)=trim(str1)//txts(jq)
 
  488        ELSE IF (
iadv(new_iq)==30) 
THEN 
  492              ttext(new_iq)=trim(str2)//txtp(jq)
 
  493              tname(new_iq)=trim(str1)//txtp(jq)
 
  504        IF(
iadv(iq).GE.0) 
THEN 
  512     WRITE(
lunout,*) trim(modname),
': Information stored in infotrac :' 
  513     WRITE(
lunout,*) trim(modname),
': iadv  niadv tname  ttext :' 
  524        IF (
iadv(iq)/=10 .AND. 
iadv(iq)/=14 .AND. 
iadv(iq)/=0) 
THEN 
  525           WRITE(
lunout,*)trim(modname),
' STOP : The option iadv=',
iadv(iq),
' is not tested in this version of LMDZ' 
  526           CALL abort_gcm(
'infotrac_init',
'In this version only iadv=10 and iadv=14 is tested!',1)
 
  527        ELSE IF (
iadv(iq)==14 .AND. iq/=1) 
THEN 
  528           WRITE(
lunout,*)trim(modname),
'STOP : The option iadv=',
iadv(iq),
' is not tested in this version of LMDZ' 
  529           CALL abort_gcm(
'infotrac_init',
'In this version iadv=14 is only permitted for water vapour!',1)
 
  547       if (tnom_transp(iq) == 
'air') 
then 
  549         WRITE(
lunout,*) 
'Le traceur',iq,
', appele ',trim(tnom_0(iq)),
', est un pere' 
  554         WRITE(
lunout,*) 
'Le traceur',iq,
', appele ',trim(tnom_0(iq)),
', est un fils' 
  558           if (tnom_transp(iq) == tnom_0(ipere)) 
then 
  560             WRITE(
lunout,*) 
'Le traceur',iq,
'appele ', &
 
  561       &          trim(tnom_0(iq)),
' est le fils de ',ipere,
'appele ',trim(tnom_0(ipere))
 
  568             if (ipere.gt.
nqtot) 
then 
  569                 WRITE(
lunout,*) 
'Le traceur',iq,
'appele ', &
 
  570       &          trim(tnom_0(iq)),
', est orpelin.' 
  571                 CALL abort_gcm(
'infotrac_init',
'Un traceur est orphelin',1)
 
  599       WRITE(
lunout,*) 
'Le traceur ',iq,
', appele ',trim(tnom_0(iq)),
' est un traceur de generation: ',
generation 
  611         if (
iadv(iq)/=10) 
then 
  612            WRITE(
lunout,*)trim(modname),
' STOP : The option iadv=',
iadv(iq),
' is not implemented for sons' 
  613           CALL abort_gcm(
'infotrac_init',
'Sons should be advected by scheme 10',1)
 
  617           WRITE(
lunout,*)trim(modname),
' STOP : The option iadv=',
iadv(iq),
' is not implemented for fathers' 
  618           CALL abort_gcm(
'infotrac_init',
'Fathers should be advected by scheme 10 ou 14',1)
 
  630     DEALLOCATE(tnom_0, hadv, vadv,tnom_transp)
 
  647     CHARACTER(len=15) tnom_0(nqtrue)
 
  650     CHARACTER(len=3), 
DIMENSION(niso_possibles) :: tnom_iso
 
  651     INTEGER, 
ALLOCATABLE,
DIMENSION(:,:) :: nb_iso,nb_traciso
 
  652     INTEGER, 
ALLOCATABLE,
DIMENSION(:) :: nb_isoind
 
  653     INTEGER :: ntraceurs_zone_prec,iq,phase,ixt,iiso,izone
 
  654     CHARACTER(len=19) :: tnom_trac
 
  657     tnom_iso=(/
'eau',
'HDO',
'O18',
'O17',
'HTO'/)
 
  660     ALLOCATE(nb_isoind(
nqo))
 
  678     ntraceurs_zone_prec=0
 
  685          tnom_trac=trim(tnom_0(phase))//
'_' 
  686          tnom_trac=trim(tnom_trac)//trim(tnom_iso(ixt))
 
  688          IF (tnom_0(iq) == tnom_trac) 
then 
  690           nb_iso(ixt,phase)=nb_iso(ixt,phase)+1   
 
  691           nb_isoind(phase)=nb_isoind(phase)+1   
 
  701          else if (
iqpere(iq).gt.0) 
then           
  702           if (tnom_0(
iqpere(iq)) == tnom_trac) 
then 
  705            nb_traciso(ixt,phase)=nb_traciso(ixt,phase)+1
 
  729         if (nb_iso(ixt,1).eq.1) 
then 
  733             if (nb_iso(ixt,phase).ne.nb_iso(ixt,1)) 
then 
  735               CALL abort_gcm(
'infotrac_init',
'Phases must have same number of isotopes',1)
 
  747               write(
lunout,*) 
'ixt,phase,nb_traciso=',ixt,phase,nb_traciso(ixt,phase)
 
  749               CALL abort_gcm(
'infotrac_init',
'Phases must have same number of tracers',1)
 
  754           if (ntraceurs_zone_prec.gt.0) 
then                
  758               write(*,*) 
'ntraceurs_zone_prec,ntraceurs_zone=',ntraceurs_zone_prec,
ntraceurs_zone    
  760                &
'Isotope tracers are not well defined in traceur.def',1)           
 
  764         else if (nb_iso(ixt,1).ne.0) 
then 
  766            WRITE(
lunout,*) 
'nb_iso(ixt,1)=',nb_iso(ixt,1)    
 
  767            CALL abort_gcm(
'infotrac_init',
'Isotopes are not well defined in traceur.def',1)     
 
  789         tnat=(/1.0,155.76e-6,2005.2e-6,0.004/100.,0.0/)
 
character(len=8), dimension(:), allocatable, save solsym
 
character(len=23), dimension(:), allocatable, save ttext
 
!$Id pressure_exner real ap!hybrid pressure contribution at interlayers real bp!hybrid sigma contribution at interlayer real based on!preff and scaleheight integer disvert_type!type of vertical!automatic generation
 
character(len=4), save config_inca
 
integer, dimension(:), allocatable, save nqdesc
 
integer, save ntraceurs_zone
 
real, dimension(niso_possibles), save tnat
 
logical, save ok_iso_verif
 
integer, dimension(:), allocatable, save phase_num
 
character(len=10), save planet_type
 
subroutine abort_gcm(modname, message, ierr)
 
integer, dimension(:,:), allocatable, save index_trac
 
integer, dimension(:), allocatable, save conv_flg
 
logical, save ok_init_iso
 
integer, dimension(:,:), allocatable, save iqfils
 
integer, dimension(:,:), allocatable, save iqiso
 
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL false
 
integer, dimension(niso_possibles), save indnum_fn_num
 
integer, dimension(:), allocatable, save zone_num
 
!$Header!integer nvarmx parameter(nfmx=10, imx=200, jmx=150, lmx=200, nvarmx=1000) real xd(imx
 
logical, dimension(niso_possibles), save use_iso
 
character(len=20), dimension(:), allocatable, save tname
 
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL ulevSTD CALL &zphi philevSTD CALL &zx_rh rhlevSTD!DO klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon du jour ou toutes les read_climoz CALL true
 
character(len=4), save type_trac
 
integer, dimension(:), allocatable, save niadv
 
real, dimension(niso_possibles), save alpha_ideal
 
integer, dimension(:), allocatable, save nqfils
 
integer, dimension(:), allocatable, save pbl_flg
 
subroutine infotrac_isoinit(tnom_0, nqtrue)
 
logical, save ok_isotopes
 
integer, dimension(:), allocatable, save iqpere
 
integer, dimension(:), allocatable, save iso_num
 
integer, dimension(:), allocatable, save iso_indnum
 
integer, dimension(:), allocatable, save iadv
 
!$Header!gestion des impressions de sorties et de débogage la sortie standard prt_level COMMON comprint lunout