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

Improve definition of @apply_regionally #4178

Merged
merged 1 commit into from
Mar 7, 2025
Merged

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Mar 7, 2025

By interpolating the function names we can call this macro also from other modules.

By interpolating the function names we can call this macro also from other modules.
@glwagner glwagner merged commit c4185c6 into CliMA:main Mar 7, 2025
48 of 49 checks passed
@giordano giordano deleted the patch-1 branch March 7, 2025 23:22
@giordano
Copy link
Contributor Author

giordano commented Mar 7, 2025

Very timely merge, I was looking for the definition of this macro again right now, having the link in my inbox was quite useful 😂

@glwagner
Copy link
Member

glwagner commented Mar 7, 2025

ahaha I was getting errors. But actually it didn't solve it 😢

@glwagner
Copy link
Member

glwagner commented Mar 7, 2025

example:

ERROR: LoadError: TypeError: in Type, in parameter, expected Int64, got a value of type Reactant.TracedRNumber{Int64}
Stacktrace:
  [1] Val
    @ ./essentials.jl:874 [inlined]
  [2] macro expansion
    @ ~/Projects/Oceananigans.jl/src/Utils/multi_region_transformation.jl:233 [inlined]
  [3] macro expansion
    @ ~/Projects/Oceananigans.jl/src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/compute_slow_tendencies.jl:144 [inlined]
  [4] macro expansion
    @ ~/Projects/Oceananigans.jl/src/Utils/multi_region_transformation.jl:250 [inlined]
  [5] compute_free_surface_tendency!
    @ ~/Projects/Oceananigans.jl/src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/compute_slow_tendencies.jl:143 [inlined]
  [6] compute_free_surface_tendency!(none::LatitudeLongitudeGrid{…}, none::HydrostaticFreeSurfaceModel{…}, none::SplitExplicitFreeSurface{…})
    @ Reactant ./<missing>:0
  [7] getproperty
    @ ./Base.jl:37 [inlined]
  [8] compute_free_surface_tendency!
    @ ~/Projects/Oceananigans.jl/src/Models/HydrostaticFreeSurfaceModels/SplitExplicitFreeSurfaces/compute_slow_tendencies.jl:132 [inlined]
  [9] call_with_reactant(::typeof(Oceananigans.Models.HydrostaticFreeSurfaceModels.compute_free_surface_tendency!), ::LatitudeLongitudeGrid{…}, ::HydrostaticFreeSurfaceModel{…}, ::SplitExplicitFreeSurface{…})
    @ Reactant ~/.julia/packages/Reactant/aXRlU/src/utils.jl:0
 [10] ab2_step!
    @ ~/Projects/Oceananigans.jl/ext/OceananigansReactantExt/TimeSteppers.jl:90 [inlined]
 [11] #time_step!#1
    @ ~/Projects/Oceananigans.jl/ext/OceananigansReactantExt/TimeSteppers.jl:67 [inlined]

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

Successfully merging this pull request may close these issues.

2 participants