Add comments to TrimSP Fortran core

This commit is contained in:
2026-04-14 17:25:34 +02:00
parent c998e50921
commit 7115fd3b04
+14 -1
View File
@@ -401,7 +401,9 @@ C LMAX is maximum number of layers and JMAX is maximum number of
C elements per layer.
JMAX=5
C This part reads the input file (new format)
C This part reads the input file (new format).
C The JavaScript/Electron frontend writes this sequential block layout,
C so the READ order below must stay in sync with CreateInpFile().
OPEN(UNIT=99,file=errnam,STATUS='replace')
OPEN(UNIT=11,file=innam,STATUS='unknown',ERR=1359)
C First line: properties of projectile
@@ -814,6 +816,9 @@ C
ENDDO
C
C PROJECTILE LOOP
C Each pass transports one projectile history. The state vectors
C X/Y/Z, E, direction cosines, current layer index, etc. are updated
C in-place until the particle stops, backscatters or transmits.
C
1 CONTINUE
NPROJ=NPROJ+1
@@ -829,6 +834,10 @@ C
KK1=KK0
C
C COLLISION LOOP (INCLUDES WEAK SIMULTANEOUS COLL. FOR KK1.LT.4)
C KK controls the treatment of weak simultaneous collisions.
C For every active projectile we choose a collision partner, sample an
C impact parameter, solve the scattering geometry for the selected
C interatomic potential and then update the projectile state.
C
DO 245 KK=KK1,0,-1
C
@@ -3374,6 +3383,10 @@ C & I0,3x))
& ,1x))
inquire(FILE='fort.33',EXIST=FORT33)
C fort.33 is the compact per-run summary consumed by the GUI for scan
C plots (fractions stopped in each layer, backscattering, transmission,
C mean depth, etc.). The header line is written once, then each run
C appends a single summary row.
if (.not.FORT33) then
open(33)
WRITE(33,7802) (chem(k),k=1,NLayers)