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_1
00025
00026 implicit none
00027 include 'med.hf'
00028
00029
00030 integer cret
00031 integer fid
00032 integer sdim, mdim, stype, mtype, atype, nnode
00033 character*200 cmt1,mdesc
00034 character*64 fname
00035 character*64 mname
00036 character*16 nomcoo(2)
00037 character*16 unicoo(2)
00038 character*16 dtunit
00039 real*8 dt
00040 parameter (fname = "UsesCase_MEDmesh_1.med")
00041 parameter (mdesc = "A 2D unstructured mesh")
00042 parameter (cmt1 = "A 2D unstructured mesh : 15 nodes, 12 cells")
00043 parameter (mname = "2D unstructured mesh")
00044 parameter (sdim = 2, mdim = 2, nnode=15)
00045 parameter (stype=MED_SORT_DTIT, mtype=MED_UNSTRUCTURED_MESH)
00046 parameter (atype=MED_CARTESIAN)
00047 parameter (dt=0.0)
00048 data dtunit /""/
00049 data nomcoo /"x ","y "/
00050 data unicoo /"cm ","cm "/
00051 real*8 coo(30)
00052 data coo /2.,1.,7.,1.,12.,1.,17.,1.,22.,1.,
00053 & 2.,6., 7.,6., 12.,6., 17.,6., 22.,6.,
00054 & 2.,11., 7.,11., 12.,11., 17.,11., 22.,11./
00055
00056
00057
00058 call mfiope(fid,fname,MED_ACC_CREAT,cret)
00059 print *,cret
00060 print *,fid
00061 if (cret .ne. 0 ) then
00062 print *,'ERROR : file creation'
00063 call efexit(-1)
00064 endif
00065
00066
00067
00068 call mficow(fid,cmt1,cret)
00069 print *,cret
00070 if (cret .ne. 0 ) then
00071 print *,'ERROR : write file description'
00072 call efexit(-1)
00073 endif
00074
00075
00076
00077 call mmhcre(fid, mname, sdim, mdim, mtype,mdesc,
00078 & dtunit, stype, atype, nomcoo, unicoo, cret)
00079 print *,cret
00080 if (cret .ne. 0 ) then
00081 print *,'ERROR : mesh creation'
00082 call efexit(-1)
00083 endif
00084
00085
00086
00087 call mmhcow(fid,mname,MED_NO_DT,MED_NO_IT,dt,
00088 & MED_FULL_INTERLACE,nnode,coo,cret)
00089 print *,cret
00090 if (cret .ne. 0 ) then
00091 print *,'ERROR : write nodes coordinates description'
00092 call efexit(-1)
00093 endif
00094
00095
00096
00097 call mficlo(fid,cret)
00098 print *,cret
00099 if (cret .ne. 0 ) then
00100 print *,'ERROR : close file'
00101 call efexit(-1)
00102 endif
00103
00104
00105
00106 end
00107