atomes 1.1.15
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
allocmsd.F90
Go to the documentation of this file.
1! This file is part of the 'atomes' software.
2!
3! 'atomes' is free software: you can redistribute it and/or modify it under the terms
4! of the GNU Affero General Public License as published by the Free Software Foundation,
5! either version 3 of the License, or (at your option) any later version.
6!
7! 'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8! without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9! See the GNU General Public License for more details.
10!
11! You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12! If not, see <https://www.gnu.org/licenses/>
13!
14! Copyright (C) 2022-2024 by CNRS and University of Strasbourg
15!
20
21LOGICAL FUNCTION allocmsd()
22
23USE parameters
24
25if (allocated(d2i)) deallocate(d2i)
26allocate(d2i(nsp,ns), stat=err)
27if (err .ne. 0) then
28 call show_error ("Impossible to allocate memory"//char(0), &
29 "Function: ALLOCMSD"//char(0), "Table: D2i"//char(0))
30 allocmsd = .false.
31 goto 001
32endif
33
34if (allocated(d2inac)) deallocate(d2inac)
35allocate(d2inac(nsp,ns), stat=err)
36if (err .ne. 0) then
37 call show_error ("Impossible to allocate memory"//char(0), &
38 "Function: ALLOCMSD"//char(0), "Table: D2iNAC"//char(0))
39 allocmsd = .false.
40 goto 001
41endif
42
43if (allocated(d2dir)) deallocate(d2dir)
44allocate(d2dir(nsp,6,ns), stat=err)
45if (err .ne. 0) then
46 call show_error ("Impossible to allocate memory"//char(0), &
47 "Function: ALLOCMSD"//char(0), "Table: D2dir"//char(0))
48 allocmsd = .false.
49 goto 001
50endif
51
52if (allocated(d2dirnac)) deallocate(d2dirnac)
53allocate(d2dirnac(nsp,6,ns), stat=err)
54if (err .ne. 0) then
55 call show_error ("Impossible to allocate memory"//char(0), &
56 "Function: ALLOCMSD"//char(0), "Table: D2dir"//char(0))
57 allocmsd = .false.
58 goto 001
59endif
60
61if (allocated(dcte)) deallocate(dcte)
62allocate(dcte(nsp), stat=err)
63if (err .ne. 0) then
64 call show_error ("Impossible to allocate memory"//char(0), &
65 "Function: ALLOCMSD"//char(0), "Table: Dcte"//char(0))
66 allocmsd = .false.
67 goto 001
68endif
69
70if (allocated(cor)) deallocate(cor)
71allocate(cor(3,ns), stat=err)
72if (err .ne. 0) then
73 call show_error ("Impossible to allocate memory"//char(0), &
74 "Function: ALLOCMSD"//char(0), "Table: COR"//char(0))
75 allocmsd = .false.
76 goto 001
77endif
78
79if (allocated(drift)) deallocate(drift)
80allocate(drift(3,ns), stat=err)
81if (err .ne. 0) then
82 call show_error ("Impossible to allocate memory"//char(0), &
83 "Function: ALLOCMSD"//char(0), "Table: DRIFT"//char(0))
84 allocmsd = .false.
85 goto 001
86endif
87
88d2i(:,:)=0.0d0
89d2inac(:,:)=0.0d0
90d2dir(:,:,:) =0.0d0
91d2dirnac(:,:,:) =0.0d0
92dcte(:)=0.0d0
93cor(:,:)=0.0d0
94drift(:,:)=0.0d0
95
96allocmsd=.true.
97
98001 continue
99
100END FUNCTION
101
102SUBROUTINE deallocmsd
103
104!
105! Memory allocation for bond properties
106!
107
108USE parameters
109
110if (allocated(d2i)) deallocate(d2i)
111if (allocated(d2inac)) deallocate(d2inac)
112if (allocated(d2dir)) deallocate(d2dir)
113if (allocated(d2dirnac)) deallocate(d2dirnac)
114if (allocated(dcte)) deallocate(dcte)
115if (allocated(cor)) deallocate(cor)
116if (allocated(drift)) deallocate(drift)
117
118END SUBROUTINE
logical function allocmsd()
Definition allocmsd.F90:22
subroutine deallocmsd
Definition allocmsd.F90:103
void show_error(char *error, int val, GtkWidget *win)
show error message
Definition interface.c:293
double precision, dimension(:,:), allocatable d2inac
double precision, dimension(:,:,:), allocatable d2dirnac
double precision, dimension(:), allocatable dcte
double precision, dimension(:,:), allocatable d2i
integer err
double precision, dimension(:,:), allocatable cor
double precision, dimension(:,:,:), allocatable d2dir
double precision, dimension(:,:), allocatable drift
integer nsp