31 character(MED_NAME_SIZE) :: mname =
"2D unstructured mesh" 33 character(MED_COMMENT_SIZE) :: mdesc
42 character(MED_SNAME_SIZE),
dimension(:),
allocatable :: aname
43 character(MED_SNAME_SIZE),
dimension(:),
allocatable :: aunit
44 character(MED_SNAME_SIZE) :: dtunit =
"" 46 real*8,
dimension(:),
allocatable :: coords
48 integer,
dimension(:),
allocatable :: tricon
50 integer,
dimension(:),
allocatable :: quacon
54 integer coocha, geotra
61 character(MED_NAME_SIZE) :: profna =
"" 67 call mfiope(fid,
"UsesCase_MEDmesh_6.med", med_acc_rdonly, cret)
68 if (cret .ne. 0 )
then 69 print *,
"ERROR : open file" 77 allocate ( aname(2), aunit(2) ,stat=cret )
79 print *,
"ERROR : memory allocation" 83 call mmhmin(fid, mname, sdim, mdim, mtype, mdesc, dtunit, stype, nstep, atype, aname, aunit, cret)
84 if (cret .ne. 0 )
then 85 print *,
"ERROR : read mesh informations" 88 print *,
"mesh name =", mname
89 print *,
"space dim =", sdim
90 print *,
"mesh dim =", mdim
91 print *,
"mesh type =", mtype
92 print *,
"mesh description =", mdesc
93 print *,
"dt unit = ", dtunit
94 print *,
"sorting type =", stype
95 print *,
"number of computing step =", nstep
96 print *,
"coordinates axis type =", atype
97 print *,
"coordinates axis name =", aname
98 print *,
"coordinates axis units =", aunit
99 deallocate(aname, aunit)
102 call mmhnme(fid, mname, med_no_dt, med_no_it, med_node, med_no_geotype, &
103 med_coordinate, med_no_cmode, coocha, geotra, nnodes, cret)
104 if (cret .ne. 0 )
then 105 print *,
"ERROR : read how many nodes in the mesh" 108 print *,
"number of nodes in the mesh =", nnodes
114 call mmhnme(fid, mname, med_no_dt, med_no_it, med_cell, med_tria3, med_connectivity, &
115 med_nodal, coocha, geotra, ntria3, cret)
116 if (cret .ne. 0 )
then 117 print *,
"ERROR : read how many nodes in the mesh" 120 print *,
"number of triangular cells in the mesh =", ntria3
123 call mmhnme(fid, mname, med_no_dt, med_no_it, med_cell, med_quad4, med_connectivity, &
124 med_nodal, coocha, geotra, nquad4, cret)
125 if (cret .ne. 0 )
then 126 print *,
"ERROR : read how many nodes in the mesh" 129 print *,
"number of quadrangular cells in the mesh =", nquad4
132 allocate (coords(nnodes*2),stat=cret)
134 print *,
"ERROR : memory allocation" 138 call mmhcor(fid, mname, med_no_dt, med_no_it, med_full_interlace, coords, cret)
139 if (cret .ne. 0 )
then 140 print *,
"ERROR : nodes coordinates" 143 print *,
"Nodes coordinates =", coords
147 allocate ( tricon(ntria3 * 3) ,stat=cret )
149 print *,
"ERROR : memory allocation" 153 call mmhcyr(fid, mname, med_no_dt, med_no_it, med_cell, med_tria3, &
154 med_nodal,med_full_interlace,tricon,cret)
155 if (cret .ne. 0 )
then 156 print *,
"ERROR : MED_TRIA3 connectivity" 159 print *,
"MED_TRIA3 connectivity =", tricon
162 allocate ( quacon(nquad4*4) ,stat=cret )
164 print *,
"ERROR : memory allocation" 168 call mmhcyr(fid, mname, med_no_dt, med_no_it, med_cell, med_quad4, &
169 med_nodal, med_full_interlace, quacon, cret)
170 if (cret .ne. 0 )
then 171 print *,
"ERROR : MED_QUAD4 connectivity" 174 print *,
"MED_QUAD4 connectivity =", quacon
182 call mmhcsi(fid, mname, it+1, numdt, numit, dt, cret)
183 if (cret .ne. 0 )
then 184 print *,
"ERROR : computing step info" 187 print *,
"numdt =", numdt
188 print *,
"numit =", numit
192 call mmhnep(fid, mname, numdt, numit, med_node, med_no_geotype, &
193 med_coordinate, med_no_cmode, med_global_stmode, &
194 profna, profsz, coocha, geotra, nnodes, cret)
195 if (cret .ne. 0 )
then 196 print *,
"ERROR : nodes coordinates" 199 print *,
"profna = ", profna
200 print *,
"coocha =", coocha
203 if (coocha == 1)
then 205 allocate (coords(nnodes*2),stat=cret)
207 print *,
"ERROR : memory allocation" 211 call mmhcpr(fid, mname, numdt, numit,med_global_stmode,profna, &
212 med_full_interlace,med_all_constituent, coords, cret)
213 if (cret .ne. 0 )
then 214 print *,
"ERROR : nodes coordinates" 217 print *,
"Nodes coordinates =", coords
226 if (cret .ne. 0 )
then 227 print *,
"ERROR : close file" subroutine mmhcpr(fid, name, numdt, numit, stm, pname, swm, dim, coo, cret)
program usescase_medmesh_7
subroutine mmhmin(fid, name, sdim, mdim, mtype, desc, dtunit, stype, nstep, atype, aname, aunit, cret)
subroutine mmhcyr(fid, name, numdt, numit, entype, geotype, cmode, swm, con, cret)
subroutine mfiope(fid, name, access, cret)
subroutine mmhcor(fid, name, numdt, numit, swm, coo, cret)
subroutine mmhcsi(fid, name, csit, numdt, numit, dt, cret)
subroutine mmhnep(fid, name, numdt, numit, entype, geotype, datype, cmode, stmode, pname, psize, chgt, tsf, n, cret)
subroutine mmhnme(fid, name, numdt, numit, entype, geotype, datype, cmode, chgt, tsf, n, cret)
subroutine mficlo(fid, cret)