From 45ec2316d98a04888589fa4a88fd28fcea8f4254 Mon Sep 17 00:00:00 2001 From: Antoine Hoffmann <antoine.hoffmann@epfl.ch> Date: Mon, 7 Aug 2023 19:17:17 +0200 Subject: [PATCH] minor changes --- src/circular_mod.F90 | 1 - src/geometry_mod.F90 | 6 ++---- src/grid_mod.F90 | 9 +++++---- src/miller_mod.F90 | 1 - src/model_mod.F90 | 6 +++--- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/circular_mod.F90 b/src/circular_mod.F90 index cff23018..8a01fb7c 100644 --- a/src/circular_mod.F90 +++ b/src/circular_mod.F90 @@ -8,7 +8,6 @@ MODULE circular USE grid, ONLY: local_Nky, local_Nkx, local_nz, ngz, nzgrid, kyarray, kxarray, zarray, total_nz, local_nz_offset, iodd, ieven ! use discretization USE lagrange_interpolation - USE model implicit none public:: get_circ diff --git a/src/geometry_mod.F90 b/src/geometry_mod.F90 index b20224bc..91b83db3 100644 --- a/src/geometry_mod.F90 +++ b/src/geometry_mod.F90 @@ -99,7 +99,7 @@ CONTAINS subroutine eval_magnetic_geometry USE grid, ONLY: total_nky, total_nz, local_nkx, local_nky, local_nz, ngz,& - kxarray, kyarray, set_kparray, nzgrid, zweights_SR, ieven, set_kxgrid + set_kparray, nzgrid, zweights_SR, ieven, set_kxgrid USE basic, ONLY: speak USE miller, ONLY: set_miller_parameters, get_miller USE circular, ONLY: get_circ @@ -108,10 +108,8 @@ CONTAINS USE species, ONLY: Ptot ! evalute metrix, elementwo_third_kpmaxts, jacobian and gradient implicit none - REAL(xp) :: kx,ky COMPLEX(xp), DIMENSION(local_nz) :: integrant - real(xp) :: Cx, Cy, g_xz, g_yz, g_zz - INTEGER :: eo,iz,iky,ikx + ! Allocate arrays CALL geometry_allocate_mem(local_nky,local_nkx,local_nz,ngz,nzgrid) diff --git a/src/grid_mod.F90 b/src/grid_mod.F90 index 5e52854b..a3e8a7a5 100644 --- a/src/grid_mod.F90 +++ b/src/grid_mod.F90 @@ -73,7 +73,7 @@ MODULE grid integer(C_INTPTR_T), PUBLIC,PROTECTED :: local_nkx_ptr, local_nky_ptr integer(C_INTPTR_T), PUBLIC,PROTECTED :: local_nkx_ptr_offset, local_nky_ptr_offset ! Grid spacing and limits - REAL(xp), PUBLIC, PROTECTED :: deltap, deltaz, inv_deltaz + REAL(xp), PUBLIC, PROTECTED :: deltap, deltaz, inv_deltaz, inv_dkx REAL(xp), PUBLIC, PROTECTED :: deltakx, deltaky, kx_max, ky_max, kx_min, ky_min!, kp_max INTEGER , PUBLIC, PROTECTED :: local_pmin, local_pmax INTEGER , PUBLIC, PROTECTED :: local_jmin, local_jmax @@ -492,7 +492,8 @@ CONTAINS ! x length is adapted Lx = Lx_adapted*Nexc ENDIF - deltakx = 2._xp*PI/Lx + deltakx = 2._xp*PI/Lx + inv_dkx = 1._xp/deltakx IF(MODULO(total_nkx,2) .EQ. 0) THEN ! Even number of kx (-2 -1 0 1 2 3) ! Creating a grid ordered as dk*(0 1 2 3 -2 -1) DO ikx = 1,total_nkx @@ -629,10 +630,10 @@ CONTAINS two_third_kpmax = 2._xp/3._xp * MAXVAL(kparray) END SUBROUTINE - SUBROUTINE update_grids (sky,gxx,gxy,gyy,inv_hatB2) + SUBROUTINE update_grids (sky,gxx,gxy,inv_hatB2) IMPLICIT NONE REAL(xp), DIMENSION(local_nky),INTENT(IN) :: sky ! ExB grid shift - REAL(xp), DIMENSION(local_nz+ngz,nzgrid), INTENT(IN) :: gxx,gxy,gyy,inv_hatB2 + REAL(xp), DIMENSION(local_nz+ngz,nzgrid), INTENT(IN) :: gxx,gxy,inv_hatB2 INTEGER :: eo,iz,iky,ikx REAL(xp) :: kx, ky, skp2 ! Update the kx grid diff --git a/src/miller_mod.F90 b/src/miller_mod.F90 index 463770f7..ad06e944 100644 --- a/src/miller_mod.F90 +++ b/src/miller_mod.F90 @@ -9,7 +9,6 @@ MODULE miller USE grid, ONLY: local_Nky, local_Nkx, local_nz, ngz, nzgrid, kyarray, kxarray, zarray, total_nz, local_nz_offset, iodd, ieven ! use discretization USE lagrange_interpolation - USE model implicit none public:: get_miller, set_miller_parameters diff --git a/src/model_mod.F90 b/src/model_mod.F90 index abd264ee..f74659a8 100644 --- a/src/model_mod.F90 +++ b/src/model_mod.F90 @@ -41,9 +41,9 @@ CONTAINS SUBROUTINE model_readinputs ! Read the input parameters - USE basic, ONLY: lu_in, speak - USE parallel, ONLY: num_procs_p - USE prec_const + USE basic, ONLY: lu_in, speak + USE parallel, ONLY: num_procs_p + USE prec_const, ONLY: xp IMPLICIT NONE NAMELIST /MODEL_PAR/ KERN, LINEARITY, RM_LD_T_EQ, FORCE_SYMMETRY, MHD_PD, & -- GitLab