diff options
-rw-r--r-- | param.ccl | 9 | ||||
-rw-r--r-- | src/EHFinder_Init.F90 | 14 | ||||
-rw-r--r-- | src/EHFinder_ReadData.F90 | 32 |
3 files changed, 39 insertions, 16 deletions
@@ -30,6 +30,15 @@ BOOLEAN read_conformal_factor_once "Should the conformal factor only be read onc { } "yes" +BOOLEAN cheat "Should we cheat and evolve using the last data set for a while?" +{ +} "no" + +CCTK_INT cheat_iterations "For how many iterations should we cheat" +{ +0:* :: "Positive please" +} 0 + KEYWORD initial_f[10] "Initial surface choice" { "sphere" :: "spherical surface" diff --git a/src/EHFinder_Init.F90 b/src/EHFinder_Init.F90 index d9aa13e..478839f 100644 --- a/src/EHFinder_Init.F90 +++ b/src/EHFinder_Init.F90 @@ -36,9 +36,17 @@ subroutine EHFinder_Init_F(CCTK_ARGUMENTS) ! chosen to be consistent with the run producing the numerical data. ! F.ex. if dt was 0.1 but the data was only stored every 4 iterations, the ! parameters should be chosen so that dt now is 0.4. - last_time = abs(cctk_delta_time) * last_iteration_number / & - saved_iteration_every - + last_time = abs(cctk_delta_time) * ( last_iteration_number + & + cheat_iterations ) / saved_iteration_every + + if ( cheat == 1 ) then + last_time = abs(cctk_delta_time) * ( last_iteration_number + & + cheat_iterations ) / saved_iteration_every + cctk_iteration = -cheat_iterations + else + last_time = abs(cctk_delta_time) * last_iteration_number & + / saved_iteration_every + end if cctk_time = last_time ! Allocate the logical array containing the flag determining if the diff --git a/src/EHFinder_ReadData.F90 b/src/EHFinder_ReadData.F90 index 23357d7..89067d5 100644 --- a/src/EHFinder_ReadData.F90 +++ b/src/EHFinder_ReadData.F90 @@ -26,8 +26,9 @@ subroutine EHFinder_Read_Metric(CCTK_ARGUMENTS) ! last_iteration_number (the last iteration in the numerical evolution ! producing the metric) and saved_iteration_every (how often was the metric ! saved) and the current iteration and save it in a string variable. - write(iteration_string,'(i10)') last_iteration_number - & - saved_iteration_every * cctk_iteration + i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, & + last_iteration_number ) + write(iteration_string,'(i10)') i ! Trim the string variable. iteration_string = adjustl(iteration_string) @@ -76,14 +77,15 @@ subroutine EHFinder_Read_Lapse(CCTK_ARGUMENTS) character(len=128) :: in_files, in_vars character(len=10) :: iteration_string - CCTK_INT :: nc, res + CCTK_INT :: i, nc, res ! Figure out which iteration number to read, based on the parameters ! last_iteration_number (the last iteration in the numerical evolution ! producing the metric) and saved_iteration_every (how often was the lapse ! saved) and the current iteration and save it in a string variable. - write(iteration_string,'(i10)') last_iteration_number - & - saved_iteration_every * cctk_iteration + i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, & + last_iteration_number ) + write(iteration_string,'(i10)') i ! Trim the string variable. iteration_string = adjustl(iteration_string) @@ -125,8 +127,10 @@ subroutine EHFinder_Read_Shift(CCTK_ARGUMENTS) ! last_iteration_number (the last iteration in the numerical evolution ! producing the metric) and saved_iteration_every (how often was the metric ! saved) and the current iteration and save it in a string variable. - write(iteration_string,'(i10)') last_iteration_number - & - saved_iteration_every * cctk_iteration + i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, & + last_iteration_number ) + write(iteration_string,'(i10)') i + ! Trim the string variable. iteration_string = adjustl(iteration_string) nc = len_trim(iteration_string) @@ -171,7 +175,7 @@ subroutine EHFinder_Read_Conformal(CCTK_ARGUMENTS) character(len=128) :: in_files, in_vars character(len=10) :: iteration_string - CCTK_INT :: nc, res + CCTK_INT :: i, nc, res ! Figure out which iteration number to read, based on the parameters ! last_iteration_number (the last iteration in the numerical evolution @@ -182,8 +186,9 @@ subroutine EHFinder_Read_Conformal(CCTK_ARGUMENTS) if ( read_conformal_factor_once .gt. 0 ) then write(iteration_string,'(i10)') 0 else - write(iteration_string,'(i10)') last_iteration_number - & - saved_iteration_every * cctk_iteration + i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, & + last_iteration_number ) + write(iteration_string,'(i10)') i end if ! Trim the string variable. @@ -219,14 +224,15 @@ subroutine EHFinder_Read_Mask(CCTK_ARGUMENTS) character(len=128) :: in_files, in_vars character(len=10) :: iteration_string - CCTK_INT :: nc, res + CCTK_INT :: i, nc, res ! Figure out which iteration number to read, based on the parameters ! last_iteration_number (the last iteration in the numerical evolution ! producing the metric) and saved_iteration_every (how often was the metric ! saved) and the current iteration and save it in a string variable. - write(iteration_string,'(i10)') last_iteration_number - & - saved_iteration_every * cctk_iteration + i = min ( last_iteration_number - saved_iteration_every * cctk_iteration, & + last_iteration_number ) + write(iteration_string,'(i10)') i ! Trim the string variable. iteration_string = adjustl(iteration_string) |