Skip to content

Commit c372323

Browse files
committed
changed requested to checking length cause requested either broken or works not how i understand for optional keys
1 parent c2a3225 commit c372323

1 file changed

Lines changed: 28 additions & 20 deletions

File tree

src/flowAna.f90

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ subroutine loadData(xiList, xiPath, runName, ncon, iconList, eps, tmax, flowTime
4242
xiBase = replace_all(xiPath, "RE", TRIM(xiList(xx)))
4343
anaFlow = replace_all(runName(aa), "XI", TRIM(xiList(xx)))
4444
anaFlow = replace_all(anaFlow, "NAME", TRIM(runName(aa)))
45-
anaFlow = replace_all(anaFlow, "EPS", trim(eps))
46-
anaFlow = replace_all(anaFlow, "TMAX", trim(tmax))
45+
anaFlow = replace_all(anaFlow, "EPS", TRIM(eps))
46+
anaFlow = replace_all(anaFlow, "TMAX", TRIM(tmax))
4747
do ii = 1, SIZE(iconList(aa)%rag)
4848
! Convert into to string
4949
write (iconStr, '(i0)') iconList(aa)%rag(ii)
@@ -218,8 +218,8 @@ subroutine w0Calcs(flowTime, JE4i, JEij, xiNumList, nEval, targws, xEval, &
218218
end subroutine w0Calcs
219219

220220
subroutine processToml(tomlName, producer, eps, tMax, anaDir, xiPath, xiList, &
221-
xiNumList, runName, dataName, iStart, iEnd, iSkip, &
222-
iSep, targws, targwt, w0PhysMean, w0PhysErr)
221+
xiNumList, runName, dataName, iStart, iEnd, iSkip, &
222+
iSep, targws, targwt, w0PhysMean, w0PhysErr)
223223
! Get all the values for the toml
224224
! this toml is so much harder than doing it in python...
225225
character(len=*), intent(in) :: tomlName
@@ -266,18 +266,23 @@ subroutine processToml(tomlName, producer, eps, tMax, anaDir, xiPath, xiList, &
266266
! Make an array of the xi in numbers
267267
xiNumList = to_num(xiList, xiNumList)
268268
! If xiREList is present, then put that in xiList instead
269-
call get_value(table, toml_path("data", "xiREList"), top_array, requested=.false., stat=tomlStatus)
270-
if( tomlStatus == toml_stat%success) then
269+
!call get_value(table, toml_path("data", "xiREList"), top_array, requested=.false., stat=tomlStatus)
270+
call get_value(table, toml_path("data", "xiREList"), top_array, stat=tomlStatus)
271+
if (tomlStatus == toml_stat%success) then
271272
if (LEN(top_array) == data_len) then
272-
do ii=1, data_len
273+
do ii = 1, data_len
273274
call get_value(top_array, ii, strRead)
274275
xiList(ii) = strRead
275-
deallocate(strRead)
276+
deallocate (strRead)
276277
end do
278+
else if (LEN(top_array) == 0) then
279+
! Requested does not seem to be working properly..
280+
! So this is a second test of sorts
281+
xiList = xiList
277282
else
278-
write(*,*) 'len(xiREList) != len(xiList)'
279-
write(*,*) LEN(top_array), data_len
280-
write(*,*) 'Exiting'
283+
write (*, *) 'len(xiREList) != len(xiList)'
284+
write (*, *) LEN(top_array), data_len
285+
write (*, *) 'Exiting'
281286
stop
282287
end if
283288
end if
@@ -292,8 +297,11 @@ subroutine processToml(tomlName, producer, eps, tMax, anaDir, xiPath, xiList, &
292297
end do
293298
! dataName
294299
! dataName is optional
295-
call get_value(table, toml_path("data", "dataName"), top_array, requested=.false., stat=tomlStatus)
296-
if (tomlStatus /= toml_stat%success) then
300+
! Requested not working properly...
301+
! Still giving a success even when not found
302+
!call get_value(table, toml_path("data", "dataName"), top_array, requested=.false., stat=tomlStatus)
303+
call get_value(table, toml_path("data", "dataName"), top_array, stat=tomlStatus)
304+
if (tomlStatus /= toml_stat%success .OR. LEN(top_array) == 0) then
297305
! Fill dataName with runName instead as dataName not found
298306
call get_value(table, toml_path("data", "runName"), top_array)
299307
data_len = LEN(top_array)
@@ -306,23 +314,23 @@ subroutine processToml(tomlName, producer, eps, tMax, anaDir, xiPath, xiList, &
306314
else
307315
! dataName exists
308316
! dataName is same length as runName
309-
allocate(dataName(data_len))
317+
allocate (dataName(data_len))
310318
if (LEN(top_array) == 1) then
311319
! Fill all with identical name
312320
call get_value(top_array, 1, strRead)
313321
dataName(:) = strRead
314-
deallocate(strRead)
322+
deallocate (strRead)
315323
else if (LEN(top_array) == data_len) then
316324
! possibily unique names per runName
317-
do ii=1, LEN(top_array)
325+
do ii = 1, LEN(top_array)
318326
call get_value(top_array, ii, strRead)
319327
dataName(ii) = strRead
320-
deallocate(strRead)
328+
deallocate (strRead)
321329
end do
322330
else
323-
write(*,*) 'dataName must either have length 1 (still a list)'
324-
write(*,*) 'or must have equal length as runName'
325-
write(*,*) 'Exiting'
331+
write (*, *) 'dataName must either have length 1 (still a list)'
332+
write (*, *) 'or must have equal length as runName'
333+
write (*, *) 'Exiting'
326334
stop
327335
end if
328336
end if

0 commit comments

Comments
 (0)