Initial LsPower implementation

This commit is contained in:
Silas Oettinghaus
2026-05-14 08:38:16 +02:00
commit d8ea52e974
3153 changed files with 799232 additions and 0 deletions

View File

@@ -0,0 +1 @@
real(8) b, n, m

View File

@@ -0,0 +1,25 @@
MODULE MOD_TYPES
INTEGER, PARAMETER :: SP = SELECTED_REAL_KIND(6, 37)
INTEGER, PARAMETER :: DP = SELECTED_REAL_KIND(15, 307)
END MODULE
!
MODULE F_GLOBALS
USE MOD_TYPES
IMPLICIT NONE
INTEGER, PARAMETER :: N_MAX = 16
INTEGER, PARAMETER :: I_MAX = 18
INTEGER, PARAMETER :: J_MAX = 72
REAL(SP) :: XREF
END MODULE F_GLOBALS
!
SUBROUTINE DUMMY ()
!
USE F_GLOBALS
USE MOD_TYPES
IMPLICIT NONE
!
REAL(SP) :: MINIMAL
MINIMAL = 0.01*XREF
RETURN
!
END SUBROUTINE DUMMY

View File

@@ -0,0 +1,17 @@
module datonly
implicit none
integer, parameter :: max_value = 100
real, dimension(:), allocatable :: data_array
end module datonly
module dat
implicit none
integer, parameter :: max_= 1009
end module dat
subroutine simple_subroutine(ain, aout)
use dat, only: max_
integer, intent(in) :: ain
integer, intent(out) :: aout
aout = ain + max_
end subroutine simple_subroutine

View File

@@ -0,0 +1,26 @@
SUBROUTINE TESTSUB(
& INPUT1, INPUT2, !Input
& OUTPUT1, OUTPUT2) !Output
IMPLICIT NONE
INTEGER, INTENT(IN) :: INPUT1, INPUT2
INTEGER, INTENT(OUT) :: OUTPUT1, OUTPUT2
OUTPUT1 = INPUT1 + INPUT2
OUTPUT2 = INPUT1 * INPUT2
RETURN
END SUBROUTINE TESTSUB
SUBROUTINE TESTSUB2(OUTPUT)
IMPLICIT NONE
INTEGER, PARAMETER :: N = 10 ! Array dimension
REAL, INTENT(OUT) :: OUTPUT(N)
INTEGER :: I
DO I = 1, N
OUTPUT(I) = I * 2.0
END DO
RETURN
END

View File

@@ -0,0 +1,5 @@
C This is an invalid file, but it does compile with -ffixed-form
subroutine mwe(
& x)
real x
end subroutine mwe

View File

@@ -0,0 +1,9 @@
SUBROUTINE TESTSUB(INPUT1, & ! Hello
! commenty
INPUT2, OUTPUT1, OUTPUT2) ! more comments
INTEGER, INTENT(IN) :: INPUT1, INPUT2
INTEGER, INTENT(OUT) :: OUTPUT1, OUTPUT2
OUTPUT1 = INPUT1 + &
INPUT2
OUTPUT2 = INPUT1 * INPUT2
END SUBROUTINE TESTSUB

View File

@@ -0,0 +1,5 @@
function add(n,m) result(b)
implicit none
include 'AB.inc'
b = n + m
end function add

View File

@@ -0,0 +1,9 @@
! Check that intent(in out) translates as intent(inout).
! The separation seems to be a common usage.
subroutine foo(x)
implicit none
real(4), intent(in out) :: x
dimension x(3)
x(1) = x(1) + x(2) + x(3)
return
end

View File

@@ -0,0 +1,5 @@
subroutine inquire_next(IU)
IMPLICIT NONE
integer :: IU
!f2py intent(in) IU
end subroutine

View File

@@ -0,0 +1,23 @@
module mtypes
implicit none
integer, parameter :: value1 = 100
type :: master_data
integer :: idat = 200
end type master_data
type(master_data) :: masterdata
end module mtypes
subroutine no_type_subroutine(ain, aout)
use mtypes, only: value1
integer, intent(in) :: ain
integer, intent(out) :: aout
aout = ain + value1
end subroutine no_type_subroutine
subroutine type_subroutine(ain, aout)
use mtypes, only: masterdata
integer, intent(in) :: ain
integer, intent(out) :: aout
aout = ain + masterdata%idat
end subroutine type_subroutine