Hjälp om Fortran90

From Stellarium Wiki
Revision as of 16:40, 6 April 2013 by Lakrits (Talk | contribs)
Jump to: navigation, search

Den här sidan är avsedd som hjälp i skapandet av en neptunisk satellitefemerid m.h.a. Le Guyaders och Jerome Berthiers dataset, som finns att hämta från ftp://ftp.imcce.fr/pub/ephem/satel/neptuno/.

Den svenska versionen erbjuder inget annat än en översättning av den engelska originaltexten. Alla diskussioner eller frågor bör hållas inom den internationella gemenskaper, d.v.s på engelska. På den engelskspråkiga versionen av det här avsnittet (Help with Fortran90) finns en diskussionssida, där du kan ställa frågor, skriva in behjälplig information eller komma med förslag i ämnet: klicka på fliken Discussion uppe till vänster på sidan för att komma dit.

Följande text är en slags problembeskrivning, som tar upp fördelarna och begränsningarna med ett par av de kodspråk som kan användas.


Första försöket: f77

Öppna filen Config.mk och ersätt däri FC = xlf med FC = f77 och skriv "make". Du kommer att se massor av fel i stil med

isat_d.f: In subroutine `isatd':
   210     format(8x,' Dernier pas:',d23.16)'
Invalid form for FORMAT statement at (^)

Enligt min åsikt är orsaken till de här felmeddelandena att koden inte är kompatibel med FORTRAN77. Jag försökte att överbrygga detta problem genom att korrigera källkoden, eftersom det är så många felmeddelanden om felaktigt format. För att hitta indatafilerna som jag ändrade i fs2fd.f, ändra:

infile  = trim(dir_s)//trim(fil_s)
outfile = trim(dir_d)//trim(fil_d)


infile  = './data/Nsat-fs.dat'
outfile = './data/Nsat-fd.dat'

Samma sak i ins_d.f:

theofile = './data/Nsat-fd.dat'

I ins_d.f var jag dessutom tvungen att flytta avsnittet


och placera det efter textblocket COMMON:


FORTRAN77 verkar inte ha stöd för matriser med variabel storlek, så i isat_d.f var jag tvungen att ersätta

dimension tp(np),up(np),cp(3,np),aia(4)

på rad 183 med

dimension tp(100000),up(100000),cp(3,100000),aia(4)

Detsamma gäller raderna 2455 och 2456. På rad 2408 tog jag bort definitionen av w(3,np,0:nd). Därefter kompilerades källkoden till en körbar fil kallad "ilgs_d", för versionen med dubbel precision (_d). Versionen med fyrdubbel precision bör kallas "ilgs_q" (_q efter engelskans "quadruple" för fyrdubbel). Hursomhelst misslyckades körningen av den körbara filen, med följande utdataresultat ("fichier" är franska för fil):

          Fichier ./data/Nsat-fd.dat              

open: No such file or directory
apparent state: unit 12 named /DATA/DE403/de403.unx
last format: list io
lately reading direct unformatted external IO

Andra försöket: f2c

Using f2c gives the same results as using f77. I hoped to get more insight from reading the C-code, but I did not. I had big success for the other IMCCE fortran programs with f2c, it helped me a lot in understanding and getting functional executables. But not this time.


The file ./data/Nsat-fd.dat exists, maybe the error refers to the file /DATA/DE403/de403.unx, which is indeed missing on my system. And I do not know from where to get it. At ftp://ssd.jpl.nasa.gov/pub/eph/planets/bsp/DE403.BSP I found the file for Sparc architecture, for i386 it seems not to be available any more, but it could be created from DE403.BSP.

But before doing further investigation I would like to ask a FORTRAN programmer about this software. My understanding is as follows, please correct me when I am wrong:

1) The software is a numerical integrator for a physical model of the Nepunian system. For as a period as long as the planet positions are provided, the Neptunian satellites position can be computed by numerical integration. Especially dates outside the interval 1800-2050 are no problem, when the DE403 planet positions are replaced by VSOP87 or similar.

2) Therefore it is possible to produce a large table of each satellites position and velocity for a long period, lets say 1500-2500. In fact this is the main goal. When I have this table, I will try frequency analysis techniques in order to create poisson series or similar, that can be included into stellarium.

My problem is that I can speak neigther french nor FORTRAN, so I really do not know what is going on in this software, and I would really appreciate your help. You can contact be by:

- email: johannes (dot) gajdosik (at) gmx (dot) at

- posting into the forum

- writing something in this wiki page

I am sorry for having written: "If you do not mind I would prefer to be contacted by email, please write the words "stellarium" and "fortran" into the subject line." This was really a bad idea, because it caused multiple work on the same subject for the community. So lets stay with this wiki.


Johannes 14:38, 1 May 2007 (PDT)

Hi! I'm a french programmer, but unfortunately not a fortran programmer, and I'd like to help if I can . I've started to read fortran tutorial and I plan to test lf95 trial as fortran compiler since it's the one used in the linux Config.mk provided in neptuno package but I don't have much free time these days. I'll let know if I succeed in any way, let me know if you have questions. Blakbear.

Hello Blackbear, thank you very much for offering help! I first did not see your writing into the wiki, because the "watch" function seems not to work for me. If you get any insight into the code, or if you can give any answers to 1) or 2) please send me an email, this will be the easiest way of communication. Johannes

Hi, Johannes. I could build "ilgs3_d" by g77 and execute without error. But I could not investigate that result is correct or is not correct. Shall I report my procedure?(in this page? or e-mail?) I write a part of output(little formatted), instead answer your questions.

       (  1)  Date: 0.2378496500000000E+07
       Nombre maximum d"enregistrements = 22829
       Intervalle cherché =                  1
       Temps initial d"intégration =  0.2378496500000000E+07
       Intervalle d"intégration =     0.0000000000000000E+00
       Pas d"intégration =            0.0000000000000000E+00
       Temps final d"intégration =    0.2378496500000000E+07
       (  1)  Date: 0.2378496500000000E+07
       v0(1,1,0) =-0.2019388268736855E-04
       v0(2,1,0) = 0.1722904160856275E-02
       v0(3,1,0) = 0.1629414715885055E-02
       v0(1,1,1) = 0.2533936570868142E-02
       v0(2,1,1) =-0.4058902541155617E-04
       v0(3,1,1) = 0.7430677191550270E-04

By the way, when create de403.unx, why did not you convert from unxpXXXX.403 or ascpXXXX.403?--Sigma 06:10, 9 May 2007 (PDT)

Same here, I've succeeded in compiling ilgs3_d with lf95 but I can't get a result yet, so Sigma seems more advanced. So far I can't validate my email so I can't use it for the time being, but feel free to ask if you need french to english translation. Blakbear.

I uploaded diff files: for ins3_d.f,for ins8_d.f,for isat8_d.f. Sorry, I could not upload de403.unx, because it was big size for my space(about 9MB gziped). And ilgs8_d did not execute. Probably, there may be a hint for 8 satellites code in LISETMOI and README. Please check them. I'm weak in English, additionaly can not read French. orz--Sigma 20:41, 10 May 2007 (PDT)

Hi! I've succeeded in compiling and running both ilgs3_d and ilgs8_d, getting some results and some problems when testing with later dates but at least it works for initial date it seems.
All the modifications I've done for ilgs8_d to work have already been pointed out by Johannes : bad formatting with ' where there shouldn't be and bad location, missing the . to access current dir. I've used unxp1950.403 found on jpl ftp ftp://ssd.jpl.nasa.gov/pub/eph/export/unix/ renamed in de403.unx.
I'm going to make an archive with all the files I've used and make it available tonight, so anyone will be able to test it.

--Blakbear 13:56, 11 May 2007 (PDT)


Thank you all so much for your help! In addition to the information in the wiki I got also emails describing how to create de403.unx. Indeed you had more success then I running the program. Now remains only the problem of creating ephemeris data over a reasonably long timespan, lets say 1500-2500. The file Nsat-fd.dat provides initial values not for this whole period, but I doubt that this is needed. Instead isat_d and ilgs_d should contain a numerical model and an integrator suitable for creating data for an arbitrary period, provided there are the planet positions. This leads to the question:

Can anybody of you understand the contents of isat_d.f and ilgs_d.f? where is the integrator, where is the numerical model, and from where are the planet positions needed for planetary perturbation? This is the part, where French language skills might be helpful. For I cannot understand the comments, function and variable names, for me these are just meaningless accumulations of letters.

Thanks again, --Johannes 09:44, 14 May 2007 (PDT)

Personal tools
in this wiki
other languages