json-fortran icon indicating copy to clipboard operation
json-fortran copied to clipboard

Can not find some variables in json file

Open mahmood19227 opened this issue 2 years ago • 1 comments

In a loop I everytime read a jsonfile, and extract some numbers from that. with codes like this:

 call jsonfile%get('Equipments.Drilling.MP1Throttle',Equipments%DrillingConsole%MP1Throttle,found)

 if ( .not. found ) then
    call logg(4,"Not found: MP1Throttle")
 endif

Each iteration is happened in a subroutine with local variables. So every things are redefined and reinitialized, including jsonfile and json core. So it is not possible to remain some pointer or variable from past iteration. In the beginning every thing is OK. But if in the middle of execution, number of digits of a number in the json files are changed (for example MP1Throttle goes from 9 to 10), jsonfile cannot find this value! Why this situation is happened?

mahmood19227 avatar Sep 03 '23 13:09 mahmood19227

It's hard to say without a full example that I can compile and reproduce the issue.

jacobwilliams avatar Sep 30 '23 22:09 jacobwilliams