Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Commit 8e26144

Browse files
committed
no preprocessor, add meson
1 parent 192bfa5 commit 8e26144

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@ add_subdirectory(src)
1414
add_executable(testiri90 src/iritest.for)
1515
target_link_libraries(testiri90 iri90)
1616

17-
add_executable(iri90_driver src/iri90.f src/iri90_driver.F90)
18-
target_compile_definitions(iri90_driver PRIVATE
19-
BIN_DIR='${CMAKE_CURRENT_BINARY_DIR}')
17+
add_executable(iri90_driver src/iri90.f src/iri90_driver.f90)

meson.build

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
project('iri90', 'fortran',
2+
default_options : ['default_library=static', 'buildtype=release'])
3+
4+
fc = meson.get_compiler('fortran')
5+
if fc.get_id() == 'gcc'
6+
old = '-std=legacy'
7+
endif
8+
9+
subdir('src')
10+
11+
# testiri90 is an interactive program, not for CI
12+
testiri90_exe = executable('testiri90', 'src/iritest.for',
13+
link_with: iri90_lib)
14+
15+
iri90_driver_exe = executable('iri90_driver', 'src/iri90.f', 'src/iri90_driver.f90')

src/iri90_driver.F90 renamed to src/iri90_driver.f90

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
program basictest
21
use, intrinsic:: iso_fortran_env, only: stderr=>error_unit, stdout=>output_unit
32
implicit none
43

@@ -14,10 +13,7 @@ program basictest
1413
character(80) :: argv
1514
integer :: i, argc
1615

17-
#ifndef BIN_DIR
18-
#define BIN_DIR '.'
19-
#endif
20-
character(*), parameter :: datadir = BIN_DIR // '/../iri90/data/'
16+
character(:), allocatable :: datadir
2117

2218

2319
jf = .true.
@@ -45,10 +41,13 @@ program basictest
4541
call get_command_argument(9, argv)
4642
read(argv,*) f107a
4743

48-
Nalt = argc-9
44+
call get_command_argument(10, argv)
45+
datadir = trim(argv)
46+
47+
Nalt = argc-10
4948
allocate(altkm(Nalt), outf(11,Nalt))
5049
do i = 1,Nalt
51-
call get_command_argument(9+i, argv)
50+
call get_command_argument(10+i, argv)
5251
read(argv,*) altkm(i)
5352
enddo
5453

@@ -72,9 +71,7 @@ program basictest
7271
write(stdout, '(F10.3, 11ES16.8)') altkm(i), outf(:11,i)
7372
enddo
7473

75-
print *,new_line(' ')
7674

77-
write(stdout, '(100ES16.8)') oarr
75+
write(stdout, '(/,100ES16.8)') oarr
7876

7977
end program
80-

src/meson.build

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
iri90_lib = library('iri90', 'iridreg.for', 'iritec.for', 'igrf.for', 'cira.for', 'irifun.for', 'iriflip.for', 'irisub.for',
2+
fortran_args: old)

0 commit comments

Comments
 (0)