MOM6
mom_restart::register_restart_field Interface Reference

Detailed Description

Register fields for restarts.

Definition at line 107 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...
 

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 406 of file MOM_restart.F90.

406  real, target, intent(in) :: f_ptr !< A pointer to the field to be read or written
407  character(len=*), intent(in) :: name !< variable name to be used in the restart file
408  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
409  !! successfully read from the restart file.
410  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in/out)
411  character(len=*), optional, intent(in) :: longname !< variable long name
412  character(len=*), optional, intent(in) :: units !< variable units
413  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
414 
415  type(vardesc) :: vd
416  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
417  "register_restart_field_0d: Module must be initialized before "//&
418  "it is used to register "//trim(name))
419  vd = var_desc(name, units=units, longname=longname, hor_grid='1', &
420  z_grid='1', t_grid=t_grid)
421 
422  call register_restart_field_ptr0d(f_ptr, vd, mandatory, cs)
423 

◆ 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 378 of file MOM_restart.F90.

378  real, dimension(:), target, intent(in) :: f_ptr !< A pointer to the field to be read or written
379  character(len=*), intent(in) :: name !< variable name to be used in the restart file
380  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
381  !! successfully read from the restart file.
382  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in/out)
383  character(len=*), optional, intent(in) :: longname !< variable long name
384  character(len=*), optional, intent(in) :: units !< variable units
385  character(len=*), optional, intent(in) :: hor_grid !< variable horizonal staggering, '1' if absent
386  character(len=*), optional, intent(in) :: z_grid !< variable vertical staggering, 'L' if absent
387  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
388 
389  type(vardesc) :: vd
390  character(len=8) :: hgrid
391 
392  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
393  "register_restart_field_3d: Module must be initialized before "//&
394  "it is used to register "//trim(name))
395  hgrid = '1' ; if (present(hor_grid)) hgrid = hor_grid
396  vd = var_desc(name, units=units, longname=longname, hor_grid=hgrid, &
397  z_grid=z_grid, t_grid=t_grid)
398 
399  call register_restart_field_ptr1d(f_ptr, vd, mandatory, cs)
400 

◆ 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 349 of file MOM_restart.F90.

349  real, dimension(:,:), &
350  target, intent(in) :: f_ptr !< A pointer to the field to be read or written
351  character(len=*), intent(in) :: name !< variable name to be used in the restart file
352  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
353  !! successfully read from the restart file.
354  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in/out)
355  character(len=*), optional, intent(in) :: longname !< variable long name
356  character(len=*), optional, intent(in) :: units !< variable units
357  character(len=*), optional, intent(in) :: hor_grid !< variable horizonal staggering, 'h' if absent
358  character(len=*), optional, intent(in) :: z_grid !< variable vertical staggering, '1' if absent
359  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
360 
361  type(vardesc) :: vd
362  character(len=8) :: Zgrid
363 
364  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
365  "register_restart_field_2d: Module must be initialized before "//&
366  "it is used to register "//trim(name))
367  zgrid = '1' ; if (present(z_grid)) zgrid = z_grid
368  vd = var_desc(name, units=units, longname=longname, hor_grid=hor_grid, &
369  z_grid=zgrid, t_grid=t_grid)
370 
371  call register_restart_field_ptr2d(f_ptr, vd, mandatory, cs)
372 

◆ 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 322 of file MOM_restart.F90.

322  real, dimension(:,:,:), &
323  target, intent(in) :: f_ptr !< A pointer to the field to be read or written
324  character(len=*), intent(in) :: name !< variable name to be used in the restart file
325  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
326  !! successfully read from the restart file.
327  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in/out)
328  character(len=*), optional, intent(in) :: longname !< variable long name
329  character(len=*), optional, intent(in) :: units !< variable units
330  character(len=*), optional, intent(in) :: hor_grid !< variable horizonal staggering, 'h' if absent
331  character(len=*), optional, intent(in) :: z_grid !< variable vertical staggering, 'L' if absent
332  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
333 
334  type(vardesc) :: vd
335 
336  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
337  "register_restart_field_3d: Module must be initialized before "//&
338  "it is used to register "//trim(name))
339  vd = var_desc(name, units=units, longname=longname, hor_grid=hor_grid, &
340  z_grid=z_grid, t_grid=t_grid)
341 
342  call register_restart_field_ptr3d(f_ptr, vd, mandatory, cs)
343 

◆ 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 295 of file MOM_restart.F90.

295  real, dimension(:,:,:,:), &
296  target, intent(in) :: f_ptr !< A pointer to the field to be read or written
297  character(len=*), intent(in) :: name !< variable name to be used in the restart file
298  logical, intent(in) :: mandatory !< If true, the run will abort if this field is not
299  !! successfully read from the restart file.
300  type(MOM_restart_CS), pointer :: CS !< A pointer to a MOM_restart_CS object (intent in/out)
301  character(len=*), optional, intent(in) :: longname !< variable long name
302  character(len=*), optional, intent(in) :: units !< variable units
303  character(len=*), optional, intent(in) :: hor_grid !< variable horizonal staggering, 'h' if absent
304  character(len=*), optional, intent(in) :: z_grid !< variable vertical staggering, 'L' if absent
305  character(len=*), optional, intent(in) :: t_grid !< time description: s, p, or 1, 's' if absent
306 
307  type(vardesc) :: vd
308 
309  if (.not.associated(cs)) call mom_error(fatal, "MOM_restart: " // &
310  "register_restart_field_4d: Module must be initialized before "//&
311  "it is used to register "//trim(name))
312  vd = var_desc(name, units=units, longname=longname, hor_grid=hor_grid, &
313  z_grid=z_grid, t_grid=t_grid)
314 
315  call register_restart_field_ptr4d(f_ptr, vd, mandatory, cs)
316 

◆ 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 262 of file MOM_restart.F90.

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

◆ 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 232 of file MOM_restart.F90.

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

◆ 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 201 of file MOM_restart.F90.

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

◆ 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 139 of file MOM_restart.F90.

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

◆ 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 170 of file MOM_restart.F90.

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

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