Changeset 1600 for trunk/LMDZ.GENERIC


Ignore:
Timestamp:
Sep 15, 2016, 4:33:30 PM (8 years ago)
Author:
emillour
Message:

Generic model:

  • bug fix in tpindex.F : when computing weights for abundance of species one should not return the maximum index (leads to out-of-bounds index use in the caller).

TB

Location:
trunk/LMDZ.GENERIC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/README

    r1594 r1600  
    12571257- Further cleanup to harmonize with LMDZ.COMMON turn "idissip" into
    12581258  "dissip_period".
     1259
     1260== 15/09/2016 == TB
     1261- bug fix in tpindex.F : when computing weights for abundance of species one
     1262  should not return the maximum index (leads to out-of-bounds index use in
     1263  the caller).
  • trunk/LMDZ.GENERIC/libf/phystd/tpindex.F

    r135 r1600  
    6969!     requested temperature. If the requested temperature is outside
    7070!     the T-grid, set up to extrapolate from the appropriate end.
    71 
     71!     TW : temperature to be interpolated
     72!     TREF : grid array
     73!     MT : index of TREF for bounding new temperature
     74!     U : new index (real) for temperature interpolated
    7275
    7376      IF(TW.LE.TREF(1)) THEN
     
    8588   10   continue
    8689      END IF
     90
     91      !TB15 : case low temp : MT=1: fixed TW right above tref(1)
     92      IF (MT.eq.1) THEN
     93         TW=tref(1)*1.00
     94         write(*,*) 'tpindex: Caution! Pressure of upper levels lower
     95     $than ref pressure for k-coef: k-coeff fixed for upper levels'
     96      ENDIF
    8797
    8898      U = (TW-TREF(MT))/(TREF(MT+1)-TREF(MT))
     
    104114
    105115   20 continue
     116     
     117      !TB15 : case low pressure : n=2 : fixed pwl, right above pref(1)
     118      IF (MP.eq.1) THEN
     119         PWL=Pref(1)*1.00
     120         write(*,*) 'tpindex: Caution! Pressure of upper levels lower
     121     $than ref pressure for k-coef: k-coeff fixed for upper levels'
     122      ENDIF
    106123
     124!     interpolated pressure
    107125      T = (PWL-PREF(MP))/(PREF(MP+1)-PREF(MP))
    108126
     
    118136      IF(QVAR.le.WREFVAR(1)) then
    119137        NVAR   = 1
    120         WRATIO = 0.0D0
     138        WRATIO = 0.0D0      ! put all the weight on the first point
    121139      ELSEIF(QVAR.ge.WREFVAR(L_REFVAR)) then
    122         NVAR   = L_REFVAR
    123         WRATIO = 0.0D0
     140        NVAR   = L_REFVAR-1 ! TB16 in order to not oversize NVAr when doing
     141                                  !NVAR+1
     142        WRATIO = 1.00D0     ! put all the weight on the last point
    124143      ELSE
    125144        DO N=2,L_REFVAR
Note: See TracChangeset for help on using the changeset viewer.