From 632b4d1b34f60384b0a162ee1abd53811c7e793a Mon Sep 17 00:00:00 2001
From: holger <holger.grosshans@ptb.de>
Date: Mon, 27 Apr 2020 11:06:47 +0200
Subject: [PATCH] 	modified:   run.sh 	modified:   src/makefile 
 modified:   src/pre.f90

---
 run.sh       |  2 +-
 src/makefile |  4 ++--
 src/pre.f90  | 15 ++++++++-------
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/run.sh b/run.sh
index 0753794..d24482a 100644
--- a/run.sh
+++ b/run.sh
@@ -1,2 +1,2 @@
 mkdir -p results restart output
-mpiexec -np 3 src/pafiX
+mpiexec -np 2 src/pafiX
diff --git a/src/makefile b/src/makefile
index c2b1f4e..7537dc1 100644
--- a/src/makefile
+++ b/src/makefile
@@ -15,9 +15,9 @@ INC =
 # gcc:
 CMP = mpifort
 #O3: optimization
-FLAGS   = -O3 -mcmodel=medium 
+#FLAGS   = -O3 -mcmodel=medium 
 #debugging:
-#FLAGS   = -g3 -O0 -fbounds-check -mcmodel=medium -fimplicit-none -fcheck=all -fbacktrace -floop-nest-optimize -ffpe-trap=invalid,zero,overflow -Wconversion -fno-tree-vectorize
+FLAGS   = -g3 -O0 -fbounds-check -mcmodel=medium -fimplicit-none -fcheck=all -fbacktrace -floop-nest-optimize -ffpe-trap=invalid,zero,overflow -Wconversion -fno-tree-vectorize
 FFLAGS  = -c $(FLAGS)
 
 
diff --git a/src/pre.f90 b/src/pre.f90
index 0e8b58c..02a2eb6 100644
--- a/src/pre.f90
+++ b/src/pre.f90
@@ -73,16 +73,14 @@
       next=myid+1
       prev=myid-1
 
-      if (bcx.eq.'p') then
+      select case (bcx)
+      case ('p')
         if(prev.eq.-1) prev=nrprocs-1
         if(next.eq.nrprocs) next=0
-      elseif (bcx.eq.'w') then
+      case ('w','i') 
         if(prev.eq.-1) prev=mpi_proc_null
         if(next.eq.nrprocs) next=mpi_proc_null
-      elseif (bcx.eq.'i') then
-        if(prev.eq.-1) prev=mpi_proc_null
-        if(next.eq.nrprocs) next=mpi_proc_null
-      endif
+      end select
 
 ! compute flow conditions
       ntend=ntstart+ntime-1
@@ -97,7 +95,10 @@
       muf=nuf*rhof
       ubulk=ubulk0
 
-      if (bcz.eq.'w') delta= dimz/2._pr
+      if (bcy.eq.'w'.and.bcz.eq.'w') delta= min(dimy/2._pr,dimz/2._pr)
+      if (bcy.eq.'w'.and.bcz.eq.'p') delta= dimy/2._pr
+      if (bcy.eq.'p'.and.bcz.eq.'w') delta= dimz/2._pr
+
       Re   = ubulk*delta/nuf
       ftt  = dimxtot/ubulk
 
-- 
GitLab