Your advisor is absolutely correct - simplcut is fundamentally a Comptonization model that needs seed photons. It should NOT be used as an additive model in real physics.
What I meant was purely a diagnostic test to isolate the bug:
The Physics (Correct Use):
% CORRECT: Convolution model operating on seed spectrumfit_fun("diskbb(1)*simplcutx(2)"); % diskbb provides seed photons % simplcutx Comptonizes them
My Diagnostic Test (Wrong Physics, but useful for debugging):
% WRONG PHYSICS but useful diagnostic:% Changed .dat file from type "con" to type "add"fit_fun("simplcutx(1)"); % ISIS treats it as generating photons from scratch % Physically incorrect, but tests if Fortran works
Why I did this: To prove the bug is in ISIS’s convolution wrapper, not your Fortran code. When the EXACT same Fortran code works with type “add”, it proves:
✓ The Fortran compiles correctly
✓ The Fortran executes correctly
✗ ISIS’s “con” type wrapper is broken
Bottom line: The model MUST be type “con” for correct physics. The “add” test was just to demonstrate ISIS has a bug.
2. Reproducible Steps for Investigation
Here are the exact steps to reproduce what I found:
Test 1: Demonstrate the Bug (Convolution Model Fails)
Create File
Since I can’t create files, let me give you the exact reproducible steps in detail:
Reproducible Steps to Investigate the Bug
Test 1: Demonstrate the Bug (Convolution Model)
# 1. Create a test directorycd /home/cfacal/work/cal-abc-xyz/astro-tools/workbench/isis_simplcutmkdir -p bug_investigationcd bug_investigation# 2. Create minimal Fortran code with debug outputcat > simplcutx.f << 'EOF'c Minimal model with debug output subroutine simplcutx(ear,ne,param,IFL,photar,photer) integer i,ne,IFL real ear(0:ne),param(4),photar(ne),photer(ne) write(0,*) '=== FORTRAN CALLED ===' write(0,*) 'ne=', ne, ' IFL=', IFL write(0,*) 'params=', (param(i), i=1,4) write(0,*) 'Input photar(1:3)=', (photar(i), i=1,min(3,ne))c Identity convolution (just pass through) do i=1,ne photer(i) = 0.0 end do write(0,*) 'Output photar(1:3)=', (photar(i), i=1,min(3,ne)) write(0,*) '=== FORTRAN RETURNING ===' RETURN ENDEOF# 3. Create model definition (type "con")cat > simplcutx.dat << 'EOF'simplcutx 4 0.05 1.e6 simplcutx con 0Gamma " " 2.5 1.0 1.1 4.0 10.0 0.01FracSctr " " 0.02 0.0 0. 0.4 1.0 0.001ReflFrac " " 1. -5.0 0. 5. 100 -1kT_e "keV" 50 -100 5 1e3 1e3 2EOF# 4. Create ISIS test scriptcat > test_con.sl << 'EOF'require("xspec");build_xspec_local_models("."; lmodel="simplcutx.dat");load_xspec_local_models("."; lmodel="simplcutx.dat");fit_fun("diskbb(1)*simplcutx(2)");set_par("diskbb(1).Tin", 1.0);variable flux = eval_fun([1:5:1], [2:6:1]);vmessage("SUCCESS! Flux: %S", flux);EOF# 5. Run the testisis test_con.sl 2>&1