riemann icon indicating copy to clipboard operation
riemann copied to clipboard

Inconsistent common block

Open cpraveen opened this issue 1 year ago • 2 comments
trafficstars

While trying to setup a quad grid examples, I noticed that the common blocks here

https://github.com/clawpack/riemann/blob/master/src/rpn2_euler_mapgrid.f90#L44 https://github.com/clawpack/riemann/blob/master/src/rpt2_euler_mapgrid.f90#L69

and here

https://github.com/clawpack/riemann/blob/master/src/euler_roe_solver_mapgrid.f90#L11

differ. The last one has gamma1 which is not present in the other two. I think these files will be used together.

Is this correct fortran ? The gamma1 need not have to be put in the common block.

cpraveen avatar Dec 31 '23 05:12 cpraveen

Yes, I think you're right. Thanks for catching that. I agree that the best solution is to remove gamma1 from the common block. If you'd like to make a pull request with this change, that would be great. Even better if you could create an example problem that uses this code and add it to a subdirectory in pyclaw/examples.

ketch avatar Jan 01 '24 18:01 ketch

You are right that gamma1 is not needed, although the code should still run fine either way since gamma1 is defined locally, and in Fortran a common block is just a pointer to the start of the memory locations that hold the listed variables. But it would be cleaner to remove it.

rjleveque avatar Jan 01 '24 20:01 rjleveque