clawpack / geoclaw

Version of Clawpack for geophysical waves and flows
http://www.clawpack.org/geoclaw
BSD 3-Clause "New" or "Revised" License
73 stars 86 forks source link

AttributeError: Unrecognized attribute: rho_air #605

Open sourabhmet opened 2 weeks ago

sourabhmet commented 2 weeks ago

I am trying to run the surge example for Ike in same folder but getting the below error, please check and help . on top of that if comment this line it is throwing same error for ambient_pressure in next line

make .plots -f Makefile /home/shrivastava/clawpack_src/clawpack/geoclaw/src/2d/shallow/Makefile.geoclaw /home/shrivastava/clawpack_src/clawpack/clawutil/src/Makefile.common make[1]: Entering directory /home/shrivastava/MAdli/surge-examples/ike' make data -f Makefile /home/shrivastava/clawpack_src/clawpack/geoclaw/src/2d/shallow/Makefile.geoclaw /home/shrivastava/clawpack_src/clawpack/clawutil/src/Makefile.common make[2]: Entering directory/home/shrivastava/MAdli/surge-examples/ike' rm -f .data python3.6 setrun.py geoclaw 11 days, 7:00:00 Unrecognized attribute: rho_air Perhaps a typo? Add new attributes using add_attribute method Traceback (most recent call last): File "setrun.py", line 610, in rundata = set_storm(rundata) File "setrun.py", line 529, in set_storm data.rho_air = 1.15 File "/home/shrivastava/.local/lib/python3.6/site-packages/clawpack/clawutil/data.py", line 196, in setattr raise AttributeError("Unrecognized attribute: %s" % name) AttributeError: Unrecognized attribute: rho_air make[2]: [data] Error 1 make[2]: Leaving directory /home/shrivastava/MAdli/surge-examples/ike' make[1]: *** [.data] Error 2 make[1]: Leaving directory/home/shrivastava/MAdli/surge-examples/ike' make: *** [all] Error 2

sourabhmet commented 2 weeks ago

after commenting above lines , I ran code and received another error :- /home/s.bx.shrivastava/.local/lib/python3.6/site-packages/clawpack/geoclaw/data.py:196: UserWarning: WARNING: topofile specs changed in v5.8.0 -- Flag level info now ignored warnings.warn(w, UserWarning) /home/s.bx.shrivastava/.local/lib/python3.6/site-packages/clawpack/geoclaw/data.py:141: UserWarning: WARNING: deep_depth parameter ignored as of v5.8.0 warnings.warn(w, UserWarning) /home/s.bx.shrivastava/.local/lib/python3.6/site-packages/clawpack/geoclaw/data.py:144: UserWarning: *** WARNING: max_level_deep parameter ignored as of v5.8.0 warnings.warn(w, UserWarning) touch .data make[2]: Nothing to be done for /home/s.bx.shrivastava/clawpack_src/clawpack/geoclaw/src/2d/shallow/Makefile.geoclaw'. make[2]: Nothing to be done for/home/s.bx.shrivastava/clawpack_src/clawpack/clawutil/src/Makefile.common'. make[2]: Leaving directory /home/s.bx.shrivastava/MAdli/surge-examples/ike' make output -f Makefile /home/s.bx.shrivastava/clawpack_src/clawpack/geoclaw/src/2d/shallow/Makefile.geoclaw /home/s.bx.shrivastava/clawpack_src/clawpack/clawutil/src/Makefile.common make[2]: Entering directory/home/s.bx.shrivastava/MAdli/surge-examples/ike' rm -f .output python3.6 /home/s.bx.shrivastava/clawpack_src/clawpack/clawutil/src/python/clawutil/runclaw.py xgeoclaw _output \ True None . False False None ==> runclaw: Will take data from /home/s.bx.shrivastava/MAdli/surge-examples/ike ==> runclaw: Will write output to /home/s.bx.shrivastava/MAdli/surge-examples/ike/_output ==> runclaw: Removing all old fort/gauge files in /home/s.bx.shrivastava/MAdli/surge-examples/ike/_output

==> Running with command: /home/s.bx.shrivastava/MAdli/surge-examples/ike/xgeoclaw Reading data file: claw.data first 5 lines are comments and will be skipped Reading data file: amr.data first 5 lines are comments and will be skipped At line 347 of file /home/s.bx.shrivastava/clawpack_src/clawpack/geoclaw/src/2d/shallow/amr2.f90 (unit = 5, file = 'amr.data') Fortran runtime error: Bad integer for item 1 in list input Traceback (most recent call last): File "/home/s.bx.shrivastava/clawpack_src/clawpack/clawutil/src/python/clawutil/runclaw.py", line 245, in runclaw stderr=xclawerr) File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/home/s.bx.shrivastava/MAdli/surge-examples/ike/xgeoclaw']' returned non-zero exit status 2.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/s.bx.shrivastava/clawpack_src/clawpack/clawutil/src/python/clawutil/runclaw.py", line 341, in runclaw(*args) File "/home/s.bx.shrivastava/clawpack_src/clawpack/clawutil/src/python/clawutil/runclaw.py", line 251, in runclaw stderr=cpe.stderr) main.ClawExeError:

FORTRAN EXE FAILED

make[2]: [output] Error 1 make[2]: Leaving directory `/home/s.bx.shrivastava/MAdli/surge-examples/ike' make[1]: [.output] Error 2 make[1]: Leaving directory `/home/s.bx.shrivastava/MAdli/surge-examples/ike' make: *** [all] Error 2

mandli commented 2 weeks ago

That could happen if the version of the GeoClaw Python packages is different from the "Ike" example. Those 2 values in particular were added later than the original data classes were written. I would check to make sure that the version of the python packages matches the version of the example code.

sourabhmet commented 2 weeks ago

Name: clawpack Version: 5.6.15.6.1 Summary: Clawpack: Python-based Clawpack installer Home-page: http://www.clawpack.org Author: Author-email: License: BSD and python version is 3.6.

@mandli how about second error caused by amr.data, I pasted

mandli commented 1 week ago

The version of the clawpack python tools is different than the version of the example, not Python itself. You can check the version of the installed clawpack python tools by doing:

import clawpack
clawpack.__version__

into a python command prompt or putting it in a script and running it. You will probably need to reinstall/update clawpack to get things to work as expected. Let us know how you ended up installing in the first place and we may be able to help with that.

The second error is almost certainly related to the first so see if you can get that working first.

sourabhmet commented 1 week ago

I have updated the version to python (3.11) and clawpack (5.10.0) and got new error: please check

make data -f Makefile /home/s.bx.shrivastava/model/clawpack-v5.10.0/geoclaw/src/2d/shallow/Makefile.geoclaw /home/s.bx.shrivastava/model/clawpack-v5.10.0/clawutil/src/Makefile.common make[2]: Entering directory /home/s.bx.shrivastava/MAdli/surge-examples/harvey' rm -f .data python setrun.py geoclaw Traceback (most recent call last): File "/home/s.bx.shrivastava/MAdli/surge-examples/harvey/setrun.py", line 21, in <module> from clawpack.geoclaw.surge.storm import Storm ModuleNotFoundError: No module named 'clawpack.geoclaw.surge' make[2]: *** [data] Error 1 make[2]: Leaving directory/home/s.bx.shrivastava/MAdli/surge-examples/harvey' make[1]: [.data] Error 2 make[1]: Leaving directory `/home/s.bx.shrivastava/MAdli/surge-examples/harvey' make: [all] Error 2

mandli commented 1 week ago

That error suggests that the Python GeoClaw package has not been successfully installed as it cannot find the class. What did the output from the python prompt say? Also, the examples in the surge-examples repository are not necessarily up to date although it should be straight forward to fix that if you can get everything installed correctly. I would start with trying out the Ike example in the GeoClaw directory itself at $CLAW/geoclaw/examples/storm-surge/ike and making sure that runs.

rjleveque commented 1 week ago

You should also make sure clawpack is on the Python path so that it can find clawpack modules for importing. So you might first try this in a Python shell:

import clawpack and if that works, from clawpack.geoclaw.surge.storm import Storm

See also https://www.clawpack.org/python_path.html for some hints.

On Fri, May 3, 2024 at 12:25 PM Kyle Mandli @.***> wrote:

That error suggests that the Python GeoClaw package has not been successfully installed as it cannot find the class. What did the output from the python prompt say? Also, the examples in the surge-examples repository are not necessarily up to date although it should be straight forward to fix that if you can get everything installed correctly. I would start with trying out the Ike example in the GeoClaw directory itself at $CLAW/geoclaw/examples/storm-surge/ike and making sure that runs.

— Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/clawpack/geoclaw/issues/605*issuecomment-2093636545__;Iw!!K-Hz7m0Vt54!mZtkawMGM8o3HNAlk7H8kdvqzW8M8C9W0SOm_EeJvootXVK9E8SWuTT5tF0FODVX7VmagUeaY3LLr9eHMRy7$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAFPZ6QWXNYVODGMJ7ENZGDZAPQBNAVCNFSM6AAAAABHEEC6QSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJTGYZTMNJUGU__;!!K-Hz7m0Vt54!mZtkawMGM8o3HNAlk7H8kdvqzW8M8C9W0SOm_EeJvootXVK9E8SWuTT5tF0FODVX7VmagUeaY3LLr3fb15yS$ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

sourabhmet commented 1 week ago

Thankyou very much @mandli and @rjleveque Now I can run the $CLAW/geoclaw/examples/storm-surge/ike

need you one more help, which output file will be helpfule to know gridwise Storm Surge? and for my future run, Should I use setrun.py file in $CLAW/geoclaw/examples/storm-surge/ike and modify for other events ?

mandli commented 1 week ago

The output is in a set of overlapping grids, which can be difficult to deal with depending on your application. If you would like a grid that you specify we have that functionality in something called fixed grids. There is an example of using both fixed grids and fixed grid monitoring that may be useful. Alternatively, if you want the grid structure itself, you can find that in the output files fort.q and some other information in fort.amr.

The question about modification of an existing example is a good one but is what I tend to do.