WVModel
The WVModel is responsible for time-stepping (integrating) the ocean state forward in time, as represented by a WVTransform.
Overview
Assuming you have already initialized a WVTransform, e.g.,
wvt = WVTransformConstantStratification([Lx, Ly, Lz], [Nx, Ny, Nz], N0,latitude=latitude);
and maybe set some initial conditions, you can then initialize the model,
model = WVModel(wvt)
By default the model only takes a linear time-step. To specify a nonlinear flux on initialization, for example,
model = WVModel(wvt);
You can also initialize a model from existing output,
model = WVModel.modelFromFile('SomeFile.nc');
Advanced usage ————–
- Create 1 or more NetCDFFiles
- Add 1 or more WVModelOutputGroups to each file
- Add 1 or more WVObservingSystems to each output group.
Topics
- Initialization
WVModelInitialize a model from a WVTransform instancemodelFromFileInitialize a model from an existing file
- Model Properties
initialTimeInitial model time (seconds)isDynamicsLinearIndicates whether or not the model is using linear or nonlinear dynamics.tCurrent model time (seconds)wvtThe WVTransform instance the represents the ocean state.
- Integration
integrateToTimeTime step the model forward to the requested time.setupIntegratorCustomize the time-stepping
- Particles
addParticlesAdd particles to be advected by the flow.drifterPositionsCurrent positions of the drifter particlesfloatPositionsReturns the positions of the floats at the current time as well as the value of the fields being tracked.particlePositionsPositions and values of tracked fields of particles at the current model time.setDrifterPositionsSet positions of drifter-like particles to be advected.setFloatPositionsSet positions of float-like particles to be advected by the model.
- Tracer
- Writing to NetCDF files
addNetCDFOutputVariablesAdd variables to list of variables to be written to the NetCDF variable during the model run.addNewOutputFileadd a WVModelOutputFile, by passing an output pathaddOutputFileadd a WVModelOutputFile, by passing a WVModelOutputFile instancecreateNetCDFFileForModelOutputCreate a NetCDF file for model outputncfilereturns the first/primary NetCDF file being written tooutputFileNamesretrieve the names of all output filesoutputFileWithNameretrieve a WVModelOutputFile by nameoutputFilesArray of WVModelOutputFile instancesremoveNetCDFOutputVariablesRemove variables from the list of variables to be written to the NetCDF variable during the model run.setNetCDFOutputVariablesSet list of variables to be written to the NetCDF variable during the model run.
- Integrated (fluxed) observing systems
addFluxedCoefficientsadd theWVCoefficientsto the fluxed observing systems arrayaddFluxedObservingSystemadd a WVObservingSystem to the fluxed observing systems arrayfluxedObservingSystemWithNameretrieve a WVObservingSystem by nameremoveFluxedObservingSystemremove a WVObservingSystem to the fluxed observing systems arraywvCoefficientFluxedObservingSystemreturn theWVCoefficientsfluxed observing system
- Other
absErrorToleranceCellArraycloseNetCDFFiledefaultOutputGroupNamedidBlowUpdidSetupIntegratoreulerianObservingSystemfinalIntegrationTimeset only during an integrationfluxAtTimeCellArrayfluxedObservingSystemsindicesForFluxedSysteminitialConditionsCellArrayintegrationCallbackintegrationInformTimeintegrationLastInformModelTimeintegrationLastInformWallTimewall clock, to keep track of the expected integration timeintegrationStartModelTimeintegrationStartWallTimeintegratorTypeArray integratornFluxComponentsnFluxComputationsnFluxComputationsAtLastInformoutputTimesForIntegrationPeriodThis will be called exactly once before an integrationpseudoIntegrateToTimeTime step the model forward linearlyrecomputeIndicesForFluxedSystemsrecordNetCDFFileHistoryshouldShowIntegrationDiagnosticsshowIntegrationFinishDiagnosticsshowIntegrationStartDiagnosticsshowIntegrationTimeDiagnosticssummarizeupdateIntegratorValuesFromCellArrayWe must set the time here. If we are integrating thewriteTimeStepToNetCDFFile