badlands-model / badlands

Basin and Landscape Dynamics model
https://badlands.readthedocs.io
GNU General Public License v3.0
150 stars 46 forks source link

TypeError: 'float' object has no attribute '__getitem__' when adding the the strata mesh with disp3d=1 #7

Closed tyszwh closed 7 years ago

tyszwh commented 7 years ago

Dear Dr Tristan Salles, ihowson

I found an error when I try to add the strata mesh with disp3d=1. It may related to the variable scum from the below message.

`--------------------------------------------------------------------------- TypeError Traceback (most recent call last)

in () ----> 1 model.run_to_time(250000) /root/build/pybadlands/pyBadlands/model.pyc in run_to_time(self, tEnd, profile, verbose) 265 self.recGrid.tinMesh, self.elevation, self.cumdiff, fcum, scum, Ke, Th = self.force.apply_XY_dispacements( 266 self.recGrid.areaDel, self.fixIDs, self.elevation, self.cumdiff, tflex=flexiso, scum=sload, Te=vTh, --> 267 Ke=vKe, flexure=fflex, strat=fstrat, ero=fero) 268 # Update relevant parameters in deformed TIN 269 if fflex == 1: /root/build/pybadlands/pyBadlands/forcing/forceSim.pyc in apply_XY_dispacements(self, area, fixIDs, telev, tcum, tflex, scum, Te, Ke, flexure, strat, ero) 772 cumfvals = cumf[ids] 773 if strat == 1: --> 774 scumvals = stcum[ids] 775 if ero == 1: 776 Tevals = numpy.zeros((len(zvals),lay)) TypeError: 'float' object has no attribute '__getitem__' `
tristan-salles commented 7 years ago

Hi Lynn,

Would you be able to send me your input files (displacement file/XmL input/initial surface...) So I can have a try at reproducing the error on my local computer.

Cheers Tristan

tyszwh commented 7 years ago

Hi Dr Tristan Salles,

Ok, I have sent these files to you.

tristan-salles commented 7 years ago

Hi Lynn,

Thanks for reporting the problem. I found the issue and committed the changes to fix it on the master branch. Your model looks pretty cool!

rift

tyszwh commented 7 years ago

Dear Dr Tristan Salles, Thanks for your great work.