diff options
author | allen <allen@f80f6fb6-8356-4fd4-90bc-d84ad503c100> | 1999-09-14 11:37:29 +0000 |
---|---|---|
committer | allen <allen@f80f6fb6-8356-4fd4-90bc-d84ad503c100> | 1999-09-14 11:37:29 +0000 |
commit | 3c6be18956c69f06afcdfa39ed12ad5fe9d8550c (patch) | |
tree | 1a1685015d5636f1cd304f235338f77bb40eb455 | |
parent | b746cb4eba7f858a4013e2adbf70a1f84eaf6b25 (diff) |
Design changes
git-svn-id: http://svn.cactuscode.org/arrangements/CactusWave/WaveToyF90/trunk@15 f80f6fb6-8356-4fd4-90bc-d84ad503c100
-rw-r--r-- | interface.ccl | 4 | ||||
-rw-r--r-- | src/WaveToy.F | 114 |
2 files changed, 60 insertions, 58 deletions
diff --git a/interface.ccl b/interface.ccl index d3e8fda..672a310 100644 --- a/interface.ccl +++ b/interface.ccl @@ -2,7 +2,7 @@ # $Header$ implements: wavetoy - + public: cctk_real scalarevolve type = GF @@ -10,8 +10,6 @@ cctk_real scalarevolve type = GF phi } "The evolved scalar field" -protected: - cctk_real scalarold type = GF { phi_old 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 + + |