From 71b0a5f23ac35a86cfdfbf9df5022e258684117a Mon Sep 17 00:00:00 2001 From: "Aaron M. Lattanzi" <103702284+AMLattanzi@users.noreply.github.com> Date: Thu, 2 May 2024 14:50:46 -0700 Subject: [PATCH] Modify to use zlev for data logging. (#1600) --- Source/IO/ERF_Write1DProfiles.cpp | 21 ++++++++++++++++++--- Source/IO/ERF_Write1DProfiles_stag.cpp | 21 ++++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Source/IO/ERF_Write1DProfiles.cpp b/Source/IO/ERF_Write1DProfiles.cpp index 488853e84..f4b65d633 100644 --- a/Source/IO/ERF_Write1DProfiles.cpp +++ b/Source/IO/ERF_Write1DProfiles.cpp @@ -62,7 +62,12 @@ ERF::write_1D_profiles (Real time) if (data_log1.good()) { // Write the quantities at this time for (int k = 0; k < hu_size; k++) { - Real z = (k + 0.5)* dx[2]; + Real z; + if (zlevels_stag.size() > 1) { + z = 0.5 * (zlevels_stag[k] + zlevels_stag[k+1]); + } else { + z = (k + 0.5)* dx[2]; + } data_log1 << std::setw(datwidth) << std::setprecision(timeprecision) << time << " " << std::setw(datwidth) << std::setprecision(datprecision) << z << " " << h_avg_u[k] << " " << h_avg_v[k] << " " << h_avg_w[k] << " " @@ -78,7 +83,12 @@ ERF::write_1D_profiles (Real time) if (data_log2.good()) { // Write the perturbational quantities at this time for (int k = 0; k < hu_size; k++) { - Real z = (k + 0.5)* dx[2]; + Real z; + if (zlevels_stag.size() > 1) { + z = 0.5 * (zlevels_stag[k] + zlevels_stag[k+1]); + } else { + z = (k + 0.5)* dx[2]; + } data_log2 << std::setw(datwidth) << std::setprecision(timeprecision) << time << " " << std::setw(datwidth) << std::setprecision(datprecision) << z << " " << h_avg_uu[k] - h_avg_u[k]*h_avg_u[k] << " " @@ -126,7 +136,12 @@ ERF::write_1D_profiles (Real time) if (data_log3.good()) { // Write the average stresses for (int k = 0; k < hu_size; k++) { - Real z = (k + 0.5)* dx[2]; + Real z; + if (zlevels_stag.size() > 1) { + z = 0.5 * (zlevels_stag[k] + zlevels_stag[k+1]); + } else { + z = (k + 0.5)* dx[2]; + } data_log3 << std::setw(datwidth) << std::setprecision(timeprecision) << time << " " << std::setw(datwidth) << std::setprecision(datprecision) << z << " " << h_avg_tau11[k] << " " << h_avg_tau12[k] << " " << h_avg_tau13[k] << " " diff --git a/Source/IO/ERF_Write1DProfiles_stag.cpp b/Source/IO/ERF_Write1DProfiles_stag.cpp index b25f2e7ee..f6547619b 100644 --- a/Source/IO/ERF_Write1DProfiles_stag.cpp +++ b/Source/IO/ERF_Write1DProfiles_stag.cpp @@ -66,7 +66,12 @@ ERF::write_1D_profiles_stag (Real time) if (data_log1.good()) { // Write the quantities at this time for (int k = 0; k < unstag_size; k++) { - Real z = k * dx[2]; + Real z; + if (zlevels_stag.size() > 1) { + z = zlevels_stag[k]; + } else { + z = k * dx[2]; + } data_log1 << std::setw(datwidth) << std::setprecision(timeprecision) << time << " " << std::setw(datwidth) << std::setprecision(datprecision) << z << " " << h_avg_u[k] << " " << h_avg_v[k] << " " << h_avg_w[k] << " " @@ -121,7 +126,12 @@ ERF::write_1D_profiles_stag (Real time) // For internal values, interpolate scalar quantities to faces for (int k = 1; k < unstag_size; k++) { - Real z = k * dx[2]; + Real z; + if (zlevels_stag.size() > 1) { + z = zlevels_stag[k]; + } else { + z = k * dx[2]; + } Real uface = 0.5*(h_avg_u[k] + h_avg_u[k-1]); Real vface = 0.5*(h_avg_v[k] + h_avg_v[k-1]); Real thface = 0.5*(h_avg_th[k] + h_avg_th[k-1]); @@ -212,7 +222,12 @@ ERF::write_1D_profiles_stag (Real time) if (data_log3.good()) { // Write the average stresses for (int k = 0; k < unstag_size; k++) { - Real z = k * dx[2]; + Real z; + if (zlevels_stag.size() > 1) { + z = zlevels_stag[k]; + } else { + z = k * dx[2]; + } data_log3 << std::setw(datwidth) << std::setprecision(timeprecision) << time << " " << std::setw(datwidth) << std::setprecision(datprecision) << z << " " << h_avg_tau11[k] << " " << h_avg_tau12[k] << " " << h_avg_tau13[k] << " "