Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

97 lines
3.6 KiB

  1. # 1 "/mnt/c/Projects/VSIM/SimulationCore2/Common/json-fortran/json_module.F90"
  2. !*****************************************************************************************
  3. !> author: Jacob Williams
  4. ! license: BSD
  5. !
  6. ! A Modern Fortran JSON (JavaScript Object Notation) API.
  7. !
  8. ! This module provides access to [[json_value_module]] and
  9. ! [[json_file_module]]. For normal JSON-Fortran use, using this module
  10. ! is all that is necessary.
  11. !
  12. ! Note that this module renames the kind definition variables from [[json_kinds]]
  13. ! from [`RK`, `IK`, `LK`, `CK`, and `CDK`] to [`json_RK`, `json_IK`, `json_LK`,
  14. ! `json_CK`, and `json_CDK`] so as to avoid namespace pollution with short
  15. ! variable names.
  16. !
  17. # 23
  18. !
  19. !### License
  20. ! * JSON-Fortran is released under a BSD-style license.
  21. ! See the [LICENSE](https://github.com/jacobwilliams/json-fortran/blob/master/LICENSE)
  22. ! file for details.
  23. !
  24. !### History
  25. ! * Joseph A. Levin : March 2012 : Original [FSON](https://github.com/josephalevin/fson)
  26. ! code [retrieved on 12/2/2013].
  27. ! * Jacob Williams : 2/8/2014 : Extensive modifications to the original FSON code.
  28. ! The original F95 code was split into four files:
  29. ! fson_path_m.f95, fson_string_m.f95, fson_value_m.f95, and fson.f95.
  30. ! The new code has been extensively updated, refactored and combined into this
  31. ! one module (json_module.f90).
  32. ! Various Fortran 2003/2008 features are now used
  33. ! (e.g., allocatable strings, newunit, generic, class, and abstract interface).
  34. ! * Development continues at: [Github](https://github.com/jacobwilliams/json-fortran)
  35. !
  36. !### See also
  37. ! * [json-fortran development site](https://github.com/jacobwilliams/json-fortran)
  38. ! * [json-fortran online documentation](https://jacobwilliams.github.io/json-fortran)
  39. ! * [JSON website](http://www.json.org/)
  40. ! * [JSON validator](http://jsonlint.com/)
  41. !
  42. !@note Originally JSON-Fortran was entirely contained within this module.
  43. module json_module
  44. use json_kinds, only: json_RK => RK, &
  45. json_IK => IK, &
  46. json_LK => LK, &
  47. json_CK => CK, &
  48. json_CDK => CDK
  49. # 61
  50. use json_parameters, only: json_unknown,&
  51. json_null, &
  52. json_object, &
  53. json_array, &
  54. json_logical,&
  55. json_integer,&
  56. json_real, &
  57. json_double, &
  58. json_string
  59. use json_value_module
  60. use json_file_module
  61. implicit none
  62. character(kind=json_CK,len=*),parameter,private :: version = '8.3.0'
  63. !! JSON-Fortran version.
  64. !!
  65. !!@note This string should match the one in the `.VERSION` file (which is used
  66. !! for the documentation generation.)
  67. public
  68. contains
  69. !*****************************************************************************************
  70. !*****************************************************************************************
  71. !>
  72. ! Returns the JSON-Fortran version string.
  73. function json_fortran_version() result(ver)
  74. implicit none
  75. character(len=:),allocatable :: ver !! JSON-Fortran version string
  76. ver = version
  77. end function json_fortran_version
  78. !*****************************************************************************************
  79. !*****************************************************************************************
  80. end module json_module
  81. !*****************************************************************************************