User: szilagyi Date: 2013/10/30 09:15 PM
Modified: /branches/tapir/src/ NullDecomp_IO.F90
Log: add new function combining IO with ylm projection
File Changes:
Directory: /branches/tapir/src/ ===============================
File [modified]: NullDecomp_IO.F90 Delta lines: +67 -0 =================================================================== --- branches/tapir/src/NullDecomp_IO.F90 2013-10-22 18:26:16 UTC (rev 13) +++ branches/tapir/src/NullDecomp_IO.F90 2013-10-31 02:15:48 UTC (rev 14) @@ -3,12 +3,79 @@ #include "cctk.h" #include "cctk_Parameters.h" #include "cctk_Functions.h" +!include "cctk.h" +!include "cctk_Arguments.h" +!include "cctk_Parameters.h" +!include "cctk_Functions.h"
module NullDecomp_IO implicit none
contains +! CCTK_POINTER, intent(in) :: GH
+subroutine NullDecomp_WriteCoefsForComplexFunc( & + FieldName, GH, TruncateFile, lsh, spin, zeta, f_n, f_s, time) + use NullDecomp_Vars, only: lmax + use NullDecomp_SpinDecomp, only: SpinDecompCoefs + + character(*), intent(in) :: FieldName + CCTK_POINTER, intent(in) :: GH + logical, intent(in) :: TruncateFile + integer, dimension(2), intent(in) :: lsh + integer, intent(in) :: spin + CCTK_COMPLEX, dimension(lsh(1),lsh(2)), intent(in) :: zeta + CCTK_COMPLEX, dimension(lsh(1),lsh(2)), intent(in) :: f_n, f_s + CCTK_REAL, intent(in) :: time + + CCTK_COMPLEX, dimension(spin:lmax, -lmax:lmax) :: YlmCoef + CCTK_COMPLEX, dimension(lsh(1),lsh(2),2) :: temp + DECLARE_CCTK_FUNCTIONS + + temp(:,:,1) = f_n + temp(:,:,2) = f_s + + call SpinDecompCoefs(GH, lsh(1), lsh(2), spin, zeta, temp, YlmCoef) + + if (CCTK_MyProc(GH) .gt. 0) then + return + endif + + call NullDecomp_WriteCoefFile(FieldName, TruncateFile, spin, lmax, YlmCoef, time) + +end subroutine NullDecomp_WriteCoefsForComplexFunc + + +subroutine NullDecomp_WriteCoefsForRealFunc( & + FieldName, GH, TruncateFile, lsh, zeta, f_n, f_s, time) + use NullDecomp_Vars, only: lmax + use NullDecomp_SpinDecomp, only: SpinDecompCoefs + + character(*), intent(in) :: FieldName + CCTK_POINTER, intent(in) :: GH + logical, intent(in) :: TruncateFile + integer, dimension(2), intent(in) :: lsh + CCTK_COMPLEX, dimension(lsh(1),lsh(2)), intent(in) :: zeta + CCTK_REAL, dimension(lsh(1),lsh(2)), intent(in) :: f_n, f_s + CCTK_REAL, intent(in) :: time + + CCTK_COMPLEX, dimension(0:lmax, -lmax:lmax) :: YlmCoef + CCTK_COMPLEX, dimension(lsh(1),lsh(2),2) :: temp + DECLARE_CCTK_FUNCTIONS + + temp(:,:,1) = f_n + temp(:,:,2) = f_s + + call SpinDecompCoefs(GH, lsh(1), lsh(2), 0, zeta, temp, YlmCoef) + + if (CCTK_MyProc(GH) .gt. 0) then + return + endif + + call NullDecomp_WriteCoefFile(FieldName, TruncateFile, 0, lmax, YlmCoef, time) + +end subroutine NullDecomp_WriteCoefsForRealFunc + subroutine NullDecomp_WriteCoefFile(FieldName, TruncateFile, Lmin, Lmax, YlmCoef, time) character(*), intent(in) :: FieldName logical, intent(in) :: TruncateFile