MED fichier: Fichier source de Unittest_MEDparameter_2.f

MED fichier

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

Unittest_MEDparameter_2.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 parameter module
20 C *
21 C *****************************************************************************
22 program medparameter2
23 C
24 implicit none
25 include 'med.hf'
26 C
27 C
28 integer cret
29 integer fid
30 character*64 fname
31 parameter(fname = "Unittest_MEDparameter_1.med")
32 character*64 pname1,pname2,pname
33 parameter(pname1="first parameter name")
34 parameter(pname2="second parameter name")
35 integer type1,type2,type
36 parameter(type1=med_float64, type2=med_int)
37 character*200 desc1,desc2,desc
38 parameter(desc1="First parameter description")
39 parameter(desc2="Second parameter description")
40 character*16 dtunit1,dtunit2,dtunit
41 parameter(dtunit1="unit1")
42 parameter(dtunit2="unit2")
43 integer nstep1,nstep2,nstep
44 parameter(nstep1=2,nstep2=2)
45 C
46 C
47 C open file
48 call mfiope(fid,fname,med_acc_rdonly,cret)
49 print *,'Open file',cret
50 if (cret .ne. 0 ) then
51 print *,'ERROR : open file'
52 call efexit(-1)
53 endif
54 C
55 C
56 C read information
57 call mprpin(fid,pname1,type,desc,dtunit,
58 & nstep,cret)
59 print *,'read information',cret
60 if (cret .ne. 0 ) then
61 print *,'ERROR : read information'
62 call efexit(-1)
63 endif
64 c
65 c if ( (type .ne. type1) .or.
66 c & (desc .ne. desc1) .or.
67 c & (dtunit .ne. dtunit1) .or.
68 c & (nstep .ne. nstep1) ) then
69 c print *,'ERROR : read information'
70 c call efexit(-1)
71 c endif
72 C
73 C read information
74 C
75 call mprpin(fid,pname2,type,desc,dtunit,
76 & nstep,cret)
77 print *,'read information',cret
78 if (cret .ne. 0 ) then
79 print *,'ERROR : read information'
80 call efexit(-1)
81 endif
82 c
83 c if ((type .ne. type2) .or.
84 c & (desc .ne. desc2) .or.
85 c & (dtunit .ne. dtunit2) .or.
86 c & (nstep .ne. nstep2)) then
87 c print *,'ERROR : read information'
88 c call efexit(-1)
89 c endif
90 C
91 C
92 C close file
93 call mficlo(fid,cret)
94 print *,'Close file',cret
95 if (cret .ne. 0 ) then
96 print *,'ERROR : close file'
97 call efexit(-1)
98 endif
99 C
100 C
101 C
102 end
med_float64
double med_float64
Definition: med.h:330
mprpin
subroutine mprpin(fid, name, type, desc, dtunit, nstep, cret)
Cette routine permet la lecture des informations relatives à un paramètre scalaire.
Definition: medparameter.f:147
mficlo
subroutine mficlo(fid, cret)
Fermeture d'un fichier MED.
Definition: medfile.f:80
med_int
int med_int
Definition: med.h:335
medparameter2
program medparameter2
Definition: Unittest_MEDparameter_2.f:22
mfiope
subroutine mfiope(fid, name, access, cret)
Ouverture d'un fichier MED.
Definition: medfile.f:41