diff --git a/python/swiftest/swiftest/io.py b/python/swiftest/swiftest/io.py index 00bcd914c..0397335d6 100644 --- a/python/swiftest/swiftest/io.py +++ b/python/swiftest/swiftest/io.py @@ -718,9 +718,10 @@ def clean_string_values(param, ds): ------- ds : xarray dataset with the strings cleaned up """ - #ds['name'] = ds['name'].str.decode(encoding='utf-8') - #ds['particle_type'] = ds['particle_type'].str.decode(encoding='utf-8') - # ds['origin_type'] = ds['origin_type'].str.decode(encoding='utf-8') + ds['name'] = ds['name'].str.decode(encoding='utf-8') + ds['particle_type'] = ds['particle_type'].str.decode(encoding='utf-8') + if 'origin_type' in ds: + ds['origin_type'] = ds['origin_type'].str.decode(encoding='utf-8') return ds diff --git a/src/util/util_append.f90 b/src/util/util_append.f90 index 2f7d54474..d6b18d4e8 100644 --- a/src/util/util_append.f90 +++ b/src/util/util_append.f90 @@ -134,7 +134,12 @@ module subroutine util_append_arr_info(arr, source, nold, nsrc, lsource_mask) nnew = count(lsource_mask(1:nsrc)) if (.not.allocated(arr)) then - allocate(arr(nold+nnew)) + select type(source) + class is (symba_particle_info) + allocate(symba_particle_info :: arr(nold+nnew)) + class default + allocate(swiftest_particle_info :: arr(nold+nnew)) + end select else call util_resize(arr, nold + nnew) end if