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

Commit

Permalink
Minor bug fixes to fraggle netcdf
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Dec 10, 2022
1 parent 536f318 commit beaef0b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/fraggle/fraggle_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,16 @@ module subroutine fraggle_io_write_frame(self, nc, param)

call check( nf90_put_var(nc%id, nc%time_varid, self%t, start=[eslot]), "fraggle_io_write_frame nf90_put_var time_varid" )
call check( nf90_put_var (nc%id, nc%loop_varid, int(self%iloop,kind=I4B), start=[eslot]), "fraggle_io_write_frame nf90_put_varloop_varid" )
call check( nf90_put_var(nc%id, nc%regime_varid, REGIME_NAMES(fragments%regime) , start=[eslot]), "fraggle_io_write_frame nf90_put_var regime_varid" )
charstring = trim(adjustl(REGIME_NAMES(fragments%regime)))
call check( nf90_put_var(nc%id, nc%regime_varid, charstring, start=[1, eslot], count=[len(charstring), 1]), "fraggle_io_write_frame nf90_put_var regime_varid" )

! Stage 1: The Colliders
npl = pl%nbody
do i = 1, npl
idslot = pl%id(i) + 1
call check( nf90_put_var(nc%id, nc%id_varid, pl%id(i), start=[ idslot ]), "fraggle_io_write_frame nf90_put_var id_varid" )
charstring = trim(adjustl(pl%info(i)%name))
call check( nf90_put_var(nc%id, nc%name_varid, charstring, start=[1, idslot], count=[len(charstring), 1]), "fraggle_io_write_frame nf90_put_var name_varid" )
call check( nf90_put_var(nc%id, nc%name_varid, charstring, start=[1, idslot ], count=[len(charstring), 1]), "fraggle_io_write_frame nf90_put_var name_varid" )
charstring = trim(adjustl(pl%info(i)%particle_type))
call check( nf90_put_var(nc%id, nc%ptype_varid, charstring, start=[1, idslot, eslot], count=[len(charstring), 1, 1]), "fraggle_io_write_frame nf90_put_var particle_type_varid" )

Expand All @@ -189,9 +190,11 @@ module subroutine fraggle_io_write_frame(self, nc, param)
call check( nf90_put_var(nc%id, nc%radius_varid, pl%radius(i), start=[ idslot, 1, eslot]), "fraggle_io_write_frame nf90_put_var radius_varid" )
call check( nf90_put_var(nc%id, nc%Ip_varid, pl%Ip(:,i), start=[1, idslot, 1, eslot], count=[NDIM,1,1,1]), "fraggle_io_write_frame nf90_put_var Ip_varid" )
call check( nf90_put_var(nc%id, nc%rot_varid, pl%rot(:,i), start=[1, idslot, 1, eslot], count=[NDIM,1,1,1]), "fraggle_io_write_frame nf90_put_var rotx_varid" )

end do

! Stage 2: The fragments


call check( nf90_set_fill(nc%id, old_mode, old_mode) )
end select
end associate
Expand Down

0 comments on commit beaef0b

Please sign in to comment.