00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 program UsesCase_MEDmesh_2
00025
00026 implicit none
00027 include 'med.hf90'
00028
00029 integer cret
00030 integer fid, nmesh, it, naxis
00031 character(64) :: mname = "2D unstructured mesh"
00032 character(200) :: desc
00033 character(16) :: dtunit
00034 integer nstep, mdim, sdim, stype, mtype, atype
00035 character(16), dimension(:), allocatable :: aname
00036 character(16), dimension (:), allocatable :: aunit
00037 real*8, dimension(:), allocatable :: ncoord
00038 integer coocha, geotra, nnodes, ntria3, nquad4
00039 integer, dimension(:), allocatable :: tricon
00040 integer, dimension(:), allocatable :: quacon
00041
00042
00043 call mfiope(fid,'UsesCase_MEDmesh_1.med',MED_ACC_RDONLY, cret)
00044 if (cret .ne. 0 ) then
00045 print *,'ERROR : open file'
00046 call efexit(-1)
00047 endif
00048
00049
00050
00051
00052
00053 call mmhnan(fid,mname,naxis,cret)
00054 if (cret .ne. 0 ) then
00055 print *,'Read number of axis in the mesh'
00056 call efexit(-1)
00057 endif
00058 print *,'Number of axis in the mesh = ',naxis
00059
00060
00061 allocate ( aname(naxis), aunit(naxis) ,STAT=cret )
00062 if (cret > 0) then
00063 print *,'Memory allocation'
00064 call efexit(-1)
00065 endif
00066
00067 call mmhmin(fid, mname, sdim, mdim, mtype, desc, dtunit, stype, nstep, atype, aname, aunit, cret)
00068 if (cret .ne. 0 ) then
00069 print *,'Read mesh informations'
00070 call efexit(-1)
00071 endif
00072 print *,"mesh name =", mname
00073 print *,"space dim =", sdim
00074 print *,"mesh dim =", mdim
00075 print *,"mesh type =", mtype
00076 print *,"mesh description =", desc
00077 print *,"dt unit = ", dtunit
00078 print *,"sorting type =", stype
00079 print *,"number of computing step =", nstep
00080 print *,"coordinates axis type =", atype
00081 print *,"coordinates axis name =", aname
00082 print *,"coordinates axis units =", aunit
00083 deallocate(aname, aunit)
00084
00085
00086 call mmhnme(fid,mname,MED_NO_DT,MED_NO_IT,MED_NODE,MED_NO_GEOTYPE,MED_COORDINATE,MED_NO_CMODE,coocha,geotra,nnodes,cret)
00087 if (cret .ne. 0 ) then
00088 print *,'Read how many nodes in the mesh'
00089 call efexit(-1)
00090 endif
00091 print *,"number of nodes in the mesh =", nnodes
00092
00093
00094
00095
00096
00097 call mmhnme(fid,mname,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,MED_CONNECTIVITY,MED_NODAL,coocha,geotra,ntria3,cret)
00098 if (cret .ne. 0 ) then
00099 print *,'Read how many nodes in the mesh'
00100 call efexit(-1)
00101 endif
00102 print *,"number of triangular cells in the mesh =", ntria3
00103
00104
00105 call mmhnme(fid,mname,MED_NO_DT,MED_NO_IT,MED_CELL,MED_QUAD4,MED_CONNECTIVITY,MED_NODAL,coocha,geotra,nquad4,cret)
00106 if (cret .ne. 0 ) then
00107 print *,'Read how many nodes in the mesh'
00108 call efexit(-1)
00109 endif
00110 print *,"number of quadrangular cells in the mesh =", nquad4
00111
00112
00113 allocate (ncoord(nnodes*2),STAT=cret)
00114 if (cret > 0) then
00115 print *,'Memory allocation'
00116 call efexit(-1)
00117 endif
00118
00119 call mmhcor(fid,mname,MED_NO_DT,MED_NO_IT,MED_FULL_INTERLACE,ncoord,cret)
00120 if (cret .ne. 0 ) then
00121 print *,'Nodes coordinates'
00122 call efexit(-1)
00123 endif
00124 print *,"Nodes coordinates =", ncoord
00125 deallocate(ncoord)
00126
00127
00128 allocate ( tricon(ntria3 * 3) ,STAT=cret )
00129 if (cret > 0) then
00130 print *,'Memory allocation'
00131 call efexit(-1)
00132 endif
00133
00134 call mmhcyr(fid,mname,MED_NO_DT,MED_NO_IT,MED_CELL,MED_TRIA3,MED_NODAL,MED_FULL_INTERLACE,tricon,cret)
00135 if (cret .ne. 0 ) then
00136 print *,'MED_TRIA3 connectivity'
00137 call efexit(-1)
00138 endif
00139 print *,"MED_TRIA3 connectivity =", tricon
00140 deallocate(tricon)
00141
00142 allocate ( quacon(nquad4*4) ,STAT=cret )
00143 if (cret > 0) then
00144 print *,'Memory allocation'
00145 call efexit(-1)
00146 endif
00147
00148 call mmhcyr(fid,mname,MED_NO_DT,MED_NO_IT,MED_CELL,MED_QUAD4,MED_NODAL,MED_FULL_INTERLACE,quacon,cret)
00149 if (cret .ne. 0 ) then
00150 print *,'MED_QUAD4 connectivity'
00151 call efexit(-1)
00152 endif
00153 print *,"MED_QUAD4 connectivity =", quacon
00154 deallocate(quacon)
00155
00156
00157
00158
00159 call mficlo(fid,cret)
00160 if (cret .ne. 0 ) then
00161 print *,'ERROR : close file'
00162 call efexit(-1)
00163 endif
00164
00165 end program UsesCase_MEDmesh_2
00166