@@ -257,12 +257,12 @@ subroutine test_2()
257
257
258
258
! config structure:
259
259
call json_value_create(inp) ! an object
260
- call to_object(inp,' INPUTS ' )
260
+ call to_object(inp,' inputs ' )
261
261
call json_value_add(p, inp)
262
262
263
263
! trajectory structure:
264
264
call json_value_create(traj) ! an array
265
- call to_array(traj,' TRAJECTORY ' )
265
+ call to_array(traj,' trajectory ' )
266
266
call json_value_add(p, traj)
267
267
268
268
write (* ,* ) ' '
@@ -274,8 +274,8 @@ subroutine test_2()
274
274
call json_value_add(inp, ' t0' , 0.1_wp )
275
275
call json_value_add(inp, ' tf' , 1.1_wp )
276
276
call json_value_add(inp, ' x0' , 9999.000_wp )
277
- call json_value_add(inp, ' current_segment ' , 1 )
278
- call json_value_add(inp, ' segment_groups ' , [2 ,4 ,99 ])
277
+ call json_value_add(inp, ' integer_scalar ' , 1 )
278
+ call json_value_add(inp, ' integer_array ' , [2 ,4 ,99 ])
279
279
call json_value_add(inp, ' names' , [' aaa' ,' bbb' ,' ccc' ])
280
280
call json_value_add(inp, ' logical_scalar' , .true. )
281
281
call json_value_add(inp, ' logical_vector' , [.true. , .false. , .true. ])
@@ -326,7 +326,7 @@ subroutine add_variables_to_input(me, variable, units, frame, center, rdata)
326
326
327
327
! create the object before data can be added:
328
328
call json_value_create(var)
329
- call to_object(var,' VARIABLE ' )
329
+ call to_object(var,' ' ) ! name does not matter
330
330
331
331
! variable info:
332
332
call json_value_add(var, ' VARIABLE' ,trim (variable))
@@ -482,67 +482,67 @@ subroutine test_1()
482
482
write (* ,* ) ' get some data from the file...'
483
483
484
484
write (* ,* ) ' '
485
- call json% get(' VERSION_VARS.COP_SVN_REVISION ' , ival)
485
+ call json% get(' version.svn ' , ival)
486
486
if (json_failed()) then
487
487
call print_error_message()
488
488
else
489
- write (* ,* ) ' VERSION_VARS.COP_SVN_REVISION = ' ,ival
489
+ write (* ,* ) ' version.svn = ' ,ival
490
490
end if
491
491
492
492
write (* ,* ) ' '
493
- call json% get(' SEGMENT_VARS (1).array(2)' , cval)
493
+ call json% get(' data (1).array(2)' , cval)
494
494
if (json_failed()) then
495
495
call print_error_message()
496
496
else
497
- write (* ,' (1x,A)' ) ' SEGMENT_VARS (1).array(2) = ' // trim (cval)
497
+ write (* ,' (1x,A)' ) ' data (1).array(2) = ' // trim (cval)
498
498
end if
499
499
500
500
write (* ,* ) ' '
501
- call json% get(' SPICE_VARS (1)' , cval)
501
+ call json% get(' files (1)' , cval)
502
502
if (json_failed()) then
503
503
call print_error_message()
504
504
else
505
- write (* ,' (1x,A)' ) ' SPICE_VARS (1) = ' // trim (cval)
505
+ write (* ,' (1x,A)' ) ' files (1) = ' // trim (cval)
506
506
end if
507
507
508
508
write (* ,* ) ' '
509
- call json% get(' SPICE_VARS (2)' , cval)
509
+ call json% get(' files (2)' , cval)
510
510
if (json_failed()) then
511
511
call print_error_message()
512
512
else
513
- write (* ,' (1x,A)' ) ' SPICE_VARS (2) = ' // trim (cval)
513
+ write (* ,' (1x,A)' ) ' files (2) = ' // trim (cval)
514
514
end if
515
515
516
516
write (* ,* ) ' '
517
- call json% get(' SPICE_VARS (3)' , cval)
517
+ call json% get(' files (3)' , cval)
518
518
if (json_failed()) then
519
519
call print_error_message()
520
520
else
521
- write (* ,* ) ' SPICE_VARS (3) = ' // trim (cval)
521
+ write (* ,* ) ' files (3) = ' // trim (cval)
522
522
end if
523
523
524
524
write (* ,* ) ' '
525
- call json% get(' SEGMENT_VARS (2).blah2 ' , rval)
525
+ call json% get(' data (2).real ' , rval)
526
526
if (json_failed()) then
527
527
call print_error_message()
528
528
else
529
- write (* ,* ) ' SEGMENT_VARS (2).blah2 = ' ,rval
529
+ write (* ,* ) ' data (2).real = ' ,rval
530
530
end if
531
531
532
532
write (* ,* ) ' '
533
- call json% get(' SPICE_VARS [4]' , cval) ! has hex characters
533
+ call json% get(' files [4]' , cval) ! has hex characters
534
534
if (json_failed()) then
535
535
call print_error_message()
536
536
else
537
- write (* ,' (1x,A)' ) ' SPICE_VARS [4] = ' // trim (cval)
537
+ write (* ,' (1x,A)' ) ' files [4] = ' // trim (cval)
538
538
end if
539
539
540
540
write (* ,* ) ' '
541
- call json% get(' SPICE_VARS [5]' , cval) ! string with spaces and no escape characters
541
+ call json% get(' files [5]' , cval) ! string with spaces and no escape characters
542
542
if (json_failed()) then
543
543
call print_error_message()
544
544
else
545
- write (* ,' (1x,A)' ) ' SPICE_VARS [5] = ' // trim (cval)
545
+ write (* ,' (1x,A)' ) ' files [5] = ' // trim (cval)
546
546
end if
547
547
548
548
!
@@ -551,19 +551,19 @@ subroutine test_1()
551
551
!
552
552
553
553
write (* ,* ) ' '
554
- call json% get(' SPICE_VARS [10]' , cval, found) ! value that isn't there
554
+ call json% get(' files [10]' , cval, found) ! value that isn't there
555
555
if (.not. found) then
556
- write (* ,* ) ' SPICE_VARS [10] not in file.'
556
+ write (* ,* ) ' files [10] not in file.'
557
557
else
558
- write (* ,' (1x,A)' ) ' SPICE_VARS [10] = ' // trim (cval)
558
+ write (* ,' (1x,A)' ) ' files [10] = ' // trim (cval)
559
559
end if
560
560
561
561
write (* ,* ) ' '
562
- call json% get(' VERSION_VARS .blah' , ival, found) ! value that isn't there
562
+ call json% get(' version .blah' , ival, found) ! value that isn't there
563
563
if (.not. found) then
564
- write (* ,* ) ' VERSION_VARS .blah not in file.'
564
+ write (* ,* ) ' version .blah not in file.'
565
565
else
566
- write (* ,* ) ' VERSION_VARS .blah = ' ,ival
566
+ write (* ,* ) ' version .blah = ' ,ival
567
567
end if
568
568
569
569
end if
0 commit comments