Unittest_MEDsupportMesh_2.f

Aller à la documentation de ce fichier.
00001 C*  This file is part of MED.
00002 C*
00003 C*  COPYRIGHT (C) 1999 - 2015  EDF R&D, CEA/DEN
00004 C*  MED is free software: you can redistribute it and/or modify
00005 C*  it under the terms of the GNU Lesser General Public License as published by
00006 C*  the Free Software Foundation, either version 3 of the License, or
00007 C*  (at your option) any later version.
00008 C*
00009 C*  MED is distributed in the hope that it will be useful,
00010 C*  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 C*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 C*  GNU Lesser General Public License for more details.
00013 C*
00014 C*  You should have received a copy of the GNU Lesser General Public License
00015 C*  along with MED.  If not, see <http://www.gnu.org/licenses/>.
00016 C*
00017 
00018 C******************************************************************************
00019 C * Tests for support mesh module
00020 C *
00021 C *****************************************************************************
00022       program MEDsupportMesh2
00023 C     
00024       implicit none
00025       include 'med.hf'
00026 C
00027 C     
00028       integer cret
00029       integer fid
00030       character*64  fname
00031       parameter (fname = "Unittest_MEDsupportMesh_1.med")
00032       character*64 smname1
00033       integer sdim1,mdim1
00034       parameter (sdim1=2, mdim1=2)
00035       integer sdim2,mdim2
00036       parameter (sdim2=3,mdim2=2)
00037       parameter (smname1 = "supportMesh1")
00038       character*64 smname2
00039       parameter (smname2 = "supportMesh2")
00040       character*200 description1
00041       parameter (description1="support mesh1 description")
00042       character*200 description2
00043       parameter (description2="support mesh2 description")
00044       character*16 nomcoo2D(2)
00045       character*16 unicoo2D(2)
00046       data  nomcoo2D /"x","y"/, unicoo2D /"cm","cm"/
00047       character*16 nomcoo3D(3)
00048       character*16 unicoo3D(3)
00049       data  nomcoo3D /"x","y","z"/, unicoo3D /"cm","cm","cm"/
00050       integer atype1, atype2
00051       parameter (atype1=MED_CARTESIAN, atype2=MED_CARTESIAN)
00052       integer nsmesh, i
00053       character*64  smname
00054       character*16 aunit(3), aname(3)
00055       character*200 description
00056       integer sdim, mdim, atype
00057 C
00058 C
00059 C     open file in read only access mode
00060       call mfiope(fid,fname,MED_ACC_RDONLY,cret)
00061       print *,'Open file in RD_ONLY access mode',cret
00062       if (cret .ne. 0 ) then
00063          print *,'ERROR : open file in READ_ONLY access mode'
00064          call efexit(-1)
00065       endif  
00066 C
00067 C     Read number of axis by name
00068 C
00069       call  msmnan(fid,smname1,sdim,cret)
00070       print *,'Number of axis (by name) : ',sdim
00071       if (cret .ne. 0 ) then
00072          print *,'ERROR : read number of axis (by name)'
00073          call efexit(-1)
00074       endif  
00075       if (sdim .ne. sdim1) then
00076          print *,'ERROR : number of axis (by name)'
00077          call efexit(-1)         
00078       endif
00079 
00080       call  msmnan(fid,smname2,sdim,cret)
00081       print *,'Number of axis (by name) : ',sdim
00082       if (cret .ne. 0 ) then
00083          print *,'ERROR : read number of axis (by name)'
00084          call efexit(-1)
00085       endif  
00086       if (sdim .ne. sdim2) then
00087          print *,'ERROR : number of axis (by name)'
00088          call efexit(-1)         
00089       endif
00090 C
00091 C     Read support mesh information by name
00092 C
00093       call  msmsni(fid,smname1,sdim,mdim, 
00094      &             description,atype, 
00095      &             aname, aunit, cret)
00096       print *,'Support mesh information by name',cret
00097       if (cret .ne. 0 ) then
00098          print *,'ERROR : read support mesh information by name'
00099          call efexit(-1)
00100       endif  
00101       if ((sdim .ne. sdim1) .or.
00102      &    (mdim .ne. mdim1) .or.
00103      &    (description .ne. description1) .or.
00104      &    (atype .ne. atype1) .or.
00105      &    (aunit(1) .ne. unicoo2D(1)) .or.
00106      &    (aunit(2) .ne. unicoo2D(2)) .or.
00107      &    (aname(1) .ne. nomcoo2D(1)) .or.
00108      &    (aname(2) .ne. nomcoo2D(2))
00109      & ) then
00110          print *,'ERROR : support mesh information by name'
00111          call efexit(-1)
00112       endif  
00113 C
00114 C
00115 C
00116       call  msmsni(fid,smname2,sdim,mdim, 
00117      &             description,atype, 
00118      &             aname, aunit, cret)
00119       print *,'Support mesh information by name',cret
00120       if (cret .ne. 0 ) then
00121          print *,'ERROR : read support mesh information by name'
00122          call efexit(-1)
00123       endif  
00124       if ((sdim .ne. sdim2) .or.
00125      &    (mdim .ne. mdim2) .or.
00126      &    (description .ne. description2) .or.
00127      &    (atype .ne. atype2) .or.
00128      &    (aunit(1) .ne. unicoo3D(1)) .or.
00129      &    (aunit(2) .ne. unicoo3D(2)) .or.
00130      &    (aunit(3) .ne. unicoo3D(3)) .or.
00131      &    (aname(1) .ne. nomcoo3D(1)) .or.
00132      &    (aname(2) .ne. nomcoo3D(2)) .or.
00133      &    (aname(3) .ne. nomcoo3D(3))
00134      & ) then
00135          print *,'ERROR : support mesh information by name'
00136          call efexit(-1)
00137       endif  
00138 C
00139 C
00140 C     close file
00141       call mficlo(fid,cret)
00142       print *,'Close file',cret
00143       if (cret .ne. 0 ) then
00144          print *,'ERROR :  close file'
00145          call efexit(-1)
00146       endif
00147 C
00148 C
00149 C
00150       end
00151 

Généré le Thu Oct 8 14:26:17 2015 pour MED fichier par  doxygen 1.6.1