From 3c6be18956c69f06afcdfa39ed12ad5fe9d8550c Mon Sep 17 00:00:00 2001 From: allen Date: Tue, 14 Sep 1999 11:37:29 +0000 Subject: Design changes git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyF90/trunk@15 f80f6fb6-8356-4fd4-90bc-d84ad503c100 --- src/WaveToy.F | 114 ++++++++++++++++++++++++++++++---------------------------- 1 file changed, 59 insertions(+), 55 deletions(-) (limited to 'src/WaveToy.F') diff --git a/src/WaveToy.F b/src/WaveToy.F index 460af4f..f1fc49a 100644 --- a/src/WaveToy.F +++ b/src/WaveToy.F @@ -7,53 +7,15 @@ @enddesc @@*/ +! Using Cactus infrastructure #include "cctk.h" -#include "cctk_parameters.h" -#include "cctk_arguments.h" - - - /*@@ - @routine WaveToyF90_Boundaries - @date - @author Tom Goodale - @desc - Boundary conditions for the wave equation - @enddesc - @calls ApplyFlatBC,ApplyRadiativeBC - @calledby - @history - - @endhistory - -@@*/ - - subroutine WaveToyF90_Boundaries(CCTK_FARGUMENTS) - - implicit none - DECLARE_CCTK_FARGUMENTS - DECLARE_CCTK_PARAMETERS - - integer :: ierr - integer,dimension(3):: sw=1 - CCTK_REAL,parameter :: zero = 0.0 - integer CCTK_Equals - - call ApplySymmetry(cctkGH,"wavetoy::scalarevolve") - - if (CCTK_EQUALS(bound,"flat")) then - call ApplyFlatBC(ierr,cctkGH,sw,"wavetoy::phi") - else if (CCTK_EQUALS(bound,"radiation")) then - call ApplyRadiativeBC(ierr,cctkGH,zero,sw,"wavetoy::phi","wavetoy::phi_old") - end if - - if (ierr < 0) then - call CCTK_WARN(0,"Boundary conditions not applied - giving up!"); - end if +! Using Cactus parameters +#include "cctk_parameters.h" - end subroutine wavetoyf90_boundaries +! Using Cactus arguments lists +#include "cctk_arguments.h" -c -------------------------------------------------------------- /*@@ @routine WaveToyF90_Evolution @@ -84,10 +46,10 @@ c Declare local variables c Set up shorthands c ----------------- - dx = cctk_delta_space(1) - dy = cctk_delta_space(2) - dz = cctk_delta_space(3) - dt = cctk_delta_time + dx = CCTK_DELTA_SPACE(1) + dy = CCTK_DELTA_SPACE(2) + dz = CCTK_DELTA_SPACE(3) + dt = CCTK_DELTA_TIME istart = 2 jstart = 2 @@ -115,23 +77,65 @@ c ---------------- end do end do -c Update timeslices -c ----------------- +! Update timeslices +! ----------------- phi_old = phi phi = phi_tmp -c Apply boundary conditions -c ------------------------- - call wavetoyf90_boundaries(CCTK_FARGUMENTS) +! Apply boundary conditions +! ------------------------- + call WaveToyF90_Boundaries(CCTK_FARGUMENTS) -c Synchronize -c ----------- +! Synchronize +! ----------- call CCTK_SyncGroup(cctkGH,"wavetoy::scalarevolve") end subroutine wavetoyf90_evolution -c -------------------------------------------------------------- + /*@@ + @routine WaveToyF90_Boundaries + @date + @author Tom Goodale + @desc + Boundary conditions for the wave equation + @enddesc + @calls ApplyFlatBC,ApplyRadiativeBC + @calledby + @history + + @endhistory + +@@*/ + + subroutine WaveToyF90_Boundaries(CCTK_FARGUMENTS) + + implicit none + + DECLARE_CCTK_FARGUMENTS + DECLARE_CCTK_PARAMETERS + + integer :: ierr + integer CCTK_Equals + integer,dimension(3):: sw=1 + CCTK_REAL,parameter :: zero = 0.0 + + call ApplySymmetry(cctkGH,"wavetoy::scalarevolve") + + if (CCTK_EQUALS(bound,"flat")) then + call ApplyFlatBC(ierr,cctkGH,sw,"wavetoy::phi") + else if (CCTK_EQUALS(bound,"radiation")) then + call ApplyRadiativeBC(ierr,cctkGH,zero,sw, + & "wavetoy::phi","wavetoy::phi_old") + end if + + if (ierr < 0) then + call CCTK_WARN(0,"Boundary conditions not applied - giving up!"); + end if + + end subroutine wavetoyf90_boundaries + + -- cgit v1.2.3