Skip to content

Commit

Permalink
test: lgar
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraney committed Mar 9, 2024
1 parent b925ecf commit 92df8c9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
6 changes: 6 additions & 0 deletions python/ngen_conf/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
_noah_owp_config_data_path = _datadir / "init_config_data" / "noah_owp.namelist"
_soil_freeze_thaw_config_data_path = _datadir / "init_config_data" / "soil_freeze_thaw.txt"
_soil_moisture_profile_config_data_path = _datadir / "init_config_data" / "soil_moisture_profile.txt"
_lgar_config_data_path = _datadir / "init_config_data" / "lgar.txt"


"""
Expand Down Expand Up @@ -172,3 +173,8 @@ def soil_freeze_thaw_init_config() -> str:
def soil_moisture_profile_init_config() -> str:
# drop eol char
return _soil_moisture_profile_config_data_path.read_text().rstrip()

@pytest.fixture
def lgar_init_config() -> str:
# drop eol char
return _lgar_config_data_path.read_text().rstrip()
15 changes: 15 additions & 0 deletions python/ngen_conf/tests/data/init_config_data/lgar.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
verbosity=none
soil_params_file=./data/vG_default_params.dat
layer_thickness=44.0,131.0,25.0[cm]
initial_psi=2000.0[cm]
timestep=300[sec]
endtime=7500.0[hr]
forcing_resolution=3600[sec]
ponded_depth_max=2[cm]
use_closed_form_G=false
layer_soil_type=13,14,15
max_soil_types=25
wilting_point_psi=15495.0[cm]
giuh_ordinates=0.06,0.51,0.28,0.12,0.03
sft_coupled=true
soil_z=10,20,30,40,50,60,70,80,90,100.0,110.,120,130.,140.,150.,160.,170.,180.,190.,200.0[cm]
9 changes: 7 additions & 2 deletions python/ngen_conf/tests/test_init_config_models.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from ngen.init_config import utils
from ngen.config.init_config.cfe import CFE
from ngen.config.init_config.pet import PET
from ngen.config.init_config.lgar import Lgar
from ngen.config.init_config.noahowp import NoahOWP
from ngen.config.init_config.pet import PET
from ngen.config.init_config.soil_freeze_thaw import SoilFreezeThaw
from ngen.config.init_config.soil_moisture_profile import SoilMoistureProfile
from ngen.init_config import utils


def test_cfe(cfe_init_config: str):
Expand Down Expand Up @@ -33,3 +34,7 @@ def test_soil_freeze_thaw(soil_freeze_thaw_init_config: str):
def test_soil_moisture_profile(soil_moisture_profile_init_config: str):
o = SoilMoistureProfile.from_ini_str(soil_moisture_profile_init_config)
assert o.to_ini_str() == soil_moisture_profile_init_config

def test_lgar(lgar_init_config: str):
o = Lgar.from_ini_str(lgar_init_config)
assert o.to_ini_str() == lgar_init_config

0 comments on commit 92df8c9

Please sign in to comment.