Linking DYNARE and Fortran

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.

Linking DYNARE and Fortran

Postby zakovic » Wed Apr 05, 2006 4:09 pm

Dear All,

I hope that somebody out there could help me.

I am running some optimization code, written in Fortran. For that code I need
results from DYNARE. Basically, the structure should look something like:

Fortran sends x to DYNARE
DYNARE returns some data y to Fortran
Fortran uses y, computes new x, sends it to DYNARE...

I've read the chapters from MATLAB regarding the links between MATLAB and
Fortran, but somehow that does not work for me. It works for simple examples
presented in the manual, but when I change the function and input something
that calls DYNARE code, nothing happens. I believe that I have defined and
included all the paths, but obviously something is missing. For example,
assume that I use forward.m file, produced by running

>>DYNARE forward.mod

If I type

>> forward

in the command line everything is fine, and I get the desired results.
However, when I include this function into the engine subroutine, that links
MATLAB and Fortran, nothing happens. It's not even complaining that it
couldn't find certain files, just runs, producing no results.

Anyone had any experience with linking MATLAB, or even better, DYNARE and
Fortran? Help is very much needed and would be very appreciated.

Thanks,

Stan

Stanislav Zakovic
Research Fellow
Department of Computing
Imperial College
London SW7 2AZ
zakovic
 
Posts: 1
Joined: Wed Apr 05, 2006 4:06 pm

Postby MichelJuillard » Wed Apr 05, 2006 4:34 pm

Dear Stanislav,

I don't think that calling Dynare from Fortran is the thing to do. First of all, you don't want to redo the parsing of the *.mod file at each call from the Fortran call.

You need to call from Fortran the Matlab functions from the Dynare toolbox that computes the results that you want. You may even call the Fortran program from inside the Dynare *.mod file.

What exactly do you want to do?

Kind regards

Michel
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 10 guests