Silverfrost Forums

Welcome to our forums

User's Examples

15 May 2008 8:52 #3199

topic to the index of this forum with the users codes is suggested to add to this site which will demonstrate what is possible to do with Salford fortran

4 Nov 2009 10:48 #5338

Until now there was at all no respond to this. This is actaully a very good idea :!: Learning by example is always a good start. One thing that I still cannot understand is why the examples in the FTN install directory is nowhere mentioned. If this could come to the fore it will be easy to convince anyone to use (maybe) Fortran for his application.

Recently I atended a meeting where guys demand JAVA for numerical calculations becaues of some irreproducible arguments. It is important to mention that these guys:

  1. do not know how data are (or can be ) transferred between programs;
  2. have nothing good to say about Open Source and in the next sentence demand the use of JAVA for numerical applications and
  3. want to port 10 thousands of code to JAVA without any good arguments.

What can say: do'nt drink and drive.

13 Dec 2009 5:14 #5535

Unfortunate Silverfrost does not respond (directly) to this. It would be interesting to know why.

Anyway, SIMDEM and SIMFIT might be the first attempt to fill this gap! I have taken a look at the stuff (and still continues to) - impressive. Many of the available functions offered I usually did with Matlab. And generating eps format for the graphics is fantasitc for any LaTeX user 😄 Even the source of the documentation is available - great stuff.

Thanks to Bill Bardsley!

16 Dec 2009 2:23 (Edited: 16 Dec 2009 3:45) #5560

FTN95 examples could be the most expiring ever any Fortran compiler on the earth produced. But even worse, you can not find existing poor examples folder easily...I am now searching for it for 20 min (despite i even have asked here before where they moved to and know that it is in some 'Documents and Settings' folder but i have 6 Windows installations and 10 users in each, some have no access)

16 Dec 2009 3:41 #5564

Trying searching for demo95.f90. It is in the root of the examples section.

17 Dec 2009 5:17 #5569

This pointed me into older installation in the win32app folder...Fun is i still could not find newer ones with multithreading example which showed how to make WRITE(,) FOO not to cause code to crash if function FOO performs the write itself ? BTW, is it possible to do only in multithreaded code ?

1 Jan 2010 9:43 #5633

Quoted from DanRRight BTW, I have sent [color=red:d0fa7037c0]a year or two ago[/color:d0fa7037c0] such and some other snippet examples to Silverfrosts Andrew when he asked here for user examples contributions . Did not heard since that how this idea was evolving

@Andrew, I would be pleased if you could give some comments on the user examples topic. As you probably know, the best way to program is to find some example which does what you like in some way and then change it.

7 Jan 2010 8:00 #5664

Unfortunately the progress on this issue is somewhat slow. A pitty I must admit, and especially because it was initiated by Silverfrost: https://forums.silverfrost.com/Forum/Topic/833

I got some example code from Dan (by email) which uses both opengl and Clearwin. Really impressive. Now if this does not impress someone that considers to use FTN95, I am in the wrong movie.

Solar Kingdom is a good and impressive as well. Since the code is not available, it does not motivate me to use FTN95. Anyone that wants to use FTN95 would like to choose some example that does more or less what he has in mind - and then change it. Is this not the way to program nowadays? Cut, paste and compile. Whether or not this is a good trend I cannot judge. Fact is, that is in demand.

14 Jan 2010 1:05 (Edited: 4 Feb 2010 10:48) #5718

If interested i can email them to anyone. I have couple OpenGL and Clearwin examples of visualisation of 2D and 3D meshes, pie chart, global time routine, photo editing program (resize, change perspective) which do things like in this link https://forums.silverfrost.com/Forum/Topic/1236

http://img13.imageshack.us/img13/6228/a00m.jpg

http://img205.imageshack.us/img205/2515/tokiofixed2.jpg

http://img37.imageshack.us/img37/7568/mesh2d3d.png

http://img685.imageshack.us/img685/7519/pie.png

http://img43.imageshack.us/img43/8941/timezones.png

http://img694.imageshack.us/img694/3522/mand3.png

http://img36.imageshack.us/img36/8403/grbkgp.png

15 Jan 2010 4:15 #5762

As Sebastian suggested, i am also posting the link on these examples so that not registered in this forum people will be able to get them. Will add something else when will have time, i have many made in two decades. They are usually my test benches incorporated then into the large hydrocode. I hope you also have something to share.

If rapidshare time for these posts will expire you still can send me an email

OpenGL 2D and 3D mesh http://rapidshare.com/files/335475587/Mesh.zip.html

OpenGL pie chart http://rapidshare.com/files/335475588/pie.zip.html

Globaltime http://rapidshare.com/files/335475589/maps.zip.html

Perspective fix, resizing and panoramic images view http://rapidshare.com/files/335779520/PerspectiveFix.zip.html

Fractal http://rapidshare.com/files/336286054/Fractal.zip.html

Bitmap background in graphics window http://rapidshare.com/files/336403835/Gr_bkg.zip.html

18 Jan 2010 6:14 #5771

I see images which were hosted by imageshack are gone. Seems they do not like to pay for excessive traffic LOL. Any suggestions where we can place them instead?

19 Jan 2010 1:46 #5776

Hi Dan,

I really enjoy and learn from your examples! And I am sure that others can learn as well! What I do not understand is why Silverfrost does not respond to this. It must be in the interest of Silverfrost to promote their ClearWin+ product. And if it are user examples it means that ClearWin is in use out there.

Since I am new in using (or learning) ClearWin I think an example that 1.) get some user information; 2.) perorm some calculation and 3.) then display the result will also be very interesting. My background in using Fortran until now is only numerical calculations. We use Visual Basic/JAVA/C++ to write GUI's to collect the model parameters and write this in some text/XML file. Afterwords the Fortran program is called and the results file display in a window. Do you perhaps have something in this direction, i.e. collect and display the results using ClearWin+?

I really hope that Silverfrost would respond to the user examples idea! By the way, how do you get the images in the forum?

19 Jan 2010 2:15 #5779

The biggest problem here is that, when the examples were requested, only a very small number came through. We are looking at a new release soon, and while these new examples may not make that release, they will be looked at for inclusion.

19 Jan 2010 2:18 #5780

Hi Andrew,

thank you for your reply. If I understood it correctly, you would like to include the examples wih the new release. What about making them available directly on the Silverfrost website?

20 Jan 2010 12:58 #5783

jjgermis,

As i said all these examples are prototypes, all of them were modified, made as a subroutines and used in large numerical code for visualization of simulation data in real time and/or post-processing. It is a lot of work (or almost impossible) to make universal visualization program for all cases, so just take the idea and modify it for your needs. The PIE and MESH programs as an example can load your own data files for visualization, so it is really easy to do all the work after that. And all is in Fortran and in the same compiler, which can help you find even many errors in Clearwin code.

What can be done else? When object oriented Fortran will finally appear, create truly Visual Clearwin with user expandable library of visual task forms-images AND math tasks like fluid dynamics, ODE, linear algebra and 10000th of others and do not program anything, only drag and drop last ones into predefined visual library of forms which will self-assemble the code for you. But that's all probably will be available in a year 2100.

20 Jan 2010 8:59 #5787

I do not know the marketing strategy from Silverfrost, but the following came to my mind: If the user examples are to be included in the next release it means that only Silverfrost users benefit from this, i.e. no potential users are addressed. Comparing to user examples on the Silverfrost website, I see the following oppertunity: 1.) ClearWin/Silverfrost is public available on the web; 2.) if some potential user becomes aware of the possibilties he can immediatly download the FTN95 PE and 3.) the user examples becomes dynamic.

27 Jan 2010 4:25 #5845

I think it would be really good if there is a possibility to share software examples. I can offer you for instance a small but nice text editor with source code, standard icons etc., all files zipped with less than 18 KB. It's free.

Simply write to wilfried.linder@uni-duesseldorf.de and I will send you the editor.

Regards, Wilfried

29 Jan 2010 7:21 #5847

Wilfried, thanks for supporting this idea. I do belive that there are more users that would like to see something happening here!

4 Feb 2010 11:14 (Edited: 4 Feb 2010 11:25) #5893

Here is just a bit more complex Fahreheit to Celcius, Kelvin and electron-volts and vice versa converter with 3 convenience sliders covering temperatues from human body to neutron star which i sometimes use myself. The code and picture for the simpler one you've seen before,

http://img109.imageshack.us/img109/5341/gradus.png

it was just a demo, you can find in other thread.

I will simply post the code here without the picture, the only missing will be background file, which you can easily substitute. Glue two parts together and compile FTN95 filename.f95 /link

! Dan R Right 2009. Reference on author is not required. Use at your own risk
module Funct
 real*8 Rel_Temp01, Rel_Temp01Sun, Rel_Temp01NStar, Temp_Fahrenheit, Temp_Celsius, Temp_Kelvin, Temp_EV   
 real*8 TempHumanMin, TempHumanMax 
 contains
integer function update_Slider ()
 Temp_Fahrenheit = TempHumanMin + (TempHumanMax-TempHumanMin) * Rel_Temp01
 Temp_Celsius    = (Temp_Fahrenheit-32)*5./9.
 Temp_Kelvin     = Temp_Celsius + 273.
 Temp_EV         = Temp_Kelvin/11604.505
 Rel_Temp01      = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)
 Rel_Temp01Sun   = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1000
 Rel_Temp01NStar = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1.e11
 update_Slider   = 1
end function
integer function update_SliderSun ()
 Temp_Fahrenheit = TempHumanMin + (TempHumanMax-TempHumanMin) * Rel_Temp01Sun * 1000
 Temp_Celsius    = (Temp_Fahrenheit-32)*5./9.
 Temp_Kelvin     = Temp_Celsius + 273.
 Temp_EV         = Temp_Kelvin/11604.505
 Rel_Temp01      = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)
 Rel_Temp01Sun   = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1000
 Rel_Temp01NStar = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1.e11
 update_SliderSun= 1
end function
integer function update_SliderNStar ()
 Temp_Fahrenheit = TempHumanMin + (TempHumanMax-TempHumanMin) * Rel_Temp01NStar * 1.e11
 Temp_Celsius    = (Temp_Fahrenheit-32)*5./9.
 Temp_Kelvin     = Temp_Celsius + 273.
 Temp_EV         = Temp_Kelvin/11604.505
 Rel_Temp01      = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)
 Rel_Temp01Sun   = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1000
 Rel_Temp01NStar = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1.e11
 update_SliderNStar = 1
end function
integer function update_F ()
 Temp_Celsius    = (Temp_Fahrenheit-32)*5./9.	
 Temp_Kelvin     = Temp_Celsius + 273.
 Temp_EV         = Temp_Kelvin/11604.505
 Rel_Temp01      = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)
 Rel_Temp01Sun   = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1000
 Rel_Temp01NStar = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1.e11
 update_F = 1
end function
integer function update_C ()
 Temp_Fahrenheit = 32 + Temp_Celsius * 9./5.
 Temp_Kelvin     = Temp_Celsius + 273.
 Temp_EV         = Temp_Kelvin/11604.505
 Rel_Temp01      = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)
 Rel_Temp01Sun   = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1000
 Rel_Temp01NStar = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1.e11
 update_C = 1
end function 
4 Feb 2010 11:17 #5894
integer function update_K ()
 Temp_Celsius    = Temp_Kelvin - 273.
 Temp_Fahrenheit = 32 + Temp_Celsius * 9./5. + 273.
 Temp_EV         = Temp_Kelvin/11604.505
 Rel_Temp01      = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)
 Rel_Temp01Sun   = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1000
 Rel_Temp01NStar = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1.e11
 update_K = 1
end function 
integer function update_eV ()
 Temp_Kelvin     = Temp_eV * 11604.505
 Temp_Celsius    = Temp_Kelvin-273.
 Temp_Fahrenheit = 32 + Temp_Celsius * 9./5. + 273.
 Rel_Temp01      = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)
 Rel_Temp01      = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)
 Rel_Temp01Sun   = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1000
 Rel_Temp01NStar = (Temp_Fahrenheit-TempHumanMin )/(TempHumanMax-TempHumanMin)/1.e11
 update_eV = 1
end function
end module funct

Program F_to_C_to_K_to_eV
use clrwin
use funct 
 TempHumanMin    = 90; 	TempHumanMax = 110
 Temp_Fahrenheit = 98
 Temp_Celsius    = 36.6
 Temp_Kelvin     = Temp_Celsius + 273.
 Temp_eV         = Temp_Kelvin/11604.505

 i=winio@('%sy[3d_raised]%ww[casts_shadow]&')
 i=winio@('%ca[Fahrenheit to Celsius to Kelvin to eV]&')
 i=WINIO@('%wp[BkGrTurb01]&')
 i=winio@('%bg[grey]&')
 i=winio@('%cn Type your input in any field or use slider%ff&')
 i=winio@('%4.1ob&')
   i=winio@('Human %ff&')
   i=winio@('%^12sl[vertical ]%ff&', Rel_Temp01, 0.0D0, 1.0D0, update_Slider)
 i=winio@('%cb&')
   i=winio@(' Sun %ff&')
   i=winio@('%^12sl[vertical ]%ff&', Rel_Temp01Sun, 0.0D0, 1.0D0, update_SliderSun)
 i=winio@('%cb&')
   i=winio@('N-Star %ff&')
   i=winio@('%^12sl[vertical ]%ff&', Rel_Temp01NStar, 0.0D0, 1.0D0, update_SliderNStar)
 i=winio@('%cb&')
   i=winio@('%fn[Times new Roman]%ts%tc[red]%bf%cn C = &
     &%fl%^8rf%sf%ff&', 2.0d0, -1.d199, 1.d199, Temp_Celsius, update_C)
   i=winio@('%fn[Times new Roman]%ts%tc[blue]%bf%cn F = &
     &%fl%^8rf%sf%ff&', 2.d0, -1.d199, 1.d199, Temp_Fahrenheit, update_F)
   i=winio@('%fn[Times new Roman]%ts%tc[green]%bf%cn K = &
     &%fl%^8rf%sf%ff&', 2.0d0, -1.d199, 1.d199, Temp_Kelvin, update_K)
   i=winio@('%fn[Times new Roman]%ts%tc[black]%bf%cn eV= &
     &%fl%^8rf%sf%ff&', 2.0d0, -1.d199, 1.d199, Temp_eV, update_eV)
 i=winio@('%cb&')
 i=winio@('%ac[esc]&','exit')
 i=winio@('%nl%ff%cn%3`bt[OK]')
! horizontal left_right         vertical bottom_top
   Fahr_to_C = 2
   end
Resources
BkGrTurb01 bitmap  BkGrTurb01.bmp
Please login to reply.