Calling mod-files from subfolders

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Calling mod-files from subfolders

Postby kmarshallbanana » Mon Jul 28, 2014 9:21 pm

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?
kmarshallbanana
 
Posts: 7
Joined: Wed Sep 21, 2011 1:48 pm

Re: Calling mod-files from subfolders

Postby jpfeifer » Tue Jul 29, 2014 8:26 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Calling mod-files from subfolders

Postby kmarshallbanana » Wed Jul 30, 2014 2:17 am

Okay thanks. Guess I will just wait for the current unstable to become stable.
kmarshallbanana
 
Posts: 7
Joined: Wed Sep 21, 2011 1:48 pm

Re: Calling mod-files from subfolders

Postby Econbee » Wed Jul 30, 2014 2:22 am

You may add the Dynare subfolder by using addpath in your Matlab m file.
Econbee
 
Posts: 74
Joined: Fri Nov 08, 2013 8:14 am

Re: Calling mod-files from subfolders

Postby jpfeifer » Wed Jul 30, 2014 7:08 am

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests

cron