From 07a0b00c9d699ed37b913bfa7c6e6a4ce424309e Mon Sep 17 00:00:00 2001 From: lrobion Date: Fri, 27 Mar 2026 17:07:36 -0400 Subject: [PATCH 1/3] Remove deprecated inputs from default yaml --- Code.v05-00/defaults/input.yaml | 30 -------------------------- Code.v05-00/include/Defaults/Input.hpp | 30 -------------------------- 2 files changed, 60 deletions(-) diff --git a/Code.v05-00/defaults/input.yaml b/Code.v05-00/defaults/input.yaml index da32a821..8ed1e89a 100644 --- a/Code.v05-00/defaults/input.yaml +++ b/Code.v05-00/defaults/input.yaml @@ -51,16 +51,11 @@ PARAMETER MENU: # Temperature, RH, and wind shear can be overwritten if using meteorological input files METEOROLOGICAL PARAMETERS SUBMENU: - # Can be overwritten if met file is passed - Temperature [K] (double): 217 - # Can be overwritten if met file is passed - R.Hum. wrt water [%] (double): 63.94 # Pressure altitude at which the contrail is initialized Pressure [hPa] (double): 265 Horiz. diff. coeff. [m^2/s] (double): 15.0 # Can be overwritten if met file is passed Verti. diff. [m^2/s] (double): 0.15 - Wind shear [1/s] (double): 0.002 Brunt-Vaisala Frequency [s^-1] (double): 0.013 LOCATION AND TIME SUBMENU: # Affects for solar zenith angle and photolysis which affect EPM/diurnal variations of temperature @@ -157,31 +152,6 @@ METEOROLOGY MENU: Init vert. veloc. from met. data (T/F): T Vert. veloc. time series input (T/F): F Interpolate vert. veloc. met. data (T/F): F - # Option to modify NWP RH data - HUMIDITY SCALING OPTIONS: - # For reference on humidity scaling option, see - # Teoh et al, "Aviation contrail climate effects in the North Atlantic from 2016 to 2021" (2022) - # Constant is a fixed value at initialization - Humidity modification scheme (none / constant / scaling): none - # "Overwrite initial RHi": - Constant RHi [%] (double): 110.0 - Humidity scaling constant a (double): 0.9779 - Humidity scaling constant b (double): 1.635 - - - #- OR -------------------+ - IMPOSE MOIST LAYER DEPTH SUBMENU: - # Sets constant RHi for the entire layer defined by Moist layer depth - Impose moist layer depth (T/F): F - Moist layer depth [m] (double): 1000 - Subsaturated air RHi [%] (double): 80 - #- OR -----------------+ - IMPOSE LAPSE RATE SUBMENU: - # Sets constant lapse rate - Impose lapse rate (T/F): F - Lapse rate [K/m] (T/F): -6.0E-03 - # ---END MET INPUT OPTIONS --- - Add diurnal variations (T/F): F # Perturbations to the temperature field can be added to the contrail simulation to account for some effects of # atmospheric turbulence and gravity waves. diff --git a/Code.v05-00/include/Defaults/Input.hpp b/Code.v05-00/include/Defaults/Input.hpp index 64baf682..ae4766b6 100644 --- a/Code.v05-00/include/Defaults/Input.hpp +++ b/Code.v05-00/include/Defaults/Input.hpp @@ -52,16 +52,11 @@ PARAMETER MENU: # Temperature, RH, and wind shear can be overwritten if using meteorological input files METEOROLOGICAL PARAMETERS SUBMENU: - # Can be overwritten if met file is passed - Temperature [K] (double): 217 - # Can be overwritten if met file is passed - R.Hum. wrt water [%] (double): 63.94 # Pressure altitude at which the contrail is initialized Pressure [hPa] (double): 265 Horiz. diff. coeff. [m^2/s] (double): 15.0 # Can be overwritten if met file is passed Verti. diff. [m^2/s] (double): 0.15 - Wind shear [1/s] (double): 0.002 Brunt-Vaisala Frequency [s^-1] (double): 0.013 LOCATION AND TIME SUBMENU: # Affects for solar zenith angle and photolysis which affect EPM/diurnal variations of temperature @@ -158,31 +153,6 @@ METEOROLOGY MENU: Init vert. veloc. from met. data (T/F): T Vert. veloc. time series input (T/F): F Interpolate vert. veloc. met. data (T/F): F - # Option to modify NWP RH data - HUMIDITY SCALING OPTIONS: - # For reference on humidity scaling option, see - # Teoh et al, "Aviation contrail climate effects in the North Atlantic from 2016 to 2021" (2022) - # Constant is a fixed value at initialization - Humidity modification scheme (none / constant / scaling): none - # "Overwrite initial RHi": - Constant RHi [%] (double): 110.0 - Humidity scaling constant a (double): 0.9779 - Humidity scaling constant b (double): 1.635 - - - #- OR -------------------+ - IMPOSE MOIST LAYER DEPTH SUBMENU: - # Sets constant RHi for the entire layer defined by Moist layer depth - Impose moist layer depth (T/F): F - Moist layer depth [m] (double): 1000 - Subsaturated air RHi [%] (double): 80 - #- OR -----------------+ - IMPOSE LAPSE RATE SUBMENU: - # Sets constant lapse rate - Impose lapse rate (T/F): F - Lapse rate [K/m] (T/F): -6.0E-03 - # ---END MET INPUT OPTIONS --- - Add diurnal variations (T/F): F # Perturbations to the temperature field can be added to the contrail simulation to account for some effects of # atmospheric turbulence and gravity waves. From 17779fd91909c55241f255ddac3c3b467c32b553 Mon Sep 17 00:00:00 2001 From: lrobion Date: Fri, 27 Mar 2026 17:35:25 -0400 Subject: [PATCH 2/3] Fix broken yaml tests --- Code.v05-00/tests/test.yaml | 18 ------------------ Code.v05-00/tests/test1.yaml | 18 ------------------ Code.v05-00/tests/test_yamlreader.cpp | 6 ++---- 3 files changed, 2 insertions(+), 40 deletions(-) diff --git a/Code.v05-00/tests/test.yaml b/Code.v05-00/tests/test.yaml index 93e20c9a..d41f026f 100644 --- a/Code.v05-00/tests/test.yaml +++ b/Code.v05-00/tests/test.yaml @@ -32,12 +32,9 @@ PARAMETER MENU: # : for MC runs where it should be 200 240 or 200:240) Plume Process [hr] (double): 24 METEOROLOGICAL PARAMETERS SUBMENU: - Temperature [K] (double): 215:5:225 - R.Hum. wrt water [%] (double): 43.9432 Pressure [hPa] (double): 220 230 240 Horiz. diff. coeff. [m^2/s] (double): 15.0 Verti. diff. [m^2/s] (double): 0.15 - Wind shear [1/s] (double): 0.002 Brunt-Vaisala Frequency [s^-1] (double): 0.013 LOCATION AND TIME SUBMENU: LON [deg] (double): -15 @@ -107,21 +104,6 @@ METEOROLOGY MENU: Init vert. veloc. from met. data (T/F): T Vert. veloc. time series input (T/F): T Interpolate vert. veloc. met. data (T/F): T - HUMIDITY SCALING OPTIONS: - Humidity modification scheme (none / constant / scaling): none - Constant RHi [%] (double): 110.0 - Humidity scaling constant a (double): 0.9779 - Humidity scaling constant b (double): 1.635 - #- OR -------------------+ - IMPOSE MOIST LAYER DEPTH SUBMENU: - Impose moist layer depth (T/F): T - Moist layer depth [m] (double): 200 - Subsaturated air RHi [%] (double): 80 - #--- OR -----------------+ - IMPOSE LAPSE RATE SUBMENU: - Impose lapse rate (T/F): T - Lapse rate [K/m] (T/F): -6.0E-03 - Add diurnal variations (T/F): T TEMPERATURE PERTURBATION SUBMENU: Enable Temp. Pert. (T/F): T Temp. Perturb. Amplitude (double): 2.0 diff --git a/Code.v05-00/tests/test1.yaml b/Code.v05-00/tests/test1.yaml index 47e632fe..74e9f4e1 100644 --- a/Code.v05-00/tests/test1.yaml +++ b/Code.v05-00/tests/test1.yaml @@ -32,11 +32,8 @@ PARAMETER MENU: # : for MC runs where it should be 200 240 or 200:240) Plume Process [hr] (double): 24 METEOROLOGICAL PARAMETERS SUBMENU: - Temperature [K] (double): 215:5:225 - R.Hum. wrt water [%] (double): 43.9432 Pressure [hPa] (double): 220 230 240 Verti. diff. [m^2/s] (double): 0.15 - Wind shear [1/s] (double): 0.002 Brunt-Vaisala Frequency [s^-1] (double): 0.013 LOCATION AND TIME SUBMENU: LON [deg] (double): -15 @@ -107,21 +104,6 @@ METEOROLOGY MENU: Init vert. veloc. from met. data (T/F): T Vert. veloc. time series input (T/F): T Interpolate vert. veloc. met. data (T/F): T - HUMIDITY SCALING OPTIONS: - Humidity modification scheme (none / constant / scaling): none - Constant RHi [%] (double): 110.0 - Humidity scaling constant a (double): 0.9779 - Humidity scaling constant b (double): 1.635 - #- OR -------------------+ - IMPOSE MOIST LAYER DEPTH SUBMENU: - Impose moist layer depth (T/F): T - Moist layer depth [m] (double): 200 - Subsaturated air RHi [%] (double): 80 - #--- OR -----------------+ - IMPOSE LAPSE RATE SUBMENU: - Impose lapse rate (T/F): F - Lapse rate [K/m] (T/F): -6.0E-03 - Add diurnal variations (T/F): T TEMPERATURE PERTURBATION SUBMENU: Enable Temp. Pert. (T/F): F Temp. Perturb. Amplitude (double): 1.0 diff --git a/Code.v05-00/tests/test_yamlreader.cpp b/Code.v05-00/tests/test_yamlreader.cpp index 1aa913f1..bb3a4c4e 100644 --- a/Code.v05-00/tests/test_yamlreader.cpp +++ b/Code.v05-00/tests/test_yamlreader.cpp @@ -317,8 +317,6 @@ TEST_CASE("Read Yaml File"){ REQUIRE(input.MET_TEMP_PERTURB_AMPLITUDE == 2.0); REQUIRE(input.MET_TEMP_PERTURB_TIMESCALE == 10); - - REQUIRE(error == "Cannot fix both moist layer depth and lapse rate"); } SECTION("Read Diagnostic Menu"){ OptInput input; @@ -390,7 +388,7 @@ TEST_CASE("Generate Input Objects"){ OptInput input; YamlInputReader::readYamlInputFiles(input, {filename}); vector> cases = generateCases(input); - REQUIRE(cases.size() == 18); + REQUIRE(cases.size() == 6); Input caseInput = Input(0, cases, "", "", "", "", ""); REQUIRE(caseInput.simulationTime() == 24); REQUIRE(caseInput.pressure_Pa() == 22000); @@ -428,7 +426,7 @@ TEST_CASE("Merge Input Files"){ OptInput input; YamlInputReader::readYamlInputFiles(input, {filename1, filename2}); vector> cases = generateCases(input); - REQUIRE(cases.size() == 18); + REQUIRE(cases.size() == 6); Input caseInput = Input(0, cases, "", "", "", "", ""); REQUIRE(caseInput.simulationTime() == 24); REQUIRE(caseInput.pressure_Pa() == 32000); From d51e3d256b1d8817d3d4ce4e4433e2f3eb1b2d5c Mon Sep 17 00:00:00 2001 From: lrobion Date: Fri, 27 Mar 2026 18:14:46 -0400 Subject: [PATCH 3/3] Smaller tests for advection diffusion solver --- Code.v05-00/tests/test_adv_diff_solver.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code.v05-00/tests/test_adv_diff_solver.cpp b/Code.v05-00/tests/test_adv_diff_solver.cpp index 286fdee5..d5ce7622 100644 --- a/Code.v05-00/tests/test_adv_diff_solver.cpp +++ b/Code.v05-00/tests/test_adv_diff_solver.cpp @@ -298,7 +298,7 @@ namespace FVM_ANDS{ // Solution: f(x,y,t) = exp(-t) * sin(pi*x) * sin(2*pi*y) double u = 0, v = 0, shear = 0, Dh = 1.0, Dv = 1.0, xlim_left = 0.1, xlim_right = 0.8, ylim_bot = 0.2, ylim_top = 0.9; - int nx = 100, ny = 100; + int nx = 50, ny = 50; // double dx = 1.0/nx; // double dy = 1.0/ny; //double dt = 0.24 * std::min( (dx*dx) / (2*Dh) , (dy*dy) / (2*Dv)); @@ -312,7 +312,7 @@ namespace FVM_ANDS{ FVM_Solver solver(params, mesh.x(), mesh.y(), bc, exact, false, 1000 , 1e-5); //the convergence on this problem really sucks without ILUT precond //Problem is, ILUT is way too expensive to use in APCEMM as a default. Maybe the code can be templated later to allow for customizability. - double t = 0, t_max = 3; + double t = 0, t_max = 1.5; int n_timesteps = t_max/dt; for(int i = 0; i < n_timesteps; i++){ t = dt*(i + 1); @@ -404,7 +404,7 @@ namespace FVM_ANDS{ x(t) = 0.5 + \int u(t) dt = 0.5 + u0t - shear * (y0*t + v0/2 t^2) */ - int nx = 500, ny = 500; + int nx = 200, ny = 200; double dx = 1.0/nx; double dy = 1.0/ny; double dt = 1;