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 2348720 commit 51307b2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -292,24 +292,18 @@ jobs:
- name: create build directory
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -DTASK=ktable_test -DACCOUNT=${{env.ACCOUNT}} -DTOKEN=${{secrets.ACCESS_TOKEN}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -B ${{github.workspace}}/build-netcdf
run: cmake -DTASK=ktable_earth -DACCOUNT=${{env.ACCOUNT}} -DTOKEN=${{secrets.ACCESS_TOKEN}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -B ${{github.workspace}}/build-netcdf

- name: build
# Build your program with the given configuration
run: |
cmake --build ${{github.workspace}}/build-netcdf --config ${{env.BUILD_TYPE}} -- -j2
- name: test generating ktable
working-directory: ${{github.workspace}}/build-netcdf
working-directory: ${{github.workspace}}/build-netcdf/bin
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: |
cp ./bin/example_giants_ir.yaml .
python ./bin/run_ktable.py -i ./bin/example_giants_ir.inp
- name: test jupiter heating/cooling
working-directory: ${{github.workspace}}/build-netcdf
run: echo "Cheers!"
run: python ./run_ktable_simple.py

straka-2d:
if: github.event.pull_request.draft == false
Expand Down
2 changes: 0 additions & 2 deletions cmake/ktable_test.cmake → cmake/ktable_earth.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ set_if_empty(NVAPOR 0)
set_if_empty(NCLOUD 0)
set_if_empty(NTRACER 2)

# canoe task set(TASKLIST InversionTasks)

# canoe configure
set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/opt/")
set(HYDROSTATIC ON)
Expand Down
2 changes: 1 addition & 1 deletion tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ endforeach()

file(COPY clean_rfm_runs.sh DESTINATION ${CMAKE_BINARY_DIR}/bin)

configure_file(run_ktable.py.in ${CMAKE_BINARY_DIR}/bin/run_ktable.py @ONLY)
configure_file(run_ktable_simple.py.in ${CMAKE_BINARY_DIR}/bin/run_ktable_simple.py @ONLY)
configure_file(cktable.py.in ${CMAKE_BINARY_DIR}/bin/cktable.py @ONLY)

# copy yaml and inp files
Expand Down
2 changes: 1 addition & 1 deletion tools/example_earth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ B1:
grid-type: regular
wavenumber-range: [600., 700.]
resolution: 0.01
opacity: [CO2]
opacity: [H2O, CO2]
outdir: (0., 0.)
9 changes: 6 additions & 3 deletions tools/run_ktable_new.py → tools/run_ktable_simple.py.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#! /usr/bin/env python3
import sys, os, subprocess

sys.path.append("/Users/chengcli/Development/canoe/build/python")

hitran_file = "/Users/chengcli/Development/canoe/data/HITRAN2020.par"
sys.path.append("@CMAKE_BINARY_DIR@/python")

from pyharp import radiation_band
from utilities import load_file
from collections import OrderedDict
from numpy import *

cmake_source_dir = "@CMAKE_SOURCE_DIR@"
cmake_binary_dir = "@CMAKE_BINARY_DIR@"
hitran_file = f"{cmake_source_dir}/data/HITRAN2020.par"

def check_file_exist(filename: str) -> bool:
if not os.path.isfile(filename):
Expand Down Expand Up @@ -159,6 +160,8 @@ def run_kcoeff(inpfile: str, ncfile: str) -> None:
atm["TEM"] = Ts_K * ones(num_layers)
# ppmv
atm["CO2"] = 400.0 * ones(num_layers)
# ppmv
atm["H2O"] = 4000.0 * exp(-atm["HGT"] * 1e3 / (Hscale_m / 5.))

create_rfm_atm(absorbers, atm)

Expand Down

0 comments on commit 51307b2

Please sign in to comment.