1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
module TABDATA
implicit none
real(kind=8),dimension(:),allocatable :: U
integer Taille_U
integer Unit_U
integer,parameter :: Taille_Max=2048000000
interface
subroutine allocation(Taille)
implicit none
integer,intent(in) :: Taille
end subroutine allocation
function Get_U(i)
implicit none
integer,intent(in) :: i
real(kind=8) Get_U
end function Get_U
subroutine Set_U(i,x)
implicit none
integer,intent(in) :: i
real(kind=8),intent(in) :: x
end subroutine Set_U
end interface
end module TABDATA
subroutine allocation(Taille)
implicit none
integer,intent(in) :: Taille
Taille_U=Taille
if (Taille>Taill_Max) then
Unit_U=15
open(unit=Unit_U,access=direct)
else
Unit_U=0
allocate(U(Taille_U))
end if
end subroutine allocation
function Get_U(i)
implicit none
integer,intent(in) :: i
real(kind=8) Get_U
if (Unit_U==0)then
Get_U=U(i)
return
else
read(Unit_U,rec=i)Get_U
return
end if
end function Get_U
subroutine Set_U(i,x)
implicit none
integer,intent(in) :: i
real(kind=8),intent(in) :: x
if (Unit_U==0)then
U(i)=x
return
else
write(Unit_U,rec=i)x
return
end if
end subroutine Set_U |
Partager