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, const int a_use_vert_integ=0,
19 const int a_is_transport=0);
20
21 void Initialize ();
22
23 /// Calculate
24 void update_interpolated_to_time (amrex::Real time);
25
26 /// Container for interpolated data; Only used if save_interpolated == true
27 amrex::FArrayBox* fab_interp;
28
29 /// Whether the field is specified in the z-dimension
30 int has_z;
31 /// Whether to use the depth-integrated value read from file; Used
32 /// when !has_z
34 /// Whether this field is the river transport, as opposed to a tracer
35 /// concentration. Only the transport is distributed in the vertical by
36 /// river_Vshape (ROMS Qsrc = Qbar*Qshape)
38
39 /// FABs to pointers of river data
40 amrex::FArrayBox* fab_before;
41 amrex::FArrayBox* fab_after;
42 /// Vshape data if needed
43 amrex::FArrayBox* fab_vshape = nullptr;
44
45 /**
46 * Read in data from file at time index itime and fill into FAB
47 */
48 void read_in_at_time (amrex::FArrayBox* vec, int itime);
49 private:
50
51 /// File names to read from
52 amrex::Vector<std::string> file_names;
53 /// Field name in netcdf file
54 std::string field_name;
55 /// Field name for time series in netcdf file
56 std::string time_name;
57
58 /// Number of rivers
59 int nriv;
60 /// Number of vertical points
61 int nz;
62 /// How many vertical cells there are in the data fabs
63 int nzbox;
64
65 /// Time points in netcdf file
66 amrex::Vector<amrex::Real> river_times;
67 /// File index to access a particular time
68 amrex::Vector<int> file_for_time;
69 /// Offset to access a particular time within its file
70 amrex::Vector<int> file_itime_offset;
71 /// Time index immediately before the last time interpolated to
73 /// Time in ocean_time immediately before the last time interpolated to
74 amrex::Real time_before;
75 /// Time in ocean_time immediately after the last time interpolated to
76 amrex::Real time_after;
77
78};
79
80#endif // REMORA_USE_NETCDF
81#endif //_REMORA_NCTIMESEIRESRIVER_H_
mf_h setVal(geomdata.ProbHi(2))
int nriv
Number of rivers.
amrex::Real time_before
Time in ocean_time immediately before the last time interpolated to.
int nzbox
How many vertical cells there are in the data fabs.
void update_interpolated_to_time(amrex::Real time)
Calculate.
amrex::Vector< int > file_itime_offset
Offset to access a particular time within its file.
amrex::Vector< std::string > file_names
File names to read from.
std::string time_name
Field name for time series in netcdf file.
amrex::Vector< amrex::Real > river_times
Time points in netcdf file.
std::string field_name
Field name in netcdf file.
amrex::FArrayBox * fab_vshape
Vshape data if needed.
amrex::FArrayBox * fab_after
int i_time_before
Time index immediately before the last time interpolated to.
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.
amrex::Real time_after
Time in ocean_time immediately after the last time interpolated to.