Adapt a model to multithreading

Your functions.stan defines a functions block, then in your main model file you have another functions block, and this is what confuses the parser. Just put the function definitions inside functions.stan and include that file inside the functions block of your main model file as:

functions {
#include /functions.stan
  vector f(...) {
     <..
  }
}

After you fix that, you’ll see that the parser will point you to other errors such as those that @wds15 pointed out.

@seantalts: does stanc3 report a more helpful message in the case of the opening post?