Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
SWE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Gaurav Kukreja
SWE
Commits
60d0d798
Commit
60d0d798
authored
Jan 18, 2013
by
Sebastian Rettenberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add optio to flush netcdf files to disk
parent
1937ac27
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
NetCdfWriter.cpp
src/writer/NetCdfWriter.cpp
+8
-2
NetCdfWriter.hh
src/writer/NetCdfWriter.hh
+5
-1
No files found.
src/writer/NetCdfWriter.cpp
View file @
60d0d798
...
...
@@ -43,6 +43,7 @@
* @param i_dY cell size in y-direction.
* @param i_originX
* @param i_originY
* @param i_flush If > 0, flush data to disk every i_flush write operation
* @param i_dynamicBathymetry
*/
io
::
NetCdfWriter
::
NetCdfWriter
(
const
std
::
string
&
i_baseName
,
...
...
@@ -50,9 +51,11 @@ io::NetCdfWriter::NetCdfWriter( const std::string &i_baseName,
const
BoundarySize
&
i_boundarySize
,
int
i_nX
,
int
i_nY
,
float
i_dX
,
float
i_dY
,
float
i_originX
,
float
i_originY
)
:
float
i_originX
,
float
i_originY
,
unsigned
int
i_flush
)
:
//const bool &i_dynamicBathymetry) : //!TODO
io
::
Writer
(
i_baseName
+
".nc"
,
i_b
,
i_boundarySize
,
i_nX
,
i_nY
)
io
::
Writer
(
i_baseName
+
".nc"
,
i_b
,
i_boundarySize
,
i_nX
,
i_nY
),
flush
(
i_flush
)
{
int
status
;
...
...
@@ -216,4 +219,7 @@ void io::NetCdfWriter::writeTimeStep( const Float2D &i_h,
// Increment timeStep for next call
timeStep
++
;
if
(
flush
>
0
&&
timeStep
%
flush
==
0
)
nc_sync
(
dataFile
);
}
src/writer/NetCdfWriter.hh
View file @
60d0d798
...
...
@@ -48,6 +48,9 @@ private:
/** Variable ids */
int
timeVar
,
hVar
,
huVar
,
hvVar
,
bVar
;
/** Flush after every x write operation? */
unsigned
int
flush
;
// writer time dependent variables.
void
writeVarTimeDependent
(
const
Float2D
&
i_matrix
,
int
i_ncVariable
);
...
...
@@ -63,7 +66,8 @@ private:
const
BoundarySize
&
i_boundarySize
,
int
i_nX
,
int
i_nY
,
float
i_dX
,
float
i_dY
,
float
i_originX
=
0.
,
float
i_originY
=
0.
);
float
i_originX
=
0.
,
float
i_originY
=
0.
,
unsigned
int
i_flush
=
0
);
virtual
~
NetCdfWriter
();
// writes the unknowns at a given time step to the netCDF-file.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment