Ignore:
Timestamp:
Nov 25, 2020, 7:24:05 PM (4 years ago)
Author:
yjaziri
Message:

Generic GCM:
Implementation of an option for a new reading process of "traceur.def"
Use "#ModernTrac-v1" flag as first line of "traceur.def" to use this option
Further details in "LMDZ.GENERIC/deftank/traceur.def.modern"
YJ + JVO

Location:
trunk/LMDZ.GENERIC/libf/phystd/dyn1d
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/kcm1d.F90

    r1714 r2436  
    9090  real :: latitude(1), longitude(1), cell_area(1), phisfi(1)
    9191 
     92  !     added by JVO and YJ to read modern traceur.def
     93  character(len=500) :: line ! to store a line of text
     94  LOGICAL :: moderntracdef=.false. ! JVO, YJ : modern traceur.def
     95
    9296  ! --------------
    9397  ! Initialisation
     
    162166        write(*,*) "kcm1d: Reading file traceur.def"
    163167        ! read number of tracers:
    164         read(90,*,iostat=ierr) nq
     168        !! - Modif. by JVO and YJ for modern planetary traceur.def ---------------
     169        READ(90,'(A)') line
     170        IF (trim(line).ne.'#ModernTrac-v1') THEN ! Test modern traceur.def
     171           READ(line,*,iostat=ierr) nq ! Try standard traceur.def
     172        ELSE
     173           moderntracdef = .true.
     174           DO
     175             READ(90,'(A)',iostat=ierr) line
     176             IF (ierr.eq.0) THEN
     177               IF (index(line,'#').ne.1) THEN ! Allows arbitary number of comments lines in the header
     178                 READ(line,*,iostat=ierr) nq
     179                 EXIT
     180               ENDIF
     181             ELSE ! If pb, or if reached EOF without having found nbtr
     182                write(*,*) "rcm1d: error reading number of tracers"
     183                write(*,*) "   (first line of traceur.def) "
     184                stop
     185             ENDIF
     186           ENDDO
     187        ENDIF ! if modern or standard traceur.def
    165188        if (ierr.ne.0) then
    166189           write(*,*) "kcm1d: error reading number of tracers"
     
    184207           endif
    185208        enddo !of do iq=1,nq
     209        close(90)
    186210     endif
    187211
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F

    r2354 r2436  
    144144      real :: latitude(1), longitude(1), cell_area(1)
    145145
     146      !     added by JVO and YJ to read modern traceur.def
     147      character(len=500) :: line ! to store a line of text
     148      LOGICAL :: moderntracdef=.false. ! JVO, YJ : modern traceur.def
     149
    146150c=======================================================================
    147151c INITIALISATION
     
    152156     &       iostat=ierr)
    153157      if (ierr.eq.0) then
    154         read(90,*,iostat=ierr) nq
     158        ! read number of tracers:
     159        !! - Modif. by JVO and YJ for modern planetary traceur.def ---------------
     160            READ(90,'(A)') line
     161            IF (trim(line).ne.'#ModernTrac-v1') THEN ! Test modern traceur.def
     162               READ(line,*,iostat=ierr) nq ! Try standard traceur.def
     163            ELSE
     164               moderntracdef = .true.
     165               DO
     166                 READ(90,'(A)',iostat=ierr) line
     167                 IF (ierr.eq.0) THEN
     168                   IF (index(line,'#').ne.1) THEN ! Allows arbitary number of comments lines in the header
     169                     READ(line,*,iostat=ierr) nq
     170                     EXIT
     171                   ENDIF
     172                 ELSE ! If pb, or if reached EOF without having found nbtr
     173                    write(*,*) "rcm1d: error reading number of tracers"
     174                    write(*,*) "   (first line of traceur.def) "
     175                    stop
     176                 ENDIF
     177               ENDDO
     178            ENDIF ! if modern or standard traceur.def
    155179      else
    156180        nq=0
     
    243267          write(*,*) "rcm1d: Reading file traceur.def"
    244268          ! read number of tracers:
    245           read(90,*,iostat=ierr) nq
     269          !! - Modif. by JVO and YJ for modern planetary traceur.def ---------------
     270          READ(90,'(A)') line
     271          IF (trim(line).ne.'#ModernTrac-v1') THEN ! Test modern traceur.def
     272             READ(line,*,iostat=ierr) nq ! Try standard traceur.def
     273          ELSE
     274             moderntracdef = .true.
     275             DO
     276               READ(90,'(A)',iostat=ierr) line
     277               IF (ierr.eq.0) THEN
     278                 IF (index(line,'#').ne.1) THEN ! Allows arbitary number of comments lines in the header
     279                   READ(line,*,iostat=ierr) nq
     280                   EXIT
     281                 ENDIF
     282               ELSE ! If pb, or if reached EOF without having found nbtr
     283                  write(*,*) "rcm1d: error reading number of tracers"
     284                  write(*,*) "   (first line of traceur.def) "
     285                  stop
     286               ENDIF
     287             ENDDO
     288          ENDIF ! if modern or standard traceur.def
    246289          nqtot=nq ! set value of nqtot (in infotrac module) as nq
    247290          if (ierr.ne.0) then
Note: See TracChangeset for help on using the changeset viewer.