Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_maxwell_solvers_base.F90
Go to the documentation of this file.
1 !**************************************************************
2 ! Copyright INRIA
3 !
4 ! This code SeLaLib (for Semi-Lagrangian-Library)
5 ! is a parallel library for simulating the plasma turbulence
6 ! in a tokamak.
7 !
8 ! This software is governed by the CeCILL-B license
9 ! under French law and abiding by the rules of distribution
10 ! of free software. You can use, modify and redistribute
11 ! the software under the terms of the CeCILL-B license as
12 ! circulated by CEA, CNRS and INRIA at the following URL
13 ! "http://www.cecill.info".
14 !**************************************************************
15 !
19 
20 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 #include "sll_memory.h"
22 #include "sll_working_precision.h"
23 #include "sll_maxwell_solvers_macros.h"
24 
25  use sll_m_utilities, only: &
27 
28  implicit none
29 
30  public :: &
32 
33  private
34 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
35 
38 
39  sll_int32 :: nc_eta1
40  sll_int32 :: nc_eta2
41  sll_int32 :: polarization
42  sll_real64 :: e_0
43  sll_real64 :: mu_0
44  sll_real64 :: c
45  sll_real64 :: eta1_min
46  sll_real64 :: eta1_max
47  sll_real64 :: delta_eta1
48  sll_real64 :: eta2_min
49  sll_real64 :: eta2_max
50  sll_real64 :: delta_eta2
51 
52  end type sll_maxwell_solver
53 
54 contains
55 
57  subroutine sll_s_plot_two_fields(fname, n1, n2, f1, f2, iplot, time)
58  character(len=*), intent(in) :: fname
59  sll_int32, intent(in) :: n1
60  sll_int32, intent(in) :: n2
61  sll_real64, dimension(n1, n2), intent(in) :: f1
62  sll_real64, dimension(n1, n2), intent(in) :: f2
63  sll_int32, intent(in) :: iplot
64  sll_real64, intent(in) :: time
65 
66  integer :: i, j
67  character(len=4) :: cplot
68 
69  call sll_s_int2string(iplot, cplot)
70 
71 !write domains
72  open (80, file=fname//cplot//".dat")
73  do i = 1, n1
74  do j = 1, n2
75  write (80, *) i, j, sngl(f1(i, j)), sngl(f2(i, j))
76  end do
77  write (80, *)
78  end do
79  close (80)
80 
81  open (90, file=fname//'plots.gnu', position="append")
82  if (iplot == 1) then
83  rewind(90)
84  !write(90,*)"set xr[-0.1:1.1]"
85  !write(90,*)"set yr[-0.1:1.1]"
86  write (90, *) "set zr[-1.1:1.1]"
87  !write(90,*)"set cbrange[-1:1]"
88  !write(90,*)"set pm3d"
89  write (90, *) "set surf"
90  write (90, *) "set term x11"
91  end if
92  write (90, *) "set title 'Time = ", time, "'"
93  write (90, "(a)", advance='no') "splot '"//fname//cplot//".dat' w lines"
94  write (90, "(a)", advance='no') ",'"//fname//cplot//".dat' u 1:2:4 w lines"
95  close (90)
96 
97  end subroutine sll_s_plot_two_fields
98 
This module contains common subroutines for Maxwell solvers.
subroutine, public sll_s_plot_two_fields(fname, n1, n2, f1, f2, iplot, time)
write files to visualize 2d fields with gnuplot
Some common numerical utilities.
subroutine, public sll_s_int2string(istep, cstep)
Convert an integer < 9999 to a 4 characters string.
    Report Typos and Errors