Changeset 1448


Ignore:
Timestamp:
Nov 2, 2010, 9:35:59 AM (14 years ago)
Author:
Ehouarn Millour
Message:

Small bug fix in the way the traceur.def file is read : using a fixed format for reading that file is not a good idea (things are easily misread), using a free format makes more sense.
Added default initialization for planets (1 tracer) when there is no traceur.def file.

EM

Location:
LMDZ5/branches/LMDZ5V1.0-dev/libf
Files:
2 edited

Legend:

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

    r1446 r1448  
    105105          WRITE(lunout,*) trim(modname),': Problem in opening traceur.def'
    106106          WRITE(lunout,*) trim(modname),': WARNING using defaut values'
    107           nqtrue=4 ! Defaut value
     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
    108112       END IF
    109113       if ( planet_type=='earth') then
     
    162166          ! Continue to read tracer.def
    163167          DO iq=1,nqtrue
    164              READ(90,999) hadv(iq),vadv(iq),tnom_0(iq)
     168             READ(90,*) hadv(iq),vadv(iq),tnom_0(iq)
    165169          END DO
    166170          CLOSE(90) 
    167        ELSE ! Without tracer.def, set default values (for Earth!)
    168          if ((nqtrue==4).and.(planet_type=="earth")) then
     171       ELSE ! Without tracer.def, set default values
     172         if (planet_type=="earth") then
     173          ! for Earth, default is to have 4 tracers
    169174          hadv(1) = 14
    170175          vadv(1) = 14
     
    179184          vadv(4) = 10
    180185          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)
     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")
    188191       END IF
    189192       
     
    345348    DEALLOCATE(tracnam)
    346349
    347 999 FORMAT (i2,1x,i2,1x,a15)
    348 
    349350  END SUBROUTINE infotrac_init
    350351
  • LMDZ5/branches/LMDZ5V1.0-dev/libf/dyn3dpar/infotrac.F90

    r1446 r1448  
    105105          WRITE(lunout,*) trim(modname),': Problem in opening traceur.def'
    106106          WRITE(lunout,*) trim(modname),': WARNING using defaut values'
    107           nqtrue=4 ! Defaut value
     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
    108112       END IF
    109113       if ( planet_type=='earth') then
     
    162166          ! Continue to read tracer.def
    163167          DO iq=1,nqtrue
    164              READ(90,999) hadv(iq),vadv(iq),tnom_0(iq)
     168             READ(90,*) hadv(iq),vadv(iq),tnom_0(iq)
    165169          END DO
    166170          CLOSE(90) 
    167        ELSE ! Without tracer.def, set default values (for Earth!)
    168          if ((nqtrue==4).and.(planet_type=="earth")) then
     171       ELSE ! Without tracer.def, set default values
     172         if (planet_type=="earth") then
     173          ! for Earth, default is to have 4 tracers
    169174          hadv(1) = 14
    170175          vadv(1) = 14
     
    179184          vadv(4) = 10
    180185          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)
     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")
    188191       END IF
    189192       
     
    345348    DEALLOCATE(tracnam)
    346349
    347 999 FORMAT (i2,1x,i2,1x,a15)
    348 
    349350  END SUBROUTINE infotrac_init
    350351
Note: See TracChangeset for help on using the changeset viewer.