Skip to content

Commit 3088d84

Browse files
committed
Merge branch 'hotfix/4.17.16' into main
2 parents bbc1c3f + 37be9d6 commit 3088d84

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+622
-258
lines changed

.github/workflows/build_test.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
# Controls when the action will run.
4+
on:
5+
push:
6+
branches: [ main, '*-devel' ]
7+
pull_request:
8+
branches: [ main, '*-devel' ]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
jobs:
14+
build_and_test:
15+
# The type of runner that the job will run on
16+
runs-on: ubuntu-20.04
17+
strategy:
18+
matrix:
19+
include:
20+
- mode: debug
21+
flag: -b
22+
define:
23+
- mode: debug
24+
flag: -b
25+
define: >-
26+
-DPER_SPECIES_WEIGHT -DZERO_CURRENT_PARTICLES -DNO_PARTICLE_PROBES
27+
-DPARTICLE_SHAPE_TOPHAT -DPARTICLE_ID -DPHOTONS -DTRIDENT_PHOTONS
28+
-DBREMSSTRAHLUNG -DPARSER_DEBUG -DNO_IO -DCOLLISIONS_TEST
29+
-DPER_PARTICLE_CHARGE_MASS -DPARSER_CHECKING -DNO_USE_ISATTY
30+
-DWORK_DONE_INTEGRATED -DHC_PUSH -DNO_MPI3 -DDECK_DEBUG
31+
- mode:
32+
flag:
33+
define:
34+
35+
env:
36+
COMPILER: gfortran
37+
MPIPROCS: 2
38+
MODE: ${{ matrix.mode }}
39+
DEFINE: ${{ matrix.define }}
40+
41+
steps:
42+
- name: Install dependencies
43+
run: sudo apt update &&
44+
sudo apt install -y
45+
python3-dev
46+
python3-numpy
47+
python3-nose
48+
python3-matplotlib
49+
libpython3-dev
50+
mpich
51+
52+
- name: Checkout code
53+
uses: actions/checkout@v2
54+
with:
55+
submodules: recursive
56+
fetch-depth: 0
57+
58+
- name: Merge branch
59+
if: github.event_name == 'pull_request'
60+
run: git config user.email "test@example.com" &&
61+
git config user.name "test" &&
62+
git checkout -b $GITHUB_HEAD_REF $GITHUB_SHA &&
63+
git checkout -b $GITHUB_BASE_REF origin/$GITHUB_BASE_REF &&
64+
git merge --no-ff $GITHUB_HEAD_REF
65+
66+
- name: Cleanup
67+
run: cd epoch1d && make cleanall &&
68+
cd ../epoch2d && make cleanall &&
69+
cd ../epoch3d && make cleanall
70+
71+
- name: Compile and run tests
72+
run: ./scripts/run-tests-epoch-all.sh ${{ matrix.flag }}

SDF

epoch1d/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ endif
147147
# ARCHER (also works for HECToR)
148148
# ========
149149
ifeq ($(strip $(COMPILER)),archer)
150-
FFLAGS = -O3
150+
FFLAGS = -O3 -hipa2
151151
ifeq ($(strip $(MODE)),debug)
152152
FFLAGS = -O0 -g -ea -ec -eC -eD -eI -en -hfp_trap -Ktrap=fp -m0 -M1438,7413
153153
endif

epoch1d/src/constants.F90

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,27 @@ MODULE constants
103103
INTEGER, PARAMETER :: c_err_io_error = 2**15
104104
INTEGER, PARAMETER :: c_err_bad_setup = 2**16
105105
INTEGER, PARAMETER :: c_err_window = 2**17
106+
INTEGER, PARAMETER :: c_err_max = 17
107+
108+
CHARACTER(LEN=*), PARAMETER :: c_err_char(0:c_err_max) = (/ &
109+
'unknown_block ', &
110+
'unknown_element ', &
111+
'preset_element ', &
112+
'preset_element_use_later', &
113+
'bad_value ', &
114+
'missing_elements ', &
115+
'terminate ', &
116+
'required_element_not_set', &
117+
'pp_options_missing ', &
118+
'bad_array_length ', &
119+
'other ', &
120+
'warn_bad_value ', &
121+
'generic_warning ', &
122+
'generic_error ', &
123+
'pp_options_wrong ', &
124+
'io_error ', &
125+
'bad_setup ', &
126+
'window '/)
106127

107128
INTEGER, PARAMETER :: c_ds_first = 1
108129
INTEGER, PARAMETER :: c_ds_last = 2
@@ -293,9 +314,23 @@ MODULE constants
293314
INTEGER, PARAMETER :: c_pt_species = 9
294315
INTEGER, PARAMETER :: c_pt_subset = 10
295316
INTEGER, PARAMETER :: c_pt_default_constant = 11
317+
INTEGER, PARAMETER :: c_pt_max = 11
296318
INTEGER, PARAMETER :: c_pt_bad = 1024
297319
INTEGER, PARAMETER :: c_pt_null = 1025
298320

321+
CHARACTER(LEN=*), PARAMETER :: c_pt_char(c_pt_max) = (/ &
322+
'variable ', &
323+
'constant ', &
324+
'operator ', &
325+
'function ', &
326+
'parenthesis ', &
327+
'separator ', &
328+
'character ', &
329+
'deck_constant ', &
330+
'species ', &
331+
'subset ', &
332+
'default_constant'/)
333+
299334
! Opcode constants
300335
INTEGER, PARAMETER :: c_opcode_plus = 1
301336
INTEGER, PARAMETER :: c_opcode_minus = 2

epoch1d/src/deck/deck.F90

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ RECURSIVE SUBROUTINE read_deck(filename, first_call, deck_state_in)
538538
deck_values(2)%value = ''
539539
slen = 1
540540
line = 1
541+
deck_line_number = '0'
541542
column = 0
542543

543544
! Use non-advancing IO to pop characters off the deck file one at a time
@@ -558,6 +559,7 @@ RECURSIVE SUBROUTINE read_deck(filename, first_call, deck_state_in)
558559
got_eof = .TRUE.
559560
column = 0
560561
line = line + 1
562+
CALL integer_as_string(line - 1, deck_line_number)
561563
ELSE
562564
got_eor = .FALSE.
563565
column = column + 1
@@ -667,6 +669,7 @@ RECURSIVE SUBROUTINE read_deck(filename, first_call, deck_state_in)
667669
END IF
668670
continuation = .FALSE.
669671
line = line + 1
672+
CALL integer_as_string(line - 1, deck_line_number)
670673
column = 0
671674
END IF
672675

@@ -678,6 +681,7 @@ RECURSIVE SUBROUTINE read_deck(filename, first_call, deck_state_in)
678681
io = io_units(iu)
679682
WRITE(io,*)
680683
WRITE(io,*) '*** ERROR ***'
684+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
681685
IF (flip > 1) THEN
682686
WRITE(io,*) 'Whilst reading ',TRIM(deck_values(1)%value) &
683687
// ' = ' // TRIM(deck_values(2)%value(1:pos-1))
@@ -847,6 +851,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
847851
io = io_units(iu)
848852
WRITE(io,*)
849853
WRITE(io,*) '*** WARNING ***'
854+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
850855
WRITE(io,*) 'The block "' // TRIM(value) &
851856
// '" cannot be set because'
852857
WRITE(io,*) 'the code has not been compiled with the correct ' &
@@ -861,6 +866,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
861866
io = io_units(iu)
862867
WRITE(io,*)
863868
WRITE(io,*) '*** WARNING ***'
869+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
864870
WRITE(io,*) 'The block "' // TRIM(value) &
865871
// '" cannot be set because'
866872
WRITE(io,*) 'the code has not been compiled with the correct ' &
@@ -875,6 +881,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
875881
io = io_units(iu)
876882
WRITE(io,*)
877883
WRITE(io,*) '*** WARNING ***'
884+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
878885
WRITE(io,*) 'Unknown block "' // TRIM(value) &
879886
// '" in input deck, ignoring', deck_state
880887
END DO
@@ -903,6 +910,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
903910
WRITE(du,*)
904911
IF (err_count /= 0) THEN
905912
WRITE(du,*) '*** WARNING ***'
913+
WRITE(du,*) 'Input deck line number ', TRIM(deck_line_number)
906914
WRITE(du,*) 'Block "' // TRIM(ADJUSTL(value)) // '" contains errors'
907915
WRITE(du,*)
908916
END IF
@@ -919,6 +927,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
919927
io = io_units(iu)
920928
WRITE(io,*)
921929
WRITE(io,*) '*** ERROR ***'
930+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
922931
WRITE(io,*) 'Value "' // TRIM(value) // '" in element "' &
923932
// TRIM(element) // '" is invalid and cannot be parsed.'
924933
WRITE(io,*) 'Code will terminate'
@@ -947,6 +956,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
947956
io = io_units(iu)
948957
WRITE(io,*)
949958
WRITE(io,*) '*** WARNING ***'
959+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
950960
WRITE(io,*) 'Unrecognised element "' // TRIM(element) &
951961
// '" in input deck.'
952962
WRITE(io,*) 'Code will continue to run, but behaviour is undefined'
@@ -960,6 +970,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
960970
io = io_units(iu)
961971
WRITE(io,*)
962972
WRITE(io,*) '*** WARNING ***'
973+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
963974
WRITE(io,*) 'Element "' // TRIM(element) &
964975
// '" is set multiple times in this deck.'
965976
WRITE(io,*) 'Code will continue using first value in deck'
@@ -973,6 +984,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
973984
io = io_units(iu)
974985
WRITE(io,*)
975986
WRITE(io,*) '*** WARNING ***'
987+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
976988
WRITE(io,*) 'Element "' // TRIM(element) &
977989
// '" is set multiple times in this deck.'
978990
WRITE(io,*) 'Code will continue using last value in deck'
@@ -986,6 +998,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
986998
io = io_units(iu)
987999
WRITE(io,*)
9881000
WRITE(io,*) '*** ERROR ***'
1001+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
9891002
WRITE(io,*) 'Value "' // TRIM(value) // '" in element "' &
9901003
// TRIM(element) // '" is'
9911004
WRITE(io,*) 'invalid or could not be parsed. Code will terminate.'
@@ -1000,6 +1013,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
10001013
io = io_units(iu)
10011014
WRITE(io,*)
10021015
WRITE(io,*) '*** WARNING ***'
1016+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
10031017
WRITE(io,*) 'Value "' // TRIM(value) // '" in element "' &
10041018
// TRIM(element) // '" is'
10051019
WRITE(io,*) 'invalid or could not be parsed. Code will use', &
@@ -1015,6 +1029,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
10151029
io = io_units(iu)
10161030
WRITE(io,*)
10171031
WRITE(io,*) '*** ERROR ***'
1032+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
10181033
WRITE(io,*) 'Value "' // TRIM(value) // '" in element "' &
10191034
// TRIM(element) // '" cannot be'
10201035
WRITE(io,*) 'set because a prerequisite element "' &
@@ -1031,6 +1046,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
10311046
io = io_units(iu)
10321047
WRITE(io,*)
10331048
WRITE(io,*) '*** WARNING ***'
1049+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
10341050
WRITE(io,*) 'The element "' // TRIM(element) // '" of block "' &
10351051
// TRIM(current_block_name) // '" cannot be set'
10361052
WRITE(io,*) 'because the code has not been compiled with the ' &
@@ -1048,6 +1064,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
10481064
io = io_units(iu)
10491065
WRITE(io,*)
10501066
WRITE(io,*) '*** WARNING ***'
1067+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
10511068
WRITE(io,*) TRIM(extended_error_string)
10521069
WRITE(io,*)
10531070
END DO
@@ -1059,6 +1076,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
10591076
io = io_units(iu)
10601077
WRITE(io,*)
10611078
WRITE(io,*) '*** ERROR ***'
1079+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
10621080
WRITE(io,*) TRIM(extended_error_string)
10631081
WRITE(io,*)
10641082
END DO
@@ -1071,6 +1089,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
10711089
io = io_units(iu)
10721090
WRITE(io,*)
10731091
WRITE(io,*) '*** ERROR ***'
1092+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
10741093
WRITE(io,*) 'You have managed to find an impossible situation in ' &
10751094
// 'this code.'
10761095
WRITE(io,*) 'Good for you. Just because of that, the code will ' &

epoch1d/src/deck/deck_constant_block.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ FUNCTION constant_block_handle_element(element, value) RESULT(errcode)
115115
DO iu = 1, nio_units ! Print to stdout and to file
116116
io = io_units(iu)
117117
WRITE(io,*) '*** WARNING ***'
118+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
118119
WRITE(io,*) 'The constant block variable "' // TRIM(element) &
119120
// '" conflicts with a'
120121
WRITE(io,*) 'built-in constant name. It will be ignored.'

epoch1d/src/deck/deck_dist_fn_block.f90

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ FUNCTION dist_fn_block_handle_element(element, value) RESULT(errcode)
167167
DO iu = 1, nio_units ! Print to stdout and to file
168168
io = io_units(iu)
169169
WRITE(io,*) '*** ERROR ***'
170+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
170171
WRITE(io,*) 'Distribution functions can only be 1D, 2D or 3D'
171172
END DO
172173
END IF
@@ -277,6 +278,7 @@ FUNCTION dist_fn_block_handle_element(element, value) RESULT(errcode)
277278
DO iu = 1, nio_units ! Print to stdout and to file
278279
io = io_units(iu)
279280
WRITE(io,*) '*** ERROR ***'
281+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
280282
WRITE(io,*) 'Unable to apply dist_fn to non existant species ', &
281283
ispecies
282284
END DO

epoch1d/src/deck/deck_injector_block.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ FUNCTION injector_block_handle_element(element, value) RESULT(errcode)
9999
DO iu = 1, nio_units ! Print to stdout and to file
100100
io = io_units(iu)
101101
WRITE(io,*) '*** ERROR ***'
102+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
102103
WRITE(io,*) 'Cannot set injector properties before boundary is set'
103104
END DO
104105
CALL abort_code(c_err_required_element_not_set)

epoch1d/src/deck/deck_io_block.F90

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
329329
DO iu = 1, nio_units ! Print to stdout and to file
330330
io = io_units(iu)
331331
WRITE(io,*) '*** ERROR ***'
332+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
332333
WRITE(io,*) 'Cannot have multiple "rolling_restart" blocks.'
333334
END DO
334335
END IF
@@ -387,6 +388,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
387388
DO iu = 1, nio_units ! Print to stdout and to file
388389
io = io_units(iu)
389390
WRITE(io,*) '*** ERROR ***'
391+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
390392
WRITE(io,*) 'The "extended_io_file" option is no longer supported.'
391393
WRITE(io,*) 'Please use the "import" directive instead'
392394
END DO
@@ -433,6 +435,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
433435
DO iu = 1, nio_units ! Print to stdout and to file
434436
io = io_units(iu)
435437
WRITE(io,*) '*** ERROR ***'
438+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
436439
WRITE(io,*) 'Output block "' // TRIM(value) &
437440
// '" already defined.'
438441
END DO
@@ -728,6 +731,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
728731
io = io_units(iu)
729732
WRITE(io,*)
730733
WRITE(io,*) '*** WARNING ***'
734+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
731735
WRITE(io,*) 'Element "' // TRIM(ADJUSTL(element)) &
732736
// '" not ', 'allowed in an unnamed output block.'
733737
WRITE(io,*) 'It has been ignored.'
@@ -740,6 +744,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
740744
io = io_units(iu)
741745
WRITE(io,*)
742746
WRITE(io,*) '*** WARNING ***'
747+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
743748
WRITE(io,*) 'Element "' // TRIM(ADJUSTL(element)) &
744749
// '" not ', 'allowed in a named output block.'
745750
WRITE(io,*) 'It has been ignored.'
@@ -752,6 +757,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
752757
io = io_units(iu)
753758
WRITE(io,*)
754759
WRITE(io,*) '*** WARNING ***'
760+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
755761
WRITE(io,*) 'Element "' // TRIM(ADJUSTL(element)) &
756762
// '" should be moved to ', 'an "output_global" block.'
757763
WRITE(io,*) 'Its value will be applied to all output blocks.'
@@ -841,6 +847,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
841847
DO iu = 1, nio_units ! Print to stdout and to file
842848
io = io_units(iu)
843849
WRITE(io,*) '*** WARNING ***'
850+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
844851
WRITE(io,*) 'Attempting to set per species property for "' &
845852
// TRIM(element) // '" which'
846853
WRITE(io,*) 'does not support this property. Ignoring.'
@@ -889,6 +896,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
889896
DO iu = 1, nio_units ! Print to stdout and to file
890897
io = io_units(iu)
891898
WRITE(io,*) '*** WARNING ***'
899+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
892900
WRITE(io,*) 'Attempting to set average property for "' &
893901
// TRIM(element) // '" which'
894902
WRITE(io,*) 'does not support this property. Ignoring.'
@@ -907,6 +915,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
907915
DO iu = 1, nio_units ! Print to stdout and to file
908916
io = io_units(iu)
909917
WRITE(io,*) '*** WARNING ***'
918+
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
910919
WRITE(io,*) 'Error occurred whilst assigning the averaging ', &
911920
'dumpmask of the variable'
912921
WRITE(io,*) '"' // TRIM(element) &

0 commit comments

Comments
 (0)