Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to get Dynap to work with the ny space Charge module. #1148

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/mad_dynap.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ dynap_tables_create(struct in_cmd* cmd)

t = make_table("dynaptune", "dynaptune", dynaptune_table_cols, dynaptune_table_types, npart);
add_to_table_list(t, table_register);

if (table_exists("mytracksumm")) {
/* hrr Sep 2021 table mytracksumm is not cleaned so pre-existence printf is not needed.
printf("Table mytracksumm does exist already\n"); hrr Sep 2021 */
}
else {
t = make_table("mytracksumm", "mytracksumm", mytracksumm_table_cols,
mytracksumm_table_types, 2*stored_track_start->curr);
add_to_table_list(t, table_register);
}

}

// public interface
Expand Down
12 changes: 7 additions & 5 deletions src/trrun.f90
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ subroutine trrun(switch, turns, orbit0, rt, part_id, last_turn, last_pos, &
endif

!--- Write checkpoint_restart data
call BB_Write(jmax, orbit0, z);
call BB_Write(jmax, orbit0, z, dynap);

!--- enter last turn in summary table.
! Add as well as tracksumm recreated each RUN call new permanent table mytracksumm. ! hrr Feb 2022
Expand Down Expand Up @@ -5885,7 +5885,7 @@ subroutine BB_Update2(turn, orbit0, z, part_id, last_turn)

end subroutine BB_Update2

subroutine BB_Write(turn, orbit0, z)
subroutine BB_Write(turn, orbit0, z, dynap)

use spch_bbfi
use trackfi
Expand All @@ -5894,11 +5894,13 @@ subroutine BB_Write(turn, orbit0, z)
use SpaceCharge !hrr Oct 2021

integer, intent(IN) :: turn
logical, intent(In) :: dynap
integer :: i, j

double precision, intent(IN) :: orbit0(6), z(6,N_macro_surv)

! if (bb_sxy_update) then !hrr Dec 2021 checkpoint_restart must not depend on bb_sxy_update

!if (bb_sxy_update) !hrr Dec 2021 checkpoint_restart must not depend on bb_sxy_update
if (.not. dynap) then
rewind unit_chpt
write(unit_chpt) jmax
write(unit_chpt) Ex_rms
Expand All @@ -5911,7 +5913,7 @@ subroutine BB_Write(turn, orbit0, z)
write(unit_chpt) sigma_t
write(unit_chpt) mean_t
write(unit_chpt) N_ini
! endif !hrr Dec 2021
endif
end subroutine BB_Write

subroutine table_input(betx_start, bety_start, &
Expand Down