Skip to content

Commit 89aa160

Browse files
committed
whitespace cleanup
1 parent 49c4c1f commit 89aa160

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

src/json_module.F90

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,15 @@ module json_module
259259
!
260260
! The types of JSON data.
261261
!
262-
integer(IK),parameter,public :: json_unknown = 0 !! Unknown JSON data type
262+
integer(IK),parameter,public :: json_unknown = 0 !! Unknown JSON data type
263263
!! (see [[json_file_variable_info]] and [[json_info]])
264264
integer(IK),parameter,public :: json_null = 1 !! Null JSON data type
265265
!! (see [[json_file_variable_info]] and [[json_info]])
266266
integer(IK),parameter,public :: json_object = 2 !! Object JSON data type
267267
!! (see [[json_file_variable_info]] and [[json_info]])
268268
integer(IK),parameter,public :: json_array = 3 !! Array JSON data type
269269
!! (see [[json_file_variable_info]] and [[json_info]])
270-
integer(IK),parameter,public :: json_logical = 4 !! Logical JSON data type
270+
integer(IK),parameter,public :: json_logical = 4 !! Logical JSON data type
271271
!! (see [[json_file_variable_info]] and [[json_info]])
272272
integer(IK),parameter,public :: json_integer = 5 !! Integer JSON data type
273273
!! (see [[json_file_variable_info]] and [[json_info]])
@@ -464,7 +464,7 @@ module json_module
464464

465465
!*************************************************************************************
466466
abstract interface
467-
467+
468468
subroutine array_callback_func(element, i, count)
469469
!! Array element callback function. Used by [[json_get_array]]
470470
import :: json_value,IK
@@ -473,15 +473,15 @@ subroutine array_callback_func(element, i, count)
473473
integer(IK),intent(in) :: i !index
474474
integer(IK),intent(in) :: count !size of array
475475
end subroutine array_callback_func
476-
476+
477477
subroutine traverse_callback_func(p,finished)
478478
!! Callback function used by [[json_traverse]]
479479
import :: json_value,LK
480480
implicit none
481481
type(json_value),pointer,intent(in) :: p
482482
logical(LK),intent(out) :: finished
483483
end subroutine traverse_callback_func
484-
484+
485485
end interface
486486
!*************************************************************************************
487487

@@ -668,7 +668,7 @@ end subroutine traverse_callback_func
668668
module procedure MAYBEWRAP(json_value_remove_if_present)
669669
end interface
670670
!*************************************************************************************
671-
671+
672672
!*************************************************************************************
673673
!>
674674
! Allocate a [[json_value]] pointer and make it a double variable.
@@ -889,9 +889,9 @@ end subroutine traverse_callback_func
889889
integer(IK),parameter :: spaces_per_tab = 2
890890

891891
!Variables for real string printing:
892-
892+
893893
logical(LK) :: compact_real = .true. !! to use the "compact" form of real numbers for output
894-
894+
895895
!find out the precision of the floating point number system
896896
!and set safety factors
897897
integer(IK),parameter :: rp_safety_factor = 1
@@ -906,7 +906,7 @@ end subroutine traverse_callback_func
906906
real(max(maxexp,abs(maxexp)),&
907907
kind=RK) ) )
908908

909-
integer(IK),parameter :: max_numeric_str_len = real_precision + real_exponent_digits + 6
909+
integer(IK),parameter :: max_numeric_str_len = real_precision + real_exponent_digits + 6
910910
!! 6 = sign + leading 0 + decimal + 'E' + exponent sign + 1 extra
911911
character(kind=CDK,len=*),parameter :: int_fmt = '(ss,I0)' !! minimum width format for integers
912912
character(kind=CK, len=*),parameter :: star = '*' !! for invalid numbers and list-directed real output
@@ -919,7 +919,7 @@ end subroutine traverse_callback_func
919919

920920
!exception handling [private variables]
921921
logical(LK) :: is_verbose = .false. !! if true, all exceptions are immediately printed to console
922-
logical(LK) :: exception_thrown = .true. !! the error flag (by default, this is true to
922+
logical(LK) :: exception_thrown = .true. !! the error flag (by default, this is true to
923923
!! make sure that [[json_initialize]] is called.
924924
character(kind=CK,len=:),allocatable :: err_message !! the error message
925925

@@ -966,12 +966,12 @@ subroutine json_clone(from,to)
966966
implicit none
967967

968968
type(json_value),pointer :: from !! this is the structure to clone
969-
type(json_value),pointer :: to !! the clone is put here
969+
type(json_value),pointer :: to !! the clone is put here
970970
!! (it must not already be associated)
971-
971+
972972
!call the main function:
973-
call json_value_clone_func(from,to)
974-
973+
call json_value_clone_func(from,to)
974+
975975
end subroutine json_clone
976976
!*****************************************************************************************
977977

@@ -981,30 +981,30 @@ end subroutine json_clone
981981
!
982982
! Recursive deep copy function called by [[json_clone]].
983983
!
984-
!@note If new data is added to the [[json_value]] type,
984+
!@note If new data is added to the [[json_value]] type,
985985
! then this would need to be updated.
986-
986+
987987
recursive subroutine json_value_clone_func(from,to,parent,previous,next,children,tail)
988988

989989
implicit none
990990

991991
type(json_value),pointer :: from !! this is the structure to clone
992-
type(json_value),pointer :: to !! the clone is put here
992+
type(json_value),pointer :: to !! the clone is put here
993993
!! (it must not already be associated)
994994
type(json_value),pointer,optional :: parent !! to%parent
995995
type(json_value),pointer,optional :: previous !! to%previous
996996
type(json_value),pointer,optional :: next !! to%next
997997
type(json_value),pointer,optional :: children !! to%children
998998
logical,optional :: tail !! if "to" is the tail of its parent's children
999-
999+
10001000
nullify(to)
10011001

10021002
if (associated(from)) then
1003-
1003+
10041004
allocate(to)
1005-
1005+
10061006
!copy over the data variables:
1007-
! [note: the allocate() statements don't work here for the
1007+
! [note: the allocate() statements don't work here for the
10081008
! deferred-length characters in gfortran-4.9]
10091009
if (allocated(from%name)) to%name = from%name
10101010
if (allocated(from%dbl_value)) allocate(to%dbl_value,source=from%dbl_value)
@@ -1013,17 +1013,17 @@ recursive subroutine json_value_clone_func(from,to,parent,previous,next,children
10131013
if (allocated(from%int_value)) allocate(to%int_value,source=from%int_value)
10141014
to%var_type = from%var_type
10151015
to%n_children = from%n_children
1016-
1016+
10171017
!allocate and associate the pointers as necessary:
1018-
1018+
10191019
if (present(parent)) to%parent => parent
10201020
if (present(previous)) to%previous => previous
10211021
if (present(next)) to%next => next
10221022
if (present(children)) to%children => children
10231023
if (present(tail)) then
10241024
if (tail) to%parent%tail => to
10251025
end if
1026-
1026+
10271027
if (associated(from%next)) then
10281028
allocate(to%next)
10291029
call json_value_clone_func(from%next,&
@@ -1038,9 +1038,9 @@ recursive subroutine json_value_clone_func(from,to,parent,previous,next,children
10381038
call json_value_clone_func(from%children,&
10391039
to%children,&
10401040
parent=to,&
1041-
tail=(.not. associated(from%children%next)))
1041+
tail=(.not. associated(from%children%next)))
10421042
end if
1043-
1043+
10441044
end if
10451045

10461046
end subroutine json_value_clone_func
@@ -1053,9 +1053,9 @@ end subroutine json_value_clone_func
10531053
! Cast a [[json_value]] object as a [[json_file(type)]] object
10541054

10551055
function initialize_json_file(p) result(file_object)
1056-
1056+
10571057
implicit none
1058-
1058+
10591059
type(json_value),pointer,optional,intent(in) :: p !! `json_value` object to cast
10601060
!! as a `json_file` object
10611061
type(json_file) :: file_object
@@ -1819,7 +1819,7 @@ subroutine json_initialize(verbose,compact_reals,print_signs,real_format)
18191819
present(compact_reals) .or. &
18201820
present(print_signs) .or. &
18211821
present(real_format) ) then
1822-
1822+
18231823
!allow the special case where real format is '*':
18241824
! [this overrides the other options]
18251825
if (present(real_format)) then
@@ -1830,7 +1830,7 @@ subroutine json_initialize(verbose,compact_reals,print_signs,real_format)
18301830
end if
18311831
end if
18321832

1833-
if (present(compact_reals)) compact_real = compact_reals
1833+
if (present(compact_reals)) compact_real = compact_reals
18341834

18351835
!set defaults
18361836
sgn_prnt = .false.
@@ -3382,9 +3382,9 @@ subroutine json_get_parent(me,p)
33823382

33833383
type(json_value),pointer,intent(in) :: me !! JSON object
33843384
type(json_value),pointer,intent(out) :: p !! pointer to parent
3385-
3385+
33863386
p => me%parent
3387-
3387+
33883388
end subroutine json_get_parent
33893389
!*****************************************************************************************
33903390

@@ -3401,9 +3401,9 @@ subroutine json_get_next(me,p)
34013401

34023402
type(json_value),pointer,intent(in) :: me !! JSON object
34033403
type(json_value),pointer,intent(out) :: p !! pointer to next
3404-
3404+
34053405
p => me%next
3406-
3406+
34073407
end subroutine json_get_next
34083408
!*****************************************************************************************
34093409

@@ -3420,9 +3420,9 @@ subroutine json_get_previous(me,p)
34203420

34213421
type(json_value),pointer,intent(in) :: me !! JSON object
34223422
type(json_value),pointer,intent(out) :: p !! pointer to previous
3423-
3423+
34243424
p => me%previous
3425-
3425+
34263426
end subroutine json_get_previous
34273427
!*****************************************************************************************
34283428

@@ -3439,9 +3439,9 @@ subroutine json_get_tail(me,p)
34393439

34403440
type(json_value),pointer,intent(in) :: me !! JSON object
34413441
type(json_value),pointer,intent(out) :: p !! pointer to tail
3442-
3442+
34433443
p => me%tail
3444-
3444+
34453445
end subroutine json_get_tail
34463446
!*****************************************************************************************
34473447

@@ -4152,16 +4152,16 @@ function string_to_double(str) result(rval)
41524152
integer(IK) :: ierr
41534153

41544154
if (.not. exception_thrown) then
4155-
4155+
41564156
!string to double
4157-
read(str,fmt=*,iostat=ierr) rval
4158-
4157+
read(str,fmt=*,iostat=ierr) rval
4158+
41594159
if (ierr/=0) then !if there was an error
41604160
rval = 0.0_RK
41614161
call throw_exception('Error in string_to_double:'//&
41624162
' string cannot be converted to a double: '//trim(str))
41634163
end if
4164-
4164+
41654165
end if
41664166

41674167
end function string_to_double
@@ -5195,7 +5195,7 @@ end subroutine json_get_array
51955195
! date: 09/02/2015
51965196
!
51975197
! Traverse a JSON structure.
5198-
! This routine calls the user-specified [[traverse_callback_func]]
5198+
! This routine calls the user-specified [[traverse_callback_func]]
51995199
! for each element of the structure.
52005200
!
52015201
recursive subroutine json_traverse(me,traverse_callback)

0 commit comments

Comments
 (0)