diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b2747665..fe0de1d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -292,7 +292,7 @@ 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 @@ -300,16 +300,10 @@ jobs: 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 diff --git a/cmake/ktable_test.cmake b/cmake/ktable_earth.cmake similarity index 91% rename from cmake/ktable_test.cmake rename to cmake/ktable_earth.cmake index c35bc6a6..518ede52 100644 --- a/cmake/ktable_test.cmake +++ b/cmake/ktable_earth.cmake @@ -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) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index a3111380..a223ff3d 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -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 diff --git a/tools/example_earth.yaml b/tools/example_earth.yaml index f7d724ea..760df1be 100644 --- a/tools/example_earth.yaml +++ b/tools/example_earth.yaml @@ -15,5 +15,5 @@ B1: grid-type: regular wavenumber-range: [600., 700.] resolution: 0.01 - opacity: [CO2] + opacity: [H2O, CO2] outdir: (0., 0.) diff --git a/tools/run_ktable_new.py b/tools/run_ktable_simple.py.in similarity index 95% rename from tools/run_ktable_new.py rename to tools/run_ktable_simple.py.in index 743e26d7..6a001b74 100755 --- a/tools/run_ktable_new.py +++ b/tools/run_ktable_simple.py.in @@ -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): @@ -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)