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
RevLine 
[27032]1Index: ../trunk-jpl/src/m/classes/SMBautoregression.py
2===================================================================
3--- ../trunk-jpl/src/m/classes/SMBautoregression.py (revision 26815)
4+++ ../trunk-jpl/src/m/classes/SMBautoregression.py (revision 26816)
5@@ -132,10 +132,18 @@
6 indices = np.where(md.smb.basin_id==ii+1)[0]
7 elemsh = np.zeros((len(indices)))
8 for jj in range(len(indices)):
9- elemsh[jj] = np.mean(md.geometry.surface[md.mesh.elements[indices[jj],:]-1])
10- if(ii==0 and jj==0):
11- print(md.geometry.surface[md.mesh.elements[indices[jj],:]-1])
12+ #elemsh[jj] = np.mean(md.geometry.surface[md.mesh.elements[indices[jj],:]-1])
13+ sumval = 0
14+ cntval = 0
15+ elemindices = md.mesh.elements[indices[jj],:]-1
16+ for kk in range(len(elemindices)):
17+ sumval += md.geometry.surface[elemindices[kk]]
18+ cntval += 1
19+ elemsh[jj] = sumval/cntval
20 temprefelevation[ii] = np.sum(areas[indices]*elemsh)/np.sum(areas[indices])
21+ print(indices)
22+ print(areas[indices])
23+ print(elemsh)
24 if(np.any(templapserate_pos!=0) or np.any(templapserate_neg!=0)):
25 print(' smb.refelevation not specified: Reference elevations set to mean surface elevation of basins')
26
Note: See TracBrowser for help on using the repository browser.