Simulation Core
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

test_redis.f90 1.0 KiB

1234567891011121314151617181920212223242526272829303132333435363738
  1. module test_redis
  2. contains
  3. SUBROUTINE test()
  4. use RedisInterface
  5. use SimulationVariables
  6. use json_module
  7. character(len=:),allocatable::s2
  8. character(len=:),allocatable::redisContent
  9. type(json_value),pointer :: jsonvalue
  10. type(json_core) :: jsoncore
  11. call initConnection()
  12. print *,"redis exmaple program"
  13. call jsoncore%create_object(jsonvalue,'')
  14. call ConfigurationToJson(jsonvalue)
  15. call WarningsToJson(jsonvalue)
  16. call ProblemsToJson(jsonvalue)
  17. print *,"write starts"
  18. call jsoncore%serialize(jsonvalue,redisContent)
  19. ! s = "Test redis write!"
  20. call setData(redisContent)
  21. print *,"write ends len=",len(redisContent)
  22. call getData(s2)
  23. print *,"len(read)=",len(s2)
  24. print *, s2(1:10),' .... ', s2(len(s2)-10:len(s2))
  25. call deallocateData()
  26. ! print *,"S2 = ",s2
  27. deallocate(s2)
  28. end SUBROUTINE
  29. end module test_redis
  30. program redis_example
  31. use test_redis
  32. call test()
  33. end program redis_example