Set the number of threads with nvfortran

I am using nvfortran with the -stdpar=multicore flag to multi-thread my program. Is there a way to specify how many threads to use? It seems the default is the maximum amount of threads possible. It is using 42 threads when I would rather have it say use 21 threads. I know gfortran has the flag -ftree-parallelize-loops=21. Is there an equivalent in nvfortran.

Since our Fortran stdpar implementation uses our OpenACC runtime, you can set the environment variable “ACC_NUM_CORES=N” where “N” is the the number of cores (threads) to use.

That works perfectly!