From: dpb on
Mirko.Vukovic(a)gmail.com 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... :)

--
From: Mirko.Vukovic on
On Jan 30, 4:59 pm, dpb <n...(a)non.net> wrote:
> Mirko.Vuko...(a)gmail.com 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

From: dpb on
Mirko.Vukovic(a)gmail.com wrote:
....

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

That's not the question -- where do vDataN come from and why can't they
be an ALLOCATED array of the proper dimension, instead?

--
From: Mirko.Vukovic on
On Jan 30, 6:07 pm, dpb <n...(a)non.net> wrote:
> Mirko.Vuko...(a)gmail.com wrote:
>
> ...
>
> > I pass the data to the TecPlot dump routine by calling:
> > call dump_data( vData1,vData2, ...)
>
> That's not the question -- where do vDataN come from and why can't they
> be an ALLOCATED array of the proper dimension, instead?
>
> --

Hmm, I am not sure what you're getting at. But here's my story:

I am doing a 1-D time-dependent electromagnetic simulation and
calculate E and B fields. These are stored in their own vectors.
After each time step, I want to pass the two vectors to the tecplot
dump routine. So, I do allocate the two vectors at the beginning of
the run.

But I want to write the tecplot dump routine because eventually, I
will be following more variables than that, and I will be passing it
more vectors.

Hope this clarifies things a bit.

Thanks,

Mirko
From: dpb on
Mirko.Vukovic(a)gmail.com wrote:
> On Jan 30, 6:07 pm, dpb <n...(a)non.net> wrote:
>> Mirko.Vuko...(a)gmail.com wrote:
>>
>> ...
>>
>>> I pass the data to the TecPlot dump routine by calling:
>>> call dump_data( vData1,vData2, ...)
>> That's not the question -- where do vDataN come from and why can't they
>> be an ALLOCATED array of the proper dimension, instead?
>>
>> --
>
> Hmm, I am not sure what you're getting at. But here's my story:
>
> I am doing a 1-D time-dependent electromagnetic simulation and
> calculate E and B fields. These are stored in their own vectors.
> After each time step, I want to pass the two vectors to the tecplot
> dump routine. So, I do allocate the two vectors at the beginning of
> the run.
>
> But I want to write the tecplot dump routine because eventually, I
> will be following more variables than that, and I will be passing it
> more vectors.

I'm saying for the output routine instead of creating more vectors,
create an array and populate it at each time step instead...

--