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,nonlinearFlux=QGPVE(wvt,u_damp=wvt.uvMax));
You can also initialize a model from existing output,
model = WVModel.modelFromFile('SomeFile.nc');
Topics
- Initialization
WVModelInitialize a model from a WVTransform instancemodelFromFileInitialize a model from an existing file
- Model Properties
initialTimeInitial model time (seconds)linearDynamicsIndicates whether or not the model is using linear or nonlinear dynamics.nonlinearFluxOperationThe operation responsible for computing the nonlinear flux of the modeltCurrent model time (seconds)wvtThe WVTransform instance the represents the ocean state.
- Integration
incrementsWrittenToFileoutput index of the current/most recent step.integrateToTimeTime step the model forward to the requested time.outputIntervalModel output interval (seconds)setupIntegratorCustomize the time-steppingtimeOfLastIncrementWrittenToFileoutput index of the current/most recent step.
- 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.createNetCDFFileForModelOutputCreate a NetCDF file for model outputncfileReference to the NetCDFFile being used for model outputnetCDFOutputVariablesList of all StateVariables being written to NetCDF fileremoveNetCDFOutputVariablesRemove 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.
- Other
closeNetCDFFiledidBlowUpdidInitializeNetCDFFiledidSetupIntegratorfinalIntegrationTimeset only during an integrationinitialConditionOnlyVariablesinitialOutputTimeoutput time corresponding to outputIndex=1 (set on instance initialization)initializeParticleStorageintegrationInformTimeintegrationLastInformModelTimeintegrationLastInformWallTimewall clock, to keep track of the expected integration timeintegrationStartTimeintegratorTypeArray integratornetcdfVariableMapForParticleWithNamemap to a map containing the particle variables, e.g. particlesWithName(‘float’) returns a map containing keys (‘x’,’y’,’z’) at minimumopenNetCDFFileForTimeSteppingparticlecell array containing particle structsparticleIndexWithNamemap from particle name to cell array indexrecordNetCDFFileHistoryshouldShowIntegrationDiagnosticsshowIntegrationFinishDiagnosticsshowIntegrationStartDiagnosticsshowIntegrationTimeDiagnosticstimeSeriesVariablestracerArraytracerIndexWithNameupdateParticleTrackedFieldsOne special thing we have to do is log the particlewriteParticleDataAtTimeIndexwriteTimeStepToNetCDFFile