diff options
-rw-r--r-- | schedule.ccl | 21 | ||||
-rw-r--r-- | src/EHFinder_Init.F90 | 76 |
2 files changed, 63 insertions, 34 deletions
diff --git a/schedule.ccl b/schedule.ccl index ade0b15..4ff5fe0 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -75,13 +75,30 @@ if (use_mask) # Set up the initial level set function -schedule EHFinder_Init at CCTK_POSTINITIAL +schedule EHFinder_Init at CCTK_INITIAL +{ + LANG: Fortran + SYNC: level_set +} "Setup local variables" + +schedule EHFinder_Init_F at CCTK_INITIAL { LANG: Fortran SYNC: level_set } "Setup the initial surface" -schedule EHFinder_InitWeights at CCTK_POSTINITIAL +schedule EHFinder_InitWeights at CCTK_INITIAL +{ + LANG: FORTRAN +} "Setup weights for Simpson integration" + +schedule EHFinder_Init at CCTK_POST_RECOVER_VARIABLES +{ + LANG: Fortran + SYNC: level_set +} "Setup local variables" + +schedule EHFinder_InitWeights at CCTK_POST_RECOVER_VARIABLES { LANG: FORTRAN } "Setup weights for Simpson integration" diff --git a/src/EHFinder_Init.F90 b/src/EHFinder_Init.F90 index c8e2f19..cf700f3 100644 --- a/src/EHFinder_Init.F90 +++ b/src/EHFinder_Init.F90 @@ -5,7 +5,7 @@ #include "cctk_Parameters.h" #include "cctk_Arguments.h" -subroutine EHFinder_Init(CCTK_ARGUMENTS) +subroutine EHFinder_Init_F(CCTK_ARGUMENTS) use EHFinder_mod @@ -16,13 +16,10 @@ subroutine EHFinder_Init(CCTK_ARGUMENTS) DECLARE_CCTK_FUNCTIONS CCTK_INT :: i, j, k - CCTK_REAL :: last_time CCTK_REAL, dimension(3) :: xp, xpt CCTK_REAL, dimension(3,3) :: txyz CCTK_REAL :: cosa, sina, cosb, sinb, cosc, sinc - - ! Set up the value used in interiour inactive cells. - ex_value = - ( one + shell_width ) * maxval(cctk_delta_space) + CCTK_REAL :: last_time ! Initialize the current_iteration variable. current_iteration = last_iteration_number @@ -36,13 +33,6 @@ subroutine EHFinder_Init(CCTK_ARGUMENTS) cctk_time = last_time - ! Initialize nx, ny and nz based on the local gris size. They are defined - ! in the module EHFinder_mod and will therefore be known from now on by all - ! routine that uses this module. - nx = cctk_lsh(1) - ny = cctk_lsh(2) - nz = cctk_lsh(3) - ! If a sphere is requested... if ( CCTK_EQUALS( initial_f, 'sphere' ) ) then @@ -104,6 +94,29 @@ subroutine EHFinder_Init(CCTK_ARGUMENTS) ! Initialise the internal mask. eh_mask = 0 + return +end subroutine EHFinder_Init_F + +subroutine EHFinder_Init(CCTK_ARGUMENTS) + + use EHFinder_mod + + implicit none + + DECLARE_CCTK_PARAMETERS + DECLARE_CCTK_ARGUMENTS + DECLARE_CCTK_FUNCTIONS + + ! Set up the value used in interiour inactive cells. + ex_value = - ( one + shell_width ) * maxval(cctk_delta_space) + + ! Initialize nx, ny and nz based on the local gris size. They are defined + ! in the module EHFinder_mod and will therefore be known from now on by all + ! routine that uses this module. + nx = cctk_lsh(1) + ny = cctk_lsh(2) + nz = cctk_lsh(3) + ! Find the maximal grid spacing. delta = maxval ( cctk_delta_space ) @@ -127,25 +140,24 @@ subroutine EHFinder_Init(CCTK_ARGUMENTS) call CCTK_WARN(0,'Could not obtain a handle for sum reduction') end if - ! Register a coodinatsystem for the 2D surface grid arrays. This has no - ! effect yet, but should do something useful, when TAGS can be used to - ! assign coordinates to grid arrays. - call CCTK_CoordRegisterSystem ( ierr, 2, 'cart2d' ) - if ( ierr .lt. 0 ) then - call CCTK_WARN(0,'Could not register a 2D coordinate system as "cart2d"') - end if - call CCTK_CoordRegisterData ( ierr, 1, 'ehfinder::ctheta', & - 'x', 'cart2d' ) - if ( ierr .lt. 0 ) then - call CCTK_WARN(0,'Could not register ctheta as the 1st coordinate for "cart2d"') - end if - call CCTK_CoordRegisterData ( ierr, 2, 'ehfinder::cphi', & - 'y', 'cart2d' ) - if ( ierr .lt. 0 ) then - call CCTK_WARN(0,'Could not register cphi as the 2nd coordinate for "cart2d"') - end if +! ! Register a coodinatsystem for the 2D surface grid arrays. This has no +! ! effect yet, but should do something useful, when TAGS can be used to +! ! assign coordinates to grid arrays. +! call CCTK_CoordRegisterSystem ( ierr, 2, 'cart2d' ) +! if ( ierr .lt. 0 ) then +! call CCTK_WARN(1,'Could not register a 2D coordinate system as "cart2d"') +! end if +! call CCTK_CoordRegisterData ( ierr, 1, 'ehfinder::ctheta', & +! 'x', 'cart2d' ) +! if ( ierr .lt. 0 ) then +! call CCTK_WARN(1,'Could not register ctheta as the 1st coordinate for "cart2d"') +! end if +! call CCTK_CoordRegisterData ( ierr, 2, 'ehfinder::cphi', & +! 'y', 'cart2d' ) +! if ( ierr .lt. 0 ) then +! call CCTK_WARN(1,'Could not register cphi as the 2nd coordinate for "cart2d"') +! end if +! +! call CCTK_INFO('2d coordinate system registered') - call CCTK_INFO('2d coordinate system registered') - - return end subroutine EHFinder_Init |