ERROR Liquefaction Scenario OpenQuake: ZhuEtAl2017LiquefactionGeneral

42 views
Skip to first unread message

Ridho Alfi Mubarok

unread,
Mar 29, 2026, 1:40:09 AM (6 days ago) Mar 29
to OpenQuake Users

Hello OpenQuake community,

I am running a scenario-based (event-based) analysis with secondary perils (liquefaction) using OpenQuake Engine WebUI version 3.23.3 on Windows, applying the ZhuEtAl2017LiquefactionGeneral model.

My setup is as follows:

  • Liquefaction model: ZhuEtAl2017LiquefactionGeneral

  • Site model CSV includes additional parameters vs30, dw, gwd, precip

However, during execution, the calculation fails with the following error:
image.png
For reference, I am attaching the configuration file (job.ini) and the site model CSV used in this scenario-based analysis.  However, during execution, the calculation fails with the following error:

Ridho Alfi Mubarok

unread,
Mar 29, 2026, 1:40:47 AM (6 days ago) Mar 29
to OpenQuake Users
image.png

Ridho Alfi Mubarok

unread,
Mar 29, 2026, 1:44:33 AM (6 days ago) Mar 29
to OpenQuake Users
job.ini
image (1).png

Lana Todorovic

unread,
Mar 29, 2026, 7:20:49 AM (6 days ago) Mar 29
to OpenQuake Users

Dear User,

Please see the answer from this thread: https://groups.google.com/g/openquake-users/c/G6fOarB16hs/m/s3_ymvdkAwAJ (you need to remove Hazard sites block - you don't need to define region_grid_spacing and region, given that you are providing the site_file.csv below).

If this does not help, please do send all the inputs (not only job.ini file, but all the necessary inputs to perform the analysis). That saying, please use command oq zip job.ini and share it here.

Cheers,
Lana
On Sunday, March 29, 2026 at 7:44:33 AM UTC+2 ridhoal...@gmail.com wrote:

Ridho Alfi Mubarok

unread,
Mar 29, 2026, 10:07:01 AM (6 days ago) Mar 29
to openqua...@googlegroups.com

Hi Lana, thank you so much for the guidance!

I followed your advice and removed the [Hazard sites] block in my job.ini file. You were totally right—the calculation ran perfectly smooth when I used the Zhu et al. (2015) model.

However, when I tried running the exact same scenario using the Zhu et al. (2017) model with intensity_measure_types = PGA, PGV, a completely different error popped up: UnboundLocalError: cannot access local variable 'prob_liq'.

Out of curiosity, and because I really needed both the PGA and PGV outputs, I decided to poke around the openquake/sep/classes.py file (with a little help from AI to understand the code flow). It seems the error in the 2017 model is a slightly different case. The issue appears to happen because the out.append() lines are still being executed when the loop evaluates PGA, even though the 2017 function only initializes those variables when the IMT is PGV.

So, I tried experimenting by adding an indentation to those 3 append lines so they sit securely inside the if im.string == "PGV": block, like this:

Python
    def compute(self, mag, imt_gmf, sites):
        out = []
        for im, gmf in imt_gmf:
            if im.string == "PGV":
                prob_liq, out_class, lse = zhu_etal_2017_general(
                    pgv=gmf,
                    vs30=sites.vs30,
                    dw=sites.dw,
                    gwd=sites.gwd,
                    precip=sites.precip,
                )
                # I tried adding indentation to these 3 lines
                out.append(prob_liq)
                out.append(out_class)
                out.append(lse)
        return out

After shifting the code, the error completely disappeared, and the scenario with the 2017 model successfully finished calculating both IMTs!

I just wanted to share the result of this little experiment. Please correct me if my understanding or this workaround is wrong, or if there is a more proper solution from the developer's side.

Thanks again so much for your help!


--
You received this message because you are subscribed to the Google Groups "OpenQuake Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openquake-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/openquake-users/b58dc63d-8906-4dac-bb43-848a8440c5efn%40googlegroups.com.

Lana Todorovic

unread,
Mar 29, 2026, 1:28:07 PM (5 days ago) Mar 29
to OpenQuake Users
Dear User,

This issue is fixed and I cannot reproduce it in current master of the engine. Can you let me know which version of the engine you are using (oq --version)? Other way to make it work is to define:
intensity_measure_types = PGV, PGA
(instead of setting intensity_measure_types = PGA, PGV)

Lana Todorovic

unread,
Mar 29, 2026, 1:34:01 PM (5 days ago) Mar 29
to OpenQuake Users
Dear User,

I have now checked on OQ Engine v3.23.4 (https://groups.google.com/g/openquake-users/c/RRcFNY1r4cM/m/dkbsGs6LBgAJ) and I can successfully run the analysis irrespective of how I define:

intensity_measure_types = PGV, PGA or  intensity_measure_types = PGA, PGV

Ridho Alfi Mubarok

unread,
Mar 29, 2026, 7:05:37 PM (5 days ago) Mar 29
to openqua...@googlegroups.com
I see, thank you for your explanation. I will consider using the latest version of OpenQuake in the future.

Reply all
Reply to author
Forward
0 new messages