From e9e3a4d6976bd4509011e5fafc84e31afbe99f31 Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Thu, 31 Oct 2024 21:52:06 +0100 Subject: [PATCH] src/gray_equil.f90: fix compilation on intel compilers --- src/gray_equil.f90 | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/src/gray_equil.f90 b/src/gray_equil.f90 index 0f87f8a..cb5ea6d 100644 --- a/src/gray_equil.f90 +++ b/src/gray_equil.f90 @@ -14,16 +14,16 @@ module gray_equil type, abstract :: abstract_equil ! Generic equilibrium interface - real(wp_) :: psi_a = 0 ! Poloidal flux at the edge minus flux on axis, ψ_a - real(wp_) :: phi_a = 0 ! Toroidal flux at the edge (r=a), Φ_a - real(wp_) :: b_axis = 0 ! Value of B_φ at the magnetic axis (used in J_cd def) - real(wp_) :: b_centre = 0 ! Value of B_φ at R_centre (used in Jcd_astra def) - real(wp_) :: r_centre = 1 ! Alternative reference radius for B_φ - real(wp_) :: sgn_bphi = 0 ! Sign of B_φ (>0 means counter-clockwise) - real(wp_) :: axis(2) = [0, 0] ! Magnetic axis position (R₀, z₀) - real(wp_) :: r_range(2) = [-comp_huge, comp_huge] ! R range of the equilibrium domain - real(wp_) :: z_range(2) = [-comp_huge, comp_huge] ! z range of the equilibrium domain - real(wp_) :: z_boundary(2) = [0, 0] ! z range of the plasma boundary + real(wp_) :: psi_a ! Poloidal flux at the edge minus flux on axis, ψ_a + real(wp_) :: phi_a ! Toroidal flux at the edge (r=a), Φ_a + real(wp_) :: b_axis ! Value of B_φ at the magnetic axis (used in J_cd def) + real(wp_) :: b_centre ! Value of B_φ at R_centre (used in Jcd_astra def) + real(wp_) :: r_centre ! Alternative reference radius for B_φ + real(wp_) :: sgn_bphi ! Sign of B_φ (>0 means counter-clockwise) + real(wp_) :: axis(2) ! Magnetic axis position (R₀, z₀) + real(wp_) :: r_range(2) ! R range of the equilibrium domain + real(wp_) :: z_range(2) ! z range of the equilibrium domain + real(wp_) :: z_boundary(2) ! z range of the plasma boundary ! Flux average splines (see `flux_average`) type(spline_simple) :: spline_area, spline_volume @@ -136,6 +136,11 @@ module gray_equil procedure :: flux_contour => vacuum_flux_contour end type + ! Interface for custom type constructor + interface vacuum + procedure :: vacuum_init + end interface + type, extends(abstract_equil) :: numeric_equil ! Numerical equilibrium @@ -1218,6 +1223,23 @@ contains ! Vacuum ! + pure function vacuum_init() result(self) + ! function arguments + type(vacuum) :: self + + self%psi_a = 0 + self%phi_a = 0 + self%b_axis = 0 + self%b_centre = 0 + self%r_centre = 1 + self%sgn_bphi = 0 + self%axis = [0, 0] + self%r_range = [-comp_huge, comp_huge] + self%z_range = [-comp_huge, comp_huge] + self%z_boundary = [0, 0] + end function vacuum_init + + pure subroutine vacuum_pol_flux(self, R, z, psi_n, dpsidr, dpsidz, & ddpsidrr, ddpsidzz, ddpsidrz) ! function arguments