Skip to content

Commit

Permalink
Merge branch 'development' into new_shock_flag_call
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Mar 19, 2024
2 parents 94f50a4 + 3942b71 commit 89e58ce
Show file tree
Hide file tree
Showing 178 changed files with 5,611 additions and 1,093 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Checks: >
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-init-variables,
Expand All @@ -20,6 +21,7 @@ Checks: >
-misc-const-correctness,
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/fsanitizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: fsanitizer

on: [push, pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-fsanitizer
cancel-in-progress: true

jobs:
fsanitizer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get submodules
run: |
git submodule update --init
cd external/Microphysics
git fetch; git checkout development
cd ../amrex
git fetch; git checkout development
cd ../..
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0
- name: Compile subchandra
run: |
cd Exec/science/subchandra
make FSANITIZER=TRUE USE_MPI=FALSE -j 4
- name: Run subchandra
run: |
cd Exec/science/subchandra
./Castro2d.gnu.SMPLSDC.ex inputs_2d.N14.coarse amr.max_level=1 max_step=1 amr.n_cell=320 640
6 changes: 3 additions & 3 deletions .github/workflows/get_release_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
txt = txt[m.end():].strip()
else:
txt = ""
# we now need to substitute characters in the string so that
# the action can deal with line breaks

# we now need to substitute characters in the string so that
# the action can deal with line breaks
txt = txt.replace('%', '%25')
txt = txt.replace('\n', '%0A')
txt = txt.replace('\r', '%0D')
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Style

on: [push, pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-style
cancel-in-progress: true

jobs:
tabs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Tabs
run: .github/workflows/style/check_tabs.sh

trailing_whitespaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Trailing Whitespaces
run: .github/workflows/style/check_trailing_whitespaces.sh
36 changes: 36 additions & 0 deletions .github/workflows/style/check_tabs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

set -eu -o pipefail

find . -type d \( -name .git \
-o -path ./paper \
-o -name build -o -name install \
-o -name tmp_build_dir -o -name tmp_install_dir \
\) -prune -o \
-type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \
-o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \
-o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \
-o -name "*.py" \
-o -name "*.md" -o -name "*.rst" \
-o -name "*.sh" \
-o -name "*.tex" \
-o -name "*.txt" \
-o -name "*.yml" \) \
-a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \
-a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \) \
\) \
-exec grep -Iq . {} \; \
-exec sed -i 's/\t/\ \ \ \ /g' {} +

gitdiff=`git diff`

if [ -z "$gitdiff" ]
then
exit 0
else
echo -e "\nTabs are not allowed. Changes suggested by"
echo -e " ${0}\n"
git --no-pager diff
echo ""
exit 1
fi
38 changes: 38 additions & 0 deletions .github/workflows/style/check_trailing_whitespaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

set -eu -o pipefail

find . -type d \( -name .git \
-o -path ./paper \
-o -name build -o -name install \
-o -name tmp_build_dir -o -name tmp_install_dir \
-o -path ./util/gcem \
\) -prune -o \
-type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \
-o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \
-o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \
-o -name "*.py" \
-o -name "*.rst" \
-o -name "*.sh" \
-o -name "*.tex" \
-o -name "*.txt" \
-o -name "*.yml" \) \
-a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \
-a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \
-a ! -path "./networks/*/reaclib_rates.H" \) \
\) \
-exec grep -Iq . {} \; \
-exec sed -i 's/[[:blank:]]\+$//g' {} +

gitdiff=`git diff`

if [ -z "$gitdiff" ]
then
exit 0
else
echo -e "\nTrailing whitespaces at the end of a line are not allowed. Changes suggested by"
echo -e " ${0}\n"
git --no-pager diff
echo ""
exit 1
fi
10 changes: 5 additions & 5 deletions Diagnostics/DustCollapse/analytic.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! Print out the analytic solution for the homologous dust collapse problem,
! from Colgate and White 1966, ApJ, 143, 626.
!
!
! This will yield r(t) as a function of t

module constants_module
Expand All @@ -18,7 +18,7 @@ module constants_module

! we try to do equal timesteps, but eventually, the radius of the
! sphere is changing so quickly that we need to adjust the size of
! the timestep. The code will take nstep timesteps, with the
! the timestep. The code will take nstep timesteps, with the
! initial timestep to be (t_f - t_i)/(nstep - 1). Once the radius
! begins to change significantly, we will begin halving the timestep
! as needed.
Expand Down Expand Up @@ -111,7 +111,7 @@ function f(r,t) result (func)
use constants_module

implicit none

double precision, intent(in) :: r, t
double precision :: func

Expand All @@ -130,7 +130,7 @@ function dfdr(r,t) result (dfuncdr)
use constants_module

implicit none

double precision, intent(in) :: r, t
double precision :: dfuncdr

Expand All @@ -145,4 +145,4 @@ function dfdr(r,t) result (dfuncdr)
end function dfdr



Loading

0 comments on commit 89e58ce

Please sign in to comment.