write_dataarray_location_tag Function

private function write_dataarray_location_tag(self, location, action) result(error)

Type Bound

xml_writer_abstract

Arguments

Type IntentOptional Attributes Name
class(xml_writer_abstract), intent(inout) :: self
character(len=*), intent(in) :: location
character(len=*), intent(in) :: action

Return Value integer(kind=I4P)


Calls

proc~~write_dataarray_location_tag~~CallsGraph proc~write_dataarray_location_tag xml_writer_abstract%write_dataarray_location_tag proc~chars string%chars proc~write_dataarray_location_tag->proc~chars proc~upper~2 string%upper proc~write_dataarray_location_tag->proc~upper~2 proc~write_end_tag xml_writer_abstract%write_end_tag proc~write_dataarray_location_tag->proc~write_end_tag proc~write_start_tag xml_writer_abstract%write_start_tag proc~write_dataarray_location_tag->proc~write_start_tag proc~stringify xml_tag%stringify proc~write_end_tag->proc~stringify proc~write_start_tag->proc~stringify proc~stringify->proc~chars proc~end_tag xml_tag%end_tag proc~stringify->proc~end_tag proc~is_allocated string%is_allocated proc~stringify->proc~is_allocated proc~self_closing_tag xml_tag%self_closing_tag proc~stringify->proc~self_closing_tag proc~start_tag xml_tag%start_tag proc~stringify->proc~start_tag proc~attributes xml_tag%attributes proc~self_closing_tag->proc~attributes proc~start_tag->proc~attributes

Called by

proc~~write_dataarray_location_tag~~CalledByGraph proc~write_dataarray_location_tag xml_writer_abstract%write_dataarray_location_tag none~write_dataarray xml_writer_abstract%write_dataarray none~write_dataarray->proc~write_dataarray_location_tag proc~write_check write_check proc~write_check->none~write_dataarray none~write_fielddata xml_writer_abstract%write_fielddata proc~write_check->none~write_fielddata none~write_geo xml_writer_abstract%write_geo proc~write_check->none~write_geo proc~write_connectivity xml_writer_abstract%write_connectivity proc~write_connectivity->none~write_dataarray proc~write_data write_data proc~write_data->none~write_dataarray proc~write_data->none~write_geo proc~write_data~2 write_data proc~write_data~2->none~write_dataarray proc~write_data~2->none~write_geo proc~write_data~3 write_data proc~write_data~3->none~write_dataarray proc~write_data~3->proc~write_connectivity proc~write_data~3->none~write_geo proc~write_data~4 write_data proc~write_data~4->none~write_dataarray proc~write_data~4->proc~write_connectivity proc~write_data~4->none~write_geo proc~write_fielddata1_rank0 xml_writer_abstract%write_fielddata1_rank0 proc~write_fielddata1_rank0->none~write_dataarray proc~write_geo_rect_data3_rank1_r4p xml_writer_abstract%write_geo_rect_data3_rank1_R4P proc~write_geo_rect_data3_rank1_r4p->none~write_dataarray proc~write_geo_rect_data3_rank1_r8p xml_writer_abstract%write_geo_rect_data3_rank1_R8P proc~write_geo_rect_data3_rank1_r8p->none~write_dataarray proc~write_geo_strg_data1_rank2_r4p xml_writer_abstract%write_geo_strg_data1_rank2_R4P proc~write_geo_strg_data1_rank2_r4p->none~write_dataarray proc~write_geo_strg_data1_rank2_r8p xml_writer_abstract%write_geo_strg_data1_rank2_R8P proc~write_geo_strg_data1_rank2_r8p->none~write_dataarray proc~write_geo_strg_data1_rank4_r4p xml_writer_abstract%write_geo_strg_data1_rank4_R4P proc~write_geo_strg_data1_rank4_r4p->none~write_dataarray proc~write_geo_strg_data1_rank4_r8p xml_writer_abstract%write_geo_strg_data1_rank4_R8P proc~write_geo_strg_data1_rank4_r8p->none~write_dataarray proc~write_geo_strg_data3_rank1_r4p xml_writer_abstract%write_geo_strg_data3_rank1_R4P proc~write_geo_strg_data3_rank1_r4p->none~write_dataarray proc~write_geo_strg_data3_rank1_r8p xml_writer_abstract%write_geo_strg_data3_rank1_R8P proc~write_geo_strg_data3_rank1_r8p->none~write_dataarray proc~write_geo_strg_data3_rank3_r4p xml_writer_abstract%write_geo_strg_data3_rank3_R4P proc~write_geo_strg_data3_rank3_r4p->none~write_dataarray proc~write_geo_strg_data3_rank3_r8p xml_writer_abstract%write_geo_strg_data3_rank3_R8P proc~write_geo_strg_data3_rank3_r8p->none~write_dataarray proc~write_geo_unst_data1_rank2_r4p xml_writer_abstract%write_geo_unst_data1_rank2_R4P proc~write_geo_unst_data1_rank2_r4p->none~write_dataarray proc~write_geo_unst_data1_rank2_r8p xml_writer_abstract%write_geo_unst_data1_rank2_R8P proc~write_geo_unst_data1_rank2_r8p->none~write_dataarray proc~write_geo_unst_data3_rank1_r4p xml_writer_abstract%write_geo_unst_data3_rank1_R4P proc~write_geo_unst_data3_rank1_r4p->none~write_dataarray proc~write_geo_unst_data3_rank1_r8p xml_writer_abstract%write_geo_unst_data3_rank1_R8P proc~write_geo_unst_data3_rank1_r8p->none~write_dataarray proc~write_pvts write_pvts proc~write_pvts->none~write_dataarray proc~write_slave write_slave proc~write_slave->none~write_dataarray proc~write_slave->none~write_fielddata proc~write_slave->none~write_geo proc~write_vts write_vts proc~write_vts->none~write_dataarray proc~write_vts->none~write_geo program~vtk_fortran_write_vtr vtk_fortran_write_vtr program~vtk_fortran_write_vtr->none~write_dataarray program~vtk_fortran_write_vtr->none~write_fielddata program~vtk_fortran_write_vtr->none~write_geo none~write_fielddata->proc~write_fielddata1_rank0 none~write_geo->proc~write_geo_rect_data3_rank1_r4p none~write_geo->proc~write_geo_rect_data3_rank1_r8p none~write_geo->proc~write_geo_strg_data1_rank2_r4p none~write_geo->proc~write_geo_strg_data1_rank2_r8p none~write_geo->proc~write_geo_strg_data1_rank4_r4p none~write_geo->proc~write_geo_strg_data1_rank4_r8p none~write_geo->proc~write_geo_strg_data3_rank1_r4p none~write_geo->proc~write_geo_strg_data3_rank1_r8p none~write_geo->proc~write_geo_strg_data3_rank3_r4p none~write_geo->proc~write_geo_strg_data3_rank3_r8p none~write_geo->proc~write_geo_unst_data1_rank2_r4p none~write_geo->proc~write_geo_unst_data1_rank2_r8p none~write_geo->proc~write_geo_unst_data3_rank1_r4p none~write_geo->proc~write_geo_unst_data3_rank1_r8p program~vtk_fortran_write_pvts vtk_fortran_write_pvts program~vtk_fortran_write_pvts->proc~write_pvts program~vtk_fortran_write_pvts->proc~write_vts program~vtk_fortran_write_volatile vtk_fortran_write_volatile program~vtk_fortran_write_volatile->proc~write_check program~vtk_fortran_write_volatile->proc~write_slave program~vtk_fortran_write_vtm vtk_fortran_write_vtm program~vtk_fortran_write_vtm->proc~write_data program~vtk_fortran_write_vts vtk_fortran_write_vts program~vtk_fortran_write_vts->proc~write_data~2 program~vtk_fortran_write_vtu vtk_fortran_write_vtu program~vtk_fortran_write_vtu->proc~write_data~3 program~vtk_fortran_write_vtu~2 vtk_fortran_write_vtu program~vtk_fortran_write_vtu~2->proc~write_data~4

Source Code

   function write_dataarray_location_tag(self, location, action) result(error)
   !< Write `<[/]PointData>` or `<[/]CellData>` open/close tag.
   !<
   !< @note **must** be called before saving the data related to geometric mesh, this function initializes the
   !< saving of data variables indicating the *location* (node or cell centered) of variables that will be saved.
   !<
   !< @note A single file can contain both cell and node centered variables. In this case the VTK_DAT_XML function must be
   !< called two times, before saving cell-centered variables and before saving node-centered variables.
   !<
   !<### Examples of usage
   !<
   !<#### Opening node piece
   !<```fortran
   !< error = vtk%write_dataarray('node','OPeN')
   !<```
   !<
   !<#### Closing node piece
   !<```fortran
   !< error = vtk%write_dataarray('node','Close')
   !<```
   !<
   !<#### Opening cell piece
   !<```fortran
   !< error = vtk%write_dataarray('cell','OPEN')
   !<```
   !<
   !<#### Closing cell piece
   !<```fortran
   !< error = vtk%write_dataarray('cell','close')
   !<```
   class(xml_writer_abstract), intent(inout) :: self      !< Writer.
   character(*),               intent(in)    :: location  !< Location of variables: **cell** or **node** centered.
   character(*),               intent(in)    :: action    !< Action: **open** or **close** tag.
   integer(I4P)                              :: error     !< Error status.
   type(string)                              :: location_ !< Location string.
   type(string)                              :: action_   !< Action string.

   location_ = trim(adjustl(location)) ; location_ = location_%upper()
   action_ = trim(adjustl(action)) ; action_ = action_%upper()
   select case(location_%chars())
   case('CELL')
      location_ = 'CellData'
   case('NODE')
      location_ = 'PointData'
   endselect
   select case(self%topology%chars())
   case('PRectilinearGrid', 'PStructuredGrid', 'PUnstructuredGrid')
      location_ = 'P'//location_
   endselect
   select case(action_%chars())
   case('OPEN')
      call self%write_start_tag(name=location_%chars())
   case('CLOSE')
      call self%write_end_tag(name=location_%chars())
   endselect
   error = self%error
   endfunction write_dataarray_location_tag