Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
chengcli committed Nov 5, 2023
1 parent 51307b2 commit 73bef6b
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 331 deletions.
39 changes: 6 additions & 33 deletions examples/2020-Li-polar-vortex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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

Expand Down
38 changes: 5 additions & 33 deletions examples/2023-Chen-exo3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
38 changes: 6 additions & 32 deletions examples/2023-Li-saturn-vla/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
30 changes: 14 additions & 16 deletions examples/2023-Li-saturn-vla/radio_channels.yaml
Original file line number Diff line number Diff line change
@@ -1,68 +1,66 @@
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-]

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]
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
1 change: 0 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
16 changes: 0 additions & 16 deletions python/pyopacity.cpp

This file was deleted.

12 changes: 6 additions & 6 deletions src/opacity/absorber_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ AbsorberPtr AbsorberFactory::createAbsorberPartial(std::string name,
ab = std::make_shared<FreedmanSimple>();
} else if (type == "freedman_mean") {
ab = std::make_shared<FreedmanSimple>();
} else if (type == "JunoMWR-NH3") {
} else if (type == "radio-NH3") {
ab = std::make_shared<gp::MwrAbsorberNH3>();
} else if (type == "JunoMWR-H2O") {
} else if (type == "radio-H2O") {
ab = std::make_shared<gp::MwrAbsorberH2O>();
} else if (type == "JunoMWR-H2S") {
} else if (type == "radio-H2S") {
ab = std::make_shared<gp::MwrAbsorberH2S>();
} else if (type == "JunoMWR-PH3") {
} else if (type == "radio-PH3") {
ab = std::make_shared<gp::MwrAbsorberPH3>();
} else if (type == "JunoMWR-CIA") {
} else if (type == "radio-CIA") {
ab = std::make_shared<gp::MwrAbsorberCIA>();
} else if (type == "JunoMWR-Electron") {
} else if (type == "radio-Electron") {
ab = std::make_shared<gp::MwrAbsorberElectron>();
} else {
throw NotFoundError("createAbsorberPartial", "Class = " + type);
Expand Down
Loading

0 comments on commit 73bef6b

Please sign in to comment.