Ignore:
Timestamp:
Apr 17, 2015, 4:34:43 PM (9 years ago)
Author:
jyg
Message:

Correction of a bug concerning the number 'nqo' of
water phases transported by the dynamic : the
default value (= 2, corresponding to vapour and
liquid phases) was still explicitely present in
various places.

Modified files:

infotrac.F90,
physiq.F90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dyn3d_common/infotrac.F90

    r2180 r2262  
    143143          endif
    144144       END IF
    145        if ( planet_type=='earth') then
    146          ! For Earth, water vapour & liquid tracers are not in the physics
    147          nbtr=nqtrue-2
    148        else
    149          ! Other planets (for now); we have the same number of tracers
    150          ! in the dynamics than in the physics
    151          nbtr=nqtrue
    152        endif
     145!jyg<
     146!!       if ( planet_type=='earth') then
     147!!         ! For Earth, water vapour & liquid tracers are not in the physics
     148!!         nbtr=nqtrue-2
     149!!       else
     150!!         ! Other planets (for now); we have the same number of tracers
     151!!         ! in the dynamics than in the physics
     152!!         nbtr=nqtrue
     153!!       endif
     154!>jyg
    153155    ELSE ! type_trac=inca
     156!jyg<
     157       ! The traceur.def file is used to define the number "nqo" of water phases
     158       ! present in the simulation. Default : nqo = 2.
     159       OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr)
     160       IF(ierr.EQ.0) THEN
     161          WRITE(lunout,*) trim(modname),': Open traceur.def : ok'
     162          READ(90,*) nqo
     163       ELSE
     164          WRITE(lunout,*) trim(modname),': Using default value for nqo'
     165          nqo=2
     166       ENDIF
     167       IF (nqo /= 2 .OR. nqo /= 3 ) THEN
     168          WRITE(lunout,*) trim(modname),': nqo=',nqo, ' is not allowded. Only 2 or 3 water phases allowed'
     169          CALL abort_gcm('infotrac_init','Bad number of water phases',1)
     170       END IF
    154171       ! nbtr has been read from INCA by init_const_lmdz() in gcm.F
    155        nqtrue=nbtr+2
    156     END IF
     172       nqtrue=nbtr+nqo
     173!!       nqtrue=nbtr+2
     174    END IF   ! type_trac
     175!>jyg
    157176
    158177    IF ((planet_type=="earth").and.(nqtrue < 2)) THEN
     
    161180    END IF
    162181   
     182!jyg<
    163183! Transfert number of tracers to Reprobus
    164     IF (type_trac == 'repr') THEN
    165 #ifdef REPROBUS
    166        CALL Init_chem_rep_trac(nbtr)
    167 #endif
    168     END IF
     184!!    IF (type_trac == 'repr') THEN
     185!!#ifdef REPROBUS
     186!!       CALL Init_chem_rep_trac(nbtr)
     187!!#endif
     188!!    END IF
     189!>jyg
    169190       
    170191!
    171 ! Allocate variables depending on nqtrue and nbtr
     192! Allocate variables depending on nqtrue
    172193!
    173194    ALLOCATE(tnom_0(nqtrue), hadv(nqtrue), vadv(nqtrue))
    174     ALLOCATE(conv_flg(nbtr), pbl_flg(nbtr), solsym(nbtr))
    175     conv_flg(:) = 1 ! convection activated for all tracers
    176     pbl_flg(:)  = 1 ! boundary layer activated for all tracers
     195!
     196!jyg<
     197!!    ALLOCATE(conv_flg(nbtr), pbl_flg(nbtr), solsym(nbtr))
     198!!    conv_flg(:) = 1 ! convection activated for all tracers
     199!!    pbl_flg(:)  = 1 ! boundary layer activated for all tracers
     200!>jyg
    177201
    178202!-----------------------------------------------------------------------
     
    230254         endif ! of if (planet_type=="earth")
    231255       END IF
    232 
    233 !CR: nombre de traceurs de l eau
    234        if (tnom_0(3) == 'H2Oi') then
    235           nqo=3
    236        else
    237           nqo=2
    238        endif
    239256       
    240257       WRITE(lunout,*) trim(modname),': Valeur de traceur.def :'
     
    244261       END DO
    245262
    246     ELSE  ! type_trac=inca : config_inca='aero' ou 'chem'
     263       if ( planet_type=='earth') then
     264         !CR: nombre de traceurs de l eau
     265         if (tnom_0(3) == 'H2Oi') then
     266            nqo=3
     267         else
     268            nqo=2
     269         endif
     270         ! For Earth, water vapour & liquid tracers are not in the physics
     271         nbtr=nqtrue-nqo
     272       else
     273         ! Other planets (for now); we have the same number of tracers
     274         ! in the dynamics than in the physics
     275         nbtr=nqtrue
     276       endif
     277
     278    ENDIF  ! (type_trac == 'lmdz' .OR. type_trac == 'repr')
     279!jyg<
     280!
     281! Transfert number of tracers to Reprobus
     282    IF (type_trac == 'repr') THEN
     283#ifdef REPROBUS
     284       CALL Init_chem_rep_trac(nbtr)
     285#endif
     286    END IF
     287!
     288! Allocate variables depending on nbtr
     289!
     290    ALLOCATE(conv_flg(nbtr), pbl_flg(nbtr), solsym(nbtr))
     291    conv_flg(:) = 1 ! convection activated for all tracers
     292    pbl_flg(:)  = 1 ! boundary layer activated for all tracers
     293!
     294!!    ELSE  ! type_trac=inca : config_inca='aero' ou 'chem'
     295!
     296    IF (type_trac == 'inca') THEN   ! config_inca='aero' ou 'chem'
     297!>jyg
    247298! le module de chimie fournit les noms des traceurs
    248299! et les schemas d'advection associes.
     
    258309       tnom_0(1)='H2Ov'
    259310       tnom_0(2)='H2Ol'
    260 
    261        DO iq =3,nqtrue
    262           tnom_0(iq)=solsym(iq-2)
     311       IF (nqo == 3) tnom_0(3)='H2Oi'     !! jyg
     312
     313!jyg<
     314       DO iq = nqo+1, nqtrue
     315          tnom_0(iq)=solsym(iq-nqo)
    263316       END DO
    264        nqo = 2
    265 
    266     END IF ! type_trac
     317!!       DO iq =3,nqtrue
     318!!          tnom_0(iq)=solsym(iq-2)
     319!!       END DO
     320!!       nqo = 2
     321!>jyg
     322
     323    END IF ! (type_trac == 'inca')
    267324
    268325!-----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.