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

Commit

Permalink
reassigned pl => self and updated mass in netcdf_read_frame_base
Browse files Browse the repository at this point in the history
  • Loading branch information
cwishard committed Sep 29, 2021
1 parent c528b9a commit 7cf3adf
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/netcdf/netcdf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -373,26 +373,27 @@ module function netcdf_read_frame_base(self, iu, param) result(ierr)
call check( nf90_get_var(iu%ncid, iu%capm_varid, self%capm(j), start=[idslot, tslot]) )
end if

select type(self)
select type(pl => self)
class is (swiftest_pl) ! Additional output if the passed polymorphic object is a massive body
call check( nf90_get_var(iu%ncid, iu%Gmass_varid, self%Gmass(j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%Gmass_varid, pl%Gmass(j), start=[idslot, tslot]) )
pl%mass(j) = pl%Gmass(j) / param%GU
if (param%lrhill_present) then
call check( nf90_get_var(iu%ncid, iu%rhill_varid, self%rhill(j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%rhill_varid, pl%rhill(j), start=[idslot, tslot]) )
end if
if (param%lclose) then
call check( nf90_get_var(iu%ncid, iu%radius_varid, self%radius(j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%radius_varid, pl%radius(j), start=[idslot, tslot]) )
end if
if (param%lrotation) then
call check( nf90_get_var(iu%ncid, iu%Ip1_varid, self%Ip(1, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%Ip2_varid, self%Ip(2, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%Ip3_varid, self%Ip(3, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%rotx_varid, self%rot(1, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%roty_varid, self%rot(2, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%rotz_varid, self%rot(3, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%Ip1_varid, pl%Ip(1, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%Ip2_varid, pl%Ip(2, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%Ip3_varid, pl%Ip(3, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%rotx_varid, pl%rot(1, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%roty_varid, pl%rot(2, j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%rotz_varid, pl%rot(3, j), start=[idslot, tslot]) )
end if
if (param%ltides) then
call check( nf90_get_var(iu%ncid, iu%k2_varid, self%k2(j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%Q_varid, self%Q(j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%k2_varid, pl%k2(j), start=[idslot, tslot]) )
call check( nf90_get_var(iu%ncid, iu%Q_varid, pl%Q(j), start=[idslot, tslot]) )
end if

end select
Expand Down

0 comments on commit 7cf3adf

Please sign in to comment.