f/test14.f

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     * - Nom du fichier : test14.f
00020 C     *
00021 C     * - Description : ecriture des noeuds d'un maillage MED
00022 C     *                 a l'aide des routines de niveau 2
00023 C     *                 MED - equivalent a test4.f
00024 C     *
00025 C     ******************************************************************************
00026       program test14           
00027 C     
00028       implicit none             
00029       include 'med.hf'
00030 C      
00031       integer cret, fid
00032 C     ** la dimension du maillage **
00033       integer mdim,sdim
00034 C     ** nom du maillage de longueur maxi MED_TAILLE_NOM ** 
00035       character*64 maa
00036 C     ** le nombre de noeuds **
00037       integer   nnoe
00038       parameter (mdim=2,maa="maa1",nnoe=4,sdim=2)
00039 C     ** table des coordonnees  
00040       real*8 coo(mdim*nnoe)
00041 C     ** tables des noms et des unites des coordonnees 
00042       character*16 nomcoo(mdim), unicoo(mdim) 
00043 C     ** tables des noms, numeros, numeros de familles des noeuds
00044 C     autant d'elements que de noeuds - les noms ont pout longueur
00045 C     MED_TAILLE_PNOM : 8  **
00046       character*16 nomnoe(nnoe)
00047       integer numnoe(nnoe), nufano(nnoe)
00048       real*8 dt
00049       parameter(dt=0.0)
00050 
00051       data   coo /0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0/
00052       data   nomcoo /"x","y"/, unicoo /"cm","cm"/
00053       data   nomnoe /"nom1","nom2","nom3","nom4"/
00054       data   numnoe /1,2,3,4/,nufano /0,1,2,2/
00055       
00056 C  ** Creation du fichier test14.med  **
00057       call mfiope(fid,'test14.med',MED_ACC_RDWR, cret)
00058       print *,cret
00059       if (cret .ne. 0 ) then
00060          print *,'Erreur creation du fichier'
00061          call efexit(-1)
00062       endif      
00063 
00064 C     ** Creation du maillage  **
00065       call mmhcre(fid,maa,mdim,sdim,MED_UNSTRUCTURED_MESH,
00066      &     'un maillage pour test14',"",MED_SORT_DTIT,
00067      &     MED_CARTESIAN,nomcoo,unicoo,cret) 
00068       print *,cret  
00069       if (cret .ne. 0 ) then
00070          print *,'Erreur creation du maillage'
00071          call efexit(-1)
00072       endif      
00073       
00074 C     ** Ecriture des noeuds d'un maillage MED : 
00075 C     - Des coordonnees en mode MED_FULL_INTERLACE : (X1,Y1,X2,Y2,X3,Y3,...) 
00076 C     dans un repere cartesien 
00077 C     - Des noms (optionnel dans un fichier MED) 
00078 C     - Des numeros (optionnel dans un fichier MED) 
00079 C     - Des numeros de familles des noeuds **     
00080       call mmhnow(fid,maa,MED_NO_DT,MED_NO_IT,dt,MED_FULL_INTERLACE, 
00081      &            nnoe,coo,MED_TRUE,nomnoe,MED_TRUE,numnoe,
00082      &            MED_TRUE,nufano,cret)    
00083       print *,cret
00084       if (cret .ne. 0 ) then
00085          print *,'Erreur ecriture des noeuds'
00086          call efexit(-1)
00087       endif      
00088       
00089 C     ** Fermeture du fichier **
00090       call mficlo(fid,cret)
00091       print *,cret
00092       if (cret .ne. 0 ) then
00093          print *,'Erreur fermeture du fichier'
00094          call efexit(-1)
00095       endif      
00096 C
00097       end 
00098         
00099 
00100 

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