Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: Unrecognized attribute: rho_air #605

Closed
sourabhmet opened this issue May 2, 2024 · 9 comments
Closed

AttributeError: Unrecognized attribute: rho_air #605

sourabhmet opened this issue May 2, 2024 · 9 comments

Comments

@sourabhmet
Copy link

sourabhmet commented May 2, 2024

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
Copy link
Author

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
Copy link
Member

mandli commented May 2, 2024

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
Copy link
Author

sourabhmet commented May 2, 2024

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
Copy link
Member

mandli commented May 3, 2024

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
Copy link
Author

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
Copy link
Member

mandli commented May 3, 2024

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
Copy link
Member

rjleveque commented May 3, 2024 via email

@sourabhmet
Copy link
Author

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
Copy link
Member

mandli commented May 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants