@@ -261,9 +261,9 @@ subroutine test_4()
261
261
do i= 1 ,100
262
262
write (istr,fmt= ' (I10)' ) i
263
263
istr = adjustl (istr)
264
- call json_value_add (inp, ' x' // trim (istr),i)
264
+ call json_add (inp, ' x' // trim (istr),i)
265
265
end do
266
- call json_value_add (p, inp)
266
+ call json_add (p, inp)
267
267
nullify(inp)
268
268
269
269
write (* ,' (A)' ) ' '
@@ -327,26 +327,26 @@ subroutine test_2()
327
327
328
328
! config structure:
329
329
call json_create_object(inp,' inputs' ) ! an object
330
- call json_value_add (p, inp)
330
+ call json_add (p, inp)
331
331
332
332
! trajectory structure:
333
333
call json_create_array(traj,' trajectory' ) ! an array
334
- call json_value_add (p, traj)
334
+ call json_add (p, traj)
335
335
336
336
write (* ,' (A)' ) ' '
337
337
write (* ,' (A)' ) ' adding some data to structure...'
338
338
339
339
! add some variables:
340
340
341
341
! input variables:
342
- call json_value_add (inp, ' t0' , 0.1_wp )
343
- call json_value_add (inp, ' tf' , 1.1_wp )
344
- call json_value_add (inp, ' x0' , 9999.000_wp )
345
- call json_value_add (inp, ' integer_scalar' , 1 )
346
- call json_value_add (inp, ' integer_array' , [2 ,4 ,99 ])
347
- call json_value_add (inp, ' names' , [' aaa' ,' bbb' ,' ccc' ])
348
- call json_value_add (inp, ' logical_scalar' , .true. )
349
- call json_value_add (inp, ' logical_vector' , [.true. , .false. , .true. ])
342
+ call json_add (inp, ' t0' , 0.1_wp )
343
+ call json_add (inp, ' tf' , 1.1_wp )
344
+ call json_add (inp, ' x0' , 9999.000_wp )
345
+ call json_add (inp, ' integer_scalar' , 1 )
346
+ call json_add (inp, ' integer_array' , [2 ,4 ,99 ])
347
+ call json_add (inp, ' names' , [' aaa' ,' bbb' ,' ccc' ])
348
+ call json_add (inp, ' logical_scalar' , .true. )
349
+ call json_add (inp, ' logical_vector' , [.true. , .false. , .true. ])
350
350
nullify(inp)
351
351
352
352
! trajectory variables:
@@ -395,16 +395,16 @@ subroutine add_variables_to_input(me, variable, units, frame, center, rdata)
395
395
call json_create_object(var,' ' ) ! name does not matter
396
396
397
397
! variable info:
398
- call json_value_add (var, ' VARIABLE' ,trim (variable))
399
- call json_value_add (var, ' UNITS' , trim (units))
400
- call json_value_add (var, ' FRAME' , trim (frame))
401
- call json_value_add (var, ' CENTER' , trim (center))
398
+ call json_add (var, ' VARIABLE' ,trim (variable))
399
+ call json_add (var, ' UNITS' , trim (units))
400
+ call json_add (var, ' FRAME' , trim (frame))
401
+ call json_add (var, ' CENTER' , trim (center))
402
402
403
403
! trajectory [vector of reals]:
404
- call json_value_add (var, ' DATA' , rdata)
404
+ call json_add (var, ' DATA' , rdata)
405
405
406
406
! add this variable to trajectory structure:
407
- call json_value_add (me, var)
407
+ call json_add (me, var)
408
408
409
409
! cleanup:
410
410
nullify(var)
@@ -710,4 +710,4 @@ end subroutine print_error_message
710
710
711
711
! *******************************************************************************************************
712
712
end program json_test
713
- ! *******************************************************************************************************
713
+ ! *******************************************************************************************************
0 commit comments