Re: passing a variable number of args/vectors to a routine



On Jan 30, 4:59 pm, dpb <n...@xxxxxxx> wrote:
Mirko.Vuko...@xxxxxxxxx wrote:
Hello,

I am writing a module to produce TecPlot data files (in ASCII code).

...

dump_loop: do iData=1,self%cData_pts
select case (self%cDep_Profs)
case (1)
write (self%lu,*) vP1(iData)
case (2)
write (self%lu,*) vP1(iData),vP2(iData)
case (3)
write (self%lu,*) vP1(iData),vP2(iData),vP3(iData)
... etc.

So, is there a better/cleaner way to do all this?

In principle, I could store the data in a matrix, and then print
matrix columns. But this really exposes TecPlot output routine's
internals to the outside world, and I'd like to avoid that.

How are you getting the data in? I don't see why using an array of the
proper dimensions internally has to "expose" anything of Tecplot any
more than does the use of multiple 1D vectors does and it's surely far
simpler to write.

And, btw, I _love_ Tecplot and the ability to generate these files so
simply... :)

--

I pass the data to the TecPlot dump routine by calling:
call dump_data( vData1,vData2, ...)

Mirko

.



Relevant Pages