Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||||
There was a problem hiding this comment.
Pull request overview
This pull request unifies all real number types across the codebase to use real(dp) where dp is an alias for real64 from iso_fortran_env. All floating-point literals have been updated to use the _dp suffix instead of the older d0 notation.
Key Changes:
- Replaced
real(8)andreal(real64)declarations withreal(dp) - Converted floating-point literals from
d0,d-N, anddNsuffixes to_dpande-N_dpformat - Added
use iso_fortran_env, only: dp => real64to all relevant modules - Renamed some variables (e.g.,
Dp→D_plateau,dp→d_p) to avoid naming conflicts with the newdptype parameter
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test_torque.f90 | Updated real types and literals; renamed variable Dp to D_plateau |
| test/test_reslines.f90 | Updated real types and literals |
| test/test_parallel.f90 | Updated real types and literals |
| test/test_omega_prime.f90 | Updated real types and literals |
| test/test_neort_lib.f90 | Updated real types and literals |
| test/test_misc.f90 | Updated real types and literals |
| test/test_frequencies.f90 | Updated real types and literals |
| test/test_bounce.f90 | Updated real types and literals |
| src/util.f90 | Added dp type; updated all real declarations and literals |
| src/transport.f90 | Updated real types; renamed Dp to D_plateau |
| src/resonance.f90 | Updated real types and literals |
| src/profiles.f90 | Updated real types and literals |
| src/orbit.f90 | Updated real types and literals; added import for interface |
| src/nonlin.f90 | Updated real types and literals |
| src/neort.f90 | Updated real types; renamed Dp to D_plateau |
| src/magfie.f90 | Updated real types and literals |
| src/freq.f90 | Updated real types and literals |
| src/driftorbit.f90 | Updated real types and literals |
| src/do_magfie_standalone.f90 | Updated real types and literals |
| src/diag/*.f90 | Updated all diagnostic modules to use dp type |
| src/datatypes.f90 | Updated all data structure fields to use dp |
| src/collis_nbi.f90 | Updated real types; renamed dp → d_p to avoid conflict |
| src/attenuation_factor.f90 | Updated real types and literals |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| D_plateau = pi * vth**3 / (16.0_dp * R0 * iota * (qi * B0 / (mi * c))**2) | ||
| Tphi = (sqrtgBth / c) * qe * (-ni1 * D_plateau * (D(1) * A1 + D(2) * A2)) * AVG_NABLA_S |
There was a problem hiding this comment.
The variable name was changed from dp to D_plateau on line 87, but the variable name Dp (without underscore) is still used on line 98. This should be D_plateau to match the variable declaration.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
| Dp = pi*vth**3/(16d0*R0*iota*(qi*B0/(mi*c))**2) | ||
| dsdreff = 2d0/a*sqrt(s) ! TODO: Use exact value instead of this approximation | ||
| D = dsdreff**(-2)*D/Dp | ||
| D_plateau = pi * vth**3 / (16.0_dp * R0 * iota * (qi * B0 / (mi * c))**2) |
There was a problem hiding this comment.
The variable name in the comment should be D_plateau instead of Dp to match the actual variable name declared on line 77.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I couldn't believe that these suggestions were reasonable (as |
User description
Made all reals
real(dp)wheredpisreal64fromiso_fortran_env. Made all floating point literals with suffix_dp. Closes #29.PR Type
Enhancement
Description
Unified all floating-point precision declarations across the codebase to use
real(dp)wheredpis defined asreal64fromiso_fortran_envStandardized all floating-point literals to use the
_dpsuffix notation (e.g.,1.0d0→1.0_dp,1d-6→1.0e-6_dp)Replaced all
real(8),complex(8), anddouble precisiondeclarations withreal(dp)andcomplex(dp)respectivelyUpdated 27 source and test files to ensure consistent precision handling throughout the codebase
Improved code clarity by renaming ambiguous variables (e.g.,
Dp→D_plateau) to avoid conflicts with thedpkind parameterAdded explicit
use iso_fortran_env, only: dp => real64imports to all affected modulesDiagram Walkthrough
File Walkthrough
26 files
do_magfie_standalone.f90
Unify floating-point precision to real64 via dp aliassrc/do_magfie_standalone.f90
use iso_fortran_env, only: dp => real64to definedpas thestandard real kind
real(8)declarations withreal(dp)throughout the moduled0/d-Nnotation to_dpsuffix (e.g.,
1.0d0→1.0_dp)freq.f90
Standardize real precision declarations to real64src/freq.f90
use iso_fortran_env, only: dp => real64module importreal(8)type declarations withreal(dp)_dpsuffix notationnotation
orbit.f90
Unify real and complex precision to real64 standardsrc/orbit.f90
use iso_fortran_env, only: dp => real64at module startreal(8)andcomplex(8)declarations withreal(dp)andcomplex(dp)d0/d-Nto_dpsuffix formatimport :: dpstatement in interface block for proper kindparameter passing
test_omega_prime.f90
Standardize test program precision to real64test/test_omega_prime.f90
use iso_fortran_env, only: dp => real64importreal(8)declarations withreal(dp)_dpsuffix notation throughouttransport.f90
Unify precision and improve variable naming in transport modulesrc/transport.f90
use iso_fortran_env, only: dp => real64module importreal(8)andcomplex(8)declarations withreal(dp)andcomplex(dp)_dpsuffix notationDptoD_plateaufor clarity in transport coefficientcalculations
neort.f90
Standardize precision and improve module dependenciessrc/neort.f90
use iso_fortran_env, only: dp => real64importreal(8)andcomplex(8)declarations withreal(dp)andcomplex(dp)_dpsuffix notationDptoD_plateaufor consistencyusestatements withonlyclause for better code claritytest_bounce.f90
Unify test program precision to real64 standardtest/test_bounce.f90
use iso_fortran_env, only: dp => real64importreal(8)declarations withreal(dp)_dpsuffix notationtest_misc.f90
Unify real precision to real64 with dp aliastest/test_misc.f90
use iso_fortran_env, only: dp => real64import at module startreal(8)declarations withreal(dp)1d0,1d-6) tonew format with
_dpsuffix (e.g.,1.0_dp,1.0e-6_dp)test subroutines
collis_nbi.f90
Unify precision declarations and standardize floating-point literalssrc/collis_nbi.f90
use iso_fortran_env, only: dp => real64andimplicit noneatmodule start
double precisiondeclarations withreal(dp)_dpsuffix format throughoutdptod_pto avoid conflict with thedpkindparameter
format
diag_contrib_map.f90
Standardize real precision alias and floating-point literalssrc/diag/diag_contrib_map.f90
use iso_fortran_env, only: real64touseiso_fortran_env, only: dp => real64real(real64)declarations withreal(dp)_dpsuffix format (e.g.,1.0_real64to1.0_dp)real()type conversion calls to usedpinstead ofreal64datatypes.f90
Unify all derived type declarations to use dp precisionsrc/datatypes.f90
use iso_fortran_env, only: dp => real64at module startreal(8)andcomplex(8)declarations withreal(dp)andcomplex(dp)precision
diag_bounce_debug.f90
Standardize real precision alias and floating-point literalssrc/diag/diag_bounce_debug.f90
use iso_fortran_env, only: real64touseiso_fortran_env, only: dp => real64real(real64)declarations withreal(dp)_dpsuffix format throughoutreal()type conversion calls to usedpinstead ofreal64profiles.f90
Standardize floating-point literals to _dp suffix formatsrc/profiles.f90
0d0,1d-24) to newformat with
_dpsuffixreal(8)toreal(dp)forOm_tEvariable declarationtest_torque.f90
Unify real precision and standardize floating-point literalstest/test_torque.f90
use iso_fortran_env, only: dp => real64import at program startreal(8)declarations withreal(dp)_dpsuffix formatDptoD_plateauto improve clarityresonance.f90
Unify real precision and standardize floating-point literalssrc/resonance.f90
use iso_fortran_env, only: dp => real64import at module startreal(8)declarations withreal(dp)_dpsuffix format (e.g.,1d0to1.0_dp)diag_bounce_nonlin.f90
Standardize real precision alias and floating-point literalssrc/diag/diag_bounce_nonlin.f90
use iso_fortran_env, only: real64touseiso_fortran_env, only: dp => real64real(real64)declarations withreal(dp)_dpsuffix formatreal()type conversion calls to usedpinstead ofreal64diag_atten_map.f90
Standardize real precision alias and floating-point literalssrc/diag/diag_atten_map.f90
use iso_fortran_env, only: real64touseiso_fortran_env, only: dp => real64real(real64)declarations withreal(dp)_dpsuffix formatreal()type conversion calls to usedpinstead ofreal64nonlin.f90
Unify real precision and standardize floating-point literalssrc/nonlin.f90
use iso_fortran_env, only: dp => real64import at module startreal(8)declarations withreal(dp)_dpsuffix formatformat
test_frequencies.f90
Unify real precision and standardize floating-point literalstest/test_frequencies.f90
use iso_fortran_env, only: dp => real64import at program startreal(8)declarations withreal(dp)_dpsuffix format (e.g.,8.2512439552d-02to8.2512439552e-02_dp)test_neort_lib.f90
Standardize floating-point literals to _dp suffix formattest/test_neort_lib.f90
0.5d0,1d-12) tonew format with
_dpsuffixformat
real(dp)declarationsutil.f90
Unify real precision and standardize floating-point literalssrc/util.f90
use iso_fortran_env, only: dp => real64import at module startreal(8)andcomplex(8)declarations withreal(dp)andcomplex(dp)_dpsuffix format (e.g.,4.803204d-10to4.803204e-10_dp)format
test_reslines.f90
Unify real precision and standardize floating-point literalstest/test_reslines.f90
use iso_fortran_env, only: dp => real64import at program startreal(8)declarations withreal(dp)_dpsuffix formatdriftorbit.f90
Unify real precision and standardize floating-point literalssrc/driftorbit.f90
use iso_fortran_env, only: dp => real64import at module startreal(8)declarations withreal(dp)_dpsuffix format (e.g.,1d0to1.0_dp,1d-6to1.0e-6_dp)magfie.f90
Unify real precision and standardize floating-point literalssrc/magfie.f90
use iso_fortran_env, only: dp => real64import at module startreal(8)declarations withreal(dp)_dpsuffix formatformat
attenuation_factor.f90
Unify real precision and standardize floating-point literalssrc/attenuation_factor.f90
use iso_fortran_env, only: dp => real64import at module andsubroutine start
double precisiondeclarations withreal(dp)_dpsuffix format (e.g.,1.d0to1.0_dp)test_parallel.f90
Standardize floating-point literals to _dp suffix formattest/test_parallel.f90
1.0d-12,0.5d0) tonew format with
_dpsuffixformat
real(dp)declarations