Changeset 2215


Ignore:
Timestamp:
Jan 10, 2020, 10:59:33 AM (5 years ago)
Author:
emillour
Message:

Mars GCM:
Improve localtime utility: handle the case when fields to be
interpolated may contain "undefined" (a.k.a "missing") values by
refraining from doing the interpolation in these cases.
EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/util/localtime.F90

    r2207 r2215  
    12751275     if (((x.ge.xd(i)).and.(x.le.xd(i+1))).or.&
    12761276          ((x.le.xd(i)).and.(x.ge.xd(i+1)))) then
    1277         y=yd(i)+(x-xd(i))*(yd(i+1)-yd(i))/(xd(i+1)-xd(i))
     1277        if ((yd(i).eq.missing).or.(yd(i+1).eq.missing)) then
     1278          ! cannot perform the interpolation if an encompasing value
     1279          ! is already set to 'missing'
     1280        else
     1281          !linear interpolation based on encompassing values
     1282          y=yd(i)+(x-xd(i))*(yd(i+1)-yd(i))/(xd(i+1)-xd(i))
     1283        endif
    12781284        exit
    12791285     endif
Note: See TracChangeset for help on using the changeset viewer.