diff --git a/examples/2020-Li-polar-vortex/CMakeLists.txt b/examples/2020-Li-polar-vortex/CMakeLists.txt index c9d1bd04..9ae4b270 100644 --- a/examples/2020-Li-polar-vortex/CMakeLists.txt +++ b/examples/2020-Li-polar-vortex/CMakeLists.txt @@ -1,37 +1,10 @@ -string(TOLOWER ${CMAKE_BUILD_TYPE} buildl) -string(TOUPPER ${CMAKE_BUILD_TYPE} buildu) - -# 1. Compile straka.cpp - -#set(namel straka) - -foreach(namel shallow_xy polar_vortex) - find_package(Boost REQUIRED) - - add_executable(${namel}.${buildl} ${namel}.cpp - ${CMAKE_BINARY_DIR}/main_${TASK}.cpp) - - set_target_properties( - ${namel}.${buildl} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - COMPILE_FLAGS ${CMAKE_CXX_FLAGS_${buildu}} - ) - - target_link_libraries(${namel}.${buildl} - ${CANOE_LIBRARY_${buildu}} - ) - - target_include_directories(${namel}.${buildl} - PRIVATE - ${CMAKE_BINARY_DIR} - ${CANOE_INCLUDE_DIR} - ${MPI_CXX_INCLUDE_PATH} - ${NETCDF_INCLUDES} - ${PNETCDF_INCLUDE_DIR} - ) -endforeach() +# ============================================ +# Examples published in Li et al. (2022), PNAS +# ============================================ +# 1. Compile shallow_xy and polar_vortex +setup_problem(shallow_xy) +setup_problem(polar_vortex) # 1. Copy input file to run directory diff --git a/examples/2023-Chen-exo3/CMakeLists.txt b/examples/2023-Chen-exo3/CMakeLists.txt index b43fe30c..fefac019 100644 --- a/examples/2023-Chen-exo3/CMakeLists.txt +++ b/examples/2023-Chen-exo3/CMakeLists.txt @@ -1,39 +1,11 @@ -string(TOLOWER ${CMAKE_BUILD_TYPE} buildl) -string(TOUPPER ${CMAKE_BUILD_TYPE} buildu) +# =============================================== +# Examples published in Cheng et al. (2023), ApJS +# =============================================== # 1. Compile dam_break.cpp +setup_problem(dam_break) -foreach(namel dam_break) - add_executable(${namel}.${buildl} ${namel}.cpp - ${CMAKE_BINARY_DIR}/main_${TASK}.cpp) - - set_target_properties( - ${namel}.${buildl} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - COMPILE_FLAGS ${CMAKE_CXX_FLAGS_${buildu}} - ) - - target_link_libraries(${namel}.${buildl} - ${CANOE_LIBRARY_${buildu}} - ${NETCDF_LIBRARIES} - ${PNETCDF_LIBRARY} - ${MPI_CXX_LIBRARIES} - ) - - target_include_directories(${namel}.${buildl} - PRIVATE - ${CMAKE_BINARY_DIR} - ${CANOE_INCLUDE_DIR} - ${MPI_CXX_INCLUDE_PATH} - ${NETCDF_INCLUDES} - ${PNETCDF_INCLUDE_DIR} - ) -endforeach() - - -# 1. Copy input file to run directory - +# 2. Copy input file to run directory file(GLOB inputs *.inp *.dat) foreach(input ${inputs}) file(COPY ${input} DESTINATION ${CMAKE_BINARY_DIR}/bin) diff --git a/examples/2023-Li-saturn-vla/CMakeLists.txt b/examples/2023-Li-saturn-vla/CMakeLists.txt index 0a436676..64097b5b 100644 --- a/examples/2023-Li-saturn-vla/CMakeLists.txt +++ b/examples/2023-Li-saturn-vla/CMakeLists.txt @@ -1,37 +1,11 @@ -string(TOLOWER ${CMAKE_BUILD_TYPE} buildl) -string(TOUPPER ${CMAKE_BUILD_TYPE} buildu) +# ======================================================== +# Examples published in Li et al. (2019), Science Advances +# ======================================================== -# 1. Compile juno.cpp - -set(namel saturn_radio) - -add_executable(${namel}.${buildl} ${namel}.cpp - ${CMAKE_BINARY_DIR}/main_${TASK}.cpp) - -set_target_properties( - ${namel}.${buildl} - PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" - COMPILE_FLAGS ${CMAKE_CXX_FLAGS_${buildu}} - ) - -target_link_libraries(${namel}.${buildl} - ${ATHENAPP_LIBRARY_${buildu}} - ${CANOE_LIBRARY_${buildu}} - ${NETCDF_LIBRARIES} - ${CPPDISORT_LIBRARY_${buildu}} - ) - -target_include_directories(${namel}.${buildl} - PRIVATE - ${CMAKE_BINARY_DIR} - ${CANOE_INCLUDE_DIR} - ${EIGEN3_INCLUDE_DIR} - ${MPI_CXX_INCLUDE_PATH} - ) - -# 1. Copy input file to run directory +# 1. Compile saturn_radio.cpp +setup_problem(saturn_radio) +# 2. Copy input file to run directory file(GLOB inputs *.inp *.yaml) foreach(input ${inputs}) file(COPY ${input} DESTINATION ${CMAKE_BINARY_DIR}/bin) diff --git a/examples/2023-Li-saturn-vla/radio_channels.yaml b/examples/2023-Li-saturn-vla/radio_channels.yaml index 5cb9f263..7917643a 100644 --- a/examples/2023-Li-saturn-vla/radio_channels.yaml +++ b/examples/2023-Li-saturn-vla/radio_channels.yaml @@ -1,23 +1,27 @@ name: Saturn radio channel opacity file opacity-sources: - - name: radio-CIA + - name: CIA + class: radio-CIA long-name: "Hydrogen/Helium collisional induced absorption" parameters: {xHe: 0.135, xCH4: 2.04E-3, mix: 0.} - - name: radio-NH3 + - name: NH3 + class: radio-NH3 long-name: "Ammonia line absorption" model: Hanley09 dependent-species: [vapor.NH3, vapor.H2O] parameters: {xHe: 0.135, power: 0.} - - name: radio-H2O + - name: H2O + class: radio-H2O long-name: "H2O line absorption" model: Karpowicz dependent-species: [vapor.H2O] parameters: {xHe: 0.135, scale: 0.} - - name: radio-Electron + - name: Electron + class: radio-Electron long-name: "Electron absorption" model: AppletonHartree dependent-species: [tracer.e-] @@ -25,44 +29,38 @@ opacity-sources: bands: [CH1, CH2, CH3, CH4, CH5, CH6] CH1: - type: radio rt-solver: Lambert unit: GHz - wavenumber-range: [0.6, 0.6] + frequency-range: [0.6, 0.6] opacity: [CIA, NH3, H2O, Electron] paramters: {alpha: 0.0} CH2: - type: radio rt-solver: Lambert unit: GHz - wavenumber-range: [1.25, 1.25] + frequency-range: [1.25, 1.25] opacity: [CIA, NH3, H2O] CH3: - type: radio rt-solver: Lambert unit: GHz - wavenumber-range: [2.6, 2.6] + frequency-range: [2.6, 2.6] opacity: [CIA, NH3, H2O] CH4: - type: radio rt-solver: Lambert unit: GHz - wavenumber-range: [5.2, 5.2] + frequency-range: [5.2, 5.2] opacity: [CIA, NH3, H2O] CH5: - type: radio rt-solver: Lambert unit: GHz - wavenumber-range: [10., 10.] + frequency-range: [10., 10.] opacity: [CIA, NH3, H2O] CH6: - type: radio rt-solver: Lambert unit: GHz - wavenumber-range: [22., 22.] + frequency-range: [22., 22.] opacity: [CIA, NH3, H2O] diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 8116b2e3..ddc46cd8 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -6,7 +6,7 @@ if(${HYDROSTATIC}) #add_subdirectory(1d-rad-jupiter) add_subdirectory(2023-jupiter-mwr-eq) add_subdirectory(2023-Li-saturn-vla) - add_subdirectory(2023-Li-uranus) + #add_subdirectory(2023-Li-uranus) add_subdirectory(2018-Li-harp) if(${EQUATION_OF_STATE} STREQUAL "shallow_yz") add_subdirectory(2023-Chen-exo3) @@ -16,6 +16,6 @@ else() add_subdirectory(2020-Li-polar-vortex) else() add_subdirectory(2019-Li-snap) - add_subdirectory(2024-Li-plume) + #add_subdirectory(2024-Li-plume) endif() endif() diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index a1331c53..4efab5e0 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -45,5 +45,4 @@ endmacro() add_python_module(pyathena) add_python_module(pycanoe) add_python_module(pyharp) -add_python_module(pyopacity) add_python_module(utilities) diff --git a/python/pyopacity.cpp b/python/pyopacity.cpp deleted file mode 100644 index 9123c8d6..00000000 --- a/python/pyopacity.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// pybind -#include -#include - -// canoe -#include - -// opacity -#include - -namespace py = pybind11; - -PYBIND11_MODULE(pyopacity, m) { - m.attr("__name__") = "pyharp"; - m.doc() = "Python bindings for opacity module"; -} diff --git a/src/opacity/absorber_factory.cpp b/src/opacity/absorber_factory.cpp index 44a44d85..4a5ac789 100644 --- a/src/opacity/absorber_factory.cpp +++ b/src/opacity/absorber_factory.cpp @@ -102,17 +102,17 @@ AbsorberPtr AbsorberFactory::createAbsorberPartial(std::string name, ab = std::make_shared(); } else if (type == "freedman_mean") { ab = std::make_shared(); - } else if (type == "JunoMWR-NH3") { + } else if (type == "radio-NH3") { ab = std::make_shared(); - } else if (type == "JunoMWR-H2O") { + } else if (type == "radio-H2O") { ab = std::make_shared(); - } else if (type == "JunoMWR-H2S") { + } else if (type == "radio-H2S") { ab = std::make_shared(); - } else if (type == "JunoMWR-PH3") { + } else if (type == "radio-PH3") { ab = std::make_shared(); - } else if (type == "JunoMWR-CIA") { + } else if (type == "radio-CIA") { ab = std::make_shared(); - } else if (type == "JunoMWR-Electron") { + } else if (type == "radio-Electron") { ab = std::make_shared(); } else { throw NotFoundError("createAbsorberPartial", "Class = " + type); diff --git a/src/special/giants_add_absorber_v1.hpp b/src/special/giants_add_absorber_v1.hpp deleted file mode 100644 index 38f6251e..00000000 --- a/src/special/giants_add_absorber_v1.hpp +++ /dev/null @@ -1,135 +0,0 @@ -// C/C++ -#include - -// application -#include -#include - -// harp -#include - -// utils -#include -#include -#include - -// opacity -#include -#include -#include -#include -#include - -namespace gp = GiantPlanets; - -void RadiationBand::addAbsorberInfrared(YAML::Node &node) { - auto name = node["name"].as(); - auto params = ToParameterMap(node["parameters"]); - - std::vector species; - std::string data_file; - - if (node["dependent-species"]) - species = node["dependent-species"].as>(); - - if (node["data"]) { - data_file = node["data"].as(); - } else { - data_file = "kcoeff." + myfile_ + "-" + name_ + ".nc"; - } - - auto app = Application::GetInstance(); - std::string full_path; - try { - full_path = app->FindInputFile(data_file); - } catch (NotFoundError const &e) { - auto log = app->GetMonitor("harp"); - std::stringstream ss; - ss << e.what() << std::endl; - ss << name << " will not be loaded." << std::endl; - log->Warn(ss.str()); - } - - if (name == "H2-H2-CIA") { - auto ab = std::make_unique(species, params); - - absorbers_.push_back(std::move(ab)); - } else if (name == "H2-He-CIA") { - auto ab = std::make_unique(species, params); - - absorbers_.push_back(std::move(ab)); - } else if (name == "CH4") { - auto ab = std::make_unique(name, species, params); - if (FileExists(full_path)) ab->LoadCoefficient(data_file); - absorbers_.push_back(std::move(ab)); - - } else if (name == "C2H2") { - auto ab = std::make_unique(name, species, params); - if (FileExists(full_path)) ab->LoadCoefficient(data_file); - absorbers_.push_back(std::move(ab)); - - } else if (name == "C2H4") { - auto ab = std::make_unique(name, species, params); - if (FileExists(full_path)) ab->LoadCoefficient(data_file); - absorbers_.push_back(std::move(ab)); - - } else if (name == "C2H6") { - auto ab = std::make_unique(name, species, params); - if (FileExists(full_path)) ab->LoadCoefficient(data_file); - absorbers_.push_back(std::move(ab)); - - } else if (name == "freedman_simple") { - auto ab = std::make_unique(species, params); - absorbers_.push_back(std::move(ab)); - - } else if (name == "freedman_mean") { - auto ab = std::make_unique(species, params); - absorbers_.push_back(std::move(ab)); - - } else if (strncmp(name.c_str(), "ck-", 3) == 0) { - auto aname = extract_second(name, "-"); - auto ab = std::make_unique(aname, species, params); - - absorbers_.push_back(std::move(ab)); - } else { - throw NotFoundError("addAbsorberInfrared", "Absorber " + name); - } -} - -// radiation -void RadiationBand::addAbsorberRadio(YAML::Node &node) { - auto name = node["name"].as(); - auto params = ToParameterMap(node["parameters"]); - - std::vector species; - if (node["dependent-species"]) - species = node["dependent-species"].as>(); - - if (name == "NH3") { - auto ab = std::make_unique(species, params); - - absorbers_.push_back(std::move(ab)); - } else if (name == "H2O") { - auto ab = std::make_unique(species, params); - - absorbers_.push_back(std::move(ab)); - } else if (name == "H2S") { - auto ab = std::make_unique(species, params); - - absorbers_.push_back(std::move(ab)); - } else if (name == "PH3") { - auto ab = std::make_unique(species, params); - - absorbers_.push_back(std::move(ab)); - } else if (name == "CIA") { - auto ab = std::make_unique(species, params); - - absorbers_.push_back(std::move(ab)); - } else if (name == "Electron") { - auto ab = std::make_unique(species, params); - - absorbers_.push_back(std::move(ab)); - } else { - throw NotFoundError("addAbsorberRadio", "Absorber " + name); - } -} diff --git a/src/special/mars_absorber.cpp b/src/special/mars_absorber.cpp deleted file mode 100644 index 36d0f83d..00000000 --- a/src/special/mars_absorber.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// C/C++ -#include -#include -#include -#include - -// external -#include - -// application -#include - -// opacity -#include -#include -#include -#include -#include - -// utils -#include - -// harp -#include "absorber.hpp" -#include "radiation_band.hpp" - -void RadiationBand::addAbsorberInfrared(YAML::Node &node) { - auto name = node["name"].as(); - auto params = ToParameterMap(node["parameters"]); - - std::vector species; - if (node["dependent-species"]) - species = node["dependent-species"].as>(); - - if (name == "CO2-CO2-CIA") { - // auto ab = std::make_unique(species, params); - - // absorbers_.push_back(std::move(ab)); - } else if (name == "CO2") { - auto ab = std::make_unique(name, species, params); - absorbers_.push_back(std::move(ab)); - } else if (name == "H2O") { - auto ab = std::make_unique(name, species, params); - absorbers_.push_back(std::move(ab)); - } else if (name == "O3") { - auto ab = std::make_unique(name, species, params); - absorbers_.push_back(std::move(ab)); - } else if (name == "O2") { - auto ab = std::make_unique(name, species, params); - absorbers_.push_back(std::move(ab)); - } else if (name == "CO") { - auto ab = std::make_unique(name, species, params); - absorbers_.push_back(std::move(ab)); - } else { - throw NotFoundError("addAbsorberInfrared", "Absorber " + name); - } -}