Ignore:
Timestamp:
Nov 18, 2010, 1:01:24 PM (14 years ago)
Author:
Laurent Fairhead
Message:

Merge of LMDZ5V1.0-dev branch r1453 into LMDZ5 trunk r1434


Fusion entre la version r1453 de la branche de développement LMDZ5V1.0-dev
et le tronc LMDZ5 (r1434)

Location:
LMDZ5/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk

  • LMDZ5/trunk/libf/dyn3dpar/infotrac.F90

    r1403 r1454  
    6161    CHARACTER(len=1), DIMENSION(3)  :: txts
    6262    CHARACTER(len=2), DIMENSION(9)  :: txtp
    63     CHARACTER(len=13)               :: str1,str2
     63    CHARACTER(len=23)               :: str1,str2
    6464 
    6565    INTEGER :: nqtrue  ! number of tracers read from tracer.def, without higer order of moment
    6666    INTEGER :: iq, new_iq, iiq, jq, ierr
    67     INTEGER, EXTERNAL :: lnblnk
    68  
     67
     68    character(len=*),parameter :: modname="infotrac_init"
    6969!-----------------------------------------------------------------------
    7070! Initialization :
     
    100100       OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr)
    101101       IF(ierr.EQ.0) THEN
    102           WRITE(lunout,*) 'Open traceur.def : ok'
     102          WRITE(lunout,*) trim(modname),': Open traceur.def : ok'
    103103          READ(90,*) nqtrue
    104104       ELSE
    105           WRITE(lunout,*) 'Problem in opening traceur.def'
    106           WRITE(lunout,*) 'ATTENTION using defaut values'
    107           nqtrue=4 ! Defaut value
    108        END IF
    109        ! Attention! Only for planet_type=='earth'
    110        nbtr=nqtrue-2
     105          WRITE(lunout,*) trim(modname),': Problem in opening traceur.def'
     106          WRITE(lunout,*) trim(modname),': WARNING using defaut values'
     107          if (planet_type=='earth') then
     108            nqtrue=4 ! Default value for Earth
     109          else
     110            nqtrue=1 ! Default value for other planets
     111          endif
     112       END IF
     113       if ( planet_type=='earth') then
     114         ! For Earth, water vapour & liquid tracers are not in the physics
     115         nbtr=nqtrue-2
     116       else
     117         ! Other planets (for now); we have the same number of tracers
     118         ! in the dynamics than in the physics
     119         nbtr=nqtrue
     120       endif
    111121    ELSE
    112122       ! nbtr has been read from INCA by init_cont_lmdz() in gcm.F
     
    114124    END IF
    115125
    116     IF (nqtrue < 2) THEN
    117        WRITE(lunout,*) 'nqtrue=',nqtrue, ' is not allowded. 2 tracers is the minimum'
     126    IF ((planet_type=="earth").and.(nqtrue < 2)) THEN
     127       WRITE(lunout,*) trim(modname),': nqtrue=',nqtrue, ' is not allowded. 2 tracers is the minimum'
    118128       CALL abort_gcm('infotrac_init','Not enough tracers',1)
    119129    END IF
     
    156166          ! Continue to read tracer.def
    157167          DO iq=1,nqtrue
    158              READ(90,999) hadv(iq),vadv(iq),tnom_0(iq)
     168             READ(90,*) hadv(iq),vadv(iq),tnom_0(iq)
    159169          END DO
    160170          CLOSE(90) 
    161        ELSE ! Without tracer.def
     171       ELSE ! Without tracer.def, set default values
     172         if (planet_type=="earth") then
     173          ! for Earth, default is to have 4 tracers
    162174          hadv(1) = 14
    163175          vadv(1) = 14
     
    172184          vadv(4) = 10
    173185          tnom_0(4) = 'PB'
     186         else ! default for other planets
     187          hadv(1) = 10
     188          vadv(1) = 10
     189          tnom_0(1) = 'dummy'
     190         endif ! of if (planet_type=="earth")
    174191       END IF
    175192       
    176        WRITE(lunout,*) 'Valeur de traceur.def :'
    177        WRITE(lunout,*) 'nombre de traceurs ',nqtrue
     193       WRITE(lunout,*) trim(modname),': Valeur de traceur.def :'
     194       WRITE(lunout,*) trim(modname),': nombre de traceurs ',nqtrue
    178195       DO iq=1,nqtrue
    179196          WRITE(lunout,*) hadv(iq),vadv(iq),tnom_0(iq)
     
    217234          new_iq=new_iq+10 ! 9 tracers added
    218235       ELSE
    219           WRITE(lunout,*) 'This choice of advection schema is not available'
     236          WRITE(lunout,*) trim(modname),': This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
    220237          CALL abort_gcm('infotrac_init','Bad choice of advection schema - 1',1)
    221238       END IF
     
    227244       nqtot = new_iq
    228245
    229        WRITE(lunout,*) 'The choice of advection schema for one or more tracers'
     246       WRITE(lunout,*) trim(modname),': The choice of advection schema for one or more tracers'
    230247       WRITE(lunout,*) 'makes it necessary to add tracers'
    231        WRITE(lunout,*) nqtrue,' is the number of true tracers'
    232        WRITE(lunout,*) nqtot, ' is the total number of tracers needed'
     248       WRITE(lunout,*) trim(modname)//': ',nqtrue,' is the number of true tracers'
     249       WRITE(lunout,*) trim(modname)//': ',nqtot, ' is the total number of tracers needed'
    233250
    234251    ELSE
     
    258275          iadv(new_iq)=11
    259276       ELSE
    260           WRITE(lunout,*)'This choice of advection schema is not available'
     277          WRITE(lunout,*)trim(modname),': This choice of advection schema is not available',iq,hadv(iq),vadv(iq)
     278
    261279          CALL abort_gcm('infotrac_init','Bad choice of advection schema - 2',1)
    262280       END IF
     
    265283       tname(new_iq)= tnom_0(iq)
    266284       IF (iadv(new_iq)==0) THEN
    267           ttext(new_iq)=str1(1:lnblnk(str1))
     285          ttext(new_iq)=trim(str1)
    268286       ELSE
    269           ttext(new_iq)=str1(1:lnblnk(str1))//descrq(iadv(new_iq))
     287          ttext(new_iq)=trim(tnom_0(iq))//descrq(iadv(new_iq))
    270288       END IF
    271289
     
    276294             new_iq=new_iq+1
    277295             iadv(new_iq)=-20
    278              ttext(new_iq)=str2(1:lnblnk(str2))//txts(jq)
    279              tname(new_iq)=str1(1:lnblnk(str1))//txts(jq)
     296             ttext(new_iq)=trim(str2)//txts(jq)
     297             tname(new_iq)=trim(str1)//txts(jq)
    280298          END DO
    281299       ELSE IF (iadv(new_iq)==30) THEN
     
    283301             new_iq=new_iq+1
    284302             iadv(new_iq)=-30
    285              ttext(new_iq)=str2(1:lnblnk(str2))//txtp(jq)
    286              tname(new_iq)=str1(1:lnblnk(str1))//txtp(jq)
     303             ttext(new_iq)=trim(str2)//txtp(jq)
     304             tname(new_iq)=trim(str1)//txtp(jq)
    287305          END DO
    288306       END IF
     
    303321
    304322
    305     WRITE(lunout,*) 'Information stored in infotrac :'
    306     WRITE(lunout,*) 'iadv  niadv tname  ttext :'
     323    WRITE(lunout,*) trim(modname),': Information stored in infotrac :'
     324    WRITE(lunout,*) trim(modname),': iadv  niadv tname  ttext :'
    307325    DO iq=1,nqtot
    308        WRITE(lunout,*) iadv(iq),niadv(iq), tname(iq), ttext(iq)
     326       WRITE(lunout,*) iadv(iq),niadv(iq),&
     327       ' ',trim(tname(iq)),' ',trim(ttext(iq))
    309328    END DO
    310329
     
    315334    DO iq=1,nqtot
    316335       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'
     336          WRITE(lunout,*)trim(modname),' STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ'
    318337          CALL abort_gcm('infotrac_init','In this version only iadv=10 and iadv=14 is tested!',1)
    319338       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'
     339          WRITE(lunout,*)trim(modname),'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ'
    321340          CALL abort_gcm('infotrac_init','In this version iadv=14 is only permitted for water vapour!',1)
    322341       END IF
     
    329348    DEALLOCATE(tracnam)
    330349
    331 999 FORMAT (i2,1x,i2,1x,a15)
    332 
    333350  END SUBROUTINE infotrac_init
    334351
Note: See TracChangeset for help on using the changeset viewer.