Changeset 730 in lmdz_wrf


Ignore:
Timestamp:
Apr 26, 2016, 9:43:34 PM (9 years ago)
Author:
lfita
Message:

Fixing right matrix indices

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/module_ForInterpolate.F90

    r729 r730  
    197197END SUBROUTINE CoarselonlatFind
    198198
    199 SUBROUTINE CoarseInterpolate(inpts, projlon, projlat, lonvs, latvs, percen, mindiff, ivar, newvar,    &
    200   newvarin, newvarinpt, newvarindiff, dimx, dimy, Ninpts)
     199SUBROUTINE CoarseInterpolate(projlon, projlat, lonvs, latvs, percen, mindiff, ivar, newvar, newvarin, &
     200  newvarinpt, newvarindiff, dimx, dimy, Ninpts)
    201201! Subroutine which finds the closest grid point within a projection throughout a first guest
    202202!   approche from percentages of the whole domain
     
    210210  REAL(r_k), DIMENSION(dimx,dimy), INTENT(in)            :: projlon, projlat
    211211  INTEGER, INTENT(in)                                    :: Ninpts
    212   INTEGER, DIMENSION(Ninpts), INTENT(in)                 :: inpts
    213212  REAL(r_k), DIMENSION(Ninpts), INTENT(in)               :: ivar, lonvs, latvs
    214213  REAL(r_k)                                              :: mindiff, percen
     
    230229
    231230!!!!!!! Variables
    232 ! inpts: relative position of the values to interpolate
    233231! dimx, dimy: dimension length of the target interpolation
    234232! proj[lon/lat]: longitudes and latitudes of the target interpolation
     
    301299
    302300        IF (ilonlat(1) >= 0 .AND. ilonlat(1) >= 0) THEN
    303           newvar(ilonlat(1),ilonlat(2)) = ivar(inpts(iv))
    304           newvarin(ilonlat(1),ilonlat(2)) = inpts(iv)
    305           newvarinpt(inpts(iv)) = 1
    306           newvarindiff(inpts(iv)) = mindiffLl
     301          newvar(ilonlat(1),ilonlat(2)) = ivar(iv)
     302          newvarin(ilonlat(1),ilonlat(2)) = iv
     303          newvarinpt(iv) = 1
     304          newvarindiff(iv) = mindiffLl
    307305!          PRINT *,'Lluis iv:', newvarin(ilonlat(1),ilonlat(2)), ' localized:', newvarinpt(iv),        &
    308306!            ' values:', newvar(ilonlat(1),ilonlat(2)), ' invalues:', ivar(iv), ' mindist:',           &
  • trunk/tools/nc_var_tools.py

    r729 r730  
    1974019740            ovars = ovar[iri:ire].astype('float64')
    1974119741
    19742             newvar,newvarin,newvarinpt,newvarindiff =                                \
    19743               fin.module_forinterpolate.coarseinterpolate(pts, projlon, projlat,     \
     19742            newvar,newvarin,newvarinpt[pts],newvarindiff[pts] =                      \
     19743              fin.module_forinterpolate.coarseinterpolate(projlon, projlat,          \
    1974419744              lonvss, latvss, np.float64(fracd), np.float64(mindiff), ovars)
    1974519745            newnc.sync()
Note: See TracChangeset for help on using the changeset viewer.