@@ -25,7 +25,9 @@ SUBROUTINE createVTK (layoutnumber, size, sgg,vtkindex,somethingdone,mpidir,tagt
2525 !- ----------------------->
2626 CHARACTER (LEN= BUFSIZE) :: filename ! File name
2727 CHARACTER (LEN= BUFSIZE) :: fichero,fichero_input,char_i_sub_time ! File name
28- !
28+ integer (kind= 4 ) :: k
29+ character (len= 32 ), dimension (3 ) :: suffFile = (/ ' _current.vtk' , ' _efield.vtk ' , ' _hfield.vtk ' / )
30+ character (len= 3 ), dimension (3 ) :: suffTag = (/ ' cu' , ' ef' , ' hf' / )
2931 !
3032 !
3133
@@ -66,6 +68,7 @@ SUBROUTINE createVTK (layoutnumber, size, sgg,vtkindex,somethingdone,mpidir,tagt
6668 real (kind= RKIND), allocatable , dimension (:,:) :: Nodes
6769 integer (kind= 4 ), allocatable , dimension (:,:) :: Elems
6870 integer (kind= 4 ) :: coldummy
71+ integer (kind= 4 ), dimension (5 ) :: volumicCurrentFlags = [iCur, iCurX, iCurY, iCurZ, mapvtk]
6972! print *,'RKIND,CKIND,REALSIZE,COMPLEXSIZE,MPI_DOUBLE_PRECISION, MPI_DOUBLE_COMPLEX',RKIND,CKIND,REALSIZE,COMPLEXSIZE,MPI_DOUBLE_PRECISION, MPI_DOUBLE_COMPLEX
7073 yacreado= .false.
7174 numNodes= 0 ; numEdges= 0 ;numQuads= 0 ;
@@ -77,35 +80,30 @@ SUBROUTINE createVTK (layoutnumber, size, sgg,vtkindex,somethingdone,mpidir,tagt
7780 !
7881 somethingdone= .false.
7982 barridoprobes: DO ii = 1 , sgg% NumberRequest
80-
81- IF (sgg% observation(ii)% Volumic) then
82- if (sgg% observation(ii)% nP == 1 ) then
83- if ((sgg% observation(ii)% P(1 )% What == iCur).or. (sgg% observation(ii)% P(1 )% What == iCurX).or. &
84- (sgg% observation(ii)% P(1 )% What == iCurY).or. (sgg% observation(ii)% P(1 )% What == iCurZ).or. &
85- (sgg% observation(ii)% P(1 )% What == mapvtk)) THEN ! solo corrientes volumicas
86- if (sgg% Observation(ii)% done.and. (sgg% Observation(ii)% flushed)) then
83+ IF ((sgg% observation(ii)% Volumic) .and. (sgg% observation(ii)% nP == 1 )) then
84+ if (any (sgg% observation(ii)% P(1 )% What == volumicCurrentFlags)) then
85+ if (sgg% Observation(ii)% done) then
86+ if (sgg% Observation(ii)% flushed) then
8787 cycle barridoprobes
88- elseif (sgg % Observation(ii) % done) then
89- sgg% Observation(ii)% flushed= .true. ! ultima que se flushea
88+ else
89+ sgg% Observation(ii)% flushed= .true.
9090 continue
91- elseif ((.not. (sgg% Observation(ii)% done)).and. (sgg% Observation(ii)% Begun)) then
91+ endif
92+ else
93+ if (sgg% Observation(ii)% Begun) then
9294 continue
93- elseif ( .not. (sgg % Observation(ii) % begun)) then
95+ else
9496 cycle barridoprobes
95- else ! creo que tengo toda la casuistica, por si se me escapa algo continuo, y ya debajo se manejara
96- continue
9797 endif
98+ endif
9899 else
99100 cycle barridoprobes
100101 endif
101- endif
102102 endif
103103 ! sondas Volumic traducelas a VTK
104104 IF (sgg% observation(ii)% Volumic) then
105105 if (sgg% observation(ii)% nP == 1 ) then
106- if ((sgg% observation(ii)% P(1 )% What == iCur).or. (sgg% observation(ii)% P(1 )% What == iCurX).or. &
107- (sgg% observation(ii)% P(1 )% What == iCurY).or. (sgg% observation(ii)% P(1 )% What == iCurZ).or. &
108- (sgg% observation(ii)% P(1 )% What == mapvtk)) THEN ! solo corrientes volumicas
106+ if (any (sgg% observation(ii)% P(1 )% What == volumicCurrentFlags)) then
109107 INQUIRE (FILE= trim (adjustl (output(ii)% item(1 )% path)), EXIST= lexis)
110108 if ((lexis).and. (output(ii)% TimesWritten/= 0 )) then
111109 !
@@ -163,15 +161,6 @@ SUBROUTINE createVTK (layoutnumber, size, sgg,vtkindex,somethingdone,mpidir,tagt
163161 endif
164162 endif
165163#endif
166-
167-
168- ! !! OPEN (output(ii)%item(1)%UNIT, FILE=trim(adjustl(output(ii)%item(1)%path)), &
169- ! !! FORM='unformatted')
170- ! !! DO
171- ! !! READ (output(ii)%item(1)%UNIT, end=762) finalstep
172- ! !! END DO
173- ! !!762 CONTINUE
174- ! !! CLOSE (output(ii)%item(1)%UNIT)
175164 finalstep= output(ii)% TimesWritten
176165 allocate (att(1 :finalstep))
177166 ! !!!!!!!!!!!!
@@ -495,15 +484,7 @@ SUBROUTINE createVTK (layoutnumber, size, sgg,vtkindex,somethingdone,mpidir,tagt
495484 READ (output(ii)% item(1 )% UNIT) &
496485 Serialized% valorComplex_x(1 ,posicionMPI+ conta), &
497486 Serialized% valorComplex_y(1 ,posicionMPI+ conta), &
498- Serialized% valorComplex_z(1 ,posicionMPI+ conta) ! lo meto en el unico step
499- READ (output(ii)% item(1 )% UNIT) &
500- Serialized% valorComplex_Ex(1 ,posicionMPI+ conta), &
501- Serialized% valorComplex_Ey(1 ,posicionMPI+ conta), &
502- Serialized% valorComplex_Ez(1 ,posicionMPI+ conta) ! lo meto en el unico step
503- READ (output(ii)% item(1 )% UNIT) &
504- Serialized% valorComplex_Hx(1 ,posicionMPI+ conta), &
505- Serialized% valorComplex_Hy(1 ,posicionMPI+ conta), &
506- Serialized% valorComplex_Hz(1 ,posicionMPI+ conta) ! lo meto en el unico step
487+ Serialized% valorComplex_z(1 ,posicionMPI+ conta)
507488 end do
508489 endif
509490
@@ -848,30 +829,23 @@ SUBROUTINE createVTK (layoutnumber, size, sgg,vtkindex,somethingdone,mpidir,tagt
848829 else
849830 if (freqDomain) then
850831 total_sub_times= time_phases_param
851- do i_sub_time= 0 ,total_sub_times
852- write (char_i_sub_time,' (i3)' ) i_sub_time
853- fichero_input= fichero(1 :iroot1-1 )// ' _n_' // trim (adjustl (char_i_sub_time))// ' _current.vtk'
854- CALL write_VTKfile(sgg,fichero_input,iroot2, Serialized, numberOfSerialized,Nodes,Numnodes,Elems,NumEdges,NumQuads,time, &
855- i_sub_time,total_sub_times,freqDomain,sgg% observation(ii)% P(1 )% What,sggMtag,' cu' )
856- write (dubuf,' (a,i9,a,i9)' ) trim (adjustl (whoamishort))// ' -------> Dumped frequency phase file ' // trim (adjustl (fichero_input))// ' , ' ,i_sub_time,' /' ,total_sub_times
857- call print11(layoutnumber,dubuf,.true. )
858- ! electric
832+ do i_sub_time = 0 , total_sub_times
833+ write (char_i_sub_time,' (i3)' ) i_sub_time
834+ do k = 1 , 3
835+ fichero_input = fichero(1 :iroot1-1 )// ' _n_' // trim (adjustl (char_i_sub_time))// suffFile(k)
836+
837+ CALL write_VTKfile( sgg, fichero_input, iroot2, Serialized, numberOfSerialized, &
838+ Nodes, Numnodes, Elems, NumEdges, NumQuads, time, &
839+ i_sub_time, total_sub_times, freqDomain, sgg% observation(ii)% P(1 )% What, sggMtag, &
840+ suffTag(k) )
841+
842+ write (dubuf,' (a,i9,a,i9)' ) trim (adjustl (whoamishort))// ' -------> Dumped frequency phase file ' // &
843+ trim (adjustl (fichero_input))// ' , ' , i_sub_time, ' /' , total_sub_times
844+ call print11(layoutnumber, dubuf, .true. )
845+ end do
859846
860- fichero_input= fichero(1 :iroot1-1 )// ' _n_' // trim (adjustl (char_i_sub_time))// ' _efield.vtk'
861- CALL write_VTKfile(sgg,fichero_input,iroot2, Serialized, numberOfSerialized,Nodes,Numnodes,Elems,NumEdges,NumQuads,time, &
862- i_sub_time,total_sub_times,freqDomain,sgg% observation(ii)% P(1 )% What,sggMtag,' ef' )
863- write (dubuf,' (a,i9,a,i9)' ) trim (adjustl (whoamishort))// ' -------> Dumped frequency phase file ' // trim (adjustl (fichero_input))// ' , ' ,i_sub_time,' /' ,total_sub_times
864- call print11(layoutnumber,dubuf,.true. )
865- !
866- ! magnetic
867-
868- fichero_input= fichero(1 :iroot1-1 )// ' _n_' // trim (adjustl (char_i_sub_time))// ' _hfield.vtk'
869- CALL write_VTKfile(sgg,fichero_input,iroot2, Serialized, numberOfSerialized,Nodes,Numnodes,Elems,NumEdges,NumQuads,time, &
870- i_sub_time,total_sub_times,freqDomain,sgg% observation(ii)% P(1 )% What,sggMtag,' hf' )
871- write (dubuf,' (a,i9,a,i9)' ) trim (adjustl (whoamishort))// ' -------> Dumped frequency phase file ' // trim (adjustl (fichero_input))// ' , ' ,i_sub_time,' /' ,total_sub_times
872- call print11(layoutnumber,dubuf,.true. )
873- !
874847 end do
848+
875849 else
876850 fichero_input= fichero(1 :iroot1-1 )// ' _current.vtk'
877851 i_sub_time=- 30 ! cualquier cosa
0 commit comments