MED fichier: Fichier source de Unittest_MEDprofile_1.f

MED fichier

- Documentation MED
- Guides d'utilisation
- Guides de référence

Unittest_MEDprofile_1.f
Aller à la documentation de ce fichier.
1 C* This file is part of MED.
2 C*
3 C* COPYRIGHT (C) 1999 - 2017 EDF R&D, CEA/DEN
4 C* MED is free software: you can redistribute it and/or modify
5 C* it under the terms of the GNU Lesser General Public License as published by
6 C* the Free Software Foundation, either version 3 of the License, or
7 C* (at your option) any later version.
8 C*
9 C* MED is distributed in the hope that it will be useful,
10 C* but WITHOUT ANY WARRANTY; without even the implied warranty of
11 C* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 C* GNU Lesser General Public License for more details.
13 C*
14 C* You should have received a copy of the GNU Lesser General Public License
15 C* along with MED. If not, see <http://www.gnu.org/licenses/>.
16 C*
17
18 C******************************************************************************
19 C * Tests for file module
20 C *
21 C *****************************************************************************
22 program medprofile1
23 C
24 implicit none
25 include 'med.hf'
26 C
27 C
28 integer cret
29 integer fid
30 character*64 fname, pname1, pname2
31 parameter(fname="Unittest_MEDprofile_1.med")
32 parameter(pname1="Profile name1")
33 parameter(pname2="Profile name 2")
34 integer psize1,psize2
35 parameter(psize1=4, psize2=2)
36 integer profile1(4), profile2(2)
37 data profile1 /1,2, 3,4/
38 data profile2 /5,6/
39 C
40 C
41 C file creation
42 call mfiope(fid,fname,med_acc_creat,cret)
43 print *,cret
44 print *,fid
45 if (cret .ne. 0 ) then
46 print *,'ERROR : file creation'
47 call efexit(-1)
48 endif
49 C
50 C
51 C write a first profile
52 call mpfprw(fid,pname1,psize1,profile1,cret)
53 print *,cret
54 if (cret .ne. 0 ) then
55 print *,'ERROR : profile creation'
56 call efexit(-1)
57 endif
58 C
59 C
60 C write a second profile
61 call mpfprw(fid,pname2,psize2,profile2,cret)
62 print *,cret
63 if (cret .ne. 0 ) then
64 print *,'ERROR : profile creation'
65 call efexit(-1)
66 endif
67 C
68 C
69 C close file
70 call mficlo(fid,cret)
71 print *,cret
72 if (cret .ne. 0 ) then
73 print *,'ERROR : close file'
74 call efexit(-1)
75 endif
76 C
77 C
78 C
79 end
80
mpfprw
subroutine mpfprw(fid, pname, psize, profil, cret)
Cette routine permet d'écrire un profil dans un fichier MED.
Definition: medprofile.f:21
medprofile1
program medprofile1
Definition: Unittest_MEDprofile_1.f:22
mficlo
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:80
mfiope
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:41