Skip to content

Commit 269c808

Browse files
committed
merge
2 parents 6490e05 + e16c79c commit 269c808

18 files changed

Lines changed: 164 additions & 241 deletions

.github/Dockerfile

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ ARG CXX_COMPILER
77
ARG FC_COMPILER
88
ARG COMPILER_PATH
99
ARG COMPILER_LD_LIBRARY_PATH
10-
ARG AFAR_VERSION
11-
ARG OLCF_AFAR_ROOT=""
1210

1311
ENV DEBIAN_FRONTEND=noninteractive
1412
ENV TZ=UTC
@@ -29,47 +27,10 @@ RUN apt-get update -y && \
2927
python3.12 python3.12-venv python3-pip \
3028
libfftw3-dev \
3129
openmpi-bin libopenmpi-dev; \
32-
elif [ "$TARGET" = "amd" ]; then \
33-
apt-get install -y \
34-
build-essential git make gcc g++ gfortran bc \
35-
python3.12 python3.12-venv python3-pip \
36-
libfftw3-dev libnuma1 libdrm2 libdrm-amdgpu1; \
3730
fi && \
3831
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 2 && \
3932
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
4033

41-
# AMD: download AFAR, install cmake 3.28 (Ubuntu 22.04 ships 3.22 which doesn't
42-
# recognize amdflang as LLVMFlang), then build MPICH with amdflang so the
43-
# generated mpi.mod is compiler-compatible.
44-
RUN if [ "$TARGET" = "amd" ] && [ -n "$AFAR_VERSION" ]; then \
45-
OLCF_AFAR_ROOT="/opt/${AFAR_VERSION}" && \
46-
wget -q "https://repo.radeon.com/rocm/misc/flang/${AFAR_VERSION}-ubuntu.tar.bz2" -O /tmp/afar.tar.bz2 && \
47-
tar -xjf /tmp/afar.tar.bz2 -C /opt/ && \
48-
rm /tmp/afar.tar.bz2 && \
49-
CMAKE_VER=3.28.6 && \
50-
wget -q "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-linux-x86_64.sh" \
51-
-O /tmp/cmake-install.sh && \
52-
chmod +x /tmp/cmake-install.sh && \
53-
/tmp/cmake-install.sh --prefix=/usr/local --skip-license --exclude-subdir && \
54-
rm /tmp/cmake-install.sh && \
55-
printf '#!/bin/bash\nargs=()\nwhile [ "$#" -gt 0 ]; do\n if [ "$1" = "-soname" ]; then\n args+=("-Wl,-soname,$2"); shift 2\n else\n args+=("$1"); shift\n fi\ndone\nexec '"${OLCF_AFAR_ROOT}"'/bin/amdflang "${args[@]}"\n' \
56-
> /usr/local/bin/amdflang-ld-wrap && \
57-
chmod +x /usr/local/bin/amdflang-ld-wrap && \
58-
MPICH_VER=3.4.3 && \
59-
wget -q "https://www.mpich.org/static/downloads/${MPICH_VER}/mpich-${MPICH_VER}.tar.gz" \
60-
-O /tmp/mpich.tar.gz && \
61-
mkdir -p /tmp/mpich-src && \
62-
tar -xzf /tmp/mpich.tar.gz -C /tmp/mpich-src --strip-components=1 && \
63-
cd /tmp/mpich-src && \
64-
FC=/usr/local/bin/amdflang-ld-wrap CC=gcc CXX=g++ \
65-
./configure --prefix=/opt/mpich --enable-shared --disable-static \
66-
--with-device=ch3 2>&1 && \
67-
make -j$(nproc) 2>&1 && \
68-
make install 2>&1 && \
69-
cd / && \
70-
rm -rf /tmp/mpich-src /tmp/mpich.tar.gz; \
71-
fi
72-
7334
ENV OMPI_ALLOW_RUN_AS_ROOT=1
7435
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
7536
ENV HYDRA_LAUNCHER=fork
@@ -80,7 +41,6 @@ COPY ../ /opt/MFC
8041
ENV CC=${CC_COMPILER}
8142
ENV CXX=${CXX_COMPILER}
8243
ENV FC=${FC_COMPILER}
83-
ENV OLCF_AFAR_ROOT=${OLCF_AFAR_ROOT}
8444
ENV PATH="${COMPILER_PATH}:/opt/mpich/bin:$PATH"
8545
ENV LD_LIBRARY_PATH="${COMPILER_LD_LIBRARY_PATH}:/opt/mpich/lib:${LD_LIBRARY_PATH:-}"
8646

@@ -95,17 +55,13 @@ RUN echo "TARGET=$TARGET CC=$CC_COMPILER FC=$FC_COMPILER" && \
9555
cd /opt/MFC && \
9656
if [ "$TARGET" = "gpu" ]; then \
9757
./mfc.sh build --gpu acc -j $(nproc); \
98-
elif [ "$TARGET" = "amd" ]; then \
99-
./mfc.sh build --gpu mp -j $(nproc); \
10058
else \
10159
./mfc.sh build -j $(nproc); \
10260
fi
10361

10462
RUN cd /opt/MFC && \
10563
if [ "$TARGET" = "gpu" ]; then \
10664
./mfc.sh test -a --dry-run --gpu acc -j $(nproc); \
107-
elif [ "$TARGET" = "amd" ]; then \
108-
./mfc.sh test -a --dry-run --gpu mp -j $(nproc); \
10965
else \
11066
./mfc.sh test -a --dry-run -j $(nproc); \
11167
fi

.github/workflows/docker.yml

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
- { name: 'cpu', tag: 'cpu', runner: 'ubuntu-22.04-arm', base_image: 'ubuntu:22.04' }
2929
- { name: 'gpu', tag: 'gpu-nvidia', runner: 'ubuntu-22.04', base_image: 'nvcr.io/nvidia/nvhpc:24.5-devel-cuda_multi-ubuntu22.04', compiler_arch: 'Linux_x86_64' }
3030
- { name: 'gpu', tag: 'gpu-nvidia', runner: 'ubuntu-22.04-arm', base_image: 'nvcr.io/nvidia/nvhpc:24.5-devel-cuda_multi-ubuntu22.04', compiler_arch: 'Linux_aarch64' }
31-
- { name: 'amd', tag: 'gpu-amd', runner: 'ubuntu-22.04', base_image: 'ubuntu:22.04' }
3231
runs-on: ${{ matrix.config.runner }}
3332
outputs:
3433
tag: ${{ steps.clone.outputs.tag }}
@@ -135,37 +134,6 @@ jobs:
135134
${{ env.GH_REGISTRY }}:${{ env.TAG }}-${{ matrix.config.tag }}-${{ matrix.config.runner }}
136135
push: true
137136

138-
- name: Set AMD AFAR vars
139-
if: ${{ matrix.config.name == 'amd' }}
140-
run: |
141-
AFAR=rocm-afar-8873-drop-22.2.0
142-
ROOT="/opt/${AFAR}"
143-
echo "AFAR_VERSION=${AFAR}" >> $GITHUB_ENV
144-
echo "AFAR_ROOT=${ROOT}" >> $GITHUB_ENV
145-
146-
- name: Build and push image (amd)
147-
if: ${{ matrix.config.name == 'amd' }}
148-
uses: docker/build-push-action@v6
149-
with:
150-
context: /mnt/share
151-
file: /mnt/share/Dockerfile
152-
build-args: |
153-
BASE_IMAGE=${{ matrix.config.base_image }}
154-
TARGET=amd
155-
AFAR_VERSION=${{ env.AFAR_VERSION }}
156-
OLCF_AFAR_ROOT=${{ env.AFAR_ROOT }}
157-
CC_COMPILER=gcc
158-
CXX_COMPILER=g++
159-
FC_COMPILER=${{ env.AFAR_ROOT }}/bin/amdflang
160-
COMPILER_PATH=${{ env.AFAR_ROOT }}/lib/llvm/bin:${{ env.AFAR_ROOT }}/bin
161-
COMPILER_LD_LIBRARY_PATH=${{ env.AFAR_ROOT }}/lib:${{ env.AFAR_ROOT }}/lib/llvm/lib
162-
labels: |
163-
org.opencontainers.image.source=https://github.com/${{ github.repository }}
164-
tags: |
165-
${{ secrets.DOCKERHUB_USERNAME }}/mfc:${{ env.TAG }}-gpu-amd-ubuntu-22.04
166-
${{ env.GH_REGISTRY }}:${{ env.TAG }}-gpu-amd-ubuntu-22.04
167-
push: true
168-
169137
manifests:
170138
runs-on: ubuntu-latest
171139
needs: Container
@@ -201,9 +169,8 @@ jobs:
201169
run: |
202170
GH="${{ env.GH_REGISTRY }}"
203171
for R in "$DH" "$GH"; do
204-
docker buildx imagetools create -t $R:$TAG-cpu $R:$TAG-cpu-ubuntu-22.04 $R:$TAG-cpu-ubuntu-22.04-arm
172+
docker buildx imagetools create -t $R:$TAG-cpu $R:$TAG-cpu-ubuntu-22.04 $R:$TAG-cpu-ubuntu-22.04-arm
205173
docker buildx imagetools create -t $R:$TAG-gpu-nvidia $R:$TAG-gpu-nvidia-ubuntu-22.04 $R:$TAG-gpu-nvidia-ubuntu-22.04-arm
206-
docker buildx imagetools create -t $R:$TAG-gpu-amd $R:$TAG-gpu-amd-ubuntu-22.04
207174
done
208175
209176
- name: Update latest tags
@@ -214,7 +181,6 @@ jobs:
214181
run: |
215182
GH="${{ env.GH_REGISTRY }}"
216183
for R in "$DH" "$GH"; do
217-
docker buildx imagetools create -t $R:latest-cpu $R:$TAG-cpu-ubuntu-22.04 $R:$TAG-cpu-ubuntu-22.04-arm
184+
docker buildx imagetools create -t $R:latest-cpu $R:$TAG-cpu-ubuntu-22.04 $R:$TAG-cpu-ubuntu-22.04-arm
218185
docker buildx imagetools create -t $R:latest-gpu-nvidia $R:$TAG-gpu-nvidia-ubuntu-22.04 $R:$TAG-gpu-nvidia-ubuntu-22.04-arm
219-
docker buildx imagetools create -t $R:latest-gpu-amd $R:$TAG-gpu-amd-ubuntu-22.04
220186
done

src/pre_process/m_assign_variables.fpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ contains
118118
119119
do i = 1, eqn_idx%E - eqn_idx%mom%beg
120120
q_prim_vf(i + 1)%sf(j, k, l) = 1._wp/q_prim_vf(1)%sf(j, k, &
121-
& l)*(eta*patch_icpp(patch_id)%rho*patch_icpp(patch_id)%vel(i) + (1._wp - eta)*patch_icpp(smooth_patch_id) &
122-
& %rho*patch_icpp(smooth_patch_id)%vel(i))
121+
& l)*(eta*patch_icpp(patch_id)%rho*patch_icpp(patch_id)%vel(i) + (1._wp - eta) &
122+
& *patch_icpp(smooth_patch_id)%rho*patch_icpp(smooth_patch_id)%vel(i))
123123
end do
124124
125125
q_prim_vf(eqn_idx%gamma)%sf(j, k, l) = eta*patch_icpp(patch_id)%gamma + (1._wp - eta)*patch_icpp(smooth_patch_id)%gamma
126126
127127
q_prim_vf(eqn_idx%E)%sf(j, k, l) = 1._wp/q_prim_vf(eqn_idx%gamma)%sf(j, k, &
128-
& l)*(eta*patch_icpp(patch_id)%gamma*patch_icpp(patch_id)%pres + (1._wp - eta)*patch_icpp(smooth_patch_id) &
129-
& %gamma*patch_icpp(smooth_patch_id)%pres)
128+
& l)*(eta*patch_icpp(patch_id)%gamma*patch_icpp(patch_id)%pres + (1._wp - eta) &
129+
& *patch_icpp(smooth_patch_id)%gamma*patch_icpp(smooth_patch_id)%pres)
130130
131131
q_prim_vf(eqn_idx%pi_inf)%sf(j, k, l) = eta*patch_icpp(patch_id)%pi_inf + (1._wp - eta)*patch_icpp(smooth_patch_id)%pi_inf
132132

src/pre_process/m_check_ib_patches.fpp

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ contains
9595

9696
call s_int_to_str(patch_id, iStr)
9797

98-
@:PROHIBIT(n == 0 .or. p > 0 .or. patch_ib(patch_id)%length_x <= 0._wp .or. patch_ib(patch_id) &
99-
& %length_y <= 0._wp .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id) &
100-
& %y_centroid), 'in ellipse IB patch '//trim(iStr))
98+
@:PROHIBIT(n == 0 .or. p > 0 .or. patch_ib(patch_id)%length_x <= 0._wp .or. patch_ib(patch_id)%length_y <= 0._wp &
99+
& .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid), &
100+
& 'in ellipse IB patch ' // trim(iStr))
101101

102102
end subroutine s_check_ellipse_ib_patch_geometry
103103

@@ -109,9 +109,10 @@ contains
109109

110110
call s_int_to_str(patch_id, iStr)
111111

112-
@:PROHIBIT(n == 0 .or. p > 0 .or. patch_ib(patch_id)%c <= 0._wp .or. patch_ib(patch_id)%p <= 0._wp .or. patch_ib(patch_id) &
113-
& %t <= 0._wp .or. patch_ib(patch_id)%m <= 0._wp .or. f_is_default(patch_ib(patch_id)%x_centroid) &
114-
& .or. f_is_default(patch_ib(patch_id)%y_centroid), 'in airfoil IB patch '//trim(iStr))
112+
@:PROHIBIT(n == 0 .or. p > 0 .or. patch_ib(patch_id)%c <= 0._wp .or. patch_ib(patch_id)%p <= 0._wp &
113+
& .or. patch_ib(patch_id)%t <= 0._wp .or. patch_ib(patch_id)%m <= 0._wp &
114+
& .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid), &
115+
& 'in airfoil IB patch ' // trim(iStr))
115116

116117
end subroutine s_check_airfoil_ib_patch_geometry
117118

@@ -123,9 +124,9 @@ contains
123124

124125
call s_int_to_str(patch_id, iStr)
125126

126-
@:PROHIBIT(n == 0 .or. p == 0 .or. patch_ib(patch_id)%c <= 0._wp .or. patch_ib(patch_id) &
127-
& %p <= 0._wp .or. patch_ib(patch_id)%t <= 0._wp .or. patch_ib(patch_id) &
128-
& %m <= 0._wp .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid) &
127+
@:PROHIBIT(n == 0 .or. p == 0 .or. patch_ib(patch_id)%c <= 0._wp .or. patch_ib(patch_id)%p <= 0._wp &
128+
& .or. patch_ib(patch_id)%t <= 0._wp .or. patch_ib(patch_id)%m <= 0._wp &
129+
& .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid) &
129130
& .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. f_is_default(patch_ib(patch_id)%length_z), &
130131
& 'in 3d airfoil IB patch '//trim(iStr))
131132

@@ -139,9 +140,9 @@ contains
139140

140141
call s_int_to_str(patch_id, iStr)
141142

142-
@:PROHIBIT(n == 0 .or. p > 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id) &
143-
& %y_centroid) .or. patch_ib(patch_id)%length_x <= 0._wp .or. patch_ib(patch_id)%length_y <= 0._wp, &
144-
& 'in rectangle IB patch '//trim(iStr))
143+
@:PROHIBIT(n == 0 .or. p > 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) &
144+
& .or. f_is_default(patch_ib(patch_id)%y_centroid) .or. patch_ib(patch_id)%length_x <= 0._wp &
145+
& .or. patch_ib(patch_id)%length_y <= 0._wp, 'in rectangle IB patch ' // trim(iStr))
145146

146147
end subroutine s_check_rectangle_ib_patch_geometry
147148

@@ -153,9 +154,9 @@ contains
153154

154155
call s_int_to_str(patch_id, iStr)
155156

156-
@:PROHIBIT(n == 0 .or. p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id) &
157-
& %y_centroid) .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. patch_ib(patch_id)%radius <= 0._wp, &
158-
& 'in sphere IB patch '//trim(iStr))
157+
@:PROHIBIT(n == 0 .or. p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) &
158+
& .or. f_is_default(patch_ib(patch_id)%y_centroid) .or. f_is_default(patch_ib(patch_id)%z_centroid) &
159+
& .or. patch_ib(patch_id)%radius <= 0._wp, 'in sphere IB patch ' // trim(iStr))
159160

160161
end subroutine s_check_sphere_ib_patch_geometry
161162

@@ -167,10 +168,10 @@ contains
167168

168169
call s_int_to_str(patch_id, iStr)
169170

170-
@:PROHIBIT(n == 0 .or. p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id) &
171-
& %y_centroid) .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. patch_ib(patch_id) &
172-
& %length_x <= 0._wp .or. patch_ib(patch_id)%length_y <= 0._wp .or. patch_ib(patch_id)%length_z <= 0._wp, &
173-
& 'in cuboid IB patch '//trim(iStr))
171+
@:PROHIBIT(n == 0 .or. p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) &
172+
& .or. f_is_default(patch_ib(patch_id)%y_centroid) .or. f_is_default(patch_ib(patch_id)%z_centroid) &
173+
& .or. patch_ib(patch_id)%length_x <= 0._wp .or. patch_ib(patch_id)%length_y <= 0._wp &
174+
& .or. patch_ib(patch_id)%length_z <= 0._wp, 'in cuboid IB patch ' // trim(iStr))
174175

175176
end subroutine s_check_cuboid_ib_patch_geometry
176177

@@ -183,16 +184,16 @@ contains
183184
call s_int_to_str(patch_id, iStr)
184185

185186
@:PROHIBIT(p == 0 .or. f_is_default(patch_ib(patch_id)%x_centroid) .or. f_is_default(patch_ib(patch_id)%y_centroid) &
186-
& .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. (patch_ib(patch_id) &
187-
& %length_x <= 0._wp .and. patch_ib(patch_id)%length_y <= 0._wp .and. patch_ib(patch_id)%length_z <= 0._wp) &
188-
& .or. patch_ib(patch_id)%radius <= 0._wp, 'in cylinder IB patch '//trim(iStr))
187+
& .or. f_is_default(patch_ib(patch_id)%z_centroid) .or. (patch_ib(patch_id)%length_x <= 0._wp &
188+
& .and. patch_ib(patch_id)%length_y <= 0._wp .and. patch_ib(patch_id)%length_z <= 0._wp) &
189+
& .or. patch_ib(patch_id)%radius <= 0._wp, 'in cylinder IB patch ' // trim(iStr))
189190

190-
@:PROHIBIT( (patch_ib(patch_id)%length_x > 0._wp .and. ((.not. f_is_default(patch_ib(patch_id)%length_y)) &
191-
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)))) .or. (patch_ib(patch_id) &
192-
& %length_y > 0._wp .and. ((.not. f_is_default(patch_ib(patch_id)%length_x)) &
193-
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)))) .or. (patch_ib(patch_id) &
194-
& %length_z > 0._wp .and. ((.not. f_is_default(patch_ib(patch_id)%length_x)) &
195-
& .or. (.not. f_is_default(patch_ib(patch_id)%length_y)))), 'in cylinder IB patch '//trim(iStr))
191+
@:PROHIBIT((patch_ib(patch_id)%length_x > 0._wp .and. ((.not. f_is_default(patch_ib(patch_id)%length_y)) &
192+
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)))) .or. (patch_ib(patch_id)%length_y > 0._wp &
193+
& .and. ((.not. f_is_default(patch_ib(patch_id)%length_x)) &
194+
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)))) .or. (patch_ib(patch_id)%length_z > 0._wp &
195+
& .and. ((.not. f_is_default(patch_ib(patch_id)%length_x)) &
196+
& .or. (.not. f_is_default(patch_ib(patch_id)%length_y)))), 'in cylinder IB patch ' // trim(iStr))
196197

197198
end subroutine s_check_cylinder_ib_patch_geometry
198199

@@ -206,8 +207,8 @@ contains
206207

207208
@:PROHIBIT(patch_ib(patch_id)%model_filepath == dflt_char, 'Empty model file path for patch '//trim(iStr))
208209

209-
@:PROHIBIT(patch_ib(patch_id)%model_scale(1) <= 0._wp .or. patch_ib(patch_id)%model_scale(2) &
210-
& <= 0._wp .or. patch_ib(patch_id)%model_scale(3) <= 0._wp, 'Negative scale in model IB patch '//trim(iStr))
210+
@:PROHIBIT(patch_ib(patch_id)%model_scale(1) <= 0._wp .or. patch_ib(patch_id)%model_scale(2) <= 0._wp &
211+
& .or. patch_ib(patch_id)%model_scale(3) <= 0._wp, 'Negative scale in model IB patch ' // trim(iStr))
211212

212213
end subroutine s_check_model_ib_patch_geometry
213214

@@ -220,8 +221,8 @@ contains
220221
call s_int_to_str(patch_id, iStr)
221222

222223
@:PROHIBIT((.not. f_is_default(patch_ib(patch_id)%x_centroid)) .or. (.not. f_is_default(patch_ib(patch_id)%y_centroid)) &
223-
& .or. (.not. f_is_default(patch_ib(patch_id)%z_centroid)) .or. (.not. f_is_default(patch_ib(patch_id) &
224-
& %length_x)) .or. (.not. f_is_default(patch_ib(patch_id)%length_y)) &
224+
& .or. (.not. f_is_default(patch_ib(patch_id)%z_centroid)) &
225+
& .or. (.not. f_is_default(patch_ib(patch_id)%length_x)) .or. (.not. f_is_default(patch_ib(patch_id)%length_y)) &
225226
& .or. (.not. f_is_default(patch_ib(patch_id)%length_z)) .or. (.not. f_is_default(patch_ib(patch_id)%radius)), &
226227
& 'in inactive IB patch '//trim(iStr))
227228

src/pre_process/m_check_patches.fpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ contains
106106

107107
! Constraints on smoothing initial condition patch parameters
108108
do i = 1, num_patches
109-
if (i > 1 .and. (patch_icpp(i)%geometry == 2 .or. patch_icpp(i)%geometry == 3 .or. patch_icpp(i) &
110-
& %geometry == 4 .or. patch_icpp(i)%geometry == 5 .or. patch_icpp(i)%geometry == 8 .or. patch_icpp(i) &
111-
& %geometry == 9 .or. patch_icpp(i)%geometry == 10 .or. patch_icpp(i)%geometry == 11 .or. patch_icpp(i) &
112-
& %geometry == 12 .or. patch_icpp(i)%geometry == 13 .or. patch_icpp(i)%geometry == 14)) then
109+
if (i > 1 .and. (patch_icpp(i)%geometry == 2 .or. patch_icpp(i)%geometry == 3 .or. patch_icpp(i)%geometry == 4 &
110+
& .or. patch_icpp(i)%geometry == 5 .or. patch_icpp(i)%geometry == 8 .or. patch_icpp(i)%geometry == 9 &
111+
& .or. patch_icpp(i)%geometry == 10 .or. patch_icpp(i)%geometry == 11 .or. patch_icpp(i)%geometry == 12 &
112+
& .or. patch_icpp(i)%geometry == 13 .or. patch_icpp(i)%geometry == 14)) then
113113
call s_check_supported_patch_smoothing(i)
114114
else
115115
call s_check_unsupported_patch_smoothing(i)
@@ -478,11 +478,13 @@ contains
478478
call s_int_to_str(patch_id, iStr)
479479
480480
@:PROHIBIT(f_is_default(patch_icpp(patch_id)%vel(1)), "Patch "//trim(iStr)//": vel(1) must be set")
481-
@:PROHIBIT(n == 0 .and. (.not. f_is_default(patch_icpp(patch_id)%vel(2))) .and. (.not. f_approx_equal(patch_icpp(patch_id) &
482-
& %vel(2) , 0._wp)) .and. (.not. mhd), "Patch "//trim(iStr)//": vel(2) must not be set when n = 0")
481+
@:PROHIBIT(n == 0 .and. (.not. f_is_default(patch_icpp(patch_id)%vel(2))) &
482+
& .and. (.not. f_approx_equal(patch_icpp(patch_id)%vel(2), 0._wp)) .and. (.not. mhd), &
483+
& "Patch " // trim(iStr) // ": vel(2) must not be set when n = 0")
483484
@:PROHIBIT(n > 0 .and. f_is_default(patch_icpp(patch_id)%vel(2)), "Patch "//trim(iStr)//": vel(2) must be set when n > 0")
484-
@:PROHIBIT(p == 0 .and. (.not. f_is_default(patch_icpp(patch_id)%vel(3))) .and. (.not. f_approx_equal(patch_icpp(patch_id) &
485-
& %vel(3) , 0._wp)) .and. (.not. mhd), "Patch "//trim(iStr)//": vel(3) must not be set when p = 0")
485+
@:PROHIBIT(p == 0 .and. (.not. f_is_default(patch_icpp(patch_id)%vel(3))) &
486+
& .and. (.not. f_approx_equal(patch_icpp(patch_id)%vel(3), 0._wp)) .and. (.not. mhd), &
487+
& "Patch " // trim(iStr) // ": vel(3) must not be set when p = 0")
486488
@:PROHIBIT(p > 0 .and. f_is_default(patch_icpp(patch_id)%vel(3)), "Patch "//trim(iStr)//": vel(3) must be set when p > 0")
487489
@:PROHIBIT(mhd .and. (f_is_default(patch_icpp(patch_id)%vel(2)) .or. f_is_default(patch_icpp(patch_id)%vel(3))), &
488490
& "Patch "//trim(iStr)//": All velocities (vel(1:3)) must be set when mhd = true")

0 commit comments

Comments
 (0)