nkalauni / HimSim.jl

Himalayan Hydrology Simulation Model
GNU General Public License v3.0
3 stars 0 forks source link

Modeling Toolking global method error when placed inside a function #8

Open nkalauni opened 1 year ago

nkalauni commented 1 year ago

Attempting to modularize code by placing unique features of model inside a function and returning model equations, variables and parameters. Plan is to do this for all models inside src/models and run them from the src/models/Models.jl file. First attempt done to ColleRiverBasin1.jl gives the following error:

LoadError: syntax: Global method definition around .julia/packages/Symbolics/rvztO/src/register.jl:91 needs to be placed at the top level, or use "eval". Stacktrace: [1] top-level scope @ /src/models/CollieRiverBasin1.jl:7 in expression starting at /src/models/CollieRiverBasin1.jl:7 in expression starting at /src/models/Models.jl:1

nkalauni commented 1 year ago

Apparently it is possible to use MTK.jl without imploying the macros as mentioned in the docs (Final section: notes and pointers). I could not find the "separate tutorial" mentioned here. If the macros are what are causing the problem, it could be of help.