File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -344,12 +344,16 @@ contains
344344 ! i.e. Spherical support - > 1 / r scaling; Cylindrical support - > 1 / sqrt (r) [empirical correction: ^- 0.5 - > ^- 0.85 ]
345345 integer , parameter :: mass_label = 1
346346
347- if (n == 0 ) then
347+ ! An unfocused source leaves foc_length at its unset default (dflt_real < 0 , or 0 ): apply no
348+ ! radial amplitude scaling. This guards every branch against the silent- corruption the default
349+ ! would otherwise cause - foc_length(ai)** (- 0.85 ) = pow(negative, non- integer ) = NaN on some
350+ ! compilers (e.g. nvhpc <= 24.3 ) in 2D , and 1 / foc_length = wrong- sign or Inf in 3D / cylindrical.
351+ if (n == 0 .or. foc_length(ai) <= 0._wp ) then
348352 foc_length_factor = 1._wp
349- else if (p == 0 .and. (.not. cyl_coord)) then ! 2D axisymmetric case is physically 3D
350- foc_length_factor = foc_length(ai)** (- 0.85_wp ) ! Empirical correction
351- else
352- foc_length_factor = 1 / foc_length(ai)
353+ else if (p == 0 .and. (.not. cyl_coord)) then ! 2D Cartesian: cylindrical (line - source) spreading
354+ foc_length_factor = foc_length(ai)** (- 0.85_wp ) ! Empirical correction to 1 / sqrt (r)
355+ else ! 3D or axisymmetric: spherical spreading
356+ foc_length_factor = 1._wp / foc_length(ai)
353357 end if
354358
355359 source = 0._wp
You can’t perform that action at this time.
0 commit comments