@@ -32,7 +32,7 @@ module input_xml
32
32
subroutine read_input_xml ()
33
33
34
34
call read_settings_xml()
35
- call read_cross_sections_xml()
35
+ if ((run_mode /= MODE_PLOTTING)) call read_cross_sections_xml()
36
36
call read_geometry_xml()
37
37
call read_materials_xml()
38
38
call read_tallies_xml()
@@ -86,7 +86,7 @@ subroutine read_settings_xml()
86
86
! settings.xml file. If no file is found there, then we check the
87
87
! CROSS_SECTIONS environment variable
88
88
89
- if (len_trim (cross_sections_) == 0 ) then
89
+ if (len_trim (cross_sections_) == 0 .and. run_mode /= MODE_PLOTTING ) then
90
90
! No cross_sections.xml file specified in settings.xml, check environment
91
91
! variable
92
92
call get_environment_variable(" CROSS_SECTIONS" , env_variable)
@@ -1035,6 +1035,12 @@ subroutine read_materials_xml
1035
1035
call fatal_error()
1036
1036
end if
1037
1037
1038
+ if (run_mode == MODE_PLOTTING) then
1039
+ ! add to the dictionary and skip xs processing
1040
+ call material_dict % add_key(mat % id, i)
1041
+ cycle
1042
+ end if
1043
+
1038
1044
! =======================================================================
1039
1045
! READ AND PARSE <density> TAG
1040
1046
@@ -2176,13 +2182,11 @@ subroutine read_plots_xml
2176
2182
else
2177
2183
pl % not_found % rgb = (/ 255 , 255 , 255 / )
2178
2184
end if
2179
-
2185
+
2180
2186
! Copy plot type
2181
2187
select case (plot_(i) % type)
2182
2188
case (" slice" )
2183
2189
pl % type = PLOT_TYPE_SLICE
2184
- ! case ("points")
2185
- ! pl % type = PLOT_TYPE_POINTS
2186
2190
case default
2187
2191
message = " Unsupported plot type '" // plot_(i) % type &
2188
2192
// " ' in plot " // trim (to_str(pl % id))
@@ -2267,6 +2271,7 @@ subroutine read_plots_xml
2267
2271
if (pl % color_by == PLOT_COLOR_CELLS) then
2268
2272
2269
2273
if (cell_dict % has_key(col_id)) then
2274
+ col_id = cell_dict % get_key(col_id)
2270
2275
pl % colors(col_id) % rgb = plot_(i) % col_spec_(j) % rgb
2271
2276
else
2272
2277
message = " Could not find cell " // trim (to_str(col_id)) // &
@@ -2277,6 +2282,7 @@ subroutine read_plots_xml
2277
2282
else if (pl % color_by == PLOT_COLOR_MATS) then
2278
2283
2279
2284
if (material_dict % has_key(col_id)) then
2285
+ col_id = material_dict % get_key(col_id)
2280
2286
pl % colors(col_id) % rgb = plot_(i) % col_spec_(j) % rgb
2281
2287
else
2282
2288
message = " Could not find material " // trim (to_str(col_id)) // &
@@ -2288,19 +2294,54 @@ subroutine read_plots_xml
2288
2294
end do
2289
2295
end if
2290
2296
2291
- ! Alter colors based on mask information
2297
+ ! Deal with masks
2292
2298
if (associated (plot_(i) % mask_)) then
2293
- if (size (plot_(i) % mask_) > 1 ) then
2294
- message = " Mutliple masks" // &
2295
- " specified in plot " // trim (to_str(pl % id))
2296
- call fatal_error()
2297
- else if (.not. size (plot_(i) % mask_) == 0 ) then
2298
- do j= 1 ,size (pl % colors)
2299
- if (.not. any (j .eq. plot_(i) % mask_(1 ) % components)) then
2300
- pl % colors(j) % rgb = plot_(i) % mask_(1 ) % background
2301
- end if
2302
- end do
2303
- end if
2299
+
2300
+ select case (size (plot_(i) % mask_))
2301
+ case default
2302
+ message = " Mutliple masks" // &
2303
+ " specified in plot " // trim (to_str(pl % id))
2304
+ call fatal_error()
2305
+ case (0 )
2306
+ case (1 )
2307
+
2308
+ ! First we need to change the user-specified identifiers to indices in
2309
+ ! the cell and material arrays
2310
+ do j= 1 ,size (plot_(i) % mask_(1 ) % components)
2311
+ col_id = plot_(i) % mask_(1 ) % components(j)
2312
+
2313
+ if (pl % color_by == PLOT_COLOR_CELLS) then
2314
+
2315
+ if (cell_dict % has_key(col_id)) then
2316
+ plot_(i) % mask_(1 ) % components(j) = cell_dict % get_key(col_id)
2317
+ else
2318
+ message = " Could not find cell " // trim (to_str(col_id)) // &
2319
+ " specified in the mask in plot " // trim (to_str(pl % id))
2320
+ call fatal_error()
2321
+ end if
2322
+
2323
+ else if (pl % color_by == PLOT_COLOR_MATS) then
2324
+
2325
+ if (material_dict % has_key(col_id)) then
2326
+ plot_(i) % mask_(1 ) % components(j) = material_dict % get_key(col_id)
2327
+ else
2328
+ message = " Could not find material " // trim (to_str(col_id)) // &
2329
+ " specified in the mask in plot " // trim (to_str(pl % id))
2330
+ call fatal_error()
2331
+ end if
2332
+
2333
+ end if
2334
+ end do
2335
+
2336
+ ! Alter colors based on mask information
2337
+ do j= 1 ,size (pl % colors)
2338
+ if (.not. any (j .eq. plot_(i) % mask_(1 ) % components)) then
2339
+ pl % colors(j) % rgb = plot_(i) % mask_(1 ) % background
2340
+ end if
2341
+ end do
2342
+
2343
+ end select
2344
+
2304
2345
end if
2305
2346
2306
2347
! Add plot to dictionary
0 commit comments