Andy,
I can't explain your 2 calls to main.
A couple of ideas from my earlier use of /timing in March this year, which was quite successful.
I was working in a win32 environment and not .net.
My main program did not have a program statement, so my MAIN@ appears (with 1 call) in the list.
I collected all files for the program, including some library source files, and assembled them all as a single .f95 file being a list of include statements. This list is the list of all routines that I wanted to time. This may not be necessary but it was a requirement of past profiling utilities and it does not cause any problems. I excluded some (extremely frequently called) routines from this list in util.f95, so they would not be timed.
I then compiled the program using the following:
ftn95 sim_ver1_tim /timing >ftn95.tce
ftn95 util /debug >>ftn95.tce
slink main_tim.txt >>ftn95.tce
where main_tim.txt is:
lo sim_ver1_tim.obj
lo util.obj
le \clearwin\saplib.mem\saplib.lib
map sim_tim.map
file sim_tim.exe
I then ran sim_tim.exe and got the list that I wanted. The program terminated normally, which is necessary to get the report.
To obtain the excel type output, I used the set parameter option, as Andrew indicated:
set TIMINGOPTS=/TMO /DLM ,
I then compiled and ran the program, and again got what I wanted. ( I do not have a batch file of doing all this, but my forum response indicated it worked)
The file sim_ver1_tim.f95 consists of:
include 'sim_data.f95'
include 'yrdplt.f95'
include 'sim_ver1.f95'
include 'read_data.f95'
include 'open.f95'
include 'stem_gen.f95'
include 'next.f95'
include 'day.f95'
include 'vessel.f95'
include 'tide.f95'
include 'train.f95'
include 'train_move.f95'
include 'pend.f95'
include 'choose.f95'
include 'pform.f95'
include 'update.f95'
include 'report.f95'
include 'lotus.f95'
In this example, sim_data.f95 and yrdplt.f95 contain module definitions, while sim_ver1.f95 is the program start.
util.f95 and the library files consisted of all routines I did not want timed. The results can vary substantially by what frequently called routines are excluded from the timing list, as there is a bit of an overhead for each routine that is timed. Some of my routines can get up to 10^9 calls, so it's good to exclude them from the timing.
This /timing approach is far easier than my past manual efforts of putting timing calls in the code. /timing is not an option I use every day, but it is useful and easy to apply in this way, when needed.
I hope these comments help, as I found this approach very easy to apply, with no impact on the fortran code.