-
Notifications
You must be signed in to change notification settings - Fork 77
Netcdf output #744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Netcdf output #744
Changes from 19 commits
ce2adad
be9a79e
1519e68
13a49c6
a3d93ed
1a425bc
e084523
c8222bd
6bd283f
589ecbd
1fd9001
34fdc72
2bfae54
7be97f8
d383a0c
ac7af5d
721e6e8
2817f11
fa1187a
34fe0b9
57ef614
457a717
a7f2f25
b497dc5
8df2dc1
d356fee
5cd822a
ee73d30
87c25bd
3ce0bf0
965d9e8
ae86a05
276c566
47a5924
364bb24
c6f5bd9
93df131
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
{ | ||
"global": { | ||
"formulations": [ | ||
{ | ||
"name": "bmi_c++", | ||
"params": { | ||
"model_type_name": "test_bmi_cpp", | ||
"library_file": "./extern/test_bmi_cpp/cmake_build/libtestbmicppmodel.so", | ||
"init_config": "./data/bmi/c/test/test_bmi_c_config.ini", | ||
"main_output_variable": "OUTPUT_VAR_2", | ||
"variables_names_map" : { | ||
"INPUT_VAR_2": "TMP_2maboveground", | ||
"INPUT_VAR_1": "precip_rate" | ||
}, | ||
"create_function": "bmi_model_create", | ||
"destroy_function": "bmi_model_destroy", | ||
"uses_forcing_file": false | ||
} | ||
} | ||
], | ||
"forcing": { | ||
"file_pattern": ".*{{id}}.*.csv", | ||
"path": "./data/forcing/" | ||
} | ||
}, | ||
"time": { | ||
"start_time": "2015-12-01 00:00:00", | ||
"end_time": "2015-12-30 23:00:00", | ||
"output_interval": 3600 | ||
}, | ||
"outputs" : { | ||
"nc_file1" : { | ||
"name" : "netcdf_output_1.nc", | ||
"type" : "NetCDF4", | ||
"dimensions" : { | ||
"X" : { | ||
"size" : 1000 | ||
}, | ||
"Y" : { | ||
"size" : 500 | ||
}, | ||
"Z" : { | ||
"size" : 100 | ||
} | ||
}, | ||
"variables" : { | ||
"inflitration_excess" : { | ||
"type" : "float", | ||
"dimensions" : "X, Y" | ||
}, | ||
"soil_moisture_content" : { | ||
"type" : "float", | ||
"dimensions" : "X, Y" | ||
} | ||
} | ||
}, | ||
"nc_file2" : { | ||
"name" : "netcdf_output_2.nc", | ||
"type" : "NetCDF4", | ||
"dimensions" : { | ||
"D1" : { | ||
"size" : 10 | ||
}, | ||
"D2" : { | ||
"size" : 100 | ||
}, | ||
"D3" : { | ||
"size" : 1000 | ||
}, | ||
"D4" : { | ||
"size" : 10000 | ||
} | ||
}, | ||
"variables" : { | ||
"var1" : { | ||
"type" : "float", | ||
"dimensions" : "D1" | ||
}, | ||
"var2" : { | ||
"type" : "int", | ||
"dimensions" : "D2" | ||
}, | ||
"var3" : { | ||
"type" : "char", | ||
"dimensions" : "D3" | ||
}, | ||
"var4" : { | ||
"type" : "int64", | ||
"dimensions" : "D4" | ||
} | ||
} | ||
} | ||
}, | ||
"catchments": { | ||
"cat-27": { | ||
"formulations": [ | ||
{ | ||
"name": "bmi_c++", | ||
"params": { | ||
"model_type_name": "test_bmi_cpp", | ||
"library_file": "./extern/test_bmi_cpp/cmake_build/libtestbmicppmodel.so", | ||
"init_config": "./data/bmi/c/test/test_bmi_c_config.ini", | ||
"main_output_variable": "OUTPUT_VAR_2", | ||
"variables_names_map" : { | ||
"INPUT_VAR_2": "TMP_2maboveground", | ||
"INPUT_VAR_1": "precip_rate" | ||
}, | ||
"create_function": "bmi_model_create", | ||
"destroy_function": "bmi_model_destroy", | ||
"uses_forcing_file": false | ||
} | ||
} | ||
], | ||
"forcing": { | ||
"path": "./data/forcing/cat-27_2015-12-01 00_00_00_2015-12-30 23_00_00.csv" | ||
} | ||
}, | ||
"cat-52": { | ||
"formulations": [ | ||
{ | ||
"name": "bmi_c++", | ||
"params": { | ||
"model_type_name": "test_bmi_cpp", | ||
"library_file": "./extern/test_bmi_cpp/cmake_build/libtestbmicppmodel.so", | ||
"init_config": "./data/bmi/c/test/test_bmi_c_config.ini", | ||
"main_output_variable": "OUTPUT_VAR_2", | ||
"variables_names_map" : { | ||
"INPUT_VAR_2": "TMP_2maboveground", | ||
"INPUT_VAR_1": "precip_rate" | ||
}, | ||
"create_function": "bmi_model_create", | ||
"destroy_function": "bmi_model_destroy", | ||
"uses_forcing_file": false | ||
} | ||
} | ||
], | ||
"forcing": { | ||
"path": "./data/forcing/cat-52_2015-12-01 00_00_00_2015-12-30 23_00_00.csv" | ||
} | ||
}, | ||
"cat-67": { | ||
"formulations": [ | ||
{ | ||
"name": "bmi_c++", | ||
"params": { | ||
"model_type_name": "test_bmi_cpp", | ||
"library_file": "./extern/test_bmi_cpp/cmake_build/libtestbmicppmodel.so", | ||
"init_config": "./data/bmi/c/test/test_bmi_c_config.ini", | ||
"main_output_variable": "OUTPUT_VAR_2", | ||
"variables_names_map" : { | ||
"INPUT_VAR_2": "TMP_2maboveground", | ||
"INPUT_VAR_1": "precip_rate" | ||
}, | ||
"create_function": "bmi_model_create", | ||
"destroy_function": "bmi_model_destroy", | ||
"uses_forcing_file": false | ||
} | ||
} | ||
], | ||
"forcing": { | ||
"path": "./data/forcing/cat-67_2015-12-01 00_00_00_2015-12-30 23_00_00.csv" | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,22 @@ | |
|
||
namespace ngen | ||
{ | ||
|
||
/** | ||
* @brief an enumeration of the types of layer classes | ||
*/ | ||
|
||
enum LayerClass | ||
{ | ||
kLayer = 1, | ||
kSurfaceLayer = 2, | ||
kDomainLayer = 3, | ||
kCatchmentLayer = 4, | ||
kNexusLayer = 5, | ||
kRoutingLayer = 6, | ||
kOverlayLayer = 7 | ||
}; | ||
|
||
|
||
class Layer | ||
{ | ||
|
@@ -64,6 +80,24 @@ namespace ngen | |
|
||
virtual ~Layer() {} | ||
|
||
/** | ||
* @brief Get a class id for this layer object | ||
* | ||
* @return int | ||
*/ | ||
virtual int class_id() { return LayerClass::kLayer; } | ||
|
||
/** | ||
* @brief Get a list of output variables names for this layer | ||
* | ||
* @return vector of output variable names | ||
*/ | ||
|
||
|
||
virtual std::vector<std::string>&& get_output_variable_names() | ||
{ | ||
return std::move(std::vector<std::string>()); | ||
} | ||
PhilMiller marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
/*** | ||
* @brief Return the next timestep that will be processed by this layer in epoch time units | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.