Skip to content

Instantly share code, notes, and snippets.

View krystophny's full-sized avatar

Christopher Albert krystophny

View GitHub Profile
@krystophny
krystophny / ntv_matched_er_hakan9.csv
Created April 18, 2026 01:09
AUG 30835 NEO-2 vs SFINCS matched-Er NTV
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 16 columns, instead of 13 in line 3.
surface,boozer_s,rho_tor,NTV,particleFlux_vm_psiN,Er_kV_per_m,neo2_surface,neo2_boozer_s,neo2_rho_pol,neo2_Er_statv_per_cm,neo2_Om_tE_rad_per_s,neo2_TphiNA_ion,neo2_TphiNA_tot,neo2_Gamma_NA_ion,neo2_Gamma_AX_ion,neo2_Er_kV_per_m
surf_00_rho_0.0922,0.00850084,0.0922,-2.4933094997472764e-07,1.7889345412848296e-09,1.9286034058436212,es_0p00700,0.007,0.11338247640009443,0.039600634966612286,13314.952312130574,-0.13300809606918862,-0.12615688334946537,93107544238328.6,37099054657591.26,1.1871971695001446
surf_01_rho_0.1597,0.025504090000000004,0.1597,-2.955012332299332e-07,4.6232994615454964e-09,6.298324633379223,es_0p02666,0.026656565656565656,0.21994375426477517,0.15429939520790564,27179.23064028323,-0.39638809713426143,-0.26533389520392103,145366009814352.1,19124600660967.805,4.625779495729145
surf_02_rho_0.2500,0.0625,0.25,-2.6103553851671014e-07,3.895373657146469e-09,9.214743057827917,es_0p06597,0.06596969696969696,0.3419723990310941,0.2246119556904286,26237.177845716138,-0.17005498483268236,0.228632494025
@krystophny
krystophny / blocking_case_links.txt
Last active February 18, 2026 13:47
Fujitsu full failure links from lfortran runs pass8+pass9
@krystophny
krystophny / configure_llvm_mac.sh
Last active July 28, 2025 22:58
Configure LLVM build on MacOS
cmake ../llvm \
-G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/opt/llvm-git \
-DLLVM_ENABLE_PROJECTS="clang;lld;lldb;mlir;flang" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind;openmp" \
-DLLVM_TARGETS_TO_BUILD="AArch64" \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLDB_ENABLE_PYTHON=ON \
-DPython3_EXECUTABLE=$(which python) \
@krystophny
krystophny / grow_type_array.f90
Created June 14, 2025 20:19
GFortran 15 bug
program grow_type_array
type :: string_t
character(:), allocatable :: s
end type string_t
type(string_t) :: str
type(string_t), allocatable :: list(:)
! This works
allocate(list(0))
@krystophny
krystophny / issue_interface.f90
Last active May 27, 2025 10:42
GFortran 15 bug
module odeint_allroutines_sub
implicit none
abstract interface
subroutine compute_derivative(x, y, dydx)
real(8), intent(in) :: x
real(8), intent(in) :: y(:)
real(8), intent(out) :: dydx(:)
end subroutine compute_derivative
end interface
@krystophny
krystophny / setup.py
Created January 10, 2025 07:33
setup.py for f2py with legacy support
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
from importlib.machinery import EXTENSION_SUFFIXES
import os
import shutil
import sys
import subprocess
import sysconfig
@krystophny
krystophny / parallel_plot.py
Created May 14, 2019 06:58
Exporting plots in parallel using concurrent.futures
import concurrent.futures
import matplotlib.pyplot as plt
import numpy as np
import time, random
def do_stuff(a): # these are examples.
x = np.linspace(1,10)
plt.plot(x, np.cos(a*x))
plt.savefig('{}.png'.format(a))
time.sleep(random.random())
@krystophny
krystophny / triplot_sample.py
Created May 7, 2019 11:13
Plotting on a mesh
import matplotlib.pyplot as plt
import matplotlib.tri as mpltri
import meshio # von https://github.com/nschloe/meshio
mesh = meshio.read('any_known_mesh_format.msh')
tria = mpltri.Triangulation(mesh.points[:,0], mesh.points[:,1], mesh.cells['triangle'])
for k in range(nplots):
plt.figure()
plt.tricontourf(tria, plot_data[k])