diff --git a/Makefile.Defines b/Makefile.Defines index 046d9d3f9..9f002eeda 100644 --- a/Makefile.Defines +++ b/Makefile.Defines @@ -48,10 +48,10 @@ COLLRESOLVE_HOME = $(ROOT_DIR)/collresolve/ ADVIXE_FLAGS = -g -O2 -qopt-report=5 -vecabi=cmdtarget -simd -shared-intel -debug inline-debug-info -DTBB_DEBUG -DTBB_USE_THREADING_TOOLS -xhost -traceback -I$(ADVISOR_2019_DIR)/include/intel64 -parallel-source-info=2 #Be sure to set the environment variable KMP_FORKJOIN_FRAMES=1 for OpenMP debuging in vtune -IDEBUG = -O0 -init=snan,arrays -nogen-interfaces -no-pie -no-ftz -fpe-all=0 -g -traceback -mp1 -qopt-matmul -fp-model strict -fpe0 -debug all -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin +IDEBUG = -O0 -init=snan,arrays -nogen-interfaces -no-pie -no-ftz -fpe-all=0 -g -traceback -mp1 -qopt-matmul -fp-model strict -fpe0 -debug all -align all -pad -ip -prec-div -prec-sqrt -assume protect-parens -CB -no-wrap-margin STRICTREAL = -fp-model=precise -prec-div -prec-sqrt -assume protect-parens SIMDVEC = -simd -xhost -align all -assume contiguous_assumed_shape -vecabi=cmdtarget -fp-model no-except -fma -PAR = -qopenmp -parallel +PAR = -qopenmp -parallel -parallel-source-info=2 HEAPARR = -heap-arrays 4194304 OPTREPORT = -qopt-report=5 IPRODUCTION = -no-wrap-margin -O3 -qopt-prefetch=0 -qopt-matmul -sox $(PAR) $(SIMDVEC) #$(HEAPARR) diff --git a/src/io/io.f90 b/src/io/io.f90 index c657ec058..ec16f207b 100644 --- a/src/io/io.f90 +++ b/src/io/io.f90 @@ -1355,7 +1355,6 @@ subroutine io_read_in_cb(self, param) close(iu, err = 667, iomsg = errmsg) if (ierr == 0) then - if (self%j2rp2 /= 0.0_DP) param%loblatecb = .true. if (param%rmin < 0.0) param%rmin = self%radius diff --git a/src/kick/kick.f90 b/src/kick/kick.f90 index 891936f20..c3e37d927 100644 --- a/src/kick/kick.f90 +++ b/src/kick/kick.f90 @@ -189,7 +189,7 @@ module subroutine kick_getacch_int_all_triangular_pl(npl, nplm, x, Gmass, radius end do !$omp end parallel do else - !$omp parallel do default(private) schedule(static)& + !$omp parallel do default(private) schedule(static)& !$omp shared(npl, nplm, x, Gmass, radius) & !$omp lastprivate(rji2, xr, yr, zr) & !$omp reduction(+:ahi) & diff --git a/src/netcdf/netcdf.f90 b/src/netcdf/netcdf.f90 index b99188855..fd2406720 100644 --- a/src/netcdf/netcdf.f90 +++ b/src/netcdf/netcdf.f90 @@ -66,6 +66,7 @@ module function netcdf_get_old_t_final_system(self, param) result(old_t_final) integer(I4B) :: itmax, idmax real(DP), dimension(:), allocatable :: vals real(DP), dimension(1) :: val + real(DP), dimension(NDIM) :: rot0 real(DP) :: KE_orb_orig, KE_spin_orig, PE_orig, Ltmp call param%nciu%open(param) @@ -74,7 +75,8 @@ module function netcdf_get_old_t_final_system(self, param) result(old_t_final) allocate(vals(idmax)) call check( nf90_get_var(param%nciu%ncid, param%nciu%time_varid, val, start=[1], count=[1]) ) - old_t_final = val(1) + !old_t_final = val(1) + old_t_final = param%t0 ! For NetCDF it is safe to overwrite the final t value on a restart if (param%lenergy) then call check( nf90_get_var(param%nciu%ncid, param%nciu%KE_orb_varid, val, start=[1], count=[1]) ) @@ -107,6 +109,24 @@ module function netcdf_get_old_t_final_system(self, param) result(old_t_final) call check( nf90_get_var(param%nciu%ncid, param%nciu%Gmass_varid, vals, start=[1,1], count=[idmax,1]) ) self%GMtot_orig = vals(1) + sum(vals(2:idmax), vals(2:idmax) == vals(2:idmax)) + select type(cb => self%cb) + class is (symba_cb) + cb%GM0 = vals(1) + cb%dGM = cb%Gmass - cb%GM0 + + call check( nf90_get_var(param%nciu%ncid, param%nciu%radius_varid, val, start=[1,1], count=[1,1]) ) + cb%R0 = val(1) + + call check( nf90_get_var(param%nciu%ncid, param%nciu%rotx_varid, val, start=[1,1], count=[1,1]) ) + rot0(1) = val(1) + call check( nf90_get_var(param%nciu%ncid, param%nciu%roty_varid, val, start=[1,1], count=[1,1]) ) + rot0(2) = val(1) + call check( nf90_get_var(param%nciu%ncid, param%nciu%rotz_varid, val, start=[1,1], count=[1,1]) ) + rot0(3) = val(1) + + cb%L0(:) = cb%Ip(3) * cb%GM0 * cb%R0**2 * rot0(:) + end select + end if deallocate(vals) diff --git a/src/symba/symba_io.f90 b/src/symba/symba_io.f90 index 80354e064..3e217bc6a 100644 --- a/src/symba/symba_io.f90 +++ b/src/symba/symba_io.f90 @@ -44,6 +44,9 @@ module subroutine symba_io_param_reader(self, unit, iotype, v_list, iostat, ioms ifirst = ilast + 1 param_value = io_get_token(line_trim, ifirst, ilast, iostat) select case (param_name) + case ("OUT_STAT") ! We need to duplicate this from the standard io_param_reader in order to make sure that the restart flag gets set properly in SyMBA + call io_toupper(param_value) + param%out_stat = param_value case ("FRAGMENTATION") call io_toupper(param_value) if (param_value == "YES" .or. param_value == "T") self%lfragmentation = .true. @@ -80,6 +83,8 @@ module subroutine symba_io_param_reader(self, unit, iotype, v_list, iostat, ioms 1 continue close(unit) + param%lrestart = (param%out_stat == "APPEND") + if (self%GMTINY < 0.0_DP) then write(iomsg,*) "GMTINY invalid or not set: ", self%GMTINY iostat = -1