src/gray_core.f90: cleanup

- add some comments
- annotate loops
- indent comments
- remove trailing whitespace
- reduce usage of opaque global variables
- use Fortran 90 logical operators
- use Fortran 2003 array syntax
This commit is contained in:
Michele Guerini Rocco 2022-05-10 12:36:37 +02:00
parent 6010a9361b
commit f5ab40f54f
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450
4 changed files with 504 additions and 419 deletions

View File

@ -12,7 +12,7 @@ contains
use gray_params, only : raytracing_parameters
use const_and_precisions, only : half,two
implicit none
type(raytracing_parameters), intent(in) :: rtrparam
type(raytracing_parameters), intent(inout) :: rtrparam
real(wp_), dimension(:,:), intent(out), pointer :: ywork,ypwork, &
gri,psjki,ppabs,ccci
real(wp_), dimension(:,:,:), intent(out), pointer :: xc,du1,ggri
@ -41,6 +41,7 @@ contains
end if
nray = (nrayr-1)*nrayth + 1
jkray1 = (jray1-2)*nrayth + 2
rtrparam%nray = nray
if(nrayr>1) then
twodr2 = two*(rwmax/(nrayr-1))**2

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,7 @@ module gray_params
type raytracing_parameters
real(wp_) :: dst ! Integration step size
real(wp_) :: rwmax ! Normalized maximum radius of beam power
integer :: nrayr, nrayth ! Radial/angular number of rays
integer :: nray, nrayr, nrayth ! Total/radial/angular number of rays
integer :: igrad ! Complex eikonal switch
integer :: nstep ! Max number of integration steps
integer :: idst ! Choice of the integration variable

View File

@ -408,8 +408,7 @@ contains
use const_and_precisions, only : zero, degree
use coreprofiles, only : set_prfan, set_prfspl, temp, fzeff
use dispersion, only : expinit
use gray_params, only : gray_parameters, print_parameters, &
headw, headl
use gray_params, only : gray_parameters, print_parameters
use beams, only : launchangles2n, xgygcoeff
use magsurf_data, only : flux_average, dealloc_surfvec
use beamdata, only : init_btr, dealloc_beam
@ -421,12 +420,12 @@ contains
implicit none
! subroutine arguments
type(gray_parameters), intent(in) :: params
type(gray_parameters), intent(inout) :: params
real(wp_), intent(in) :: pabs, icd
real(wp_), dimension(:), intent(in) :: jphi, jcd, dpdv, currins, pins
real(wp_), intent(out) :: jphip, dpdvp, rhotj, rhotjava, &
rhotp, rhotpav, drhotjava, drhotpav, &
ratjamx,ratjbmx
ratjamx, ratjbmx
! local variables
real(wp_) :: ak0, bres, xgcn