rompy.swan.components.lockup.HOTFILE#
- pydantic model rompy.swan.components.lockup.HOTFILE[source]#
Write intermediate results.
HOTFILE 'fname' ->FREE|UNFORMATTED
This command can be used to write the entire wave field at the end of a computation to a so-called hotfile, to be used as initial condition in a subsequent SWAN run (see command INITIAL HOTSTART). This command must be entered immediately after a COMPUTE command.
The user may choose the format of the hotfile to be written either as free or unformatted. If the free format is chosen, then this format is identical to the format of the files written by the SPECOUT command (option SPEC2D). This hotfile is therefore an ASCII file which is human readable.
An unformatted (or binary) file usually requires less space on your computer than an ASCII file. Moreover, it can be readed by a subsequent SWAN run much faster than an ASCII file. Especially, when the hotfile might become a big file, the choice for unformatted is preferable. Note that your compiler and OS should follow the same ABI (Application Binary Interface) conventions (e.g. word size, endianness), so that unformatted hotfiles may transfer properly between different OS or platforms. This implies that the present and subsequent SWAN runs do not have to be carried out on the same operating system (e.g. Windows, Linux) or on the same computer, provided that distinct ABI conventions have been followed.
Note
For parallel MPI runs, more than one hotfile will be generated depending on the number of processors (fname-001, fname-002, etc).
Examples
In [1]: from rompy.swan.components.lockup import HOTFILE In [2]: hotfile = HOTFILE(fname="hotfile.swn") In [3]: print(hotfile.render()) HOTFILE fname='hotfile.swn' In [4]: hotfile = HOTFILE(fname="hotfile.dat", format="unformatted") In [5]: print(hotfile.render()) HOTFILE fname='hotfile.dat' UNFORMATTED
Show JSON schema
{ "title": "HOTFILE", "description": "Write intermediate results.\n\n.. code-block:: text\n\n HOTFILE 'fname' ->FREE|UNFORMATTED\n\nThis command can be used to write the entire wave field at the end of a computation\nto a so-called hotfile, to be used as initial condition in a subsequent SWAN run\n(see command `INITIAL HOTSTART`). This command must be entered immediately after a\n`COMPUTE` command.\n\nThe user may choose the format of the hotfile to be written either as free or\nunformatted. If the free format is chosen, then this format is identical to the\nformat of the files written by the `SPECOUT` command (option `SPEC2D`). This\nhotfile is therefore an ASCII file which is human readable.\n\nAn unformatted (or binary) file usually requires less space on your computer than\nan ASCII file. Moreover, it can be readed by a subsequent SWAN run much faster than\nan ASCII file. Especially, when the hotfile might become a big file, the choice for\nunformatted is preferable. Note that your compiler and OS should follow the same\nABI (Application Binary Interface) conventions (e.g. word size, endianness), so\nthat unformatted hotfiles may transfer properly between different OS or platforms.\nThis implies that the present and subsequent SWAN runs do not have to be carried\nout on the same operating system (e.g. Windows, Linux) or on the same computer,\nprovided that distinct ABI conventions have been followed.\n\nNote\n----\nFor parallel MPI runs, more than one hotfile will be generated depending on the\nnumber of processors (`fname-001`, `fname-002`, etc).\n\nExamples\n--------\n\n.. ipython:: python\n :okwarning:\n\n from rompy.swan.components.lockup import HOTFILE\n hotfile = HOTFILE(fname=\"hotfile.swn\")\n print(hotfile.render())\n hotfile = HOTFILE(fname=\"hotfile.dat\", format=\"unformatted\")\n print(hotfile.render())", "type": "object", "properties": { "model_type": { "default": "hotfile", "description": "Model type discriminator", "enum": [ "hotfile", "HOTFILE" ], "title": "Model Type", "type": "string" }, "fname": { "description": "Name of the file to which the wave field is written", "format": "path", "title": "Fname", "type": "string" }, "format": { "anyOf": [ { "enum": [ "free", "unformatted" ], "type": "string" }, { "type": "null" } ], "default": null, "description": "Choose between free (SWAN ASCII) or unformatted (binary) format", "title": "Format" } }, "additionalProperties": false, "required": [ "fname" ] }
- Fields:
- Validators:
- field fname: Path [Required]#
Name of the file to which the wave field is written
- Validated by:
- field format: Literal['free', 'unformatted'] | None = None#
Choose between free (SWAN ASCII) or unformatted (binary) format
- field model_type: Literal['hotfile', 'HOTFILE'] = 'hotfile'#
Model type discriminator