MOM6
mom_restart::register_restart_field Interface Reference

Detailed Description

Register fields for restarts.

Definition at line 111 of file MOM_restart.F90.

Private functions

subroutine register_restart_field_ptr4d (f_ptr, var_desc, mandatory, CS)
 Register a 4-d field for restarts, providing the metadata in a structure. More...
 
subroutine register_restart_field_4d (f_ptr, name, mandatory, CS, longname, units, hor_grid, z_grid, t_grid)
 Register a 4-d field for restarts, providing the metadata as individual arguments. More...
 
subroutine register_restart_field_ptr3d (f_ptr, var_desc, mandatory, CS)
 Register a 3-d field for restarts, providing the metadata in a structure. More...
 
subroutine register_restart_field_3d (f_ptr, name, mandatory, CS, longname, units, hor_grid, z_grid, t_grid)
 Register a 3-d field for restarts, providing the metadata as individual arguments. More...
 
subroutine register_restart_field_ptr2d (f_ptr, var_desc, mandatory, CS)
 Register a 2-d field for restarts, providing the metadata in a structure. More...
 
subroutine register_restart_field_2d (f_ptr, name, mandatory, CS, longname, units, hor_grid, z_grid, t_grid)
 Register a 2-d field for restarts, providing the metadata as individual arguments. More...
 
subroutine register_restart_field_ptr1d (f_ptr, var_desc, mandatory, CS)
 Register a 1-d field for restarts, providing the metadata in a structure. More...
 
subroutine register_restart_field_1d (f_ptr, name, mandatory, CS, longname, units, hor_grid, z_grid, t_grid)
 Register a 1-d field for restarts, providing the metadata as individual arguments. More...
 
subroutine register_restart_field_ptr0d (f_ptr, var_desc, mandatory, CS)
 Register a 0-d field for restarts, providing the metadata in a structure. More...
 
subroutine register_restart_field_0d (f_ptr, name, mandatory, CS, longname, units, t_grid)
 Register a 0-d field for restarts, providing the metadata as individual arguments. More...
 

Detailed Description

Register fields for restarts.

Definition at line 111 of file MOM_restart.F90.

Functions and subroutines

◆ register_restart_field_0d()

subroutine mom_restart::register_restart_field::register_restart_field_0d ( real, intent(in), target  f_ptr,
character(len=*), intent(in)  name,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
character(len=*), intent(in), optional  t_grid 
)
private

Register a 0-d field for restarts, providing the metadata as individual arguments.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]namevariable name to be used in the restart file
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)
[in]longnamevariable long name
[in]unitsvariable units
[in]t_gridtime description: s, p, or 1, 's' if absent

Definition at line 478 of file MOM_restart.F90.

478  real, target, intent(in) :: f_ptr !< A pointer to the field to be read or written
479  character(len=*), intent(in) :: name !< variable name to be used in the restart file
480  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
481  !! successfully read from the restart file.
482  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
483  character(len=*), optional, intent(in) :: longname !< variable long name
484  character(len=*), optional, intent(in) :: units !< variable units
485  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
486 
487  type(vardesc) :: vd
488  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
489  "register_restart_field_0d: Module must be initialized before "//&
490  "it is used to register "//trim(name))
491  vd = var_desc(name, units=units, longname=longname, hor_grid='1', &
492  z_grid='1', t_grid=t_grid)
493 
494  call register_restart_field_ptr0d(f_ptr, vd, mandatory, cs)
495 

◆ register_restart_field_1d()

subroutine mom_restart::register_restart_field::register_restart_field_1d ( real, dimension(:), intent(in), target  f_ptr,
character(len=*), intent(in)  name,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
character(len=*), intent(in), optional  hor_grid,
character(len=*), intent(in), optional  z_grid,
character(len=*), intent(in), optional  t_grid 
)
private

Register a 1-d field for restarts, providing the metadata as individual arguments.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]namevariable name to be used in the restart file
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)
[in]longnamevariable long name
[in]unitsvariable units
[in]hor_gridvariable horizonal staggering, '1' if absent
[in]z_gridvariable vertical staggering, 'L' if absent
[in]t_gridtime description: s, p, or 1, 's' if absent

Definition at line 450 of file MOM_restart.F90.

450  real, dimension(:), target, intent(in) :: f_ptr !< A pointer to the field to be read or written
451  character(len=*), intent(in) :: name !< variable name to be used in the restart file
452  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
453  !! successfully read from the restart file.
454  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
455  character(len=*), optional, intent(in) :: longname !< variable long name
456  character(len=*), optional, intent(in) :: units !< variable units
457  character(len=*), optional, intent(in) :: hor_grid !< variable horizonal staggering, '1' if absent
458  character(len=*), optional, intent(in) :: z_grid !< variable vertical staggering, 'L' if absent
459  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
460 
461  type(vardesc) :: vd
462  character(len=8) :: hgrid
463 
464  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
465  "register_restart_field_3d: Module must be initialized before "//&
466  "it is used to register "//trim(name))
467  hgrid = '1' ; if (present(hor_grid)) hgrid = hor_grid
468  vd = var_desc(name, units=units, longname=longname, hor_grid=hgrid, &
469  z_grid=z_grid, t_grid=t_grid)
470 
471  call register_restart_field_ptr1d(f_ptr, vd, mandatory, cs)
472 

◆ register_restart_field_2d()

subroutine mom_restart::register_restart_field::register_restart_field_2d ( real, dimension(:,:), intent(in), target  f_ptr,
character(len=*), intent(in)  name,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
character(len=*), intent(in), optional  hor_grid,
character(len=*), intent(in), optional  z_grid,
character(len=*), intent(in), optional  t_grid 
)
private

Register a 2-d field for restarts, providing the metadata as individual arguments.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]namevariable name to be used in the restart file
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)
[in]longnamevariable long name
[in]unitsvariable units
[in]hor_gridvariable horizonal staggering, 'h' if absent
[in]z_gridvariable vertical staggering, '1' if absent
[in]t_gridtime description: s, p, or 1, 's' if absent

Definition at line 421 of file MOM_restart.F90.

421  real, dimension(:,:), &
422  target, intent(in) :: f_ptr !< A pointer to the field to be read or written
423  character(len=*), intent(in) :: name !< variable name to be used in the restart file
424  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
425  !! successfully read from the restart file.
426  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
427  character(len=*), optional, intent(in) :: longname !< variable long name
428  character(len=*), optional, intent(in) :: units !< variable units
429  character(len=*), optional, intent(in) :: hor_grid !< variable horizonal staggering, 'h' if absent
430  character(len=*), optional, intent(in) :: z_grid !< variable vertical staggering, '1' if absent
431  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
432 
433  type(vardesc) :: vd
434  character(len=8) :: zgrid
435 
436  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
437  "register_restart_field_2d: Module must be initialized before "//&
438  "it is used to register "//trim(name))
439  zgrid = '1' ; if (present(z_grid)) zgrid = z_grid
440  vd = var_desc(name, units=units, longname=longname, hor_grid=hor_grid, &
441  z_grid=zgrid, t_grid=t_grid)
442 
443  call register_restart_field_ptr2d(f_ptr, vd, mandatory, cs)
444 

◆ register_restart_field_3d()

subroutine mom_restart::register_restart_field::register_restart_field_3d ( real, dimension(:,:,:), intent(in), target  f_ptr,
character(len=*), intent(in)  name,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
character(len=*), intent(in), optional  hor_grid,
character(len=*), intent(in), optional  z_grid,
character(len=*), intent(in), optional  t_grid 
)
private

Register a 3-d field for restarts, providing the metadata as individual arguments.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]namevariable name to be used in the restart file
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)
[in]longnamevariable long name
[in]unitsvariable units
[in]hor_gridvariable horizonal staggering, 'h' if absent
[in]z_gridvariable vertical staggering, 'L' if absent
[in]t_gridtime description: s, p, or 1, 's' if absent

Definition at line 394 of file MOM_restart.F90.

394  real, dimension(:,:,:), &
395  target, intent(in) :: f_ptr !< A pointer to the field to be read or written
396  character(len=*), intent(in) :: name !< variable name to be used in the restart file
397  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
398  !! successfully read from the restart file.
399  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
400  character(len=*), optional, intent(in) :: longname !< variable long name
401  character(len=*), optional, intent(in) :: units !< variable units
402  character(len=*), optional, intent(in) :: hor_grid !< variable horizonal staggering, 'h' if absent
403  character(len=*), optional, intent(in) :: z_grid !< variable vertical staggering, 'L' if absent
404  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
405 
406  type(vardesc) :: vd
407 
408  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
409  "register_restart_field_3d: Module must be initialized before "//&
410  "it is used to register "//trim(name))
411  vd = var_desc(name, units=units, longname=longname, hor_grid=hor_grid, &
412  z_grid=z_grid, t_grid=t_grid)
413 
414  call register_restart_field_ptr3d(f_ptr, vd, mandatory, cs)
415 

◆ register_restart_field_4d()

subroutine mom_restart::register_restart_field::register_restart_field_4d ( real, dimension(:,:,:,:), intent(in), target  f_ptr,
character(len=*), intent(in)  name,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS,
character(len=*), intent(in), optional  longname,
character(len=*), intent(in), optional  units,
character(len=*), intent(in), optional  hor_grid,
character(len=*), intent(in), optional  z_grid,
character(len=*), intent(in), optional  t_grid 
)
private

Register a 4-d field for restarts, providing the metadata as individual arguments.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]namevariable name to be used in the restart file
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)
[in]longnamevariable long name
[in]unitsvariable units
[in]hor_gridvariable horizonal staggering, 'h' if absent
[in]z_gridvariable vertical staggering, 'L' if absent
[in]t_gridtime description: s, p, or 1, 's' if absent

Definition at line 367 of file MOM_restart.F90.

367  real, dimension(:,:,:,:), &
368  target, intent(in) :: f_ptr !< A pointer to the field to be read or written
369  character(len=*), intent(in) :: name !< variable name to be used in the restart file
370  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
371  !! successfully read from the restart file.
372  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
373  character(len=*), optional, intent(in) :: longname !< variable long name
374  character(len=*), optional, intent(in) :: units !< variable units
375  character(len=*), optional, intent(in) :: hor_grid !< variable horizonal staggering, 'h' if absent
376  character(len=*), optional, intent(in) :: z_grid !< variable vertical staggering, 'L' if absent
377  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
378 
379  type(vardesc) :: vd
380 
381  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
382  "register_restart_field_4d: Module must be initialized before "//&
383  "it is used to register "//trim(name))
384  vd = var_desc(name, units=units, longname=longname, hor_grid=hor_grid, &
385  z_grid=z_grid, t_grid=t_grid)
386 
387  call register_restart_field_ptr4d(f_ptr, vd, mandatory, cs)
388 

◆ register_restart_field_ptr0d()

subroutine mom_restart::register_restart_field::register_restart_field_ptr0d ( real, intent(in), target  f_ptr,
type(vardesc), intent(in)  var_desc,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS 
)
private

Register a 0-d field for restarts, providing the metadata in a structure.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]var_descA structure with metadata about this variable
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)

Definition at line 273 of file MOM_restart.F90.

273  real, target, intent(in) :: f_ptr !< A pointer to the field to be read or written
274  type(vardesc), intent(in) :: var_desc !< A structure with metadata about this variable
275  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
276  !! successfully read from the restart file.
277  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
278 
279  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
280  "register_restart_field: Module must be initialized before it is used.")
281 
282  cs%novars = cs%novars+1
283  if (cs%novars > cs%max_fields) return ! This is an error that will be reported
284  ! once the total number of fields is known.
285 
286  cs%restart_field(cs%novars)%vars = var_desc
287  cs%restart_field(cs%novars)%mand_var = mandatory
288  cs%restart_field(cs%novars)%initialized = .false.
289  call query_vardesc(cs%restart_field(cs%novars)%vars, &
290  name=cs%restart_field(cs%novars)%var_name, &
291  caller="register_restart_field_ptr0d")
292 
293  cs%var_ptr0d(cs%novars)%p => f_ptr
294  cs%var_ptr4d(cs%novars)%p => null()
295  cs%var_ptr3d(cs%novars)%p => null()
296  cs%var_ptr2d(cs%novars)%p => null()
297  cs%var_ptr1d(cs%novars)%p => null()
298 

◆ register_restart_field_ptr1d()

subroutine mom_restart::register_restart_field::register_restart_field_ptr1d ( real, dimension(:), intent(in), target  f_ptr,
type(vardesc), intent(in)  var_desc,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS 
)
private

Register a 1-d field for restarts, providing the metadata in a structure.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]var_descA structure with metadata about this variable
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)

Definition at line 243 of file MOM_restart.F90.

243  real, dimension(:), target, intent(in) :: f_ptr !< A pointer to the field to be read or written
244  type(vardesc), intent(in) :: var_desc !< A structure with metadata about this variable
245  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
246  !! successfully read from the restart file.
247  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
248 
249  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
250  "register_restart_field: Module must be initialized before it is used.")
251 
252  cs%novars = cs%novars+1
253  if (cs%novars > cs%max_fields) return ! This is an error that will be reported
254  ! once the total number of fields is known.
255 
256  cs%restart_field(cs%novars)%vars = var_desc
257  cs%restart_field(cs%novars)%mand_var = mandatory
258  cs%restart_field(cs%novars)%initialized = .false.
259  call query_vardesc(cs%restart_field(cs%novars)%vars, &
260  name=cs%restart_field(cs%novars)%var_name, &
261  caller="register_restart_field_ptr1d")
262 
263  cs%var_ptr1d(cs%novars)%p => f_ptr
264  cs%var_ptr4d(cs%novars)%p => null()
265  cs%var_ptr3d(cs%novars)%p => null()
266  cs%var_ptr2d(cs%novars)%p => null()
267  cs%var_ptr0d(cs%novars)%p => null()
268 

◆ register_restart_field_ptr2d()

subroutine mom_restart::register_restart_field::register_restart_field_ptr2d ( real, dimension(:,:), intent(in), target  f_ptr,
type(vardesc), intent(in)  var_desc,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS 
)
private

Register a 2-d field for restarts, providing the metadata in a structure.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]var_descA structure with metadata about this variable
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)

Definition at line 212 of file MOM_restart.F90.

212  real, dimension(:,:), &
213  target, intent(in) :: f_ptr !< A pointer to the field to be read or written
214  type(vardesc), intent(in) :: var_desc !< A structure with metadata about this variable
215  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
216  !! successfully read from the restart file.
217  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
218 
219  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
220  "register_restart_field: Module must be initialized before it is used.")
221 
222  cs%novars = cs%novars+1
223  if (cs%novars > cs%max_fields) return ! This is an error that will be reported
224  ! once the total number of fields is known.
225 
226  cs%restart_field(cs%novars)%vars = var_desc
227  cs%restart_field(cs%novars)%mand_var = mandatory
228  cs%restart_field(cs%novars)%initialized = .false.
229  call query_vardesc(cs%restart_field(cs%novars)%vars, &
230  name=cs%restart_field(cs%novars)%var_name, &
231  caller="register_restart_field_ptr2d")
232 
233  cs%var_ptr2d(cs%novars)%p => f_ptr
234  cs%var_ptr4d(cs%novars)%p => null()
235  cs%var_ptr3d(cs%novars)%p => null()
236  cs%var_ptr1d(cs%novars)%p => null()
237  cs%var_ptr0d(cs%novars)%p => null()
238 

◆ register_restart_field_ptr3d()

subroutine mom_restart::register_restart_field::register_restart_field_ptr3d ( real, dimension(:,:,:), intent(in), target  f_ptr,
type(vardesc), intent(in)  var_desc,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS 
)
private

Register a 3-d field for restarts, providing the metadata in a structure.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]var_descA structure with metadata about this variable
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)

Definition at line 150 of file MOM_restart.F90.

150  real, dimension(:,:,:), &
151  target, intent(in) :: f_ptr !< A pointer to the field to be read or written
152  type(vardesc), intent(in) :: var_desc !< A structure with metadata about this variable
153  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
154  !! successfully read from the restart file.
155  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
156 
157  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
158  "register_restart_field: Module must be initialized before it is used.")
159 
160  cs%novars = cs%novars+1
161  if (cs%novars > cs%max_fields) return ! This is an error that will be reported
162  ! once the total number of fields is known.
163 
164  cs%restart_field(cs%novars)%vars = var_desc
165  cs%restart_field(cs%novars)%mand_var = mandatory
166  cs%restart_field(cs%novars)%initialized = .false.
167  call query_vardesc(cs%restart_field(cs%novars)%vars, &
168  name=cs%restart_field(cs%novars)%var_name, &
169  caller="register_restart_field_ptr3d")
170 
171  cs%var_ptr3d(cs%novars)%p => f_ptr
172  cs%var_ptr4d(cs%novars)%p => null()
173  cs%var_ptr2d(cs%novars)%p => null()
174  cs%var_ptr1d(cs%novars)%p => null()
175  cs%var_ptr0d(cs%novars)%p => null()
176 

◆ register_restart_field_ptr4d()

subroutine mom_restart::register_restart_field::register_restart_field_ptr4d ( real, dimension(:,:,:,:), intent(in), target  f_ptr,
type(vardesc), intent(in)  var_desc,
logical, intent(in)  mandatory,
type(mom_restart_cs), pointer  CS 
)
private

Register a 4-d field for restarts, providing the metadata in a structure.

Parameters
[in]f_ptrA pointer to the field to be read or written
[in]var_descA structure with metadata about this variable
[in]mandatoryIf true, the run will abort if this field is not successfully read from the restart file.
csA pointer to a MOM_restart_CS object (intent in/out)

Definition at line 181 of file MOM_restart.F90.

181  real, dimension(:,:,:,:), &
182  target, intent(in) :: f_ptr !< A pointer to the field to be read or written
183  type(vardesc), intent(in) :: var_desc !< A structure with metadata about this variable
184  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
185  !! successfully read from the restart file.
186  type(mom_restart_cs), pointer :: cs !< A pointer to a MOM_restart_CS object (intent in/out)
187 
188  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart " // &
189  "register_restart_field: Module must be initialized before it is used.")
190 
191  cs%novars = cs%novars+1
192  if (cs%novars > cs%max_fields) return ! This is an error that will be reported
193  ! once the total number of fields is known.
194 
195  cs%restart_field(cs%novars)%vars = var_desc
196  cs%restart_field(cs%novars)%mand_var = mandatory
197  cs%restart_field(cs%novars)%initialized = .false.
198  call query_vardesc(cs%restart_field(cs%novars)%vars, &
199  name=cs%restart_field(cs%novars)%var_name, &
200  caller="register_restart_field_ptr4d")
201 
202  cs%var_ptr4d(cs%novars)%p => f_ptr
203  cs%var_ptr3d(cs%novars)%p => null()
204  cs%var_ptr2d(cs%novars)%p => null()
205  cs%var_ptr1d(cs%novars)%p => null()
206  cs%var_ptr0d(cs%novars)%p => null()
207 

The documentation for this interface was generated from the following file: