Skip to content

Constant initializers with intrinsic calls (max, epsilon) are refused #16

Description

@chenyueqi

CLUBB's constants_clubb declares eps = max( 1.0e-10_core_rknd, epsilon(pi) ) and rt_tol, chi_tol the same way; penta_bicgstab_solver has bicgstab_tol = max( 1.e-10, epsilon(bicgstab_tol) ). recast.fortran.expr.build refuses any Intrinsic_Function_Reference, so every unit that use-imports one of these constants fails in translate.tree with unsupported initializer node Intrinsic_Function_Reference. Seen on 4 of 14 tier-0 CLUBB_core units (new_tsdadg_pdf, nc_ncn_eqns, skx_module, interpolation) and it will block nearly every tier-1 unit. Proposal: an Expr kind call for a whitelist of pure intrinsics (max, min, epsilon, huge, tiny, abs, sqrt, real, dble, int) rendered by both callbacks, so the stand-in and the Python constant still agree by construction.

Found 2026-09-03 running the recast-clubb extension's tier-0 units (CLUBB_core of larson-group/clubb_release at 8ab3902, double precision, statistics off).

Activity

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

Metadata

Metadata

Assignees

Labels

area:frontendFortran parsing, interface extraction, constant foldingenhancementNew feature or requestfixed-in-prfixed on a branch, awaiting the PR's mergefound-by:clubbsurfaced by the recast-clubb extension on CLUBB_core

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions