| 1 |
C* This file is part of MED. |
| 2 |
C* |
| 3 |
C* COPYRIGHT (C) 1999 - 2020 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 paramter module |
| 20 |
C * |
| 21 |
C ***************************************************************************** |
| 22 |
program MEDparameter1 |
| 23 |
C |
| 24 |
implicit none |
| 25 |
include 'med.hf' |
| 26 |
C |
| 27 |
C |
| 28 |
integer cret |
| 29 |
integer*8 fid |
| 30 |
|
| 31 |
character*64 fname |
| 32 |
parameter (fname = "Unittest_MEDparameter_1.med") |
| 33 |
character*64 pname1,pname2 |
| 34 |
parameter (pname1="first parameter name") |
| 35 |
parameter (pname2="second parameter name") |
| 36 |
integer type1,type2 |
| 37 |
parameter (type1=MED_FLOAT64, type2=MED_INT) |
| 38 |
character*200 desc1,desc2 |
| 39 |
parameter (desc1="First parameter description") |
| 40 |
parameter (desc2="Second parameter description") |
| 41 |
character*16 dtunit1,dtunit2 |
| 42 |
parameter (dtunit1="unit1") |
| 43 |
parameter (dtunit2="unit2") |
| 44 |
real*8 p1v1, p1v2 |
| 45 |
parameter (p1v1=1.0,p1v2=2.0) |
| 46 |
integer p1numdt1,p1numdt2,p2numdt1,p2numdt2 |
| 47 |
parameter (p1numdt1=MED_NO_DT,p1numdt2=1) |
| 48 |
parameter (p2numdt1=2, p2numdt2=3) |
| 49 |
real*8 dt1, dt2 |
| 50 |
parameter (dt1=MED_UNDEF_DT,dt2=5.5) |
| 51 |
integer p2v1,p2v2 |
| 52 |
parameter (p2v1=3,p2v2=4) |
| 53 |
integer p1numit1, p1numit2, p2numit1, p2numit2 |
| 54 |
parameter (p1numit1=MED_NO_IT, p1numit2=1) |
| 55 |
parameter (p2numit1=2, p2numit2=3) |
| 56 |
C |
| 57 |
C |
| 58 |
C file creation |
| 59 |
call mfiope(fid,fname,MED_ACC_CREAT,cret) |
| 60 |
print *,'Open file',cret |
| 61 |
if (cret .ne. 0 ) then |
| 62 |
print *,'ERROR : file creation' |
| 63 |
call efexit(-1) |
| 64 |
endif |
| 65 |
C |
| 66 |
C |
| 67 |
C first parameter creation |
| 68 |
call mprcre(fid,pname1,type1,desc1,dtunit1,cret) |
| 69 |
print *,'parameter creation',cret |
| 70 |
if (cret .ne. 0 ) then |
| 71 |
print *,'ERROR : parameter creation' |
| 72 |
call efexit(-1) |
| 73 |
endif |
| 74 |
C |
| 75 |
C |
| 76 |
C write values |
| 77 |
call mprrvw(fid,pname1,p1numdt1,p1numit1,dt1,p1v1,cret) |
| 78 |
print *,'write value',cret |
| 79 |
if (cret .ne. 0 ) then |
| 80 |
print *,'ERROR : write value' |
| 81 |
call efexit(-1) |
| 82 |
endif |
| 83 |
c |
| 84 |
call mprrvw(fid,pname1,p1numdt2,p1numit2,dt2,p1v2,cret) |
| 85 |
print *,'write value',cret |
| 86 |
if (cret .ne. 0 ) then |
| 87 |
print *,'ERROR : write value' |
| 88 |
call efexit(-1) |
| 89 |
endif |
| 90 |
C |
| 91 |
C |
| 92 |
C second parameter creation |
| 93 |
call mprcre(fid,pname2,type2,desc2,dtunit2,cret) |
| 94 |
print *,'parameter creation',cret |
| 95 |
if (cret .ne. 0 ) then |
| 96 |
print *,'ERROR : parameter creation' |
| 97 |
call efexit(-1) |
| 98 |
endif |
| 99 |
C |
| 100 |
C |
| 101 |
C write values |
| 102 |
call mprivw(fid,pname2,p2numdt1,p2numit1,dt1,p2v1,cret) |
| 103 |
print *,'write value',cret |
| 104 |
if (cret .ne. 0 ) then |
| 105 |
print *,'ERROR : write value' |
| 106 |
call efexit(-1) |
| 107 |
endif |
| 108 |
c |
| 109 |
call mprivw(fid,pname2,p2numdt2,p2numit2,dt2,p2v2,cret) |
| 110 |
print *,'write value',cret |
| 111 |
if (cret .ne. 0 ) then |
| 112 |
print *,'ERROR : write value' |
| 113 |
call efexit(-1) |
| 114 |
endif |
| 115 |
C |
| 116 |
C |
| 117 |
C close file |
| 118 |
call mficlo(fid,cret) |
| 119 |
print *,'Close file',cret |
| 120 |
if (cret .ne. 0 ) then |
| 121 |
print *,'ERROR : close file' |
| 122 |
call efexit(-1) |
| 123 |
endif |
| 124 |
C |
| 125 |
C |
| 126 |
C |
| 127 |
end |
| 128 |
|