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

Commit

Permalink
Fixed dimensionality of the j2rp2 and j4rp4 variables in NetCDF reads…
Browse files Browse the repository at this point in the history
… and writes. Now it only varies in the time dimension
  • Loading branch information
daminton committed Mar 4, 2022
1 parent 8cc8b84 commit 757118c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/io/io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ subroutine io_read_in_cb(self, param)

if (ierr == 0) then

if (self%j2rp2 /= 0.0_DP) param%loblatecb = .true.
param%loblatecb = ((self%j2rp2 /= 0.0_DP) .or. (self%j4rp4 /= 0.0_DP))
if (param%rmin < 0.0) param%rmin = self%radius

select type(cb => self)
Expand Down
13 changes: 5 additions & 8 deletions src/netcdf/netcdf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,9 @@ module function netcdf_read_frame_system(self, iu, param) result(ierr)
if (npl > 0) pl%Q(:) = pack(rtemp, plmask)
end if

call check( nf90_get_var(iu%ncid, iu%j2rp2_varid, rtemp, start=[1, tslot]) )
cb%j2rp2 = rtemp(1)
if (cb%j2rp2 /= 0.0_DP) param%loblatecb = .true.

call check( nf90_get_var(iu%ncid, iu%j4rp4_varid, rtemp, start=[1, tslot]) )
cb%j4rp4 = rtemp(1)
call check( nf90_get_var(iu%ncid, iu%j2rp2_varid, cb%j2rp2, start=[tslot]) )
call check( nf90_get_var(iu%ncid, iu%j4rp4_varid, cb%j4rp4, start=[tslot]) )
param%loblatecb = ((cb%j2rp2 /= 0.0_DP) .or. (cb%j4rp4 /= 0.0_DP))

call self%read_particle_info(iu, param, plmask, tpmask)
end associate
Expand Down Expand Up @@ -978,8 +975,8 @@ module subroutine netcdf_write_frame_base(self, iu, param)

call check( nf90_put_var(iu%ncid, iu%Gmass_varid, self%Gmass, start=[idslot, tslot]) )
if (param%lclose) call check( nf90_put_var(iu%ncid, iu%radius_varid, self%radius, start=[idslot, tslot]) )
call check( nf90_put_var(iu%ncid, iu%j2rp2_varid, self%j2rp2, start=[idslot, tslot]))
call check( nf90_put_var(iu%ncid, iu%j4rp4_varid, self%j4rp4, start=[idslot, tslot]))
call check( nf90_put_var(iu%ncid, iu%j2rp2_varid, self%j2rp2, start=[tslot]))
call check( nf90_put_var(iu%ncid, iu%j4rp4_varid, self%j4rp4, start=[tslot]))
if (param%lrotation) then
call check( nf90_put_var(iu%ncid, iu%Ip1_varid, self%Ip(1), start=[idslot, tslot]) )
call check( nf90_put_var(iu%ncid, iu%Ip2_varid, self%Ip(2), start=[idslot, tslot]) )
Expand Down

0 comments on commit 757118c

Please sign in to comment.