Silverfrost Forums

Welcome to our forums

Latest Posts

I've been thinking about the problem. Here's a couple of other things that might affect %lv for 64-bit.

  1. A separation character in the data. Sometime, my users might put a "pipe" character in their data, so I have to flag this. If it happens, the %lv can get "confused". Just like when they have commas in their data and want to generate a CSV file, then wonder why it doesn't work.
  2. There should always be a trailing separation character in your data and in your header definition. There is nothing that says you MUST, I've just found it useful.
  3. Uninitialized items array. While you might specify the number of elements to limit the %lv, it is still important that all rows following the last data item are blank. I cannot say exactly why, it's just that this had helped me.
  4. When a cell is being updated, or changes are being made (i.e. deleting a row), be sparing on using windows_update@(). If you do these too fast, or have too many, it might crash the control. You only really need the last one to make the update to the %lv. All others just consume resources (and can make a crash).

Maybe this will help? Bill

Build Purge (64-bit)

3 Feb 2026 15:30GMT

Thanks Paul, by the way, "clicked" on the web address in this message, system said "Silverfrost forums web page not found", had to go into You Tube and enter manually. I did remove the Silverfrost folder and re-downloaded all, set short-cut icons for Plato 64 bit, Plato 32 bit, sdbg 64 Bit and sdbg 32 Bit. All problems now fixed except one, still amazes me as this used to work. When I execute the sdbg 64 Bit program, the debug screen comes up in my program but immediately "freezes", will not accept any debug commands. This has happened now for quite a while and not sure what is causing it. Please let me know if a solution, Sid Kraft

Ralf, how did you go withg this problem ?

Lately, I have been learning how to use %lv. I have found it very useful to display data as a well presented list. The "character :: items(0:???)*???" needs to be dimensioned large enough for both the information and the header description.

I have written a routine to read the "items" array to check how wide the columns must be for both the header and the data, before %lv is updated. This has been a useful debug

If you are going to change the column widths, then "The number of characters must be sufficient to allow ClearWin+ to add the column width to each heading (4 characters per column)." I have not combined changing the column width with using "_+100" centering, or with editing the data.

My limited use of %lv has been good, so I would be interested if this has been solved.

John

64 Bit Problems (64-bit)

3 Feb 2026 11:33GMT (Edited: 3 Feb 2026 11:34GMT)

If you don't have administrator rights to c: program files(x86): silverfrost: FTN95, then when you update the files, you may have a more recent virtual copy in c:\users... This can make it a bit confusing when looking for some of these updated files.

To maintain clean versions of FTN95, I have multiple c: program files(x86): silverfrost: FTN95_9.?? copies to try and manage this issue, although you then have the problem of manageing the path

Other directories to review are C:\Program Files (x86)\Silverfrost

C:\Users\John\AppData\Roaming\SilverFrost\FTN95

C:\Users\John\AppData\Local\VirtualStore\Windows

Build Purge (64-bit)

2 Feb 2026 14:28GMT

Sid

I recommend that you watch the YouTube video "Getting started with FTN95" (see https://www.youtube.com/watch?v=7P8vPlCPxuk).

This will show you what Plato is doing for you. Then you can work from a "Command Prompt" window in order to get a better idea of what is happening when a fault occurs.

Build Purge (64-bit)

2 Feb 2026 13:52GMT

Answered my own question on this one. Downloaded the latest version of Silverfrost, re-built my module for the new system, tried to execute from the old Plato desktop icon, immediately exited to the op system. Apparently, had to go back to the Silverfrost files, create a new Plato icon as the old would not work. Now, executes fine except I cannot, still use the 64 bit, sdbg64 module, when I open, still just freezes, will not "step into or step over". Sid Kraft

Lester, no, McAfee does not allow a folder to be excluded from scanning. They used to be able to do that; they told me that one of their corporate customers had that in a customized version. However, even that option has been removed from the current product.

You can have a file excluded. However, the next time that file is changed, the exclusion is removed. It's like a dog chasing its tail!

For a non-profit that I do some IT related work for, they have been using Norton for a long time. However, it also had a problem with a small bit of SW I developed for the non-profit. In that case, I excluded the folder, and all was well.

McAfee did not seem to care about my little problem, nor could they offer a solution other than the exclusion of the file every time it was rebuilt, so I abandoned McAfee.

I can put the $$$'s saved to a good use in other areas!

Bill

Hi Bill,

I had a similar issue with Norton a while back, but resolved the issues by setting the folder where I built programs as an exclusion for scanning at runtime. Before, when running the newly built application, Norton would scan the file, verify no threats found and submit the data to its insight service, and then it would launch the application just created. I didn't have any problems with the main program installation location. Does McAfee allow you to exclude folders (or files) from being auto scanned?

I also added the Winteracter installation folder as an exclusion to avoid issues and that works.

Lester

Build Purge (64-bit)

2 Feb 2026 13:26GMT

Tried to build a new project, opened as new, included existing Fortran Routines, executed the "build" command in Plato, immediately exited to the operating system. Opened an existing project, went to execute, it immediately exited Plato to the operating system. Not sure why this is happening, could it be due to the windows automatically downloading updates or? any ideas from anyone, Sid Kraft

64 Bit Problems (64-bit)

1 Feb 2026 18:47GMT

Well, not sure what is wrong, when I compile all under the debug, 64 bit version, re-build and execute sdbg64, it brings up the window on the first line of code and then when I try to step over, step out, etc, just sits there with no response!

64 Bit Problems (64-bit)

1 Feb 2026 18:30GMT

That is the sdbg64 from version 9.10. It does work when your code is compiled with a debugging option.

Bill, your problem with MacAfee reminds me of a problem I had with Avast. ``` On my way to a holiday, Security at the airport had turned my laptop on, so it overheated in its bag. I got a new hard drive installed in Greece, with an installation of Greek Windows - and free Avast antivirus. Well, I could get e mail, but when I got back home and re-installed FTN95, nothing would run - until Avast was deleted. (And Windows re-installed). Like Robert, Defender seems good enough for me. As it wasn't the first laptop I've had ruined at an airport, I only travel with cheap little laptops nowadays.

64 Bit Problems (64-bit)

1 Feb 2026 17:47GMT

My version says file version 9.0.0, Product Version 9.10.0.0??

Thanks, Robert!

You are correct, I had misread the format reference. I asked my AI overlord about converting to local (browser) time and it suggested it could be done.

Robert, thanks for the update.

I hate to be a stickler: Shouldn't my post 1 Feb 2026 at 12:56GMT be shown as 1 Feb 2026 00:56GMT? It was definitely just after midnight GMT when I posted it.

Your post time of 11:46GMT matches the e-mail notification for me of 4:46am Mountain Standard Time (US).

Bill

64 Bit Problems (64-bit)

1 Feb 2026 13:34GMT

Robert had the same idea as myself!

Screenshot 2026-02-01 132844.jpg

64 Bit Problems (64-bit)

1 Feb 2026 13:29GMT

This is what the current one shows:

image.png

64 Bit Problems (64-bit)

1 Feb 2026 13:19GMT

windows c: program files(x86): silverfrost: FTN95: sdbg64: right click(properties), here it found this version number listed? Where else can I look? Sid Kraft

I mostly only use Defender. I also use the free copy of Malwarebytes, it doesn't seem to get in the way much.

I have set the date format to be the 24-hour format with the time-zone.

64 Bit Problems (64-bit)

1 Feb 2026 10:12GMT

1.0.3352.22789 - I have no idea what that is.

64 Bit Problems (64-bit)

1 Feb 2026 01:26GMT

Just checked the version number, recently, about 1 week ago, downloaded, supposedly the latest version, checking for the version number on sdbg64, says version 1.0.3362.22789. Note that I also tried the 32 bit version of sdbg, when I start debugging, "get to" curser location, it goes there and when I re start the app. continues on in execution mode, never does the step-in or step-over function, STRANGE FOR SURE! This may sound like my laptop problem but does the same on my PC desktop machine, Sid Kraft

Robert, it is rare for a virus or malware to hit me.

I am very careful about where I wander and choose wisely from whom I will download.

That said, I have had occasion to mis-type a URL and have gone "down the rabbit hole". It is for those times that I am glad I had something to protect.

I think Defender is just fine.

A question: Are times being given without am/pm and not for the user's time zone? I glanced at the time stamp and that's what I think I am seeing. Personally, I'm OK with 24-hour time, and it is important (I think) to know the time zone of the stamp.

Bill

On the few occasions I have had a problem with virus and their ilk, a virus checker has been largely useless.

Seriously bad interactions with McAfee (General)

31 Jan 2026 23:51GMT (Edited: 31 Jan 2026 23:55GMT)

Robert, thanks for asking.

Yes, I did. I went with the "standard" Windows Defender. Things run incredibly faster when I compile my entire project (4x at least).

And, no false virus reports. It seems to offer everything I need it to offer.

Bill

Did you change your Antivirus?

64 Bit Problems (64-bit)

31 Jan 2026 15:54GMT

I have just used sdbg64 to debug a complicated issue -- is this the program you are talking about (sdbg is the 32-bit debugger)? Which version of FTN95 are you using?

Adding vertical scrolling to the main window area (ClearWin+)

31 Jan 2026 15:15GMT (Edited: 1 Feb 2026 14:07GMT)

Lester,

Put the main content of your window (excluding the menu items) in a property sheet using %sh.

Then create a main window (with the menu items) to display the property sheet as a child window via %ch[vscrollbar,hscrollbar]. The size and position of this main window are set by %sz and %sp.

As the user resizes the main window, the scrollbars appear when they are necessary to view the child window.

I have modified your code to demonstrate the basic idea.

winapp
module schwarzschildmodule
    use clrwin
    implicit none
    real(kind=2) :: mass = 1.0, real_time = 1.0, velocity = 0.25, distance = 3000
! NIST CODATA values (2022)
! constants set to double-precision real(kind=2) and real*8 are both dp
	real(kind=2), parameter :: sol = 1.989e30   ! 1 solar mass kg
    real(kind=2), parameter :: velocity_of_light = 2.99792458e8   ! m/s
    real(kind=2), parameter :: gravitational_constant = 6.67430e-11  ! m^3 kg^1 s^2
    real(kind=2), parameter :: Planck_constant = 6.62607015e-34    ! J·s (h)
    real(kind=2), parameter :: reduced_Planck_constant = 1.054571817e-34    ! J·s (hbar)
    real(kind=2), parameter :: Boltzmann_constant = 1.380649e-23 ! J -K
    real(kind=2), parameter :: Stefan_Boltzmann_constant = 5.670374419e-8 ! W m-2 K-4
	real(kind=2), parameter :: AU = 1.495978707e11   ! Astronomical unit (m)
    real(kind=2), parameter :: LY = 9.460730472580800e15 ! Light year (m)
    real(kind=2), parameter :: PC = 3.26156*LY ! Parsec (m)
    real(kind=2), parameter :: Pi = 3.14159265359d0
    integer, parameter :: days_in_year = 365
    integer, parameter :: seconds_in_day = 86400
	integer, parameter :: seconds_in_year = 31536000
    character(200) :: str = ''
    character(len=32*1024) :: buffer = ''
    integer :: EMC2_control = 1, sr_control = 0, VELR_control = 0, &
               GTIME_control = 0, PSPHERE_control = 0, PDEFL_control = 0, &
               BHPOW_control = 0, HAWKR_control = 0
               INTEGER iv
contains

    ! Mass - Energy equivalence: E=MC^2
    function emc2(mass) result(E)
        real(kind=2), intent(in) :: mass
        real(kind=2) :: E
        E = mass * velocity_of_light**2 ! Joules
    end function emc2

    ! Time dilation as a function of velocity    
    function relativistic_time(velocity, real_time) result(rel_time)
        real(kind=2), intent(in) :: velocity, real_time
        real(kind=2) :: rel_time
        !velocity = velocity_of_object / velocity_of_light
        rel_time = real_time / sqrt(1.0 - velocity**2)
    end function relativistic_time

    ! Schwarzschild radius of a mass
	function Schwarzschild_radius(mass) result(Rs)
		real(kind=2), intent(in) :: mass
        real(kind=2) :: Rs
		Rs = 2 * gravitational_constant * mass / velocity_of_light**2
	end function Schwarzschild_radius

    ! Photon sphere for a given mass where a photon theoretically orbits a black hole (unstable)
    function photon_sphere(mass) result(P_orbit)
    ! Strong gravitational field: distance closer to Rs_rad
    ! Photon capture in an unstable orbit
        real(kind=2), intent(in) :: mass
        real(kind=2) :: P_orbit
        P_orbit = 3 * gravitational_constant * mass / velocity_of_light**2
    end function photon_sphere

    ! Black hole surface area assuming a perfect sphere
    function Surface_area_BH(mass) result(area)
        real(kind=2), intent(in) :: mass
        real(kind=2) :: Rs_rad, area
        Rs_rad = Schwarzschild_radius(mass)
        area = 4 * Pi * Rs_rad**2
    end function Surface_area_BH

    ! Black hole power radiation
    function Power_radiated_BH(mass) result(power_rad)
    ! smaller masses radiate faster
        real(kind=2), intent(in) :: mass
        real(kind=2) :: power_rad
        power_rad = Stefan_Boltzmann_constant * Surface_area_BH(mass) * Hawking_radiation(mass)**4
    end function Power_radiated_BH

    ! Gravitational time dilation for a given mass    
	function gravitational_time(mass, distance, real_time) result(grav_time)
        real(kind=2), intent(in) :: mass, distance, real_time
        real(kind=2) :: grav_time, Rs_rad
        Rs_rad = Schwarzschild_radius(mass)
        if (distance > Rs_rad) then
          grav_time = real_time / sqrt(1.0 - (Rs_rad / distance))
        else
          grav_time = -1
        end if
    end function gravitational_time

    ! Photon deflection angle proximal to a black hole of given mass
    function photon_deflection_phi(mass, distance) result(delta_phi)
    ! Weak gravitational field: distance >> Rs_rad
        real(kind=2), intent(in) :: mass, distance
        real(kind=2) :: Rs_rad, delta_phi
        Rs_rad = Schwarzschild_radius(mass)
        ! (4GM/c^2b)*(1-Rs/b) approximation
        ! relativistic correction needed close to Rs
        if (distance > Rs_rad) then
            delta_phi = (2 * Rs_rad / distance) *  (1 - Rs_rad / distance)
            !delta_phi = (2 * Rs_rad / distance) *  !(radians) 
        else
            delta_phi = -1 ! error value if distance < Rs_rad
        end if
    end function photon_deflection_phi

    ! Hawking radiation for a black hole of a given mass
    function Hawking_radiation(mass) result(HK)
        real(kind=2), intent(in) :: mass
        real(kind=2) :: HK
        HK = (reduced_Planck_constant * velocity_of_light**3) / (8 * Pi * gravitational_constant * mass * Boltzmann_constant)
    end function Hawking_radiation

    integer function calculate_cb()
        implicit none
        real(kind=2) :: val
        buffer = ''

! Mass-Energy equivalence (E=MC^2) result in Joules
        if (EMC2_control == 1) then
          val = mass * sol * velocity_of_light**2
          write(str, '("Energy (E = mc^2): ", es15.5, " Joules")') val
          call append2buffer
        end if

! Schwarzschild radius in meters as a function of N*Solar masses
        if (SR_control .eq. 1) then
          if (mass <= 0) then
              str = 'Mass must be positive!'
          else
              val = Schwarzschild_radius(mass*sol)
              write(str, '("Schwarzschild radius: ", F15.5, " meters")') val
          end if
          call append2buffer
        end if

! Time dilation as a function of relatavistic velocity
        if (VELR_control == 1) then
          val = relativistic_time(velocity, real_time)
          write(str, '("Velocity time dilation: ", f15.5, " seconds")') val
          call append2buffer
        end if

        
! Time dilation as a function of gravitation
        if (GTIME_control == 1) then
          val = gravitational_time(mass*sol, distance, real_time)
          write(str, '("Gravitational time dilation: ", f15.5, " seconds")') val
          call append2buffer
        end if

! Photon sphere for a given mass where a photon theoretically orbits a black hole (unstable)
        if (PSPHERE_control == 1) then
          val = photon_sphere(mass*sol)
          write(str, '("Photon sphere radius: ", f15.5, " meters")') val
          call append2buffer
        end if

! Photon deflection in radians
        if (PDEFL_control == 1) then
          val = photon_deflection_phi(mass*sol, distance)
          write(str, '("Photon deflection: ", f15.5, " Radians")') val
          call append2buffer
        end if

! Black hole power radiated
        if (BHPOW_control == 1) then
          val = Power_radiated_BH(mass*sol)
          write(str, '("Power radiated from Black Hole: ", es15.5, " Watts")') val
          call append2buffer
        end if

! Hawking radiation from Black hole
        if (HAWKR_control == 1) then
          val = Hawking_radiation(mass*sol)
          write(str, '("Hawking radiation of Black hole: ", es15.5, " kg/s")') val
          call append2buffer
        end if

        call window_update@(buffer)
        calculate_cb = 2
    end function calculate_cb

    subroutine append2buffer
      if (len_trim(buffer) .eq. 0) then
        buffer = str
      else
        buffer = trim(buffer)//achar(13)//achar(10)//str
      end if   
    end subroutine append2buffer
end module schwarzschildmodule

program schwarzschild_calculator
    use schwarzschildmodule
    implicit none
    integer :: iw
    real(kind=2), parameter :: min_mass = 1, max_mass = 500
    real(kind=2), parameter :: min_vel = 0.25, max_vel = 0.9999
    real(kind=2), parameter :: min_dist = 3000, max_dist = 1e6

    integer :: control_var1, screen_width, screen_depth

    iw = winio@('%sh&',control_var1)

    iw = winio@('%bg&', RGB@(230,245,250)) ! Add a pale blue background 
    iw = winio@('%il&', 0, 1000)

    iw = winio@('%ob[named_c, thin_panelled][Mass (N*Sol)]&') ! Open a box and center a title inline
    iw = winio@('%cn%30sl%nl&', mass, min_mass, max_mass) ! Slider control for mass (min, max)
    iw = winio@('%cb%2nl&') ! close the box
    iw = winio@('Mass in solar masses: %rf%2nl&', mass)
    
    iw = winio@('%ob[named_c, thin_panelled][Velocity (% Vel_c)]&')
    iw = winio@('%cn%30sl%2nl&', velocity, min_vel, max_vel)
    iw = winio@('%cb%2nl&') ! close the box
    iw = winio@(' object_velocity / velocity of light: %rf%2nl&', velocity)
    
    iw = winio@('%ob[named_c, thin_panelled][Radial distance (m)]&')
    iw = winio@('%cn%30sl%nl&', distance, min_dist, max_dist)
    iw = winio@('%cb%2nl&') ! close the box
    iw = winio@('Radial distance (m): %rf%2nl&', distance)
    
    iw = winio@('Real time in seconds: %rf%2nl&', real_time)

! Update %rb list to add new options    
    iw = winio@('%rb[Mass-Energy  ]&',EMC2_control) ! %nl = new line, %rb = radio button
    iw = winio@('%ob%eq@%cb%4nl&','E=mc{sup 2}',0,0)
    iw = winio@('%nl&')
    
    iw = winio@('%rb[Schwarzschild Radius  ]&',SR_control)
    iw = winio@('%ob%eq@%cb%6nl&','Rs = {divide 2GM; c{sup 2}}',0,0)
    iw = winio@('%nl&')
    
    iw = winio@('%rb[Time dilation as a function of velocity (%C)  ]&',VELR_control)
    iw = winio@('%ob%eq@%cb%7nl&','t{sub v} = {divide t; {sqrt} 1 - ({divide v; c}){sup 2}}',0,0)
    iw = winio@('%2nl&')
    
    iw = winio@('%rb[Time dilation as a function of gravitation  ]&',GTIME_control)
    iw = winio@('%ob%eq@%cb%7nl&','t{sub g} = t {sqrt} 1 - {divide 2GM; R c{sup 2}}',0,0)
    iw = winio@('%nl&')
     
    iw = winio@('%rb[Photon sphere radius]%nl&',PSPHERE_control)
    
    iw = winio@('%rb[Photon deflection]%nl&',PDEFL_control)
    
    iw = winio@('%rb[Power radiated by black hole]%nl&',BHPOW_control)
    
    iw = winio@('%rb[Hawking Radiation for black hole]%2nl&',HAWKR_control)


! Calculate the selected options    
    iw = winio@('%cn%`^tt[Calculate]%2nl&', calculate_cb)
    iw = winio@('%pv%42.10re[VSCROLLBAR]&',buffer) ! %pv resize calculation window
    iw = winio@('')

    ! Main window to show child
    iw = winio@('%ca[Relatavistic function Calculator]&')
    iw = winio@('%mn[&file[e&xit]]&', 'exit')    
    screen_width = clearwin_info@('SCREEN_WIDTH')
    screen_depth = clearwin_info@('SCREEN_DEPTH')
    iw = winio@('%sz&',screen_width/3, screen_depth/2)
    iw = winio@('%sp&',screen_width/3, screen_depth/3)
    iw = winio@('%pv%ch[vscrollbar,hscrollbar]&',control_var1)
    iw = winio@('')

end program schwarzschild_calculator

You might want to look at:

https://www.silverfrost.com/ftn95-help/clearwinp/formats/_pv.aspx (or not, Paul is the expert) https://www.silverfrost.com/ftn95-help/clearwinp/formats/_ww.aspx

Is the power radiated purely in terms of Hawking Radiation? Presumably this is not a rotating black hole. Does everything with a gravitational field emit Hawking Radiation? It might be interesting to see the time to evaporation -- although presumably the radiation output increases as it gets smaller.

Hello

Just playing around with formatting and testing, but cannot see how to apply a scrollable control to the whole main window, like a normal resizable windows pane. I applied it to the calculator output pane, but the whole thing extends top to bottom in the screen. I'm sure it is something obvious. Formatting equations is rather clumsy, but good to test.

winapp
module schwarzschildmodule
    use clrwin
    implicit none
    real(kind=2) :: mass = 1.0, real_time = 1.0, velocity = 0.25, distance = 3000
! NIST CODATA values (2022)
! constants set to double-precision real(kind=2) and real*8 are both dp
	real(kind=2), parameter :: sol = 1.989e30   ! 1 solar mass kg
    real(kind=2), parameter :: velocity_of_light = 2.99792458e8   ! m/s
    real(kind=2), parameter :: gravitational_constant = 6.67430e-11  ! m^3 kg^1 s^2
    real(kind=2), parameter :: Planck_constant = 6.62607015e-34    ! J·s (h)
    real(kind=2), parameter :: reduced_Planck_constant = 1.054571817e-34    ! J·s (hbar)
    real(kind=2), parameter :: Boltzmann_constant = 1.380649e-23 ! J -K
    real(kind=2), parameter :: Stefan_Boltzmann_constant = 5.670374419e-8 ! W m-2 K-4
	real(kind=2), parameter :: AU = 1.495978707e11   ! Astronomical unit (m)
    real(kind=2), parameter :: LY = 9.460730472580800e15 ! Light year (m)
    real(kind=2), parameter :: PC = 3.26156*LY ! Parsec (m)
    real(kind=2), parameter :: Pi = 3.14159265359d0
    integer, parameter :: days_in_year = 365
    integer, parameter :: seconds_in_day = 86400
	integer, parameter :: seconds_in_year = 31536000
    character(200) :: str = ''
    character(len=32*1024) :: buffer = ''
    integer :: EMC2_control = 1, sr_control = 0, VELR_control = 0, &
               GTIME_control = 0, PSPHERE_control = 0, PDEFL_control = 0, &
               BHPOW_control = 0, HAWKR_control = 0
               INTEGER iv
contains

    ! Mass - Energy equivalence: E=MC^2
    function emc2(mass) result(E)
        real(kind=2), intent(in) :: mass
        real(kind=2) :: E
        E = mass * velocity_of_light**2 ! Joules
    end function emc2

    ! Time dilation as a function of velocity    
    function relativistic_time(velocity, real_time) result(rel_time)
        real(kind=2), intent(in) :: velocity, real_time
        real(kind=2) :: rel_time
        !velocity = velocity_of_object / velocity_of_light
        rel_time = real_time / sqrt(1.0 - velocity**2)
    end function relativistic_time

    ! Schwarzschild radius of a mass
	function Schwarzschild_radius(mass) result(Rs)
		real(kind=2), intent(in) :: mass
        real(kind=2) :: Rs
		Rs = 2 * gravitational_constant * mass / velocity_of_light**2
	end function Schwarzschild_radius

    ! Photon sphere for a given mass where a photon theoretically orbits a black hole (unstable)
    function photon_sphere(mass) result(P_orbit)
    ! Strong gravitational field: distance closer to Rs_rad
    ! Photon capture in an unstable orbit
        real(kind=2), intent(in) :: mass
        real(kind=2) :: P_orbit
        P_orbit = 3 * gravitational_constant * mass / velocity_of_light**2
    end function photon_sphere

    ! Black hole surface area assuming a perfect sphere
    function Surface_area_BH(mass) result(area)
        real(kind=2), intent(in) :: mass
        real(kind=2) :: Rs_rad, area
        Rs_rad = Schwarzschild_radius(mass)
        area = 4 * Pi * Rs_rad**2
    end function Surface_area_BH

    ! Black hole power radiation
    function Power_radiated_BH(mass) result(power_rad)
    ! smaller masses radiate faster
        real(kind=2), intent(in) :: mass
        real(kind=2) :: power_rad
        power_rad = Stefan_Boltzmann_constant * Surface_area_BH(mass) * Hawking_radiation(mass)**4
    end function Power_radiated_BH

    ! Gravitational time dilation for a given mass    
	function gravitational_time(mass, distance, real_time) result(grav_time)
        real(kind=2), intent(in) :: mass, distance, real_time
        real(kind=2) :: grav_time, Rs_rad
        Rs_rad = Schwarzschild_radius(mass)
        if (distance > Rs_rad) then
          grav_time = real_time / sqrt(1.0 - (Rs_rad / distance))
        else
          grav_time = -1
        end if
    end function gravitational_time

    ! Photon deflection angle proximal to a black hole of given mass
    function photon_deflection_phi(mass, distance) result(delta_phi)
    ! Weak gravitational field: distance >> Rs_rad
        real(kind=2), intent(in) :: mass, distance
        real(kind=2) :: Rs_rad, delta_phi
        Rs_rad = Schwarzschild_radius(mass)
        ! (4GM/c^2b)*(1-Rs/b) approximation
        ! relativistic correction needed close to Rs
        if (distance > Rs_rad) then
            delta_phi = (2 * Rs_rad / distance) *  (1 - Rs_rad / distance)
            !delta_phi = (2 * Rs_rad / distance) *  !(radians) 
        else
            delta_phi = -1 ! error value if distance < Rs_rad
        end if
    end function photon_deflection_phi

    ! Hawking radiation for a black hole of a given mass
    function Hawking_radiation(mass) result(HK)
        real(kind=2), intent(in) :: mass
        real(kind=2) :: HK
        HK = (reduced_Planck_constant * velocity_of_light**3) / (8 * Pi * gravitational_constant * mass * Boltzmann_constant)
    end function Hawking_radiation

    integer function calculate_cb()
        implicit none
        real(kind=2) :: val
        buffer = ''

! Mass-Energy equivalence (E=MC^2) result in Joules
        if (EMC2_control == 1) then
          val = mass * sol * velocity_of_light**2
          write(str, '("Energy (E = mc^2): ", es15.5, " Joules")') val
          call append2buffer
        end if

! Schwarzschild radius in meters as a function of N*Solar masses
        if (SR_control .eq. 1) then
          if (mass <= 0) then
              str = 'Mass must be positive!'
          else
              val = Schwarzschild_radius(mass*sol)
              write(str, '("Schwarzschild radius: ", F15.5, " meters")') val
          end if
          call append2buffer
        end if

! Time dilation as a function of relatavistic velocity
        if (VELR_control == 1) then
          val = relativistic_time(velocity, real_time)
          write(str, '("Velocity time dilation: ", f15.5, " seconds")') val
          call append2buffer
        end if

        
! Time dilation as a function of gravitation
        if (GTIME_control == 1) then
          val = gravitational_time(mass*sol, distance, real_time)
          write(str, '("Gravitational time dilation: ", f15.5, " seconds")') val
          call append2buffer
        end if

! Photon sphere for a given mass where a photon theoretically orbits a black hole (unstable)
        if (PSPHERE_control == 1) then
          val = photon_sphere(mass*sol)
          write(str, '("Photon sphere radius: ", f15.5, " meters")') val
          call append2buffer
        end if

! Photon deflection in radians
        if (PDEFL_control == 1) then
          val = photon_deflection_phi(mass*sol, distance)
          write(str, '("Photon deflection: ", f15.5, " Radians")') val
          call append2buffer
        end if

! Black hole power radiated
        if (BHPOW_control == 1) then
          val = Power_radiated_BH(mass*sol)
          write(str, '("Power radiated from Black Hole: ", es15.5, " Watts")') val
          call append2buffer
        end if

! Hawking radiation from Black hole
        if (HAWKR_control == 1) then
          val = Hawking_radiation(mass*sol)
          write(str, '("Hawking radiation of Black hole: ", es15.5, " kg/s")') val
          call append2buffer
        end if


        call window_update@(buffer)
        calculate_cb = 2
    end function calculate_cb

    subroutine append2buffer
      if (len_trim(buffer) .eq. 0) then
        buffer = str
      else
        buffer = trim(buffer)//achar(13)//achar(10)//str
      end if   
    end subroutine append2buffer
end module schwarzschildmodule

program schwarzschild_calculator
    use schwarzschildmodule
    implicit none
    integer :: iw
    real(kind=2), parameter :: min_mass = 1, max_mass = 500
    real(kind=2), parameter :: min_vel = 0.25, max_vel = 0.9999
    real(kind=2), parameter :: min_dist = 3000, max_dist = 1e6
 
    iw = winio@('%ca[Relatavistic function Calculator]&')

    iw = winio@('%mn[&file[e&xit]]&', 'exit')
    iw = winio@('%bg&', RGB@(230,245,250)) ! Add a pale blue background
    iw = winio@('%il&', 0, 1000)

    iw = winio@('%ob[named_c, thin_panelled][Mass (N*Sol)]&') ! Open a box and center a title inline
    iw = winio@('%cn%30sl%nl&', mass, min_mass, max_mass) ! Slider control for mass (min, max)
    iw = winio@('%cb%2nl&') ! close the box
    iw = winio@('Mass in solar masses: %rf%2nl&', mass)
    
    iw = winio@('%ob[named_c, thin_panelled][Velocity (% Vel_c)]&')
    iw = winio@('%cn%30sl%2nl&', velocity, min_vel, max_vel)
    iw = winio@('%cb%2nl&') ! close the box
    iw = winio@(' object_velocity / velocity of light: %rf%2nl&', velocity)
    
    iw = winio@('%ob[named_c, thin_panelled][Radial distance (m)]&')
    iw = winio@('%cn%30sl%nl&', distance, min_dist, max_dist)
    iw = winio@('%cb%2nl&') ! close the box
    iw = winio@('Radial distance (m): %rf%2nl&', distance)
    
    iw = winio@('Real time in seconds: %rf%2nl&', real_time)

! Update %rb list to add new options    
    iw = winio@('%rb[Mass-Energy  ]&',EMC2_control) ! %nl = new line, %rb = radio button
    iw = winio@('%ob%eq@%cb%4nl&','E=mc{sup 2}',0,0)
    iw = winio@('%nl&')
    
    iw = winio@('%rb[Schwarzschild Radius  ]&',SR_control)
    iw = winio@('%ob%eq@%cb%6nl&','Rs = {divide 2GM; c{sup 2}}',0,0)
    iw = winio@('%nl&')
    
    iw = winio@('%rb[Time dilation as a function of velocity (%C)  ]&',VELR_control)
    iw = winio@('%ob%eq@%cb%7nl&','t{sub v} = {divide t; {sqrt} 1 - ({divide v; c}){sup 2}}',0,0)
    iw = winio@('%2nl&')
    
    iw = winio@('%rb[Time dilation as a function of gravitation  ]&',GTIME_control)
    iw = winio@('%ob%eq@%cb%7nl&','t{sub g} = t {sqrt} 1 - {divide 2GM; R c{sup 2}}',0,0)
    iw = winio@('%nl&')
     
    iw = winio@('%rb[Photon sphere radius]%nl&',PSPHERE_control)
    
    iw = winio@('%rb[Photon deflection]%nl&',PDEFL_control)
    
    iw = winio@('%rb[Power radiated by black hole]%nl&',BHPOW_control)
    
    iw = winio@('%rb[Hawking Radiation for black hole]%2nl&',HAWKR_control)


! Calculate the selected options    
    iw = winio@('%cn%`^tt[Calculate]%2nl&', calculate_cb)
    iw = winio@('%pv%42.10re[VSCROLLBAR]',buffer) ! %pv resize calculation window

end program schwarzschild_calculator

Lester

What's wrong here? (ClearWin+)

29 Jan 2026 21:11GMT (Edited: 29 Jan 2026 21:17GMT)

Thanks Ken. Fun is I tried this ^rf too but devilry clearly tricked me to make some typo that the code even did not compile so I gave up.

What's wrong here? (ClearWin+)

29 Jan 2026 18:42GMT

Dan, You need to change %rf to %^rf with changeTimerDelay as the callback.

module PICrunControl
use clrwin
  integer :: LastPICfileOutputNumber=0  !####
  integer (7) hwFileCheckingInterval
  real*8 :: FileCheckingInterval = 1

contains 

integer recursive function FileCheckingCB ()
  LastPICfileOutputNumber = LastPICfileOutputNumber + 1
  call window_update@(LastPICfileOutputNumber)
  FileCheckingCB = 2
end function FileCheckingCB
!...................................
integer function changeTimerDelay ()
  print*, FileCheckingInterval            !####
  call CHANGE_TIMER_INTERVAL@(hwFileCheckingInterval, FileCheckingInterval) 
  changeTimerDelay = 2
end function 
  
end module

!=============================================
Program Prog
  use PICrunControl
  
k = WINIO@('Interval    %ta%df%^rf%ff&', 1d0, FileCheckingInterval,changeTimerDelay )  !####
k = WINIO@('Caii number %ta%4rd%ff&', LastPICfileOutputNumber )
k = WINIO@('%dl&', FileCheckingInterval, FileCheckingCB)
k = WINIO@('%hw%es', hwFileCheckingInterval)
end

What's wrong here? (ClearWin+)

29 Jan 2026 16:31GMT (Edited: 29 Jan 2026 16:44GMT)

Congrats with the new updated and upgraded more spacious home for the forum.

Creating the program which checks some changes in the files ones per few seconds. The method I used as a first attempt kind of failing so I decided to use another one which employs timer control %dl . But it is also failing. Here is demo. Try to run it. Initially it works. It calls some function every second as it was preset and updates and displays the number of calls. But try to change the default interval time - no effect.

(Comment: I use recursive function just for additional safety: it has no effect in this specific demo but could be useful when the computer becomes very slow and due to that the timer will issue the call for the next such function while it is still not finished with the previous call - this will lead to crash)

module PICrunControl
  integer LastPICfileOutputNumber
  integer (7) hwFileCheckingInterval
  real*8 :: FileCheckingInterval = 1

contains 

integer recursive function FileCheckingCB ()
  LastPICfileOutputNumber = LastPICfileOutputNumber + 1
  call window_update@(LastPICfileOutputNumber)
  FileCheckingCB = 2
end function FileCheckingCB
!...................................
integer function changeTimerDelay ()
  call CHANGE_TIMER_INTERVAL@(hwFileCheckingInterval, FileCheckingInterval)
  changeTimerDelay = 2
end function 
  
end module

!=============================================
Program Prog
  use PICrunControl

k = WINIO@('Interval    %ta%df%rf%ff&', 1d0, FileCheckingInterval )
k = WINIO@('Caii number %ta%4rd%ff&', LastPICfileOutputNumber )
k = WINIO@('%dl&', FileCheckingInterval, FileCheckingCB)
k = WINIO@('%hw%es', hwFileCheckingInterval)
end

Thank you Paul, that's a very clear recommendation to be saved in to the AI's local user history.

SDBG64 defects (64-bit)

29 Jan 2026 13:55GMT

Hi Dan: Have you received any feedback on this article, I have experienced several new bugs with the 64 bit system since the latest release, primarily using the sdbg debugger. When I start the system and go to a breakpoint, after it stops and then I resume execution in the sdbg system, it all of a sudden reverts to full execution, no longer allow the "step into", "stepover" commands, etc. I have received no response to the articles that I have written, Sid Kraft

64 Bit Problems (64-bit)

29 Jan 2026 13:51GMT

Seems that the 64bit sdbg program has many errors now with the latest release. I have written articles about bug/nodebug, 64 bit debugging, etc., have had no responses about the 64 bit system. Sure would like to know the status of this system, would help with my coding situation. Sid Kraft

Ken

Thank you for the feedback.

FTN95 does not currently support the use of SPREAD as an approach to parallelisation. The outcome is that runtimes can be excessively long or sometimes it fails to compile.

This approach was recommended in the Fortran 95 book by Metcalf, Reid and Cohen, and Numerical Recipes in Fortran 90, but it is only useful when parallelisation is supported.

For FTN95, AI generated code that uses SPREAD in this way should be converted back to its simpler Fortran 77 form.

The following code exposes a bug, the assignment z = peaks(spread(x,2,n), spread(y,1,n)) fails with FTN95 (access violation).

program p
use iso_fortran_env
implicit none
integer, parameter :: n = 4
integer :: i, j
real*8 :: x(n), y(n), z(n,n), zt1(n,n), zt2(n,n)
  write(*, '(a)') compiler_version()
  print*
  x = [0,1,2,3]
  y = [-3,-2,-1,0]
  write(*,'(a,1x,4(F10.5,2X))') 'X = ', x
  write(*,'(a,1x,4(F10.5,2X))') 'Y = ', y
  print*
  
  z = peaks(spread(x,dim=2,ncopies=n), spread(y,dim=1,ncopies=n))  ! ### FTN95 fails here

  write(*, '(a)')'z = peaks(spread(x,2,n), spread(y,1,n))'
  do j = 1, n
    write(*,'(4(F10.5,2X))') (z(i,j),i=1,n)
  end do
  print*

contains

  elemental function peaks (x,y) result (val)
  real*8, intent(in) :: x, y
  real*8 :: val
     val = 3.d0*(1.d0 - x)**2 * exp( -x**2 - (y+1.d0)**2 ) &
       - 10.d0*(x/5.d0 - x**3 - y**5) * exp( -x**2 - y**2 ) &
               - 1.d0/3.d0 * exp( -(x+1.d0)**2 - y**2 )
  end function peaks

end program p

The compiler actually has to do a lot of work “under the bonnet” to get to the final result, and this AI generated line of code defeats FTN95!

I can think of at least two different ways to achieve the required end result in a much clearer way.

Nevertheless z = peaks(spread(x,2,n), spread(y,1,n)) is all Fortran 90 syntax, so looks like a bug to me.

Here is the program’s output from an alternative compiler.

GCC version 12.3.0

X =     0.00000     1.00000     2.00000     3.00000
Y =    -3.00000    -2.00000    -1.00000     0.00000

z = peaks(spread(x,2,n), spread(y,1,n))
  -0.24495    -0.10996    -0.00431    -0.00001
  -4.75961    -2.10235    -0.06164     0.00042
  -0.72391    -0.27292     0.49964     0.01301
   0.98101     2.93693     1.41216     0.03312

SDBG64 defects (64-bit)

27 Jan 2026 12:58GMT

Dan: Have same problem only cannot get sdgf step out, step over, etc. to work, just sits there and freezes?? Sid Kraft

sdbg 64 bit debug (64-bit)

27 Jan 2026 12:56GMT

Not sure what happened, downloaded the latest version of Silverfrost Fortran, compiled all of my subroutines in 64 bit debug, built and executed. Page comes up, tried to step over, step in, etc. the system does nothing, freezes? Not sure if i am doing something wrong or is an error, any advise? Sid Kraft