Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Aufruf von Funktionen in einer Subroutine

Empfohlene Antworten

Veröffentlicht

Hallo,

es geht um Fortan 77. Vorab die Frage: Können Subroutines überhaupt Funktionen aufrufen?

Ich habe folgenden Aufbau (Metakommentare stehen in "") :

SUBROUTINE KALK_DELTAT (

c NLOC, NRET, NARG, RET, ARGS, CRESLT, CZ,DZ,IZ,LZ,RZ )

IMPLICIT NONE

"Variablendeklarationen und Anweisungen"

"Es folgt ein beispielhafter Funktionsaufruf"

C Initialsiere Verdampfungsenthalpie

VENT=dhv(TBETRB)

END

C **************Bereich für die Funktionen********************

CC Berechnung der Verdampfungsenthalpie

C Die Eingabe muss in Kelvin erfolgen. Die Ausgabe erfolgt in kJ*kg^-1.

DOUBLE PRECISION function dhv(t)

EXTERNAL grei, greii

DOUBLE PRECISION t

dhv=greii(t)-grei(t)

END

CC Berechnung der freien Gibbs-Energie (Region I)

C Die Eingabe muss in Kelvin erfolgen. Die Ausgabe erfolgt in kJ*kg^-1.

DOUBLE PRECISION function grei(t)

"Variablendeklarationen und Anweisungen"

END

CC Berechnung der freien Gibbs-Energie (Region II)

C Die Eingabe muss in Kelvin erfolgen. Die Ausgabe erfolgt in kJ*kg^-1.

DOUBLE PRECISION function greii(t)

"Variablendeklarationen und Anweisungen"

END

Beim Kompilieren erhalte ich die Fehlermeldung: "Function 'dhv' has no implicit type". Lösche ich das "IMPLICIT NONE" in der Subroutine, erhalte ich die Fehlermeldung, dass die Datentypen REAL(8) und REAL(4) kollidieren.

Danke und Grüße, gaussmath

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.