Page 1 of 1

Calling mod-files from subfolders

PostPosted: Mon Jul 28, 2014 9:21 pm
by kmarshallbanana
I am calling dynare codes from inside a matlab m-file and was hoping to call a mod-file from a subfolder, eg.
Code: Select all
dynare ./CodeOutput/RBC.mod

this gives the error message
Code: Select all
It seems you are trying to call a mod-file not located in the "Current Folder". This is not possible (the / symbol is not allowed in the name of the mod file).
The file RBC[.mod,.dyn] could not be located!


I wanted to do this to keep my current folder clean. The aim was that rather than creating all of the additional dynare files (eg. RBC.log, RBC_static.m, RBC_dynamic.m, etc.) in my current folder they would be created within the ./CodeOutput/ folder. Is there a more direct way to do this? Is running codes from subfolders an intended feature in future versions of Dynare?

Re: Calling mod-files from subfolders

PostPosted: Tue Jul 29, 2014 8:26 am
by jpfeifer
No, this is not planned, because it introduces many complications on different platforms. What you can already do in the unstable version is use the
Code: Select all
clean_current_folder;

command at the end of your mod-file to delete some of the files created by Dynare.

Re: Calling mod-files from subfolders

PostPosted: Wed Jul 30, 2014 2:17 am
by kmarshallbanana
Okay thanks. Guess I will just wait for the current unstable to become stable.

Re: Calling mod-files from subfolders

PostPosted: Wed Jul 30, 2014 2:22 am
by Econbee
You may add the Dynare subfolder by using addpath in your Matlab m file.

Re: Calling mod-files from subfolders

PostPosted: Wed Jul 30, 2014 7:08 am
by jpfeifer
What you can also do is use
Code: Select all
delete *.log
delete *_dynamic.m
delete *_static.m
delete *_steady_state2.m
delete *_results.mat
delete *_set_auxiliary_variables.m
delete *.eps
delete *_pindx.mat
delete *_params.mat