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

Commit

Permalink
Fixed issues related to getting the status variables correctly determ…
Browse files Browse the repository at this point in the history
…ined on a restart
  • Loading branch information
daminton committed Jan 17, 2023
1 parent 9683841 commit ba3dbc9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/swiftest/swiftest_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,7 @@ module subroutine swiftest_io_netcdf_get_valid_masks(self, plmask, tpmask)

associate(tslot => self%tslot)

call netcdf_io_check( nf90_get_var(self%id, self%Gmass_varid, Gmass, start=[1,1], count=[idmax,1]), "swiftest_io_netcdf_get_valid_masks nf90_getvar Gmass_varid" )
call netcdf_io_check( nf90_get_var(self%id, self%Gmass_varid, Gmass, start=[1,tslot], count=[idmax,1]), "swiftest_io_netcdf_get_valid_masks nf90_getvar Gmass_varid" )

status = nf90_inq_varid(self%id, self%status_varname, self%status_varid)
if (status == NF90_NOERR) then
Expand Down Expand Up @@ -1258,10 +1258,9 @@ module subroutine swiftest_io_netcdf_read_hdr_system(self, nc, param)
idmax = size(plmask)
allocate(plmmask(idmax))
allocate(Gmtemp(idmax))
call netcdf_io_check( nf90_get_var(nc%id, nc%Gmass_varid, Gmtemp, start=[1,1], count=[idmax,1]), "netcdf_io_read_hdr_system nf90_getvar Gmass_varid" )
where(plmask(:))
plmmask(:) = Gmtemp(:) > param%GMTINY
endwhere
call netcdf_io_check( nf90_get_var(nc%id, nc%Gmass_varid, Gmtemp, start=[1,tslot], count=[idmax,1]), "netcdf_io_read_hdr_system nf90_getvar Gmass_varid" )
where(Gmtemp(:) /= Gmtemp(:)) Gmtemp(:) = 0.0_DP
plmmask(:) = plmask(:) .and. Gmtemp(:) > param%GMTINY
else
plmmask(:) = plmask(:)
end if
Expand Down Expand Up @@ -1737,7 +1736,7 @@ module subroutine swiftest_io_netcdf_write_info_body(self, nc, param)
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
! Internals
integer(I4B) :: i, j, idslot, old_mode
integer(I4B), dimension(:), allocatable :: ind, body_status
integer(I4B), dimension(:), allocatable :: ind
character(len=NAMELEN) :: charstring

call netcdf_io_check( nf90_set_fill(nc%id, NF90_NOFILL, old_mode), "netcdf_io_write_info_body nf90_set_fill NF90_NOFILL" )
Expand Down

0 comments on commit ba3dbc9

Please sign in to comment.