Fortran
26.03.2021
02.02.2021
FORTRAN: GDB infos
GDB VER 9 or newer (gdb) run 0x0000555555628b76 in sourcessinks_m::sinks_ie_pot (dt=0) at ../../SweTools/src/unrunoff_sources_sinks_IE.F90:493 493 VERSENKVOL = HALTUNGEN(IM)%STRASSENFL%VERSENKVOLALT * EXP(-HALTUNGEN(IM)%STRASSENFL%DTSUM/HALTUNGEN(IM)%STRASSENFL%KRET) + VERSENKVOL * (ONE - EXP(-HALTUNGEN(IM)%STRASSENFL%DTSUM/HALTUNGEN(IM)%STRASSENFL%KRET)) print geht irgendwie nicht auf typen in arrays.... scheiss fortran. aber explore kanns (gdb) explore datapool::HALTUNGEN(2) The value of 'datapool::HALTUNGEN(2)' is a struct/class of type 'Type haltung' with the following […]
28.10.2020
Fortran: kaputt iterieren
Hier mal ein Auszug aus einem real life Praxis Code der Jahrzehnte lang keine Probleme machte, bis ich kam. Es ist egal was und wie in dem Beispiel etwas berechnet wird. Auch die Eingangswerte sind egal (sind eh sinnlos). Wichtig ist zu wissen, dass es Fortran 77 Code war, den ich schnell nach C++ übersetzt […]
29.09.2020
UNITEK PS-7 13.8V 7/9A Netzteil Schaltplan
So, oder so ähnlich. Die Schaltung für den Kurzschlussschutz habe ich jetzt nicht untersucht. Wenn man zu der 12.5V Z-Diode eine weitere in Serie schaltet, sollte die Ausgangsspannung ansteigen. Die Akkuschrauber wollen 18V haben.
19.08.2020
17.06.2020
Fortran: Unicode UTF8 ISO8859 Umlaute
Fortran Spass mit unterschiedlichen Encodings für Umlaute in UTF8 und ISO8859 Kompletter Quellcode characterClassification.F90.zip Um das Encoding eines Strings herauszufinden, einfach über jedes Zeichen iterieren
30.05.2020
C++ Guns - Spassvergleich Fortran77 Fortran95 C++11
Links oben: Original Fortran77 Code. Rechts oben: Fortran95. Keine GOTOs, keine Labels, keine Spaltenbeschränkung, Sortieralgorithmus identifiziert Unten: C++. Standard Sortieralgorithmus, keine expliziten Array Zugriffe Click to enlarge Ja, die genaue formatierte Ausgabe auf die richtige Nachkommastelle ist im C++ Code nicht enthalten. Diese formatierte Ausgabe in Text Dateien ist auch heute nicht mehr relevant.
24.01.2019
Installing gcc, g++ and gfortran 8 from source
The procedure is quite the same as for gcc 4.8 as you can see in my older post Installing gcc, g++ and gfortran 4.8 from source Read the manual. Download, unpack, switch dir, download, unpack, link. $ wget ftp://ftp.gwdg.de/pub/misc/gcc/snapshots/LATEST-8/gcc-8-20190118.tar.xz $ xz -d gcc-8-20190118.tar.xz $ tar xf gcc-8-20190118.tar $ gcc-8-20190118/ $ wget ftp://ftp.gmplib.org/pub/gmp-6.1.2/gmp-6.1.2.tar.bz2 $ tar xjf […]
15.01.2019
C++ Guns: How NOW to design FORTRAN -> C++ Interfaces
This is one wrong way to design a FORTRAN to C++ interface. But let's start at the beginning. From FORTRAN callable C++ function must be declared with extern "C" to disable name mangling. The function funcCPP expect a 2D array. Two items a 3 values. Calculate the sum and return it. Rember: C counts from […]
13.09.2018
FORTRAN: GDB conditional watchpoint
To set a conditional watchpoint on local variable i. Example Code: Compile with -ggdb Set a breakpoint on subroutine "func". After the debugger stop on this point, the local variable "i" is in scope so one can set a watchpoint. $ gdb ./example (gdb) break func Breakpoint 1 at 0x8bb: file gdb.F90, line 4. ODER […]