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

Commit

Permalink
fixed bug in netcdf_get_old_f_final_system
Browse files Browse the repository at this point in the history
updated so that it pulls in info from the last timeslot, not from the first. seems to fix Ltot_orig = 0 problem, but angular momentum still isn't conserved.
  • Loading branch information
cwishard committed Oct 25, 2021
1 parent 25f9c4d commit 81514ea
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/netcdf/netcdf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -77,29 +77,29 @@ module function netcdf_get_old_t_final_system(self, param) result(old_t_final)
old_t_final = val(1)

if (param%lenergy) then
call check( nf90_get_var(param%nciu%ncid, param%nciu%KE_orb_varid, val, start=[1], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%KE_orb_varid, val, start=[itmax], count=[1]) )
KE_orb_orig = val(1)

call check( nf90_get_var(param%nciu%ncid, param%nciu%KE_spin_varid, val, start=[1], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%KE_spin_varid, val, start=[itmax], count=[1]) )
KE_spin_orig = val(1)

call check( nf90_get_var(param%nciu%ncid, param%nciu%PE_varid, val, start=[1], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%PE_varid, val, start=[itmax], count=[1]) )
PE_orig = val(1)

self%Eorbit_orig = KE_orb_orig + KE_spin_orig + PE_orig

call check( nf90_get_var(param%nciu%ncid, param%nciu%L_orbx_varid, val, start=[1], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_orbx_varid, val, start=[itmax], count=[1]) )
self%Lorbit_orig(1) = val(1)
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_orby_varid, val, start=[1], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_orby_varid, val, start=[itmax], count=[1]) )
self%Lorbit_orig(2) = val(1)
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_orbz_varid, val, start=[1], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_orbz_varid, val, start=[itmax], count=[1]) )
self%Lorbit_orig(3) = val(1)

call check( nf90_get_var(param%nciu%ncid, param%nciu%L_spinx_varid, val, start=[1], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_spinx_varid, val, start=[itmax], count=[1]) )
self%Lspin_orig(1) = val(1)
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_spiny_varid, val, start=[1], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_spiny_varid, val, start=[itmax], count=[1]) )
self%Lspin_orig(2) = val(1)
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_spinz_varid, val, start=[1], count=[1]) )
call check( nf90_get_var(param%nciu%ncid, param%nciu%L_spinz_varid, val, start=[itmax], count=[1]) )
self%Lspin_orig(3) = val(1)

self%Ltot_orig(:) = self%Lorbit_orig(:) + self%Lspin_orig(:)
Expand Down

0 comments on commit 81514ea

Please sign in to comment.