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

Commit

Permalink
Merge branch 'debug' into IntelAdvisor
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Oct 25, 2021
2 parents 7f30dc2 + 7f95561 commit 81d12c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/encounter/encounter_check.f90
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ subroutine encounter_check_reduce_broadphase(n, nenc, index1, index2, lencounter
logical, dimension(:), allocatable :: ltmp

nenc = count(lencounter(:)) ! Count the true number of encounters
if (nenc == 0) then
if (allocated(index1)) deallocate(index1)
if (allocated(index2)) deallocate(index2)
if (allocated(lvdotr)) deallocate(lvdotr)
return
end if

allocate(itmp(nenc))
itmp(:) = pack(index1(:), lencounter(:))
Expand Down
7 changes: 4 additions & 3 deletions src/netcdf/netcdf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ module function netcdf_get_old_t_final_system(self, param) result(old_t_final)
real(DP), dimension(1) :: val
real(DP) :: KE_orb_orig, KE_spin_orig, PE_orig, Ltmp

call param%nciu%open(param)
call param%nciu%open(param, readonly=.true.)
call check( nf90_inquire_dimension(param%nciu%ncid, param%nciu%time_dimid, len=itmax) )
call check( nf90_inquire_dimension(param%nciu%ncid, param%nciu%id_dimid, len=idmax) )
allocate(vals(idmax))
call check( nf90_get_var(param%nciu%ncid, param%nciu%time_varid, val, start=[itmax], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%time_varid, val, start=[1], count=[1]) )

old_t_final = val(1)

Expand Down Expand Up @@ -110,6 +110,7 @@ module function netcdf_get_old_t_final_system(self, param) result(old_t_final)
end if

deallocate(vals)
call param%nciu%close()

return
end function netcdf_get_old_t_final_system
Expand Down Expand Up @@ -350,7 +351,7 @@ module subroutine netcdf_open(self, param, readonly)
if (readonly) mode = NF90_NOWRITE
end if

call check( nf90_open(param%outfile, NF90_WRITE, self%ncid) )
call check( nf90_open(param%outfile, mode, self%ncid) )

call check( nf90_inq_dimid(self%ncid, TIME_DIMNAME, self%time_dimid) )
call check( nf90_inq_dimid(self%ncid, ID_DIMNAME, self%id_dimid) )
Expand Down

0 comments on commit 81d12c8

Please sign in to comment.