Skip to content

Commit

Permalink
Merge branch 'null_forcing_provider' of https://github.com/stcui007/ngen
Browse files Browse the repository at this point in the history
 into null_forcing_provider
  • Loading branch information
stcui007 committed Sep 19, 2023
2 parents 4b9683d + a625d1a commit 2a9fa2e
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 62 deletions.
96 changes: 96 additions & 0 deletions data/example_bmi_multi_realization_config_w_nfp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"global": {
"formulations": [
{
"name": "bmi_multi",
"params": {
"model_type_name": "bmi_multi_noahowp_cfe",
"forcing_file": "",
"init_config": "",
"allow_exceed_end_time": true,
"main_output_variable": "Q_OUT",
"modules": [
{
"name": "bmi_c++",
"params": {
"model_type_name": "bmi_c++_sloth",
"library_file": "./extern/sloth/cmake_build/libslothmodel.so",
"init_config": "/dev/null",
"allow_exceed_end_time": true,
"main_output_variable": "z",
"uses_forcing_file": false,
"model_params": {
"ice_fraction_schaake(1,double,m,node)": 0.0,
"ice_fraction_xinan(1,double,1,node)": 0.0,
"soil_moisture_profile(1,double,1,node)": 0.0,
"land_surface_air__temperature(1,double,K,node)": 285.8000183105469,
"atmosphere_water__liquid_equivalent_precipitation_rate(1,double,mm/s,node)": 0.1,
"atmosphere_air_water~vapor__relative_saturation(1,double,1,node)": 0.00930000003427267,
"land_surface_wind__x_component_of_velocity(1,double,m/s,node)": -2.299999952316284,
"land_surface_wind__y_component_of_velocity(1,double,m/s,node)": 0.10000000149011612,
"land_surface_air__pressure(1,double,Pa,node)": 100310.0,
"land_surface_radiation~incoming~shortwave__energy_flux(1,double,W/m2,node)": 0.0,
"land_surface_radiation~incoming~longwave__energy_flux(1,double,W/m2,node)": 361.3000183105469
}
}
},
{
"name": "bmi_fortran",
"params": {
"model_type_name": "bmi_fortran_noahowp",
"library_file": "./extern/noah-owp-modular/cmake_build/libsurfacebmi.so",
"forcing_file": "",
"init_config": "./data/bmi/fortran/noah-owp-modular-init-{{id}}.namelist.input",
"allow_exceed_end_time": true,
"main_output_variable": "QINSUR",
"variables_names_map": {
"PRCPNONC": "atmosphere_water__liquid_equivalent_precipitation_rate",
"Q2": "atmosphere_air_water~vapor__relative_saturation",
"SFCTMP": "land_surface_air__temperature",
"UU": "land_surface_wind__x_component_of_velocity",
"VV": "land_surface_wind__y_component_of_velocity",
"LWDN": "land_surface_radiation~incoming~longwave__energy_flux",
"SOLDN": "land_surface_radiation~incoming~shortwave__energy_flux",
"SFCPRS": "land_surface_air__pressure"
},
"uses_forcing_file": false
}
},
{
"name": "bmi_c",
"params": {
"model_type_name": "bmi_c_cfe",
"library_file": "./extern/cfe/cmake_build/libcfebmi.so",
"forcing_file": "",
"init_config": "./data/bmi/c/cfe/{{id}}_bmi_config.ini",
"allow_exceed_end_time": true,
"main_output_variable": "Q_OUT",
"registration_function": "register_bmi_cfe",
"variables_names_map": {
"water_potential_evaporation_flux": "ETRAN",
"atmosphere_air_water~vapor__relative_saturation": "SPFH_2maboveground",
"land_surface_air__temperature": "TMP_2maboveground",
"land_surface_wind__x_component_of_velocity": "UGRD_10maboveground",
"land_surface_wind__y_component_of_velocity": "VGRD_10maboveground",
"land_surface_radiation~incoming~longwave__energy_flux": "DLWRF_surface",
"land_surface_radiation~incoming~shortwave__energy_flux": "DSWRF_surface",
"land_surface_air__pressure": "PRES_surface"
},
"uses_forcing_file": false
}
}
],
"uses_forcing_file": false
}
}
],
"forcing": {
"provider": "NullForcingProvider"
}
},
"time": {
"start_time": "2015-12-01 00:00:00",
"end_time": "2015-12-30 23:00:00",
"output_interval": 3600
}
}
61 changes: 0 additions & 61 deletions data/example_bmi_realization_config_output.json

This file was deleted.

5 changes: 4 additions & 1 deletion include/realizations/catchment/Formulation_Manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,10 @@ namespace realization {
}

forcing_params get_forcing_params(geojson::PropertyMap &forcing_prop_map, std::string identifier, simulation_time_params &simulation_time_config) {
std::string path = forcing_prop_map.at("path").as_string();
std::string path = "";
if(forcing_prop_map.count("path") != 0){
path = forcing_prop_map.at("path").as_string();
}
std::string provider = "";
if(forcing_prop_map.count("provider") != 0){
provider = forcing_prop_map.at("provider").as_string();
Expand Down

0 comments on commit 2a9fa2e

Please sign in to comment.