@@ -31,11 +31,13 @@ module part_decompose_mesh_hdf5
3131 use constants, only: MAX_STRING_LEN,NGNOD2D_FOUR_CORNERS,NGNOD_EIGHT_CORNERS
3232
3333#ifdef USE_HDF5
34-
3534 use manager_hdf5
35+ #endif
3636
3737 implicit none
3838
39+ #ifdef USE_HDF5
40+
3941contains
4042 !- -------------------------------------------------
4143 ! Write nodes (their coordinates) pertaining to iproc partition in the corresponding Database
@@ -135,11 +137,11 @@ subroutine write_material_props_database_h5(count_def_mat, &
135137 ! name for material data group
136138 character (len= 14 ), parameter :: gname_material = " material_props" ! Group name for material properties
137139 ! for attribute count_def_mat and count_undef_mat
138- character (len= 13 ) :: m_aname = " count_def_mat"
139- character (len= 15 ) :: u_aname = " count_undef_mat"
140+ character (len= 13 ), parameter :: m_aname = " count_def_mat"
141+ character (len= 15 ), parameter :: u_aname = " count_undef_mat"
140142 ! for dataset mat_prop, undef_mat_prop
141- character (len= 40 ) :: mdsetname = " mat_prop"
142- character (len= 40 ) :: udsetname = " undef_mat_prop"
143+ character (len= 40 ), parameter :: mdsetname = " mat_prop"
144+ character (len= 40 ), parameter :: udsetname = " undef_mat_prop"
143145
144146 ! prepare groups in hdf5 file
145147 ! material data group
@@ -618,7 +620,10 @@ subroutine write_partition_database_h5(iproc, nspec, elmnts, &
618620 ! for ispec_local
619621 integer , dimension (:), allocatable :: ispec_local
620622
621- integer :: o = 0
623+ integer :: off
624+
625+ ! initializes
626+ off = 0
622627
623628 if (num_phase == 1 ) then
624629 ! counts number of spectral elements in this partition
@@ -640,7 +645,7 @@ subroutine write_partition_database_h5(iproc, nspec, elmnts, &
640645 allocate (ispec_local(offset_nelems(iproc)))
641646
642647 ! node id offset
643- o = sum (offset_nnodes(0 :iproc-1 ))
648+ off = sum (offset_nnodes(0 :iproc-1 ))
644649
645650 ! prepare a temporal array to be recorded in hdf5
646651 ! element corner indices
@@ -665,26 +670,26 @@ subroutine write_partition_database_h5(iproc, nspec, elmnts, &
665670 ! elm_conn_xdmf
666671 if (NGNOD == 8 ) then
667672 elm_conn_xdmf(1 ,count) = 9 ! cell type id xdmf
668- elm_conn_xdmf(2 ,count) = loc_nodes(0 )+ o ! +1 elm id starts 0
669- elm_conn_xdmf(3 ,count) = loc_nodes(1 )+ o
670- elm_conn_xdmf(4 ,count) = loc_nodes(2 )+ o
671- elm_conn_xdmf(5 ,count) = loc_nodes(3 )+ o
672- elm_conn_xdmf(6 ,count) = loc_nodes(4 )+ o
673- elm_conn_xdmf(7 ,count) = loc_nodes(5 )+ o
674- elm_conn_xdmf(8 ,count) = loc_nodes(6 )+ o
675- elm_conn_xdmf(9 ,count) = loc_nodes(7 )+ o
673+ elm_conn_xdmf(2 ,count) = loc_nodes(0 )+ off ! +1 elm id starts 0
674+ elm_conn_xdmf(3 ,count) = loc_nodes(1 )+ off
675+ elm_conn_xdmf(4 ,count) = loc_nodes(2 )+ off
676+ elm_conn_xdmf(5 ,count) = loc_nodes(3 )+ off
677+ elm_conn_xdmf(6 ,count) = loc_nodes(4 )+ off
678+ elm_conn_xdmf(7 ,count) = loc_nodes(5 )+ off
679+ elm_conn_xdmf(8 ,count) = loc_nodes(6 )+ off
680+ elm_conn_xdmf(9 ,count) = loc_nodes(7 )+ off
676681 else ! NGNOD = 27
677682 ! NGNOD = 27 array will not be used, only the 8 corner nodes
678683 ! are necessary for checkmesh visualization
679684 elm_conn_xdmf(1 ,count) = 9 ! 50 ! cell type id xdmf
680- elm_conn_xdmf(2 ,count) = loc_nodes(0 )+ o
681- elm_conn_xdmf(3 ,count) = loc_nodes(1 )+ o
682- elm_conn_xdmf(4 ,count) = loc_nodes(2 )+ o
683- elm_conn_xdmf(5 ,count) = loc_nodes(3 )+ o
684- elm_conn_xdmf(6 ,count) = loc_nodes(4 )+ o
685- elm_conn_xdmf(7 ,count) = loc_nodes(5 )+ o
686- elm_conn_xdmf(8 ,count) = loc_nodes(6 )+ o
687- elm_conn_xdmf(9 ,count) = loc_nodes(7 )+ o
685+ elm_conn_xdmf(2 ,count) = loc_nodes(0 )+ off
686+ elm_conn_xdmf(3 ,count) = loc_nodes(1 )+ off
687+ elm_conn_xdmf(4 ,count) = loc_nodes(2 )+ off
688+ elm_conn_xdmf(5 ,count) = loc_nodes(3 )+ off
689+ elm_conn_xdmf(6 ,count) = loc_nodes(4 )+ off
690+ elm_conn_xdmf(7 ,count) = loc_nodes(5 )+ off
691+ elm_conn_xdmf(8 ,count) = loc_nodes(6 )+ off
692+ elm_conn_xdmf(9 ,count) = loc_nodes(7 )+ off
688693! elm_conn_xdmf(10,count) = loc_nodes(8)
689694! elm_conn_xdmf(11,count) = loc_nodes(9)
690695! elm_conn_xdmf(12,count) = loc_nodes(10)
@@ -985,7 +990,7 @@ subroutine write_moho_surface_database_h5(iproc, nspec, &
985990 integer :: loc_nspec2D_moho
986991
987992 ! for loc_nspec_2d_homo attribute
988- character (len= 8 ) :: aname = " loc_moho"
993+ character (len= 8 ), parameter :: aname = " loc_moho"
989994 integer , dimension (2 ) :: moho_attr
990995
991996 ! homo_elements dataset
0 commit comments