Skip to content

Possible Incorrect Rejection of OFFLINE_CHILD_MP_PHYSICS from GPUWM Offline Downscale #3

Description

@yongsua1989

Environment
gpuwm: 2.5.2
Source: editable checkout
Python: 3.12
WRF parent domain: 9 km
Child domain: 3 km
Downscale ratio: 3
Parent microphysics: mp_physics = 6 (WSM6)

The parent namelist contains:

mp_physics = 6

The source defines:

OFFLINE_CHILD_MP_PHYSICS = frozenset({6, 8, 10, 18, 28})

and:

if source_mp_physics not in OFFLINE_CHILD_MP_PHYSICS:
    raise OfflineChildContractError(
        f"unsupported parent mp_physics={source_mp_physics}"
    )

However, _transported_source_fields(6) Line 1236 still reaches:

elif source_mp != 0:
    raise OfflineChildContractError(
        f"unsupported parent mp_physics={source_mp}")

because the function does not include 6 in its explicit field mapping.

I am unsure if this is intentional or bug, but anyway changing the code to:

elif source_mp not in {0, 6, 8, 10, 18, 28}:
    raise OfflineChildContractError(
        f"unsupported parent mp_physics={source_mp}")

removes the restriction or error for me.

Thank You.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions