getheadernames Subroutine

public subroutine getheadernames(wnamei, xandwnamei, outfilehead)

Uses

  • proc~~getheadernames~~UsesGraph proc~getheadernames getheadernames module~mod_comm_lib mod_comm_lib proc~getheadernames->module~mod_comm_lib module~mod_geometry mod_geometry proc~getheadernames->module~mod_geometry module~mod_global_parameters mod_global_parameters proc~getheadernames->module~mod_global_parameters module~mod_usr_methods mod_usr_methods proc~getheadernames->module~mod_usr_methods module~mod_geometry->module~mod_comm_lib module~mod_basic_types mod_basic_types module~mod_global_parameters->module~mod_basic_types module~mod_connectivity mod_connectivity module~mod_global_parameters->module~mod_connectivity module~mod_constants mod_constants module~mod_global_parameters->module~mod_constants module~mod_physicaldata mod_physicaldata module~mod_global_parameters->module~mod_physicaldata module~mod_variables mod_variables module~mod_global_parameters->module~mod_variables mpi mpi module~mod_global_parameters->mpi module~mod_variables->module~mod_basic_types

get all variables names

Arguments

Type IntentOptional Attributes Name
character(len=name_len) :: wnamei(1:nw+nwauxio)
character(len=name_len) :: xandwnamei(1:ndim+nw+nwauxio)
character(len=1024) :: outfilehead

Calls

proc~~getheadernames~~CallsGraph proc~getheadernames getheadernames proc~mpistop mpistop proc~getheadernames->proc~mpistop mpi_abort mpi_abort proc~mpistop->mpi_abort

Called by

proc~~getheadernames~~CalledByGraph proc~getheadernames getheadernames proc~imagedatavtk_mpi ImageDataVtk_mpi proc~imagedatavtk_mpi->proc~getheadernames proc~oneblock oneblock proc~oneblock->proc~getheadernames proc~onegrid onegrid proc~onegrid->proc~getheadernames proc~output_collapsed_csv output_collapsed_csv proc~output_collapsed_csv->proc~getheadernames proc~output_collapsed_vti output_collapsed_vti proc~output_collapsed_vti->proc~getheadernames proc~punstructuredvtk_mpi punstructuredvtk_mpi proc~punstructuredvtk_mpi->proc~getheadernames proc~write_pvtu write_pvtu proc~punstructuredvtk_mpi->proc~write_pvtu proc~punstructuredvtkb_mpi punstructuredvtkB_mpi proc~punstructuredvtkb_mpi->proc~getheadernames proc~punstructuredvtkb_mpi->proc~write_pvtu proc~put_slice put_slice proc~put_slice->proc~getheadernames proc~tecplot tecplot proc~tecplot->proc~getheadernames proc~tecplot_mpi tecplot_mpi proc~tecplot_mpi->proc~getheadernames proc~unstructuredvtk unstructuredvtk proc~unstructuredvtk->proc~getheadernames proc~unstructuredvtk_mpi unstructuredvtk_mpi proc~unstructuredvtk_mpi->proc~getheadernames proc~unstructuredvtkb unstructuredvtkB proc~unstructuredvtkb->proc~getheadernames proc~unstructuredvtkb64 unstructuredvtkB64 proc~unstructuredvtkb64->proc~getheadernames proc~write_pvtu->proc~getheadernames proc~generate_plotfile generate_plotfile proc~generate_plotfile->proc~imagedatavtk_mpi proc~generate_plotfile->proc~oneblock proc~generate_plotfile->proc~onegrid proc~generate_plotfile->proc~punstructuredvtk_mpi proc~generate_plotfile->proc~punstructuredvtkb_mpi proc~generate_plotfile->proc~tecplot proc~generate_plotfile->proc~tecplot_mpi proc~generate_plotfile->proc~unstructuredvtk proc~generate_plotfile->proc~unstructuredvtk_mpi proc~generate_plotfile->proc~unstructuredvtkb proc~generate_plotfile->proc~unstructuredvtkb64 proc~put_collapse put_collapse proc~put_collapse->proc~output_collapsed_csv proc~put_collapse->proc~output_collapsed_vti proc~write_slice write_slice proc~write_slice->proc~put_slice proc~main main proc~main->proc~generate_plotfile proc~timeintegration timeintegration proc~main->proc~timeintegration proc~saveamrfile saveamrfile proc~saveamrfile->proc~generate_plotfile proc~saveamrfile->proc~write_slice proc~write_collapsed write_collapsed proc~saveamrfile->proc~write_collapsed proc~write_collapsed->proc~put_collapse proc~timeintegration->proc~saveamrfile program~agile agile program~agile->proc~main

Source Code

  subroutine getheadernames(wnamei,xandwnamei,outfilehead)
    ! this collects all variables names in the wnamei character array, getting the info from
    ! the prim_wnames/cons_wnames strings (depending on saveprim). It combines this info with names
    ! for the dimensional directions in the xandwnamei array. In the outfilehead, it collects
    ! the dimensional names, and only those names from the nw variables for output (through w_write)
    ! together with the added names for nwauxio variables
    use mod_usr_methods, only: usr_add_aux_names
    use mod_global_parameters
    use mod_geometry
    use mod_comm_lib, only: mpistop

    character(len=name_len)   :: wnamei(1:nw+nwauxio),&
       xandwnamei(1:ndim+nw+nwauxio)
    character(len=1024) :: outfilehead

    integer::  space_position,iw,ind
    character(len=name_len)::  wname
    character(len=std_len):: aux_variable_names
    character(len=std_len)::  scanstring

    logical, save:: first=.true.

    ! in case additional variables are computed and stored for output
    if (nwauxio>0) then
       if (.not. associated(usr_add_aux_names)) then
          call mpistop("usr_add_aux_names not defined")
       else
          call usr_add_aux_names(aux_variable_names)
       end if
    end if

    ! --- part to provide variable names from prim_wnames/cons_wnames strings
    if(saveprim) then
       scanstring=TRIM(aux_variable_names)
       wnamei(1:nw)=prim_wnames(1:nw)
    else
       scanstring=TRIM(aux_variable_names)
       wnamei(1:nw)=cons_wnames(1:nw)
    endif

    space_position=index(scanstring,' ')
    do iw=nw+1,nw+nwauxio
       do while (space_position==1)
         scanstring=scanstring(2:)
         space_position=index(scanstring,' ')
       enddo
       wname=scanstring(:space_position-1)
       scanstring=scanstring(space_position+1:)
       space_position=index(scanstring,' ')

       ! fill all names, even those that we will not write away from the first nw
       wnamei(iw)=TRIM(wname)
    enddo
    ! --- end of part to provide variable names

    select case (coordinate)
       case( spherical )
          xandwnamei(1)="r"; xandwnamei(2)="Theta"; xandwnamei(3)="Phi"
       case( cylindrical )
          xandwnamei(1)="R";
          
          if( phi_ == 2 )then
             xandwnamei(2)="Phi"
          else
             xandwnamei(2)="Z"
          endif
          
          if( phi_ == 2 )then
             xandwnamei(3)="Z"
          else
             xandwnamei(3)="Phi"
          endif
       case default
          xandwnamei(1)="X"; xandwnamei(2)="Y"; xandwnamei(3)="Z"
    end select

    xandwnamei(ndim+1:ndim+nw+nwauxio)=wnamei(1:nw+nwauxio)

    ! in outfilehead, collect the dimensional names, and all output variable names
    ! first all dimensions
    write(outfilehead,'(a)') TRIM(xandwnamei(1))
    
    do iw=2,ndim
       wname=xandwnamei(iw)
    write(outfilehead,'(a)')outfilehead(1:len_trim(outfilehead))//" "//TRIM(&
       wname)
    enddo
   
    ! then all nw variables, with w_write control for inclusion
    do iw=ndim+1,ndim+nw
       wname=xandwnamei(iw)
       if(w_write(iw-ndim)) then
    write(outfilehead,'(a)')outfilehead(1:len_trim(outfilehead))//" "//TRIM(&
       wname)
       endif
    enddo
    ! then all nwauxio variables
    if(nwauxio>0) then
      do iw=ndim+nw+1,ndim+nw+nwauxio
         wname=xandwnamei(iw)
    write(outfilehead,'(a)')outfilehead(1:len_trim(outfilehead))//" "//TRIM(&
       wname)
      enddo
    endif

    if(first.and.mype==0)then
      print*,'-------------------------------------------------------------------------------'
      write(unitterm,*&
         )'Saving visual data. Coordinate directions and variable names are:'
      ind=0
      do iw=1,ndim
        ind=ind+1
        print *,ind,xandwnamei(iw)
      enddo
      do iw=1+ndim,nw+ndim
        if(w_write(iw-ndim)) then
          ind=ind+1
          write(*,*) ind,wnamei(iw-ndim)
        end if
      end do
      do iw=ndim+nw+1,ndim+nw+nwauxio
        ind=ind+1
        print *,ind,wnamei(iw-ndim)
      enddo
      write(unitterm,*)'time =', global_time
      print*,'-------------------------------------------------------------------------------'
      first=.false.
    endif

  end subroutine getheadernames