Ignore:
Timestamp:
Oct 22, 2010, 11:27:25 AM (14 years ago)
Author:
Ehouarn Millour
Message:

Implemented modifications to enable running with only one tracer for planet types different from "earth". Rem: If flag 'planet_type' is set to "earth" (default behaviour) then there must be at least 2 tracers for the dynamics to function properly.

These updates do not induce any changes in model outputs with respect to previous revisions.

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/LMDZ5V1.0-dev/libf/dyn3dpar/infotrac.F90

    r1443 r1446  
    6565    INTEGER :: nqtrue  ! number of tracers read from tracer.def, without higer order of moment
    6666    INTEGER :: iq, new_iq, iiq, jq, ierr
    67  
     67
     68    character(len=*),parameter :: modname="infotrac_init"
    6869!-----------------------------------------------------------------------
    6970! Initialization :
     
    99100       OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr)
    100101       IF(ierr.EQ.0) THEN
    101           WRITE(lunout,*) 'Open traceur.def : ok'
     102          WRITE(lunout,*) trim(modname),': Open traceur.def : ok'
    102103          READ(90,*) nqtrue
    103104       ELSE
    104           WRITE(lunout,*) 'Problem in opening traceur.def'
    105           WRITE(lunout,*) 'ATTENTION using defaut values'
     105          WRITE(lunout,*) trim(modname),': Problem in opening traceur.def'
     106          WRITE(lunout,*) trim(modname),': WARNING using defaut values'
    106107          nqtrue=4 ! Defaut value
    107108       END IF
    108        ! Attention! Only for planet_type=='earth'
    109        nbtr=nqtrue-2
     109       if ( planet_type=='earth') then
     110         ! For Earth, water vapour & liquid tracers are not in the physics
     111         nbtr=nqtrue-2
     112       else
     113         ! Other planets (for now); we have the same number of tracers
     114         ! in the dynamics than in the physics
     115         nbtr=nqtrue
     116       endif
    110117    ELSE
    111118       ! nbtr has been read from INCA by init_cont_lmdz() in gcm.F
     
    113120    END IF
    114121
    115     IF (nqtrue < 2) THEN
    116        WRITE(lunout,*) 'nqtrue=',nqtrue, ' is not allowded. 2 tracers is the minimum'
     122    IF ((planet_type=="earth").and.(nqtrue < 2)) THEN
     123       WRITE(lunout,*) trim(modname),': nqtrue=',nqtrue, ' is not allowded. 2 tracers is the minimum'
    117124       CALL abort_gcm('infotrac_init','Not enough tracers',1)
    118125    END IF
     
    158165          END DO
    159166          CLOSE(90) 
    160        ELSE ! Without tracer.def
     167       ELSE ! Without tracer.def, set default values (for Earth!)
     168         if ((nqtrue==4).and.(planet_type=="earth")) then
    161169          hadv(1) = 14
    162170          vadv(1) = 14
     
    171179          vadv(4) = 10
    172180          tnom_0(4) = 'PB'
     181         else
     182           ! Error message, we need a traceur.def file
     183           write(lunout,*) trim(modname),&
     184           ': Cannot set default tracer names!'
     185           write(lunout,*) trim(modname),' Make a traceur.def file!!!'
     186           CALL abort_gcm('infotrac_init','Need a traceur.def file!',1)
     187         endif ! of if (nqtrue==4)
    173188       END IF
    174189       
    175        WRITE(lunout,*) 'Valeur de traceur.def :'
    176        WRITE(lunout,*) 'nombre de traceurs ',nqtrue
     190       WRITE(lunout,*) trim(modname),': Valeur de traceur.def :'
     191       WRITE(lunout,*) trim(modname),': nombre de traceurs ',nqtrue
    177192       DO iq=1,nqtrue
    178193          WRITE(lunout,*) hadv(iq),vadv(iq),tnom_0(iq)
     
    216231          new_iq=new_iq+10 ! 9 tracers added
    217232       ELSE
    218           WRITE(lunout,*) 'This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
     233          WRITE(lunout,*) trim(modname),': This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
    219234          CALL abort_gcm('infotrac_init','Bad choice of advection schema - 1',1)
    220235       END IF
     
    226241       nqtot = new_iq
    227242
    228        WRITE(lunout,*) 'The choice of advection schema for one or more tracers'
     243       WRITE(lunout,*) trim(modname),': The choice of advection schema for one or more tracers'
    229244       WRITE(lunout,*) 'makes it necessary to add tracers'
    230        WRITE(lunout,*) nqtrue,' is the number of true tracers'
    231        WRITE(lunout,*) nqtot, ' is the total number of tracers needed'
     245       WRITE(lunout,*) trim(modname)//': ',nqtrue,' is the number of true tracers'
     246       WRITE(lunout,*) trim(modname)//': ',nqtot, ' is the total number of tracers needed'
    232247
    233248    ELSE
     
    257272          iadv(new_iq)=11
    258273       ELSE
    259           WRITE(lunout,*)'This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
     274          WRITE(lunout,*)trim(modname),': This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
    260275
    261276          CALL abort_gcm('infotrac_init','Bad choice of advection schema - 2',1)
     
    303318
    304319
    305     WRITE(lunout,*) 'Information stored in infotrac :'
    306     WRITE(lunout,*) 'iadv  niadv tname  ttext :'
     320    WRITE(lunout,*) trim(modname),': Information stored in infotrac :'
     321    WRITE(lunout,*) trim(modname),': iadv  niadv tname  ttext :'
    307322    DO iq=1,nqtot
    308        WRITE(lunout,*) iadv(iq),niadv(iq), tname(iq), ttext(iq)
     323       WRITE(lunout,*) iadv(iq),niadv(iq),&
     324       ' ',trim(tname(iq)),' ',trim(ttext(iq))
    309325    END DO
    310326
     
    315331    DO iq=1,nqtot
    316332       IF (iadv(iq)/=10 .AND. iadv(iq)/=14 .AND. iadv(iq)/=0) THEN
    317           WRITE(lunout,*)'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ'
     333          WRITE(lunout,*)trim(modname),' STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ'
    318334          CALL abort_gcm('infotrac_init','In this version only iadv=10 and iadv=14 is tested!',1)
    319335       ELSE IF (iadv(iq)==14 .AND. iq/=1) THEN
    320           WRITE(lunout,*)'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ'
     336          WRITE(lunout,*)trim(modname),'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ'
    321337          CALL abort_gcm('infotrac_init','In this version iadv=14 is only permitted for water vapour!',1)
    322338       END IF
Note: See TracChangeset for help on using the changeset viewer.