source: issm/oecreview/Archive/26740-27031/ISSM-26815-26816.diff@ 27032

Last change on this file since 27032 was 27032, checked in by Mathieu Morlighem, 3 years ago

CHG: added 26740-27031

File size: 1.5 KB
  • TabularUnified ../trunk-jpl/src/m/classes/SMBautoregression.py

     
    132132                indices = np.where(md.smb.basin_id==ii+1)[0]
    133133                elemsh  = np.zeros((len(indices)))
    134134                for jj in range(len(indices)):
    135                     elemsh[jj] = np.mean(md.geometry.surface[md.mesh.elements[indices[jj],:]-1])
    136                     if(ii==0 and jj==0):
    137                         print(md.geometry.surface[md.mesh.elements[indices[jj],:]-1])
     135                    #elemsh[jj] = np.mean(md.geometry.surface[md.mesh.elements[indices[jj],:]-1])
     136                    sumval = 0
     137                    cntval = 0
     138                    elemindices = md.mesh.elements[indices[jj],:]-1
     139                    for kk in range(len(elemindices)):
     140                        sumval += md.geometry.surface[elemindices[kk]]
     141                        cntval += 1
     142                    elemsh[jj] = sumval/cntval
    138143                temprefelevation[ii] = np.sum(areas[indices]*elemsh)/np.sum(areas[indices])
     144                print(indices)
     145                print(areas[indices])
     146                print(elemsh)
    139147            if(np.any(templapserate_pos!=0) or np.any(templapserate_neg!=0)):
    140148                print('      smb.refelevation not specified: Reference elevations set to mean surface elevation of basins')
    141149
Note: See TracBrowser for help on using the repository browser.