REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_NCTimeSeriesRiver.H
Go to the documentation of this file.
1#ifndef _REMORA_NCTIMESEIRESRIVER_H_
2#define _REMORA_NCTIMESEIRESRIVER_H_
3
4#ifdef REMORA_USE_NETCDF
5
6#include <string>
7
8#include <AMReX_AmrCore.H>
9
10#include <REMORA.H>
11
13{
14 public:
15 NCTimeSeriesRiver (const amrex::Vector<std::string>& a_file_names,
16 const std::string a_field_name,
17 const std::string a_time_name,
18 const int a_nz, double a_time_ref,
19 const int a_use_vert_integ=0,
20 const int a_is_transport=0);
21
22 void Initialize ();
23
24 /// Calculate interpolated values at time, in seconds on the model clock
26
27 /// Container for interpolated data; Only used if save_interpolated == true
28 amrex::FArrayBox* fab_interp;
29
30 /// Whether the field is specified in the z-dimension
31 int has_z;
32 /// Whether to use the depth-integrated value read from file; Used
33 /// when !has_z
35 /// Whether this field is the river transport, as opposed to a tracer
36 /// concentration. Only the transport is distributed in the vertical by
37 /// river_Vshape (ROMS Qsrc = Qbar*Qshape)
39
40 /// FABs to pointers of river data
41 amrex::FArrayBox* fab_before;
42 amrex::FArrayBox* fab_after;
43 /// Vshape data if needed
44 amrex::FArrayBox* fab_vshape = nullptr;
45
46 /**
47 * Read in data from file at time index itime and fill into FAB
48 */
49 void read_in_at_time (amrex::FArrayBox* vec, int itime);
50 private:
51
52 /// File names to read from
53 amrex::Vector<std::string> file_names;
54 /// Field name in netcdf file
55 std::string field_name;
56 /// Field name for time series in netcdf file
57 std::string time_name;
58
59 /// Number of rivers
60 int nriv;
61 /// Number of vertical points
62 int nz;
63 /// How many vertical cells there are in the data fabs
64 int nzbox;
65
66 /** remora.time_ref: the reference date the model clock counts from. The
67 * file's times are placed on that clock from the reference date in their
68 * units attribute. Double, like every reference date. */
69 double time_ref;
70
71 /// Time points in netcdf file, in seconds on the model clock
72 amrex::Vector<double> river_times;
73 /// File index to access a particular time
74 amrex::Vector<int> file_for_time;
75 /// Offset to access a particular time within its file
76 amrex::Vector<int> file_itime_offset;
77 /// Time index immediately before the last time interpolated to
79 /// Time in ocean_time immediately before the last time interpolated to
81 /// Time in ocean_time immediately after the last time interpolated to
82 double time_after;
83
84};
85
86#endif // REMORA_USE_NETCDF
87#endif //_REMORA_NCTIMESEIRESRIVER_H_
mf_h setVal(geomdata.ProbHi(2))
int nriv
Number of rivers.
int nzbox
How many vertical cells there are in the data fabs.
amrex::Vector< int > file_itime_offset
Offset to access a particular time within its file.
amrex::Vector< double > river_times
Time points in netcdf file, in seconds on the model clock.
amrex::Vector< std::string > file_names
File names to read from.
std::string time_name
Field name for time series in netcdf file.
double time_before
Time in ocean_time immediately before the last time interpolated to.
std::string field_name
Field name in netcdf file.
amrex::FArrayBox * fab_vshape
Vshape data if needed.
amrex::FArrayBox * fab_after
double time_after
Time in ocean_time immediately after the last time interpolated to.
int i_time_before
Time index immediately before the last time interpolated to.
void update_interpolated_to_time(double time)
Calculate interpolated values at time, in seconds on the model clock.
void read_in_at_time(amrex::FArrayBox *vec, int itime)
amrex::FArrayBox * fab_before
FABs to pointers of river data.
int nz
Number of vertical points.
amrex::Vector< int > file_for_time
File index to access a particular time.
amrex::FArrayBox * fab_interp
Container for interpolated data; Only used if save_interpolated == true.
int has_z
Whether the field is specified in the z-dimension.