diff --git a/doc/wiki/Runtime-Parameters-related/Runtime-Parameters:-All.md b/doc/wiki/Runtime-Parameters-related/Runtime-Parameters:-All.md
index a80bc75337..2733c4dd46 100644
--- a/doc/wiki/Runtime-Parameters-related/Runtime-Parameters:-All.md
+++ b/doc/wiki/Runtime-Parameters-related/Runtime-Parameters:-All.md
@@ -342,6 +342,7 @@ For variables with `Default/Min/Max` labeled as `Depend`, click the parameter na
| [[ OPT__UM_IC_REFINE \| Runtime-Parameters:-Initial-Conditions#OPT__UM_IC_REFINE ]] | 1 | None | None | refine UM_IC from level OPT__UM_IC_LEVEL to MAX_LEVEL [1] |
| [[ OPT__UNIT \| Runtime-Parameters:-Units#OPT__UNIT ]] | 0 | None | None | specify code units -> must set exactly 3 basic units below [0] ##USELESS FOR COMOVING## |
| [[ OPT__VERBOSE \| Runtime-Parameters:-Miscellaneous#OPT__VERBOSE ]] | 0 | None | None | output the simulation progress in detail [0] |
+| [[ OUTPUT_DIR \| Runtime-Parameters:-Outputs#OUTPUT_DIR ]] | "." | None | None | set the output directory [.] |
| [[ OUTPUT_DT \| Runtime-Parameters:-Outputs#OUTPUT_DT ]] | -1.0 | None | None | output data every OUTPUT_DT time interval ##OPT__OUTPUT_MODE==2 ONLY## |
| [[ OUTPUT_PART_X \| Runtime-Parameters:-Outputs#OUTPUT_PART_X ]] | -1.0 | None | None | x coordinate for OPT__OUTPUT_PART [-1.0] |
| [[ OUTPUT_PART_Y \| Runtime-Parameters:-Outputs#OUTPUT_PART_Y ]] | -1.0 | None | None | y coordinate for OPT__OUTPUT_PART [-1.0] |
diff --git a/doc/wiki/Runtime-Parameters-related/Runtime-Parameters:-Outputs.md b/doc/wiki/Runtime-Parameters-related/Runtime-Parameters:-Outputs.md
index 41fb0f5a4e..a38bceb404 100644
--- a/doc/wiki/Runtime-Parameters-related/Runtime-Parameters:-Outputs.md
+++ b/doc/wiki/Runtime-Parameters-related/Runtime-Parameters:-Outputs.md
@@ -32,6 +32,7 @@ Parameters described on this page:
[OUTPUT_PART_Y](#OUTPUT_PART_Y),
[OUTPUT_PART_Z](#OUTPUT_PART_Z),
[INIT_DUMPID](#INIT_DUMPID),
+[OUTPUT_DIR](#OUTPUT_DIR)
Parameters below are shown in the format: **`Name` (Valid Values) [Default Value]**
@@ -290,6 +291,14 @@ in most cases, even when restarting simulations, unless you want to overwrite
the default value.
* **Restriction:**
+
+* #### `OUTPUT_DIR` (string) [.]
+ * **Description:**
+Specify the output data directory. In most cases, it is unnecessary to set this value
+unless you want to overwrite the default directory.
+ * **Restriction:**
+The string length should be shorter than `MAX_STRING-100`.
+
## Remarks
diff --git a/example/test_problem/ELBDM/DiskHeating/Input__Parameter b/example/test_problem/ELBDM/DiskHeating/Input__Parameter
index 82acc4ee3c..dd2f386a0e 100644
--- a/example/test_problem/ELBDM/DiskHeating/Input__Parameter
+++ b/example/test_problem/ELBDM/DiskHeating/Input__Parameter
@@ -276,6 +276,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/ExtPot/Input__Parameter b/example/test_problem/ELBDM/ExtPot/Input__Parameter
index 0b560c879e..dfc094d758 100644
--- a/example/test_problem/ELBDM/ExtPot/Input__Parameter
+++ b/example/test_problem/ELBDM/ExtPot/Input__Parameter
@@ -156,6 +156,7 @@ OUTPUT_PART_X 0.5 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.5 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.5 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/GaussianWavePacket/Input__Parameter b/example/test_problem/ELBDM/GaussianWavePacket/Input__Parameter
index 58fab1a81d..c25174494d 100644
--- a/example/test_problem/ELBDM/GaussianWavePacket/Input__Parameter
+++ b/example/test_problem/ELBDM/GaussianWavePacket/Input__Parameter
@@ -148,6 +148,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/HaloMerger/Input__Parameter b/example/test_problem/ELBDM/HaloMerger/Input__Parameter
index b6a81826a5..364936893f 100644
--- a/example/test_problem/ELBDM/HaloMerger/Input__Parameter
+++ b/example/test_problem/ELBDM/HaloMerger/Input__Parameter
@@ -201,6 +201,7 @@ OUTPUT_PART_X 0.12938422 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.12938422 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.12938422 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/IsolatedHalo/Input__Parameter b/example/test_problem/ELBDM/IsolatedHalo/Input__Parameter
index d42b2e7d9c..0850e5ee06 100644
--- a/example/test_problem/ELBDM/IsolatedHalo/Input__Parameter
+++ b/example/test_problem/ELBDM/IsolatedHalo/Input__Parameter
@@ -200,6 +200,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# yt inline analysis (SUPPORT_LIBYT only)
diff --git a/example/test_problem/ELBDM/JeansInstabilityComoving/Input__Parameter b/example/test_problem/ELBDM/JeansInstabilityComoving/Input__Parameter
index fe16a22754..ba3f3a5c2d 100644
--- a/example/test_problem/ELBDM/JeansInstabilityComoving/Input__Parameter
+++ b/example/test_problem/ELBDM/JeansInstabilityComoving/Input__Parameter
@@ -171,6 +171,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/LSS/Input__Parameter b/example/test_problem/ELBDM/LSS/Input__Parameter
index c4f3732b83..f209cf8eb7 100644
--- a/example/test_problem/ELBDM/LSS/Input__Parameter
+++ b/example/test_problem/ELBDM/LSS/Input__Parameter
@@ -186,6 +186,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/LSS_Hybrid/Input__Parameter b/example/test_problem/ELBDM/LSS_Hybrid/Input__Parameter
index ca04a71d29..1346d29fc8 100644
--- a/example/test_problem/ELBDM/LSS_Hybrid/Input__Parameter
+++ b/example/test_problem/ELBDM/LSS_Hybrid/Input__Parameter
@@ -197,6 +197,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/Perturbation/Input__Parameter b/example/test_problem/ELBDM/Perturbation/Input__Parameter
index 5bc450b35c..98b6af5684 100644
--- a/example/test_problem/ELBDM/Perturbation/Input__Parameter
+++ b/example/test_problem/ELBDM/Perturbation/Input__Parameter
@@ -190,6 +190,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
OPT__VERBOSE 0 # output the simulation progress in detail [0]
diff --git a/example/test_problem/ELBDM/PlaneWave/Input__Parameter b/example/test_problem/ELBDM/PlaneWave/Input__Parameter
index ef408b5267..0bfd6530cc 100644
--- a/example/test_problem/ELBDM/PlaneWave/Input__Parameter
+++ b/example/test_problem/ELBDM/PlaneWave/Input__Parameter
@@ -148,6 +148,7 @@ OUTPUT_PART_X 0.5 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.5 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.5 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/SelfSimilarHalo/Input__Parameter b/example/test_problem/ELBDM/SelfSimilarHalo/Input__Parameter
index f4228edfed..731ce34b31 100644
--- a/example/test_problem/ELBDM/SelfSimilarHalo/Input__Parameter
+++ b/example/test_problem/ELBDM/SelfSimilarHalo/Input__Parameter
@@ -165,6 +165,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/Soliton/Input__Parameter b/example/test_problem/ELBDM/Soliton/Input__Parameter
index 14658c9257..482e49d502 100644
--- a/example/test_problem/ELBDM/Soliton/Input__Parameter
+++ b/example/test_problem/ELBDM/Soliton/Input__Parameter
@@ -165,6 +165,7 @@ OUTPUT_PART_X 192.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 192.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 192.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/VortexPairLinear/Input__Parameter b/example/test_problem/ELBDM/VortexPairLinear/Input__Parameter
index 06654c88ad..3ad502aeb1 100644
--- a/example/test_problem/ELBDM/VortexPairLinear/Input__Parameter
+++ b/example/test_problem/ELBDM/VortexPairLinear/Input__Parameter
@@ -143,6 +143,7 @@ OUTPUT_PART_X 0.5 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.5 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/VortexPairLinear_Hybrid/Input__Parameter b/example/test_problem/ELBDM/VortexPairLinear_Hybrid/Input__Parameter
index 2fe42309ae..f1209b9a80 100644
--- a/example/test_problem/ELBDM/VortexPairLinear_Hybrid/Input__Parameter
+++ b/example/test_problem/ELBDM/VortexPairLinear_Hybrid/Input__Parameter
@@ -150,6 +150,7 @@ OUTPUT_PART_X 0.5 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.5 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/VortexPairRotating/Input__Parameter b/example/test_problem/ELBDM/VortexPairRotating/Input__Parameter
index 0afea2f99b..1abd485211 100644
--- a/example/test_problem/ELBDM/VortexPairRotating/Input__Parameter
+++ b/example/test_problem/ELBDM/VortexPairRotating/Input__Parameter
@@ -143,6 +143,7 @@ OUTPUT_PART_X 0.5 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.5 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/ELBDM/VortexPairRotating_Hybrid/Input__Parameter b/example/test_problem/ELBDM/VortexPairRotating_Hybrid/Input__Parameter
index 34402dfd7b..32cacd136c 100644
--- a/example/test_problem/ELBDM/VortexPairRotating_Hybrid/Input__Parameter
+++ b/example/test_problem/ELBDM/VortexPairRotating_Hybrid/Input__Parameter
@@ -150,6 +150,7 @@ OUTPUT_PART_X 0.5 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.5 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/AGORA_IsolatedGalaxy/Input_Options/Input__Parameter.low-res b/example/test_problem/Hydro/AGORA_IsolatedGalaxy/Input_Options/Input__Parameter.low-res
index 6117695cb8..4de6dfc02e 100644
--- a/example/test_problem/Hydro/AGORA_IsolatedGalaxy/Input_Options/Input__Parameter.low-res
+++ b/example/test_problem/Hydro/AGORA_IsolatedGalaxy/Input_Options/Input__Parameter.low-res
@@ -234,6 +234,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/AcousticWave/Input__Parameter b/example/test_problem/Hydro/AcousticWave/Input__Parameter
index 29ad3cff03..325b61fc08 100644
--- a/example/test_problem/Hydro/AcousticWave/Input__Parameter
+++ b/example/test_problem/Hydro/AcousticWave/Input__Parameter
@@ -138,6 +138,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/BlastWave/Input__Parameter b/example/test_problem/Hydro/BlastWave/Input__Parameter
index 2e1d2daca9..f40efe1ecc 100644
--- a/example/test_problem/Hydro/BlastWave/Input__Parameter
+++ b/example/test_problem/Hydro/BlastWave/Input__Parameter
@@ -172,6 +172,7 @@ OUTPUT_PART_X 0.5 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.5 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.5 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/Bondi/Input__Parameter b/example/test_problem/Hydro/Bondi/Input__Parameter
index 53b984899f..5a964c6ec5 100644
--- a/example/test_problem/Hydro/Bondi/Input__Parameter
+++ b/example/test_problem/Hydro/Bondi/Input__Parameter
@@ -211,6 +211,7 @@ OUTPUT_PART_X 3.75 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 3.75 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 3.75 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# yt inline analysis (SUPPORT_LIBYT only)
diff --git a/example/test_problem/Hydro/CDM_LSS/Input__Parameter b/example/test_problem/Hydro/CDM_LSS/Input__Parameter
index ac07a13241..0f892f62e3 100644
--- a/example/test_problem/Hydro/CDM_LSS/Input__Parameter
+++ b/example/test_problem/Hydro/CDM_LSS/Input__Parameter
@@ -216,6 +216,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/CMZ/Input__Parameter b/example/test_problem/Hydro/CMZ/Input__Parameter
index e6f554f78e..86f53bed0b 100644
--- a/example/test_problem/Hydro/CMZ/Input__Parameter
+++ b/example/test_problem/Hydro/CMZ/Input__Parameter
@@ -268,6 +268,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/CR_Diffusion/Input__Parameter b/example/test_problem/Hydro/CR_Diffusion/Input__Parameter
index 66c2ac9dad..2bcb1bc0ac 100644
--- a/example/test_problem/Hydro/CR_Diffusion/Input__Parameter
+++ b/example/test_problem/Hydro/CR_Diffusion/Input__Parameter
@@ -295,6 +295,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# yt inline analysis (SUPPORT_LIBYT only)
diff --git a/example/test_problem/Hydro/CR_ShockTube/Input__Parameter b/example/test_problem/Hydro/CR_ShockTube/Input__Parameter
index 94cabe3720..298d30bd22 100644
--- a/example/test_problem/Hydro/CR_ShockTube/Input__Parameter
+++ b/example/test_problem/Hydro/CR_ShockTube/Input__Parameter
@@ -294,6 +294,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# yt inline analysis (SUPPORT_LIBYT only)
diff --git a/example/test_problem/Hydro/CR_SoundWave/Input__Parameter b/example/test_problem/Hydro/CR_SoundWave/Input__Parameter
index 2b9dd797ed..4d7e859ebf 100644
--- a/example/test_problem/Hydro/CR_SoundWave/Input__Parameter
+++ b/example/test_problem/Hydro/CR_SoundWave/Input__Parameter
@@ -293,6 +293,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# yt inline analysis (SUPPORT_LIBYT only)
diff --git a/example/test_problem/Hydro/Caustic/Input__Parameter b/example/test_problem/Hydro/Caustic/Input__Parameter
index 02bf3b1d82..42327b0686 100644
--- a/example/test_problem/Hydro/Caustic/Input__Parameter
+++ b/example/test_problem/Hydro/Caustic/Input__Parameter
@@ -169,6 +169,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/ClusterMerger/Input__Parameter b/example/test_problem/Hydro/ClusterMerger/Input__Parameter
index 0b59e4cecc..36ef06065f 100644
--- a/example/test_problem/Hydro/ClusterMerger/Input__Parameter
+++ b/example/test_problem/Hydro/ClusterMerger/Input__Parameter
@@ -217,6 +217,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/EnergyPowerSpectrum/Input__Parameter b/example/test_problem/Hydro/EnergyPowerSpectrum/Input__Parameter
index 7668f00e2c..4abbba3e99 100644
--- a/example/test_problem/Hydro/EnergyPowerSpectrum/Input__Parameter
+++ b/example/test_problem/Hydro/EnergyPowerSpectrum/Input__Parameter
@@ -136,6 +136,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/Gravity/Input__Parameter b/example/test_problem/Hydro/Gravity/Input__Parameter
index 964bb7f0a0..4512aa3687 100644
--- a/example/test_problem/Hydro/Gravity/Input__Parameter
+++ b/example/test_problem/Hydro/Gravity/Input__Parameter
@@ -189,6 +189,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/JeansInstability/Input__Parameter b/example/test_problem/Hydro/JeansInstability/Input__Parameter
index bfd7ae17b3..c43b618f83 100644
--- a/example/test_problem/Hydro/JeansInstability/Input__Parameter
+++ b/example/test_problem/Hydro/JeansInstability/Input__Parameter
@@ -191,6 +191,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/Jet/Input__Parameter b/example/test_problem/Hydro/Jet/Input__Parameter
index c2fdb33475..aee4e82913 100644
--- a/example/test_problem/Hydro/Jet/Input__Parameter
+++ b/example/test_problem/Hydro/Jet/Input__Parameter
@@ -193,6 +193,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/JetICMWall/Input__Parameter b/example/test_problem/Hydro/JetICMWall/Input__Parameter
index ae53449b82..8d6dc53353 100644
--- a/example/test_problem/Hydro/JetICMWall/Input__Parameter
+++ b/example/test_problem/Hydro/JetICMWall/Input__Parameter
@@ -157,6 +157,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/KelvinHelmholtzInstability/Input__Parameter b/example/test_problem/Hydro/KelvinHelmholtzInstability/Input__Parameter
index c4e8df6f48..052ec016f3 100644
--- a/example/test_problem/Hydro/KelvinHelmholtzInstability/Input__Parameter
+++ b/example/test_problem/Hydro/KelvinHelmholtzInstability/Input__Parameter
@@ -166,6 +166,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/MHD_ABC/Input__Parameter b/example/test_problem/Hydro/MHD_ABC/Input__Parameter
index 2ddb989967..d1792ca666 100644
--- a/example/test_problem/Hydro/MHD_ABC/Input__Parameter
+++ b/example/test_problem/Hydro/MHD_ABC/Input__Parameter
@@ -171,6 +171,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/MHD_LinearWave/Input__Parameter b/example/test_problem/Hydro/MHD_LinearWave/Input__Parameter
index ef9c31407b..413dfb192b 100644
--- a/example/test_problem/Hydro/MHD_LinearWave/Input__Parameter
+++ b/example/test_problem/Hydro/MHD_LinearWave/Input__Parameter
@@ -164,6 +164,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/MHD_OrszagTangVortex/Input__Parameter b/example/test_problem/Hydro/MHD_OrszagTangVortex/Input__Parameter
index 70c182cc16..139f739733 100644
--- a/example/test_problem/Hydro/MHD_OrszagTangVortex/Input__Parameter
+++ b/example/test_problem/Hydro/MHD_OrszagTangVortex/Input__Parameter
@@ -171,6 +171,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/ParticleEquilibriumIC/Input__Parameter b/example/test_problem/Hydro/ParticleEquilibriumIC/Input__Parameter
index 896b05a15a..e9034b022c 100644
--- a/example/test_problem/Hydro/ParticleEquilibriumIC/Input__Parameter
+++ b/example/test_problem/Hydro/ParticleEquilibriumIC/Input__Parameter
@@ -224,6 +224,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/ParticleTest/Input__Parameter b/example/test_problem/Hydro/ParticleTest/Input__Parameter
index 50f2d5332c..6a8f961061 100644
--- a/example/test_problem/Hydro/ParticleTest/Input__Parameter
+++ b/example/test_problem/Hydro/ParticleTest/Input__Parameter
@@ -208,6 +208,7 @@ OUTPUT_PART_X 0.5 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.5 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.5 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/Plummer/Input__Parameter b/example/test_problem/Hydro/Plummer/Input__Parameter
index d16913e281..9a7581d469 100644
--- a/example/test_problem/Hydro/Plummer/Input__Parameter
+++ b/example/test_problem/Hydro/Plummer/Input__Parameter
@@ -217,6 +217,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/Riemann/Input__Parameter b/example/test_problem/Hydro/Riemann/Input__Parameter
index 84fe92d1dd..84ac5f2728 100644
--- a/example/test_problem/Hydro/Riemann/Input__Parameter
+++ b/example/test_problem/Hydro/Riemann/Input__Parameter
@@ -162,6 +162,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/SphericalCollapse/Input__Parameter b/example/test_problem/Hydro/SphericalCollapse/Input__Parameter
index b801acfc6f..b6913cf182 100644
--- a/example/test_problem/Hydro/SphericalCollapse/Input__Parameter
+++ b/example/test_problem/Hydro/SphericalCollapse/Input__Parameter
@@ -188,6 +188,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Hydro/Zeldovich/Input__Parameter b/example/test_problem/Hydro/Zeldovich/Input__Parameter
index 56f7878525..ee3e3a5707 100644
--- a/example/test_problem/Hydro/Zeldovich/Input__Parameter
+++ b/example/test_problem/Hydro/Zeldovich/Input__Parameter
@@ -197,6 +197,7 @@ OUTPUT_PART_X 0.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y 0.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z 0.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# miscellaneous
diff --git a/example/test_problem/Template/Input__Parameter b/example/test_problem/Template/Input__Parameter
index 344f5a4f37..08430fbcfa 100644
--- a/example/test_problem/Template/Input__Parameter
+++ b/example/test_problem/Template/Input__Parameter
@@ -411,6 +411,7 @@ OUTPUT_PART_X -1.0 # x coordinate for OPT__OUTPUT_PART [-
OUTPUT_PART_Y -1.0 # y coordinate for OPT__OUTPUT_PART [-1.0]
OUTPUT_PART_Z -1.0 # z coordinate for OPT__OUTPUT_PART [-1.0]
INIT_DUMPID -1 # set the first dump ID (<0=auto) [-1]
+OUTPUT_DIR . # set the output directory [.]
# yt inline analysis (SUPPORT_LIBYT only)
diff --git a/include/Global.h b/include/Global.h
index 924857869f..30beccc53d 100644
--- a/include/Global.h
+++ b/include/Global.h
@@ -86,6 +86,7 @@ extern int OPT__UM_IC_FLOAT8;
extern double COM_CEN_X, COM_CEN_Y, COM_CEN_Z, COM_MAX_R, COM_MIN_RHO, COM_TOLERR_R;
extern int COM_MAX_ITER;
extern double ANGMOM_ORIGIN_X, ANGMOM_ORIGIN_Y, ANGMOM_ORIGIN_Z;
+extern char OUTPUT_DIR[MAX_STRING-100];
extern double FLAG_ANGULAR_CEN_X, FLAG_ANGULAR_CEN_Y, FLAG_ANGULAR_CEN_Z;
extern double FLAG_RADIAL_CEN_X, FLAG_RADIAL_CEN_Y, FLAG_RADIAL_CEN_Z;
diff --git a/include/Prototype.h b/include/Prototype.h
index ac91b4a03d..af1ba95c9b 100644
--- a/include/Prototype.h
+++ b/include/Prototype.h
@@ -22,6 +22,8 @@ void Aux_Check_Refinement( const int lv, const char *comment );
void Aux_Check_Restrict( const int lv, const char *comment );
void Aux_Error( const char *File, const int Line, const char *Func, const char *Format, ... );
bool Aux_CheckFileExist( const char *FileName );
+bool Aux_CheckFolderExist( const char *FolderName );
+bool Aux_CheckPermission( const char *FileName, const int perms );
void Aux_GetCPUInfo( const char *FileName );
void Aux_GetMemInfo();
void Aux_Message( FILE *Type, const char *Format, ... );
diff --git a/src/Auxiliary/Aux_CheckFileExist.cpp b/src/Auxiliary/Aux_CheckFileExist.cpp
index de3551b56d..7b2593f5e6 100644
--- a/src/Auxiliary/Aux_CheckFileExist.cpp
+++ b/src/Auxiliary/Aux_CheckFileExist.cpp
@@ -1,5 +1,7 @@
#include "GAMER.h"
#include
+#include
+#include
@@ -21,3 +23,67 @@ bool Aux_CheckFileExist( const char *FileName )
return ( stat(FileName,&Buf) == 0 );
} // FUNCTION : Aux_CheckFileExist
+
+
+
+//-------------------------------------------------------------------------------------------------------
+// Function : Aux_CheckFolderExist
+// Description : Check whether or not the target folder exists
+//
+// Note : Use the "stat" function to query the existence of the target folder
+//
+// Parameter : FolderName : Name of the target folder
+//
+// Return : true/false <-> folder exists/not exists
+//-------------------------------------------------------------------------------------------------------
+bool Aux_CheckFolderExist( const char *FolderName )
+{
+
+ struct stat Buf;
+
+ if ( stat(FolderName, &Buf) != 0 ) return false; // not exist
+ else if ( !(Buf.st_mode & S_IFDIR) ) return false; // not a directoy
+
+ return true;
+
+} // FUNCTION : Aux_CheckFolderExist
+
+
+
+//-------------------------------------------------------------------------------------------------------
+// Function : Aux_CheckPermission
+// Description : Check whether or not the target file has requested permissions
+//
+// Note : Use the "stat" function to query the permission of the target file
+//
+// Parameter : FileName : Name of the target file
+// : perms : Permissions code sum of the target file (4->read, 2->write, 1->execute)
+// --> Example: 1. read and write permissions => 6=4+2
+// 2. read and execute permissions => 5=4+1
+//
+// Return : true/false <-> you does/does not have the file permissions
+//-------------------------------------------------------------------------------------------------------
+bool Aux_CheckPermission( const char *FileName, const int perms )
+{
+
+ if ( perms < 0 || perms > 7 ) Aux_Error( ERROR_INFO, "Incorrect file permission code %d (0~7) !!\n", perms );
+
+ const uid_t curUserId = getuid(); // get user id
+ const gid_t curGroupId = getgid(); // get group id
+
+ struct stat Buf;
+
+ if ( stat(FileName, &Buf) != 0 ) Aux_Error( ERROR_INFO, "file \"%s\" does not exist !!\n", FileName );
+
+ int perm_r, perm_w, perm_x;
+ if ( Buf.st_uid == curUserId ) { perm_r = S_IRUSR; perm_w = S_IWUSR; perm_x = S_IXUSR; } // user
+ else if ( Buf.st_gid == curGroupId ) { perm_r = S_IRGRP; perm_w = S_IWGRP; perm_x = S_IXGRP; } // group
+ else { perm_r = S_IROTH; perm_w = S_IWOTH; perm_x = S_IXOTH; } // other
+
+ if ( (perms & 4) && !(Buf.st_mode & perm_r) ) return false;
+ if ( (perms & 2) && !(Buf.st_mode & perm_w) ) return false;
+ if ( (perms & 1) && !(Buf.st_mode & perm_x) ) return false;
+
+ return true;
+
+} // FUNCTION : Aux_CheckPermission
diff --git a/src/Auxiliary/Aux_Check_Conservation.cpp b/src/Auxiliary/Aux_Check_Conservation.cpp
index acd6a46e51..b70c5a6674 100644
--- a/src/Auxiliary/Aux_Check_Conservation.cpp
+++ b/src/Auxiliary/Aux_Check_Conservation.cpp
@@ -33,7 +33,8 @@ void Aux_Check_Conservation( const char *comment )
{
static bool FirstTime = true;
- const char *FileName = "Record__Conservation";
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Conservation", OUTPUT_DIR );
# if ( MODEL != HYDRO && MODEL != ELBDM && MODEL != PAR_ONLY )
diff --git a/src/Auxiliary/Aux_Check_Parameter.cpp b/src/Auxiliary/Aux_Check_Parameter.cpp
index 1c41984f59..08bd690a1b 100644
--- a/src/Auxiliary/Aux_Check_Parameter.cpp
+++ b/src/Auxiliary/Aux_Check_Parameter.cpp
@@ -332,6 +332,17 @@ void Aux_Check_Parameter()
# endif // #if ( MODEL == HYDRO )
+ if ( strlen(OUTPUT_DIR) > MAX_STRING-100-1 )
+ Aux_Error( ERROR_INFO, "Length of OUTPUT_DIR (%d) should be smaller than MAX_STRING-100-1 (%d) !!\n",
+ strlen(OUTPUT_DIR), MAX_STRING-100-1 );
+
+ if ( ! Aux_CheckFolderExist( OUTPUT_DIR ) )
+ Aux_Error( ERROR_INFO, "\"%s\" folder set by OUTPUT_DIR does not exist !!\n", OUTPUT_DIR );
+
+ if ( ! Aux_CheckPermission( OUTPUT_DIR, 2+1 ) )
+ Aux_Error( ERROR_INFO, "You do not have write and execute permissions for the \"%s\" folder set by OUTPUT_DIR !!\n", OUTPUT_DIR );
+
+
// general warnings
// =======================================================================================
diff --git a/src/Auxiliary/Aux_GetMemInfo.cpp b/src/Auxiliary/Aux_GetMemInfo.cpp
index 1eec0d7438..d2a40b060e 100644
--- a/src/Auxiliary/Aux_GetMemInfo.cpp
+++ b/src/Auxiliary/Aux_GetMemInfo.cpp
@@ -17,17 +17,18 @@
void Aux_GetMemInfo()
{
- const char FileName_Record[] = "Record__MemInfo";
const int PID = getpid();
const int NInfo = 4; // number of memory information to be recorded (VmSize/Peak, VmRSS/HWM)
static bool FirstTime=true;
- char FileName_Status[MAX_STRING], Useless[NInfo][MAX_STRING], *line=NULL;
+ char FileName_Record[MAX_STRING], FileName_Status[MAX_STRING], Useless[NInfo][MAX_STRING], *line=NULL;
char VmSize[MAX_STRING], VmPeak[MAX_STRING], VmRSS[MAX_STRING], VmHWM[MAX_STRING];
bool GetVmSize=false, GetVmPeak=false, GetVmRSS=false, GetVmHWM=false;
double Vm_double[NInfo], Vm_max[NInfo], Vm_sum[NInfo];
size_t len=0;
+ sprintf( FileName_Record, "%s/Record__MemInfo", OUTPUT_DIR );
+
// 1. read memory information from the file "FileName_Status"
sprintf( FileName_Status, "/proc/%d/status", PID );
diff --git a/src/Auxiliary/Aux_Record_Center.cpp b/src/Auxiliary/Aux_Record_Center.cpp
index bac5a0e25f..b19761ced1 100644
--- a/src/Auxiliary/Aux_Record_Center.cpp
+++ b/src/Auxiliary/Aux_Record_Center.cpp
@@ -20,8 +20,10 @@
void Aux_Record_Center()
{
- const char FileName[] = "Record__Center";
static bool FirstTime = true;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Center", OUTPUT_DIR );
+
// 1. Maximum fluid density in HYDRO/ELBDM
Extrema_t Max_Dens;
diff --git a/src/Auxiliary/Aux_Record_CorrUnphy.cpp b/src/Auxiliary/Aux_Record_CorrUnphy.cpp
index ffbe4a8aa4..c5ad7f844f 100644
--- a/src/Auxiliary/Aux_Record_CorrUnphy.cpp
+++ b/src/Auxiliary/Aux_Record_CorrUnphy.cpp
@@ -15,8 +15,9 @@
void Aux_Record_CorrUnphy()
{
- const char FileName[] = "Record__NCorrUnphy";
static bool FirstTime = true;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__NCorrUnphy", OUTPUT_DIR );
long NCorrAllRank[NLEVEL];
FILE *File = NULL;
diff --git a/src/Auxiliary/Aux_Record_PatchCount.cpp b/src/Auxiliary/Aux_Record_PatchCount.cpp
index 17b51a163c..102297ced2 100644
--- a/src/Auxiliary/Aux_Record_PatchCount.cpp
+++ b/src/Auxiliary/Aux_Record_PatchCount.cpp
@@ -12,7 +12,9 @@
void Aux_Record_PatchCount()
{
- const char FileName[] = "Record__PatchCount";
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__PatchCount", OUTPUT_DIR );
+
static bool FirstTime = true;
if ( MPI_Rank == 0 && FirstTime )
diff --git a/src/Auxiliary/Aux_Record_Performance.cpp b/src/Auxiliary/Aux_Record_Performance.cpp
index 5dc39964fd..58f202a033 100644
--- a/src/Auxiliary/Aux_Record_Performance.cpp
+++ b/src/Auxiliary/Aux_Record_Performance.cpp
@@ -20,8 +20,9 @@
void Aux_Record_Performance( const double ElapsedTime )
{
- const char FileName[] = "Record__Performance";
static bool FirstTime = true;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Performance", OUTPUT_DIR );
// get the total number of active particles in each rank
diff --git a/src/Auxiliary/Aux_Record_User.cpp b/src/Auxiliary/Aux_Record_User.cpp
index 7ef904a442..3ecc2b9482 100644
--- a/src/Auxiliary/Aux_Record_User.cpp
+++ b/src/Auxiliary/Aux_Record_User.cpp
@@ -23,8 +23,9 @@ void (*Aux_Record_User_Ptr)() = NULL;
void Aux_Record_User_Template()
{
- const char FileName[] = "Record__User";
static bool FirstTime = true;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__User", OUTPUT_DIR );
if ( FirstTime )
{
diff --git a/src/Auxiliary/Aux_TakeNote.cpp b/src/Auxiliary/Aux_TakeNote.cpp
index b21bdd335b..692a0f6028 100644
--- a/src/Auxiliary/Aux_TakeNote.cpp
+++ b/src/Auxiliary/Aux_TakeNote.cpp
@@ -25,8 +25,10 @@ void Aux_TakeNote()
if ( MPI_Rank == 0 ) Aux_Message( stdout, "Aux_TakeNote ...\n" );
- const char FileName[] = "Record__Note";
FILE *Note;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Note", OUTPUT_DIR );
+
if ( MPI_Rank == 0 )
{
@@ -39,7 +41,9 @@ void Aux_TakeNote()
fprintf( Note, "***********************************************************************************\n" );
fclose( Note );
- system( "cat ./Input__Note >> Record__Note" );
+ char Command[MAX_STRING];
+ sprintf( Command, "cat ./Input__Note >> %s/Record__Note", OUTPUT_DIR );
+ system( Command );
Note = fopen( FileName, "a" );
fprintf( Note, "***********************************************************************************\n" );
@@ -1641,6 +1645,7 @@ void Aux_TakeNote()
fprintf( Note, "OUTPUT_PART_Y % 21.14e\n", OUTPUT_PART_Y );
fprintf( Note, "OUTPUT_PART_Z % 21.14e\n", OUTPUT_PART_Z );
fprintf( Note, "INIT_DUMPID % d\n", INIT_DUMPID );
+ fprintf( Note, "OUTPUT_DIR %s\n", OUTPUT_DIR );
fprintf( Note, "***********************************************************************************\n" );
fprintf( Note, "\n\n" );
diff --git a/src/Auxiliary/Aux_Timing.cpp b/src/Auxiliary/Aux_Timing.cpp
index 18eb4574df..a348aa170d 100644
--- a/src/Auxiliary/Aux_Timing.cpp
+++ b/src/Auxiliary/Aux_Timing.cpp
@@ -226,9 +226,9 @@ void Aux_ResetTimer()
void Aux_Record_Timing()
{
- const char FileName[] = "Record__Timing";
-
FILE *File = NULL;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Timing", OUTPUT_DIR );
const char Comment_LB[][4] = { "Max", "Min", "Ave" };
const int NLB = 8;
@@ -986,9 +986,10 @@ void Timing__Solver( const char FileName[] )
void Aux_AccumulatedTiming( const double TotalT, double InitT, double OtherT )
{
- const char FileName[] = "Record__Timing";
const char Comment_LB[][4] = { "Max", "Min", "Ave" };
const int NNewTimer = 2;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Timing", OUTPUT_DIR );
double dt_P, Flu_P, Gra_P, Src_P, Che_P, SF_P, FB_P, FixUp_P, Flag_P, Refine_P, Sum_P, MPI_Grid_P;
double Aux_P, Corr_P, Output_P, LB_P, Par_P, MPI_Par_P, libyt_P, Init_P, Other_P;
diff --git a/src/Fluid/Flu_Close.cpp b/src/Fluid/Flu_Close.cpp
index 89a375d852..6ef546cf21 100644
--- a/src/Fluid/Flu_Close.cpp
+++ b/src/Fluid/Flu_Close.cpp
@@ -971,8 +971,8 @@ void CorrectUnphysical( const int lv, const int NPG, const int *PID0_List,
const bool CheckMinPres_No = false;
real In[NCOMP_TOTAL], tmp[NCOMP_TOTAL];
- char FileName[100];
- sprintf( FileName, "FailedPatchGroup_r%03d_lv%02d_PID0-%05d", MPI_Rank, lv, PID0_List[TID] );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/FailedPatchGroup_r%03d_lv%02d_PID0-%05d", OUTPUT_DIR, MPI_Rank, lv, PID0_List[TID] );
// use "a" instead of "w" since there may be more than one failed cell in a given patch group
FILE *File = fopen( FileName, "a" );
diff --git a/src/GPU_API/CUAPI_DiagnoseDevice.cu b/src/GPU_API/CUAPI_DiagnoseDevice.cu
index 607b3353bf..a3d4a6c278 100644
--- a/src/GPU_API/CUAPI_DiagnoseDevice.cu
+++ b/src/GPU_API/CUAPI_DiagnoseDevice.cu
@@ -59,7 +59,8 @@ void CUAPI_DiagnoseDevice()
// record the device properties
- const char FileName[] = "Record__Note";
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Note", OUTPUT_DIR );
if ( MPI_Rank == 0 )
{
diff --git a/src/Init/Init_Load_Parameter.cpp b/src/Init/Init_Load_Parameter.cpp
index d969b8e05b..9f5aa81aea 100644
--- a/src/Init/Init_Load_Parameter.cpp
+++ b/src/Init/Init_Load_Parameter.cpp
@@ -553,6 +553,7 @@ void Init_Load_Parameter()
ReadPara->Add( "OUTPUT_PART_Y", &OUTPUT_PART_Y, -1.0, NoMin_double, NoMax_double );
ReadPara->Add( "OUTPUT_PART_Z", &OUTPUT_PART_Z, -1.0, NoMin_double, NoMax_double );
ReadPara->Add( "INIT_DUMPID", &INIT_DUMPID, -1, NoMin_int, NoMax_int );
+ ReadPara->Add( "OUTPUT_DIR", OUTPUT_DIR, ".", Useless_str, Useless_str );
// yt inline analysis
diff --git a/src/LoadBalance/LB_EstimateLoadImbalance.cpp b/src/LoadBalance/LB_EstimateLoadImbalance.cpp
index cc93dc8d4c..3325a3fed4 100644
--- a/src/LoadBalance/LB_EstimateLoadImbalance.cpp
+++ b/src/LoadBalance/LB_EstimateLoadImbalance.cpp
@@ -98,8 +98,9 @@ double LB_EstimateLoadImbalance()
// 4. write to the file "Record__LoadBalance"
if ( OPT__RECORD_LOAD_BALANCE )
{
- const char FileName[] = "Record__LoadBalance";
static bool FirstTime = true;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__LoadBalance", OUTPUT_DIR );
if ( FirstTime )
{
diff --git a/src/LoadBalance/LB_GetBufferData.cpp b/src/LoadBalance/LB_GetBufferData.cpp
index a766d7620a..2d8b070ad6 100644
--- a/src/LoadBalance/LB_GetBufferData.cpp
+++ b/src/LoadBalance/LB_GetBufferData.cpp
@@ -1639,8 +1639,8 @@ void LB_GetBufferData( const int lv, const int FluSg, const int MagSg, const int
# ifdef TIMING
if ( OPT__TIMING_MPI )
{
- char FileName[100];
- sprintf( FileName, "Record__TimingMPI_Rank%05d", MPI_Rank );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__TimingMPI_Rank%05d", OUTPUT_DIR, MPI_Rank );
char ModeName[100];
switch ( GetBufMode )
diff --git a/src/Main/Main.cpp b/src/Main/Main.cpp
index ec9e51f1b6..8cdbe9629f 100644
--- a/src/Main/Main.cpp
+++ b/src/Main/Main.cpp
@@ -78,6 +78,7 @@ int OPT__UM_IC_FLOAT8;
double COM_CEN_X, COM_CEN_Y, COM_CEN_Z, COM_MAX_R, COM_MIN_RHO, COM_TOLERR_R;
int COM_MAX_ITER;
double ANGMOM_ORIGIN_X, ANGMOM_ORIGIN_Y, ANGMOM_ORIGIN_Z;
+char OUTPUT_DIR[MAX_STRING-100];
double FLAG_ANGULAR_CEN_X, FLAG_ANGULAR_CEN_Y, FLAG_ANGULAR_CEN_Z;
double FLAG_RADIAL_CEN_X, FLAG_RADIAL_CEN_Y, FLAG_RADIAL_CEN_Z;
@@ -855,7 +856,10 @@ int main( int argc, char *argv[] )
if ( MPI_Rank == 0 && OPT__RECORD_NOTE )
{
- FILE *Note = fopen( "Record__Note", "a" );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Note", OUTPUT_DIR );
+
+ FILE *Note = fopen( FileName, "a" );
fprintf( Note, "\n" );
fprintf( Note, "Total Processing Time : %lf s\n", Timer_Total.GetValue() );
fprintf( Note, "\n" );
diff --git a/src/Miscellaneous/Mis_GetTimeStep.cpp b/src/Miscellaneous/Mis_GetTimeStep.cpp
index 0ba4340add..06ae395c61 100644
--- a/src/Miscellaneous/Mis_GetTimeStep.cpp
+++ b/src/Miscellaneous/Mis_GetTimeStep.cpp
@@ -28,9 +28,10 @@
double Mis_GetTimeStep( const int lv, const double dTime_SyncFaLv, const double AutoReduceDtCoeff )
{
- const char FileName[] = "Record__TimeStep";
static bool FirstTime = true;
const int NdTimeMax = 20;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__TimeStep", OUTPUT_DIR );
char (*dTime_Name)[MAX_STRING] = new char [NdTimeMax][MAX_STRING];
double *dTime = new double [NdTimeMax];
diff --git a/src/Model_ELBDM/ELBDM_Aux_Record_Hybrid.cpp b/src/Model_ELBDM/ELBDM_Aux_Record_Hybrid.cpp
index 8441fd0784..b5e03e2ee5 100644
--- a/src/Model_ELBDM/ELBDM_Aux_Record_Hybrid.cpp
+++ b/src/Model_ELBDM/ELBDM_Aux_Record_Hybrid.cpp
@@ -19,7 +19,8 @@ void ELBDM_Aux_Record_Hybrid()
static bool FirstTime = true;
- const char *FileName = "Record__Hybrid";
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Hybrid", OUTPUT_DIR );
FILE *File = NULL;
if ( FirstTime )
diff --git a/src/Model_Hydro/MHD_Aux_Check_DivergenceB.cpp b/src/Model_Hydro/MHD_Aux_Check_DivergenceB.cpp
index 69cf5d8e3f..b789b151a3 100644
--- a/src/Model_Hydro/MHD_Aux_Check_DivergenceB.cpp
+++ b/src/Model_Hydro/MHD_Aux_Check_DivergenceB.cpp
@@ -129,7 +129,8 @@ void MHD_Aux_Check_DivergenceB( const bool Verbose, const char *comment )
if ( MPI_Rank == 0 )
{
static bool FirstTime = true;
- const char *FileName = "Record__DivB";
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__DivB", OUTPUT_DIR );
// output header
if ( FirstTime )
diff --git a/src/Output/Output_BoundaryFlagList.cpp b/src/Output/Output_BoundaryFlagList.cpp
index 7c665b98c0..ab3d26fe59 100644
--- a/src/Output/Output_BoundaryFlagList.cpp
+++ b/src/Output/Output_BoundaryFlagList.cpp
@@ -20,9 +20,9 @@ void Output_BoundaryFlagList( const int option, const int lv, const char *commen
Aux_Error( ERROR_INFO, "incorrect parameter %s = %d !!\n", "option", option );
- char FileName[100];
- if ( option ) sprintf( FileName, "BoundaryFlagList_%d_%d", MPI_Rank, lv );
- else sprintf( FileName, "BufferFlagList_%d_%d", MPI_Rank, lv );
+ char FileName[MAX_STRING];
+ if ( option ) sprintf( FileName, "%s/BoundaryFlagList_%d_%d", OUTPUT_DIR, MPI_Rank, lv );
+ else sprintf( FileName, "%s/BufferFlagList_%d_%d", OUTPUT_DIR, MPI_Rank, lv );
if ( comment != NULL )
{
diff --git a/src/Output/Output_DumpData.cpp b/src/Output/Output_DumpData.cpp
index 9e6961956b..055a8a5c61 100644
--- a/src/Output/Output_DumpData.cpp
+++ b/src/Output/Output_DumpData.cpp
@@ -103,15 +103,19 @@ void Output_DumpData( const int Stage )
// set the file names for all output functions
- char FileName_Total[50], FileName_Part[50], FileName_Temp[50], FileName_PS[50];
+ char FileName_Total[MAX_STRING], FileName_Part[MAX_STRING], FileName_Temp[MAX_STRING], FileName_PS[MAX_STRING];
# ifdef PARTICLE
- char FileName_Particle[50];
+ char FileName_Particle[MAX_STRING];
# endif
- if ( OPT__OUTPUT_TOTAL ) sprintf( FileName_Total, "Data_%06d", DumpID );
+ if ( OPT__OUTPUT_TOTAL )
+ {
+ sprintf( FileName_Total, "%s/Data_%06d", OUTPUT_DIR, DumpID );
+ }
if ( OPT__OUTPUT_PART )
{
+ sprintf( FileName_Part, "%s/", OUTPUT_DIR );
switch ( OPT__OUTPUT_PART )
{
case OUTPUT_XY : sprintf( FileName_Temp, "XYslice_z%.3f_%06d", OUTPUT_PART_Z, DumpID ); break;
@@ -126,22 +130,22 @@ void Output_DumpData( const int Stage )
if ( OPT__OUTPUT_BASE )
{
- sprintf( FileName_Part, "%s", "Base" );
+ strcat( FileName_Part, "Base" );
strcat( FileName_Part, FileName_Temp );
}
else
- strcpy( FileName_Part, FileName_Temp );
+ strcat( FileName_Part, FileName_Temp );
} // if ( OPT__OUTPUT_PART )
if ( OPT__OUTPUT_BASEPS )
- sprintf( FileName_PS, "PowerSpec_%06d", DumpID );
+ sprintf( FileName_PS, "%s/PowerSpec_%06d", OUTPUT_DIR, DumpID );
# ifdef PARTICLE
if ( OPT__OUTPUT_PAR_MODE == OUTPUT_PAR_TEXT )
- sprintf( FileName_Particle, "Particle_%06d.txt", DumpID );
+ sprintf( FileName_Particle, "%s/Particle_%06d.txt", OUTPUT_DIR, DumpID );
if ( OPT__OUTPUT_PAR_MODE == OUTPUT_PAR_CBIN )
- sprintf( FileName_Particle, "Particle_%06d.cbin", DumpID );
+ sprintf( FileName_Particle, "%s/Particle_%06d.cbin", OUTPUT_DIR, DumpID );
# endif
@@ -313,7 +317,8 @@ void Output_DumpData( const int Stage )
void Write_DumpRecord()
{
- const char FileName[] = "Record__Dump";
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__Dump", OUTPUT_DIR );
// create the "Record__Dump" file at the first dump
diff --git a/src/Output/Output_ExchangeDataPatchList.cpp b/src/Output/Output_ExchangeDataPatchList.cpp
index c2757796f7..2be286fe7e 100644
--- a/src/Output/Output_ExchangeDataPatchList.cpp
+++ b/src/Output/Output_ExchangeDataPatchList.cpp
@@ -20,9 +20,9 @@ void Output_ExchangeDataPatchList( const int option, const int lv, const char *c
Aux_Error( ERROR_INFO, "incorrect parameter %s = %d !!\n", "option", option );
- char FileName[100];
- if ( option ) sprintf( FileName, "SendDataPatchList_%d_%d", MPI_Rank, lv );
- else sprintf( FileName, "RecvDataPatchList_%d_%d", MPI_Rank, lv );
+ char FileName[MAX_STRING];
+ if ( option ) sprintf( FileName, "%s/SendDataPatchList_%d_%d", OUTPUT_DIR, MPI_Rank, lv );
+ else sprintf( FileName, "%s/RecvDataPatchList_%d_%d", OUTPUT_DIR, MPI_Rank, lv );
if ( comment != NULL )
{
diff --git a/src/Output/Output_ExchangeFluxPatchList.cpp b/src/Output/Output_ExchangeFluxPatchList.cpp
index d92b5e8d1a..c88c90c8ec 100644
--- a/src/Output/Output_ExchangeFluxPatchList.cpp
+++ b/src/Output/Output_ExchangeFluxPatchList.cpp
@@ -22,12 +22,12 @@ void Output_ExchangeFluxPatchList( const int option, const int lv, const char *c
Aux_Error( ERROR_INFO, "incorrect parameter %s = %d !!\n", "lv", lv );
- char FileName[100];
+ char FileName[MAX_STRING];
switch ( option )
{
- case 0: sprintf( FileName, "SendFluxPatchList_%d_%d", MPI_Rank, lv );
+ case 0: sprintf( FileName, "%s/SendFluxPatchList_%d_%d", OUTPUT_DIR, MPI_Rank, lv );
break;
- case 1: sprintf( FileName, "RecvFluxPatchList_%d_%d", MPI_Rank, lv );
+ case 1: sprintf( FileName, "%s/RecvFluxPatchList_%d_%d", OUTPUT_DIR, MPI_Rank, lv );
break;
}
diff --git a/src/Output/Output_ExchangePatchMap.cpp b/src/Output/Output_ExchangePatchMap.cpp
index 3921cebb6e..5e06f8e5d1 100644
--- a/src/Output/Output_ExchangePatchMap.cpp
+++ b/src/Output/Output_ExchangePatchMap.cpp
@@ -58,8 +58,8 @@ void Output_ExchangePatchMap( const int lv, const int xyz, const char *comment )
}
- char FileName[100];
- sprintf( FileName, "ExchangePatchMap_%d_%d_%2s", MPI_Rank, lv, Dim[1] );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/ExchangePatchMap_%d_%d_%2s", OUTPUT_DIR, MPI_Rank, lv, Dim[1] );
if ( comment != NULL )
{
strcat( FileName, "_" );
diff --git a/src/Output/Output_FlagMap.cpp b/src/Output/Output_FlagMap.cpp
index 05ce0b1750..837db08b51 100644
--- a/src/Output/Output_FlagMap.cpp
+++ b/src/Output/Output_FlagMap.cpp
@@ -54,8 +54,8 @@ void Output_FlagMap( const int lv, const int xyz, const char *comment )
}
- char FileName[100];
- sprintf( FileName, "FlagMap_%d_%d_%2s", MPI_Rank, lv, Dim[1] );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/FlagMap_%d_%d_%2s", OUTPUT_DIR, MPI_Rank, lv, Dim[1] );
if ( comment != NULL )
{
strcat( FileName, "_" );
diff --git a/src/Output/Output_Flux.cpp b/src/Output/Output_Flux.cpp
index 8c1abfff6d..45ae17e31e 100644
--- a/src/Output/Output_Flux.cpp
+++ b/src/Output/Output_Flux.cpp
@@ -34,8 +34,8 @@ void Output_Flux( const int lv, const int PID, const int Sib, const char *commen
patch_t *Relation = amr->patch[0][lv][PID];
- char FileName[100];
- sprintf( FileName, "Flux_r%d_lv%d_p%d%c%c", MPI_Rank, lv, PID, 45-2*(Sib%2), 120+Sib/2 );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Flux_r%d_lv%d_p%d%c%c", OUTPUT_DIR, MPI_Rank, lv, PID, 45-2*(Sib%2), 120+Sib/2 );
if ( comment != NULL )
{
strcat( FileName, "_" );
diff --git a/src/Output/Output_L1Error.cpp b/src/Output/Output_L1Error.cpp
index 220cee5634..910bb377d1 100644
--- a/src/Output/Output_L1Error.cpp
+++ b/src/Output/Output_L1Error.cpp
@@ -74,38 +74,38 @@ void Output_L1Error( void (*AnalFunc_Flu)( real fluid[], const double x, const d
char FileName[NERR][MAX_STRING];
# if ( MODEL == HYDRO )
- sprintf( FileName[ 0], "%s_Dens_%06d", Prefix, DumpID );
- sprintf( FileName[ 1], "%s_MomX_%06d", Prefix, DumpID );
- sprintf( FileName[ 2], "%s_MomY_%06d", Prefix, DumpID );
- sprintf( FileName[ 3], "%s_MomZ_%06d", Prefix, DumpID );
- sprintf( FileName[ 4], "%s_Pres_%06d", Prefix, DumpID );
+ sprintf( FileName[ 0], "%s/%s_Dens_%06d", OUTPUT_DIR, Prefix, DumpID );
+ sprintf( FileName[ 1], "%s/%s_MomX_%06d", OUTPUT_DIR, Prefix, DumpID );
+ sprintf( FileName[ 2], "%s/%s_MomY_%06d", OUTPUT_DIR, Prefix, DumpID );
+ sprintf( FileName[ 3], "%s/%s_MomZ_%06d", OUTPUT_DIR, Prefix, DumpID );
+ sprintf( FileName[ 4], "%s/%s_Pres_%06d", OUTPUT_DIR, Prefix, DumpID );
for (int v=0; vpatch[PotSg][lv][PID]->pot;
# endif
- char FileName[100];
- sprintf( FileName, "Patch_r%d_lv%d_p%d", MPI_Rank, lv, PID );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Patch_r%d_lv%d_p%d", OUTPUT_DIR, MPI_Rank, lv, PID );
if ( comment != NULL )
{
strcat( FileName, "_" );
diff --git a/src/Output/Output_PatchCorner.cpp b/src/Output/Output_PatchCorner.cpp
index a3e5d9af71..f3f6b4d452 100644
--- a/src/Output/Output_PatchCorner.cpp
+++ b/src/Output/Output_PatchCorner.cpp
@@ -18,8 +18,8 @@
void Output_PatchCorner( const int lv, const char *comment )
{
- char FileName[100];
- sprintf( FileName, "PatchCorner_%05d_%02d", MPI_Rank, lv );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/PatchCorner_%05d_%02d", OUTPUT_DIR, MPI_Rank, lv );
if ( comment != NULL )
{
strcat( FileName, "_" );
diff --git a/src/Output/Output_PatchMap.cpp b/src/Output/Output_PatchMap.cpp
index 02cb404320..5c04d91175 100644
--- a/src/Output/Output_PatchMap.cpp
+++ b/src/Output/Output_PatchMap.cpp
@@ -49,8 +49,8 @@ void Output_PatchMap( const int lv, const int PID, const int TSg, const int Comp
patch_t *Relation = amr->patch[ 0][lv][PID];
patch_t *Data = amr->patch[TSg][lv][PID];
- char FileName[100];
- sprintf( FileName, "PatchMap_r%d_lv%d_p%d_v%d", MPI_Rank, lv, PID, Comp );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/PatchMap_r%d_lv%d_p%d_v%d", OUTPUT_DIR, MPI_Rank, lv, PID, Comp );
if ( comment != NULL )
{
strcat( FileName, "_" );
diff --git a/src/Output/Output_PreparedPatch_Fluid.cpp b/src/Output/Output_PreparedPatch_Fluid.cpp
index d013ec11e2..32c32ddef7 100644
--- a/src/Output/Output_PreparedPatch_Fluid.cpp
+++ b/src/Output/Output_PreparedPatch_Fluid.cpp
@@ -50,8 +50,8 @@ void Output_PreparedPatch_Fluid( const int TLv, const int TPID,
// begin to output the prepared data
patch_t *Relation = amr->patch[0][TLv][TPID];
- char FileName[100];
- sprintf( FileName, "PrePatch_Fluid_r%d_lv%d_p%d", MPI_Rank, TLv, TPID );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/PrePatch_Fluid_r%d_lv%d_p%d", OUTPUT_DIR, MPI_Rank, TLv, TPID );
if ( comment != NULL )
{
strcat( FileName, "_" );
diff --git a/src/Particle/LoadBalance/Par_LB_SendParticleData.cpp b/src/Particle/LoadBalance/Par_LB_SendParticleData.cpp
index 20dce8d095..39dc256946 100644
--- a/src/Particle/LoadBalance/Par_LB_SendParticleData.cpp
+++ b/src/Particle/LoadBalance/Par_LB_SendParticleData.cpp
@@ -253,8 +253,8 @@ void Par_LB_SendParticleData( const int NParAttFlt, const int NParAttInt, int *S
dtime = Timer->GetValue() - time0;
// output to the same log file as LB_GetBufferData
- char FileName[100];
- sprintf( FileName, "Record__TimingMPI_Rank%05d", MPI_Rank );
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__TimingMPI_Rank%05d", OUTPUT_DIR, MPI_Rank );
FILE *File = fopen( FileName, "a" );
diff --git a/src/Particle/Par_Aux_Record_ParticleCount.cpp b/src/Particle/Par_Aux_Record_ParticleCount.cpp
index a92ba99205..3e8327ad48 100644
--- a/src/Particle/Par_Aux_Record_ParticleCount.cpp
+++ b/src/Particle/Par_Aux_Record_ParticleCount.cpp
@@ -15,8 +15,9 @@
void Par_Aux_Record_ParticleCount()
{
- const char FileName[] = "Record__ParticleCount";
static bool FirstTime = true;
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__ParticleCount", OUTPUT_DIR );
if ( MPI_Rank == 0 && FirstTime )
{
diff --git a/src/TestProblem/Hydro/Bondi/Record_Bondi.cpp b/src/TestProblem/Hydro/Bondi/Record_Bondi.cpp
index 8dd04bc738..e6173e2818 100644
--- a/src/TestProblem/Hydro/Bondi/Record_Bondi.cpp
+++ b/src/TestProblem/Hydro/Bondi/Record_Bondi.cpp
@@ -36,7 +36,8 @@ extern int Bondi_SinkNCell;
void Record_Bondi()
{
- const char FileName[] = "Record__BondiAccretionRate";
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__BondiAccretionRate", OUTPUT_DIR );
static bool FirstTime = true;
static double Time0, dTime;
diff --git a/src/TestProblem/Hydro/Gravity/Init_TestProb_Hydro_Gravity.cpp b/src/TestProblem/Hydro/Gravity/Init_TestProb_Hydro_Gravity.cpp
index 099df0d2c3..9113c521fa 100644
--- a/src/TestProblem/Hydro/Gravity/Init_TestProb_Hydro_Gravity.cpp
+++ b/src/TestProblem/Hydro/Gravity/Init_TestProb_Hydro_Gravity.cpp
@@ -370,7 +370,8 @@ void Aux_Record_Gravity()
if ( MPI_Rank == 0 )
{
// header
- const char FileName[] = "Record__PoissonPerformance";
+ char FileName[MAX_STRING];
+ sprintf( FileName, "%s/Record__PoissonPerformance", OUTPUT_DIR );
if ( !Aux_CheckFileExist(FileName) )
{