From e8aea4a830e35e88e88d97b29bfb11db927ae58f Mon Sep 17 00:00:00 2001 From: David Eldon Date: Wed, 24 Jul 2024 16:28:30 -0700 Subject: [PATCH] Change Int64 to Int --- src/SD4SOLPS.jl | 4 +- src/repair_eq.jl | 4 +- src/supersize_profile.jl | 100 +++++++++++++++++++-------------------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/SD4SOLPS.jl b/src/SD4SOLPS.jl index e436cae..8c99eb1 100644 --- a/src/SD4SOLPS.jl +++ b/src/SD4SOLPS.jl @@ -221,7 +221,7 @@ end filename::String="sd_input_data", output_format::String="json", eqdsk_set_time::Union{Nothing, Float64}=nothing, - eq_time_index::Int64=1, + eq_time_index::Int=1, )::IMASDD.dd Gathers SOLPS and EFIT files and loads them into IMAS structure. Extrapolates @@ -234,7 +234,7 @@ function preparation( filename::String="sd_input_data", output_format::String="json", eqdsk_set_time::Union{Nothing, Float64}=nothing, - eq_time_index::Int64=1, + eq_time_index::Int=1, )::IMASDD.dd b2fgmtry, b2time, b2mn, eqdsk = find_files_in_allowed_folders(dirs...; eqdsk_file=eqdsk_file) diff --git a/src/repair_eq.jl b/src/repair_eq.jl index 3d9bae7..3f82e57 100644 --- a/src/repair_eq.jl +++ b/src/repair_eq.jl @@ -15,7 +15,7 @@ export check_rho_1d """ check_rho_1d( dd::IMASDD.dd; - time_slice::Int64=1, + time_slice::Int=1, throw_on_fail::Bool=false, )::Bool @@ -23,7 +23,7 @@ Checks to see if rho exists and is valid in the equilibrium 1d profiles """ function check_rho_1d( dd::IMASDD.dd; - time_slice::Int64=1, + time_slice::Int=1, throw_on_fail::Bool=false, )::Bool rho = dd.equilibrium.time_slice[time_slice].profiles_1d.rho_tor_norm diff --git a/src/supersize_profile.jl b/src/supersize_profile.jl index 6522481..cd70054 100644 --- a/src/supersize_profile.jl +++ b/src/supersize_profile.jl @@ -106,10 +106,10 @@ end dd::IMASDD.dd, quantity_name::String; method::String="simple", - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, ) This function accepts a DD that should be populated with `equilibrium` and @@ -146,11 +146,11 @@ function fill_in_extrapolated_core_profile!( dd::IMASDD.dd, quantity_name::String; method::String="simple", - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, - cell_subset_idx::Int64=5, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, + cell_subset_idx::Int=5, ) check_rho_1d(dd; time_slice=eq_time_idx, throw_on_fail=true) grid_ggd = dd.edge_profiles.grid_ggd[grid_ggd_idx] @@ -305,7 +305,7 @@ function extrapolate_edge_exp( end """ - prep_flux_map(dd::IMASDD.dd; eq_time_idx::Int64=1, eq_profiles_2d_idx::Int64=1) + prep_flux_map(dd::IMASDD.dd; eq_time_idx::Int=1, eq_profiles_2d_idx::Int=1) Reads equilibrium data and extracts/derives some useful quantities. This is very basic, but it was being repeated and that's a no-no. @@ -316,7 +316,7 @@ Returns: - normalized poloidal flux on the equilibrium grid - a linear interpolation of norm pol flux vs. R and Z, ready to be evaluated """ -function prep_flux_map(dd::IMASDD.dd; eq_time_idx::Int64=1, eq_profiles_2d_idx::Int64=1) +function prep_flux_map(dd::IMASDD.dd; eq_time_idx::Int=1, eq_profiles_2d_idx::Int=1) eqt = dd.equilibrium.time_slice[eq_time_idx] p2 = eqt.profiles_2d[eq_profiles_2d_idx] r_eq = p2.grid.dim1 @@ -332,10 +332,10 @@ end """ mesh_psi_spacing( dd::IMASDD.dd; - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, avoid_guard_cell::Bool=true, spacing_rule="mean", ) @@ -365,10 +365,10 @@ Input Arguments: """ function mesh_psi_spacing( dd::IMASDD.dd; - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, avoid_guard_cell::Bool=true, spacing_rule="mean", ) @@ -428,10 +428,10 @@ end """ pick_extension_psi_range( dd::IMASDD.dd; - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, )::Vector{Float64} Defines the `psi_N` levels for an extended mesh. The range of `psi_N` levels starts @@ -441,10 +441,10 @@ Returns a vector of `psi_N` levels. """ function pick_extension_psi_range( dd::IMASDD.dd; - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, )::Vector{Float64} r_eq, z_eq, psin_eq, rzpi = prep_flux_map(dd; eq_time_idx, eq_profiles_2d_idx) @@ -475,7 +475,7 @@ function pick_extension_psi_range( ) lvlstart = maximum(psin_midplane * sign(dpsin)) / sign(dpsin) + dpsin lvlend = maximum(wall_psin * sign(dpsin)) / sign(dpsin) + dpsin - nlvl = Int64(ceil((lvlend - lvlstart) / dpsin)) + nlvl = Int(ceil((lvlend - lvlstart) / dpsin)) psin_levels = collect(LinRange(lvlstart, lvlend, nlvl)) # eqt = dd.equilibrium.time_slice[eq_time_idx] # if hasproperty(eqt.boundary_secondary_separatrix, :psi) @@ -541,7 +541,7 @@ end psin_eq::Matrix, rstart::Vector{Float64}, zstart::Vector{Float64}, - nlvl::Int64, + nlvl::Int, dpsin::Float64, rzpi=nothing, )::Tuple{Matrix{Float64}, Matrix{Float64}} @@ -573,7 +573,7 @@ function mesh_ext_follow_grad( psin_eq::Matrix, rstart::Vector{Float64}, zstart::Vector{Float64}, - nlvl::Int64, + nlvl::Int, dpsin::Float64, rzpi=nothing, )::Tuple{Matrix{Float64}, Matrix{Float64}} @@ -727,7 +727,7 @@ end space::IMASDD.edge_profiles__grid_ggd___space, mesh_r::Matrix{Float64}, mesh_z::Matrix{Float64}, - cut::Int64, + cut::Int, ) Records arrays of mesh data from regular 2D arrays into the DD @@ -746,7 +746,7 @@ function record_regular_mesh!( space::IMASDD.edge_profiles__grid_ggd___space, mesh_r::Matrix{Float64}, mesh_z::Matrix{Float64}, - cut::Int64, + cut::Int, ) npol, nlvl = size(mesh_r) o0 = space.objects_per_dimension[1] # Nodes @@ -902,10 +902,10 @@ end dd::IMASDD.dd, eqdsk_file::String, b2fgmtry::String; - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, clear_cache::Bool=false, )::String @@ -929,10 +929,10 @@ function cached_mesh_extension!( dd::IMASDD.dd, eqdsk_file::String, b2fgmtry::String; - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, clear_cache::Bool=false, )::String path = "$(@__DIR__)/../data/" @@ -992,20 +992,20 @@ end """ mesh_extension_sol!( dd::IMASDD.dd; - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, ) Extends the mesh out into the SOL """ function mesh_extension_sol!( dd::IMASDD.dd; - eq_time_idx::Int64=1, - eq_profiles_2d_idx::Int64=1, - grid_ggd_idx::Int64=1, - space_idx::Int64=1, + eq_time_idx::Int=1, + eq_profiles_2d_idx::Int=1, + grid_ggd_idx::Int=1, + space_idx::Int=1, ) grid_ggd = dd.edge_profiles.grid_ggd[grid_ggd_idx] space = grid_ggd.space[space_idx] @@ -1051,7 +1051,7 @@ end dd::IMASDD.dd, quantity_name::String; method::String="simple", - eq_time_idx::Int64=1, + eq_time_idx::Int=1, ) JUST A PLACEHOLDER FOR NOW. DOESN'T ACTUALLY WORK YET. @@ -1060,7 +1060,7 @@ function fill_in_extrapolated_edge_profile!( dd::IMASDD.dd, quantity_name::String; method::String="simple", - eq_time_idx::Int64=1, + eq_time_idx::Int=1, ) # Inspect input if length(dd.equilibrium.time_slice) < eq_time_idx