Routine doesn't give output when executed in crontab

I have a script running in the crontab that gets data from a database every hour. Now I would like to execute a fortran routine to process the data in some way, after getting it and saving it locally.

I have added the following commands to my script:

set convert = ${outputdir}/Scripts/data_latest.txt

cd ${outputdir}/Scripts
f90 -o routine.x routine.f
routine.x filename.dat > $convert

The output from the routine should be written in the 'convert' file, which is data_latest.txt. The file 'filename.dat' is the input file which was received from the database. When I run the script separately, the 'convert' file is filled with output, but when the script is executed in the crontab, it is completely empty.

What should I do in order to run this routine (embedded in the script) automatically and receive my output in the output file?

Thanks in advance.

Including ">$outputfile" in your script works fine in case only one output file was originally generated by the Fortran routine. But what should I do when I would like to have two different output files generated in the program? Is it possible to discriminate between different kinds of output, or should I run the program twice (once for each file)?

Anyone with a solution? Thanks in advance.