forked from UW-Hydro/VIC
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvic_driver_classic.h
89 lines (84 loc) · 4.23 KB
/
vic_driver_classic.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/******************************************************************************
* @section DESCRIPTION
*
* Header file for vic_driver_classic routines
*
* @section LICENSE
*
* The Variable Infiltration Capacity (VIC) macroscale hydrological model
* Copyright (C) 2014 The Land Surface Hydrology Group, Department of Civil
* and Environmental Engineering, University of Washington.
*
* The VIC model is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*****************************************************************************/
#ifndef VIC_DRIVER_CLASSIC_H
#define VIC_DRIVER_CLASSIC_H
#include <vic_driver_shared_all.h>
#define VIC_DRIVER "Classic"
#define BINHEADERSIZE 256
#define MAX_VEGPARAM_LINE_LENGTH 500
void alloc_atmos(int, atmos_data_struct **);
void alloc_veg_hist(int nrecs, int nveg, veg_hist_struct ***veg_hist);
void calc_netlongwave(double *, double, double, double);
double calc_netshort(double, int, double, double *);
void check_files(filep_struct *, filenames_struct *);
bool check_save_state_flag(dmy_struct *, size_t);
FILE *check_state_file(char *, size_t, size_t, int *);
void close_files(filep_struct *, out_data_file_struct *, filenames_struct *);
size_t count_n_outfiles(FILE *gp);
void compute_cell_area(soil_con_struct *);
size_t count_outfile_nvars(FILE *gp);
out_data_struct *create_output_list();
void free_atmos(int nrecs, atmos_data_struct **atmos);
void free_veg_hist(int nrecs, int nveg, veg_hist_struct ***veg_hist);
void free_veglib(veg_lib_struct **);
double get_dist(double lat1, double long1, double lat2, double long2);
void get_force_type(char *, int, int *);
void get_global_param(FILE *);
void init_output_list(out_data_struct *, int, char *, int, double);
void initialize_forcing_files(void);
void make_in_and_outfiles(filep_struct *, filenames_struct *, soil_con_struct *,
out_data_file_struct *);
FILE *open_state_file(global_param_struct *, filenames_struct, int, int);
void print_atmos_data(atmos_data_struct *atmos, size_t nr);
void parse_output_info(FILE *, out_data_file_struct **, out_data_struct *);
void read_atmos_data(FILE *, global_param_struct, int, int, double **,
double ***);
double **read_forcing_data(FILE **, global_param_struct, double ****);
void read_initial_model_state(FILE *, all_vars_struct *, int, int, int,
soil_con_struct *, lake_con_struct);
lake_con_struct read_lakeparam(FILE *, soil_con_struct, veg_con_struct *);
void read_snowband(FILE *, soil_con_struct *);
soil_con_struct read_soilparam(FILE *, char *, char *);
veg_lib_struct *read_veglib(FILE *, size_t *);
veg_con_struct *read_vegparam(FILE *, int, size_t);
out_data_file_struct *set_output_defaults(out_data_struct *);
void vic_force(atmos_data_struct *, dmy_struct *, FILE **, veg_con_struct *,
veg_hist_struct **, soil_con_struct *);
void vic_populate_model_state(all_vars_struct *, filep_struct, size_t,
soil_con_struct *, veg_con_struct *,
lake_con_struct);
void write_data(out_data_file_struct *, out_data_struct *, dmy_struct *,
double);
void write_forcing_file(atmos_data_struct *, int, out_data_file_struct *,
out_data_struct *, dmy_struct *);
void write_header(out_data_file_struct *, out_data_struct *, dmy_struct *,
global_param_struct);
void write_model_state(all_vars_struct *, int, int, filep_struct *,
soil_con_struct *);
void write_output(out_data_struct *out_data,
out_data_file_struct *out_data_files, dmy_struct *dmy,
int rec);
#endif