Skip to content

Commit

Permalink
Merge branch 'hotfix/4.17.16' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbennett committed Jul 15, 2021
2 parents bbc1c3f + 37be9d6 commit 3088d84
Show file tree
Hide file tree
Showing 56 changed files with 622 additions and 258 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

# Controls when the action will run.
on:
push:
branches: [ main, '*-devel' ]
pull_request:
branches: [ main, '*-devel' ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build_and_test:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- mode: debug
flag: -b
define:
- mode: debug
flag: -b
define: >-
-DPER_SPECIES_WEIGHT -DZERO_CURRENT_PARTICLES -DNO_PARTICLE_PROBES
-DPARTICLE_SHAPE_TOPHAT -DPARTICLE_ID -DPHOTONS -DTRIDENT_PHOTONS
-DBREMSSTRAHLUNG -DPARSER_DEBUG -DNO_IO -DCOLLISIONS_TEST
-DPER_PARTICLE_CHARGE_MASS -DPARSER_CHECKING -DNO_USE_ISATTY
-DWORK_DONE_INTEGRATED -DHC_PUSH -DNO_MPI3 -DDECK_DEBUG
- mode:
flag:
define:

env:
COMPILER: gfortran
MPIPROCS: 2
MODE: ${{ matrix.mode }}
DEFINE: ${{ matrix.define }}

steps:
- name: Install dependencies
run: sudo apt update &&
sudo apt install -y
python3-dev
python3-numpy
python3-nose
python3-matplotlib
libpython3-dev
mpich

- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: Merge branch
if: github.event_name == 'pull_request'
run: git config user.email "[email protected]" &&
git config user.name "test" &&
git checkout -b $GITHUB_HEAD_REF $GITHUB_SHA &&
git checkout -b $GITHUB_BASE_REF origin/$GITHUB_BASE_REF &&
git merge --no-ff $GITHUB_HEAD_REF

- name: Cleanup
run: cd epoch1d && make cleanall &&
cd ../epoch2d && make cleanall &&
cd ../epoch3d && make cleanall

- name: Compile and run tests
run: ./scripts/run-tests-epoch-all.sh ${{ matrix.flag }}
2 changes: 1 addition & 1 deletion SDF
Submodule SDF updated 2 files
+1 −1 FORTRAN
+1 −1 utilities
2 changes: 1 addition & 1 deletion epoch1d/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ endif
# ARCHER (also works for HECToR)
# ========
ifeq ($(strip $(COMPILER)),archer)
FFLAGS = -O3
FFLAGS = -O3 -hipa2
ifeq ($(strip $(MODE)),debug)
FFLAGS = -O0 -g -ea -ec -eC -eD -eI -en -hfp_trap -Ktrap=fp -m0 -M1438,7413
endif
Expand Down
35 changes: 35 additions & 0 deletions epoch1d/src/constants.F90
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,27 @@ MODULE constants
INTEGER, PARAMETER :: c_err_io_error = 2**15
INTEGER, PARAMETER :: c_err_bad_setup = 2**16
INTEGER, PARAMETER :: c_err_window = 2**17
INTEGER, PARAMETER :: c_err_max = 17

CHARACTER(LEN=*), PARAMETER :: c_err_char(0:c_err_max) = (/ &
'unknown_block ', &
'unknown_element ', &
'preset_element ', &
'preset_element_use_later', &
'bad_value ', &
'missing_elements ', &
'terminate ', &
'required_element_not_set', &
'pp_options_missing ', &
'bad_array_length ', &
'other ', &
'warn_bad_value ', &
'generic_warning ', &
'generic_error ', &
'pp_options_wrong ', &
'io_error ', &
'bad_setup ', &
'window '/)

INTEGER, PARAMETER :: c_ds_first = 1
INTEGER, PARAMETER :: c_ds_last = 2
Expand Down Expand Up @@ -293,9 +314,23 @@ MODULE constants
INTEGER, PARAMETER :: c_pt_species = 9
INTEGER, PARAMETER :: c_pt_subset = 10
INTEGER, PARAMETER :: c_pt_default_constant = 11
INTEGER, PARAMETER :: c_pt_max = 11
INTEGER, PARAMETER :: c_pt_bad = 1024
INTEGER, PARAMETER :: c_pt_null = 1025

CHARACTER(LEN=*), PARAMETER :: c_pt_char(c_pt_max) = (/ &
'variable ', &
'constant ', &
'operator ', &
'function ', &
'parenthesis ', &
'separator ', &
'character ', &
'deck_constant ', &
'species ', &
'subset ', &
'default_constant'/)

! Opcode constants
INTEGER, PARAMETER :: c_opcode_plus = 1
INTEGER, PARAMETER :: c_opcode_minus = 2
Expand Down
19 changes: 19 additions & 0 deletions epoch1d/src/deck/deck.F90
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ RECURSIVE SUBROUTINE read_deck(filename, first_call, deck_state_in)
deck_values(2)%value = ''
slen = 1
line = 1
deck_line_number = '0'
column = 0

! Use non-advancing IO to pop characters off the deck file one at a time
Expand All @@ -558,6 +559,7 @@ RECURSIVE SUBROUTINE read_deck(filename, first_call, deck_state_in)
got_eof = .TRUE.
column = 0
line = line + 1
CALL integer_as_string(line - 1, deck_line_number)
ELSE
got_eor = .FALSE.
column = column + 1
Expand Down Expand Up @@ -667,6 +669,7 @@ RECURSIVE SUBROUTINE read_deck(filename, first_call, deck_state_in)
END IF
continuation = .FALSE.
line = line + 1
CALL integer_as_string(line - 1, deck_line_number)
column = 0
END IF

Expand All @@ -678,6 +681,7 @@ RECURSIVE SUBROUTINE read_deck(filename, first_call, deck_state_in)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
IF (flip > 1) THEN
WRITE(io,*) 'Whilst reading ',TRIM(deck_values(1)%value) &
// ' = ' // TRIM(deck_values(2)%value(1:pos-1))
Expand Down Expand Up @@ -847,6 +851,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'The block "' // TRIM(value) &
// '" cannot be set because'
WRITE(io,*) 'the code has not been compiled with the correct ' &
Expand All @@ -861,6 +866,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'The block "' // TRIM(value) &
// '" cannot be set because'
WRITE(io,*) 'the code has not been compiled with the correct ' &
Expand All @@ -875,6 +881,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Unknown block "' // TRIM(value) &
// '" in input deck, ignoring', deck_state
END DO
Expand Down Expand Up @@ -903,6 +910,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
WRITE(du,*)
IF (err_count /= 0) THEN
WRITE(du,*) '*** WARNING ***'
WRITE(du,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(du,*) 'Block "' // TRIM(ADJUSTL(value)) // '" contains errors'
WRITE(du,*)
END IF
Expand All @@ -919,6 +927,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Value "' // TRIM(value) // '" in element "' &
// TRIM(element) // '" is invalid and cannot be parsed.'
WRITE(io,*) 'Code will terminate'
Expand Down Expand Up @@ -947,6 +956,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Unrecognised element "' // TRIM(element) &
// '" in input deck.'
WRITE(io,*) 'Code will continue to run, but behaviour is undefined'
Expand All @@ -960,6 +970,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Element "' // TRIM(element) &
// '" is set multiple times in this deck.'
WRITE(io,*) 'Code will continue using first value in deck'
Expand All @@ -973,6 +984,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Element "' // TRIM(element) &
// '" is set multiple times in this deck.'
WRITE(io,*) 'Code will continue using last value in deck'
Expand All @@ -986,6 +998,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Value "' // TRIM(value) // '" in element "' &
// TRIM(element) // '" is'
WRITE(io,*) 'invalid or could not be parsed. Code will terminate.'
Expand All @@ -1000,6 +1013,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Value "' // TRIM(value) // '" in element "' &
// TRIM(element) // '" is'
WRITE(io,*) 'invalid or could not be parsed. Code will use', &
Expand All @@ -1015,6 +1029,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Value "' // TRIM(value) // '" in element "' &
// TRIM(element) // '" cannot be'
WRITE(io,*) 'set because a prerequisite element "' &
Expand All @@ -1031,6 +1046,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'The element "' // TRIM(element) // '" of block "' &
// TRIM(current_block_name) // '" cannot be set'
WRITE(io,*) 'because the code has not been compiled with the ' &
Expand All @@ -1048,6 +1064,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) TRIM(extended_error_string)
WRITE(io,*)
END DO
Expand All @@ -1059,6 +1076,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) TRIM(extended_error_string)
WRITE(io,*)
END DO
Expand All @@ -1071,6 +1089,7 @@ SUBROUTINE handle_deck_element(element, value, errcode_deck)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'You have managed to find an impossible situation in ' &
// 'this code.'
WRITE(io,*) 'Good for you. Just because of that, the code will ' &
Expand Down
1 change: 1 addition & 0 deletions epoch1d/src/deck/deck_constant_block.f90
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ FUNCTION constant_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'The constant block variable "' // TRIM(element) &
// '" conflicts with a'
WRITE(io,*) 'built-in constant name. It will be ignored.'
Expand Down
2 changes: 2 additions & 0 deletions epoch1d/src/deck/deck_dist_fn_block.f90
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ FUNCTION dist_fn_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Distribution functions can only be 1D, 2D or 3D'
END DO
END IF
Expand Down Expand Up @@ -277,6 +278,7 @@ FUNCTION dist_fn_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Unable to apply dist_fn to non existant species ', &
ispecies
END DO
Expand Down
1 change: 1 addition & 0 deletions epoch1d/src/deck/deck_injector_block.f90
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ FUNCTION injector_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Cannot set injector properties before boundary is set'
END DO
CALL abort_code(c_err_required_element_not_set)
Expand Down
9 changes: 9 additions & 0 deletions epoch1d/src/deck/deck_io_block.F90
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Cannot have multiple "rolling_restart" blocks.'
END DO
END IF
Expand Down Expand Up @@ -387,6 +388,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'The "extended_io_file" option is no longer supported.'
WRITE(io,*) 'Please use the "import" directive instead'
END DO
Expand Down Expand Up @@ -433,6 +435,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** ERROR ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Output block "' // TRIM(value) &
// '" already defined.'
END DO
Expand Down Expand Up @@ -728,6 +731,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Element "' // TRIM(ADJUSTL(element)) &
// '" not ', 'allowed in an unnamed output block.'
WRITE(io,*) 'It has been ignored.'
Expand All @@ -740,6 +744,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Element "' // TRIM(ADJUSTL(element)) &
// '" not ', 'allowed in a named output block.'
WRITE(io,*) 'It has been ignored.'
Expand All @@ -752,6 +757,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
io = io_units(iu)
WRITE(io,*)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Element "' // TRIM(ADJUSTL(element)) &
// '" should be moved to ', 'an "output_global" block.'
WRITE(io,*) 'Its value will be applied to all output blocks.'
Expand Down Expand Up @@ -841,6 +847,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Attempting to set per species property for "' &
// TRIM(element) // '" which'
WRITE(io,*) 'does not support this property. Ignoring.'
Expand Down Expand Up @@ -889,6 +896,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Attempting to set average property for "' &
// TRIM(element) // '" which'
WRITE(io,*) 'does not support this property. Ignoring.'
Expand All @@ -907,6 +915,7 @@ FUNCTION io_block_handle_element(element, value) RESULT(errcode)
DO iu = 1, nio_units ! Print to stdout and to file
io = io_units(iu)
WRITE(io,*) '*** WARNING ***'
WRITE(io,*) 'Input deck line number ', TRIM(deck_line_number)
WRITE(io,*) 'Error occurred whilst assigning the averaging ', &
'dumpmask of the variable'
WRITE(io,*) '"' // TRIM(element) &
Expand Down
Loading

0 comments on commit 3088d84

Please sign in to comment.