Skip to content

Commit 55307b9

Browse files
committed
Add more tests
1 parent b0e4bfe commit 55307b9

2 files changed

Lines changed: 425 additions & 71 deletions

File tree

src/mctc/io/write/pymatgen.f90

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ module mctc_io_write_pymatgen
3030
module procedure :: json_value_real
3131
end interface json_value
3232

33-
interface json_array
34-
module procedure :: json_array_char_1
35-
module procedure :: json_array_int_1
36-
module procedure :: json_array_real_1
37-
end interface json_array
38-
3933
character(len=*), parameter :: nl = new_line('a')
4034

4135
contains
@@ -178,68 +172,6 @@ pure function json_string(mol, indent) result(string)
178172
string = string // "}"
179173
end function json_string
180174

181-
pure function json_array_int_1(array, indent) result(string)
182-
integer, intent(in) :: array(:)
183-
character(len=*), intent(in), optional :: indent
184-
character(len=:), allocatable :: string
185-
186-
integer :: i
187-
188-
string = "["
189-
do i = 1, size(array)
190-
if (present(indent)) string = string // nl // indent // indent
191-
string = string // json_value(array(i))
192-
if (i /= size(array)) string = string // ","
193-
end do
194-
if (present(indent)) string = string // nl // indent
195-
string = string // "]"
196-
end function json_array_int_1
197-
198-
pure function json_array_real_1(array, indent, indent2, group) result(string)
199-
real(wp), intent(in) :: array(:)
200-
character(len=*), intent(in), optional :: indent
201-
character(len=*), intent(in), optional :: indent2
202-
integer, intent(in), optional :: group
203-
character(len=:), allocatable :: string
204-
205-
integer :: i, j, step
206-
207-
step = 1
208-
if (present(group)) step = group
209-
210-
string = "["
211-
do i = 1, size(array), step
212-
if (present(indent2)) then
213-
string = string // nl // indent2
214-
else if (present(indent)) then
215-
string = string // nl // indent // indent
216-
end if
217-
do j = 1, step, 1
218-
string = string // json_value(array(i + j - 1), '(es23.16)')
219-
if (i + j - 1 /= size(array)) string = string // ","
220-
end do
221-
end do
222-
if (present(indent)) string = string // nl // indent
223-
string = string // "]"
224-
end function json_array_real_1
225-
226-
pure function json_array_char_1(array, indent) result(string)
227-
character(len=*), intent(in) :: array(:)
228-
character(len=*), intent(in), optional :: indent
229-
character(len=:), allocatable :: string
230-
231-
integer :: i
232-
233-
string = "["
234-
do i = 1, size(array)
235-
if (present(indent)) string = string // nl // indent // indent
236-
string = string // json_value(trim(array(i)))
237-
if (i /= size(array)) string = string // ","
238-
end do
239-
if (present(indent)) string = string // nl // indent
240-
string = string // "]"
241-
end function json_array_char_1
242-
243175
pure function json_key(key, indent) result(string)
244176
character(len=*), intent(in) :: key
245177
character(len=*), intent(in), optional :: indent
@@ -328,5 +260,4 @@ pure subroutine dlat_to_cell(lattice,cellpar)
328260

329261
end subroutine dlat_to_cell
330262

331-
end module mctc_io_write_pymatgen
332-
263+
end module mctc_io_write_pymatgen

0 commit comments

Comments
 (0)