| 1 |
!{ dg-do run { target fd_truncate } } |
| 2 |
! PR26136 Filling logical variables from namelist read when object list is not |
| 3 |
! complete. Test case derived from PR. |
| 4 |
! Contributed by Jerry DeLisle <[email protected]> |
| 5 |
program read_logical |
| 6 |
implicit none |
| 7 |
logical, dimension(4) :: truely |
| 8 |
integer, dimension(4) :: truely_a_very_long_variable_name |
| 9 |
namelist /mynml/ truely |
| 10 |
namelist /mynml/ truely_a_very_long_variable_name |
| 11 |
|
| 12 |
truely = .false. |
| 13 |
truely_a_very_long_variable_name = 0 |
| 14 |
|
| 15 |
open(10, status="scratch") |
| 16 |
write(10,*) "&mynml" |
| 17 |
write(10,*) "truely = trouble, traffic .true" |
| 18 |
write(10,*) "truely_a_very_long_variable_name = 4, 4, 4" |
| 19 |
write(10,*) "/" |
| 20 |
rewind(10) |
| 21 |
read (10, nml=mynml, err = 1000) |
| 22 |
if (.not.all(truely(1:3))) STOP 1 |
| 23 |
if (.not.all(truely_a_very_long_variable_name(1:3).eq.4)) STOP 2 |
| 24 |
|
| 25 |
truely = .false. |
| 26 |
truely_a_very_long_variable_name = 0 |
| 27 |
|
| 28 |
rewind(10) |
| 29 |
write(10,*) "&mynml" |
| 30 |
write(10,*) "truely = .true., .true.," |
| 31 |
write(10,*) "truely_a_very_long_variable_name = 4, 4, 4" |
| 32 |
write(10,*) "/" |
| 33 |
rewind(10) |
| 34 |
read (10, nml=mynml, err = 1000) |
| 35 |
if (.not.all(truely(1:2))) STOP 3 |
| 36 |
if (.not.all(truely_a_very_long_variable_name(1:3).eq.4)) STOP 4 |
| 37 |
|
| 38 |
truely = .true. |
| 39 |
truely_a_very_long_variable_name = 0 |
| 40 |
|
| 41 |
rewind(10) |
| 42 |
write(10,*) "&mynml" |
| 43 |
write(10,*) "truely = .false., .false.," |
| 44 |
write(10,*) "truely_a_very_long_variable_name = 4, 4, 4" |
| 45 |
write(10,*) "/" |
| 46 |
rewind(10) |
| 47 |
read (10, nml=mynml, err = 1000) |
| 48 |
if (all(truely(1:2))) STOP 5 |
| 49 |
if (.not.all(truely_a_very_long_variable_name(1:3).eq.4)) STOP 6 |
| 50 |
close(10) |
| 51 |
stop |
| 52 |
1000 STOP 7 |
| 53 |
end program read_logical |