@@ -1257,57 +1257,6 @@ def test_nested_where(fortran_reader, fortran_writer, tmp_path):
12571257 " 'UnresolvedType'. Consider adding the name of the file "
12581258 "containing the declaration of this quantity to RESOLVE_IMPORTS." )
12591259
1260- # If some information is provided, one of the WHEREs can be resolved, but
1261- # the other still is a CodeBlock
1262- code = ("module my_mod\n "
1263- " use some_mod\n "
1264- "contains\n "
1265- "subroutine my_sub()\n "
1266- " type :: mytype\n "
1267- " real, dimension(10,10,10) :: D11\n "
1268- " real, dimension(10,10,10) :: D12\n "
1269- " real, dimension(10,10,10) :: D22\n "
1270- " end type\n "
1271- " type(mytype) :: p_dal\n "
1272- " WHERE ( z_lenp4(:,:) <= 0.0_wp )\n "
1273- " p_dal%D12(:,:,1) = 0.0_wp\n "
1274- " z_lenp2(:,:) = SQRT( p_dal%D11(:,:,1) * p_dal%D22(:,:,1) )\n "
1275- " WHERE ( z_lenp2(:,:) == 0.0_wp )\n "
1276- " p_dal%D11(:,:,1) = p_ens%D11_min(:,:)\n "
1277- " p_dal%D22(:,:,1) = p_ens%D22_min(:,:)\n "
1278- " z_lenp2(:,:) = z_lenp2_min(:,:)\n "
1279- " END WHERE\n "
1280- " END WHERE\n "
1281- "end subroutine my_sub\n "
1282- "end module my_mod\n " )
1283- psyir = fortran_reader .psyir_from_source (code )
1284- code = fortran_writer (psyir )
1285- # FIXME
1286- return
1287- assert """
1288- do widx2 = 1, SIZE(z_lenp4, dim=2), 1
1289- do widx1 = 1, SIZE(z_lenp4, dim=1), 1
1290- if (z_lenp4(LBOUND(z_lenp4, dim=1) + widx1 - 1,LBOUND(z_lenp4, dim=2) \
1291- + widx2 - 1) <= 0.0_wp) then
1292- p_dal%D12(widx1,widx2,1) = 0.0_wp
1293- z_lenp2(LBOUND(z_lenp2, dim=1) + widx1 - 1,LBOUND(z_lenp2, dim=2) + \
1294- widx2 - 1) = SQRT(p_dal%D11(widx1,widx2,1) * p_dal%D22(widx1,widx2,1))
1295-
1296- ! PSyclone CodeBlock (unsupported code) reason:
1297- ! - WHERE not supported because 'p_ens' cannot be converted to an \
1298- array due to: Transformation Error: The supplied node should be a Reference \
1299- to a symbol of known type, but 'p_ens%D11_min(:,:)' is 'UnresolvedType'. \
1300- Consider adding the name of the file containing the declaration of this \
1301- quantity to RESOLVE_IMPORTS.
1302- WHERE (z_lenp2(:, :) == 0.0_wp)
1303- p_dal % D11(:, :, 1) = p_ens % D11_min(:, :)
1304- p_dal % D22(:, :, 1) = p_ens % D22_min(:, :)
1305- z_lenp2(:, :) = z_lenp2_min(:, :)
1306- END WHERE
1307- end if
1308- enddo
1309- enddo""" == code
1310-
13111260 # If enough information is provided, both WHEREs are resolved and nested
13121261 code = ("module my_mod\n "
13131262 "contains\n "
0 commit comments