dump_tem_global Subroutine

public subroutine dump_tem_global(me, root_only)

A routine to dump global informations into the mesh header in lua format

Provide a version string, for the file format

Arguments

Type IntentOptional Attributes Name
type(tem_global_type), intent(in) :: me

global type to be dumped

logical, intent(in), optional :: root_only

root dump global mesh when true and all process dump its own mesh when false


Calls

proc~~dump_tem_global~~CallsGraph proc~dump_tem_global dump_tem_global aot_out_close aot_out_close proc~dump_tem_global->aot_out_close aot_out_close_table aot_out_close_table proc~dump_tem_global->aot_out_close_table aot_out_open aot_out_open proc~dump_tem_global->aot_out_open aot_out_open_table aot_out_open_table proc~dump_tem_global->aot_out_open_table aot_out_val aot_out_val proc~dump_tem_global->aot_out_val proc~dump_tem_prophead dump_tem_prophead proc~dump_tem_global->proc~dump_tem_prophead proc~dump_tem_prophead->aot_out_close_table proc~dump_tem_prophead->aot_out_open_table proc~dump_tem_prophead->aot_out_val

Called by

proc~~dump_tem_global~~CalledByGraph proc~dump_tem_global dump_tem_global proc~dump_treelmesh dump_treelmesh proc~dump_treelmesh->proc~dump_tem_global proc~tem_adapt_dump_newmesh tem_adapt_dump_newMesh proc~tem_adapt_dump_newmesh->proc~dump_treelmesh proc~tem_dump_subtree tem_dump_subTree proc~tem_dump_subtree->proc~dump_treelmesh proc~tem_restart_openwrite tem_restart_openWrite proc~tem_restart_openwrite->proc~dump_treelmesh proc~tem_restart_openwrite->proc~tem_dump_subtree proc~hvs_output_init hvs_output_init proc~hvs_output_init->proc~tem_dump_subtree proc~hvs_output_open hvs_output_open proc~hvs_output_open->proc~tem_restart_openwrite proc~tem_write_debugmesh tem_write_debugMesh proc~tem_write_debugmesh->proc~tem_dump_subtree proc~tem_init_tracker tem_init_tracker proc~tem_init_tracker->proc~hvs_output_init proc~tem_tracker tem_tracker proc~tem_tracker->proc~hvs_output_open

Source Code

  subroutine dump_tem_global( me, root_only)
    ! -------------------------------------------------------------------- !
    !> global type to be dumped
    type(tem_global_type), intent(in) :: me
    !> root dump global mesh when true and
    !! all process dump its own mesh when false
    logical, intent(in), optional :: root_only
    ! -------------------------------------------------------------------- !
    character(len=300) :: headname
    integer :: version
    integer :: i
    type(aot_out_type) :: conf ! aotus lua state to write output
    integer :: locroot
    logical :: root_out
    ! -------------------------------------------------------------------- !
    if(present(root_only)) then
      root_out = root_only
    else
      root_out = .true.
    endif

    if (root_out) then
      locroot = 0
    else
      locroot = me%myPart
    end if

    version = 1 !! Provide a version string, for the file format
    headname = trim(me%dirname)//'header.lua'

    if (me%mypart == locroot) then
      ! Write the header only on the root process
      ! open up the mesh header lua file to dump the stuff using aotus library
      call aot_out_open( conf, headname )
      !write header version
      call aot_out_val( put_conf = conf,      &
        &               vname    = 'version', &
        &               val      = version    )
      !write mesh label/name
      call aot_out_val( put_conf = conf,     &
        &               vname    = 'label',  &
        &               val = trim(me%label) )
      !comments about the mesh
      call aot_out_val( put_conf = conf,            &
        &               vname    = 'comment',       &
        &               val      = trim(me%comment) )
      !write bounding box information in tha table
      call aot_out_open_table( conf, 'boundingbox' )
      !create another table for origin
      call aot_out_open_table( conf, 'origin' )
      !write three values of origin
      do i = 1,3
        call aot_out_val( conf, me%Origin(i) )
      end do
      call aot_out_close_table(conf)
      !write bounding box length
      call aot_out_val( put_conf = conf,                 &
        &               vname    = 'length',             &
        &               val      = me%BoundingCubeLength )
      call aot_out_close_table(conf)
      call aot_out_val( put_conf = conf,     &
        &               vname    = 'nElems', &
        &               val      = me%nElems )
      call aot_out_val( put_conf = conf,       &
        &               vname    = 'minLevel', &
        &               val      = me%minLevel )
      call aot_out_val( put_conf = conf,       &
        &               vname    = 'maxLevel', &
        &               val      = me%maxLevel )
      call aot_out_val( put_conf = conf,          &
        &               vname    = 'nProperties', &
        &               val      = me%nProperties )

      ! write effective boundary
      call aot_out_open_table( conf, 'effBoundingbox' )
      !create another table for origin
      call aot_out_open_table( conf, 'origin' )
      !write three values of origin
      do i = 1,3
        call aot_out_val( conf, me%effOrigin(i) )
      end do
      call aot_out_close_table(conf) ! close origin table
      !create another table for origin
      call aot_out_open_table( conf, 'effLength' )
      !write three values of origin
      do i = 1,3
        call aot_out_val( conf, me%effLength(i) )
      end do
      call aot_out_close_table(conf) ! close length table
      call aot_out_close_table(conf) ! close effBoundingBox table

      ! dump property head
      call dump_tem_prophead( me     = me%Property, &
        &                     conf   = conf         )

      ! close the mesh header file
      call aot_out_close(conf)
    end if

  end subroutine dump_tem_global