Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Getting SyMBA info into the NetCDF
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 28, 2021
1 parent 179709c commit d008ac3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions python/swiftest/swiftest/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
7 changes: 6 additions & 1 deletion src/util/util_append.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d008ac3

Please sign in to comment.