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