ocean_data_input_register_2d Subroutine

public subroutine ocean_data_input_register_2d(this, file, var, grid, dest_n1, dest_n2, dest_i0, dest_j0, id, time_mode, cycle_period, t_offset, t_scale, scale, add_offset, oor, nx_extra, ny_extra, ierr)

Register a 2-D time-varying field f(x, y, t). Opens the file now and keeps the handle for the run. See the module docstring for the destination-offset contract.

nx_extra/ny_extra (default 0) widen this rank’s slab by that many values in x/y. They exist for C-grid FACE fields: an x-face array spans nx_phys + 1 faces, not nx_phys, and the trailing face is OWNED by this rank (the west/south-owns-the-seam rule), so no exchange can supply it — it has to come from the file. A cell-centred field leaves both at 0.

Arguments

Type IntentOptional Attributes Name
class(ocean_data_input_t), intent(inout) :: this
character(len=*), intent(in) :: file
character(len=*), intent(in) :: var
type(hgrid_t), intent(in) :: grid
integer, intent(in) :: dest_n1
integer, intent(in) :: dest_n2
integer, intent(in) :: dest_i0
integer, intent(in) :: dest_j0
integer, intent(out) :: id
character(len=*), intent(in), optional :: time_mode
real(kind=wp), intent(in), optional :: cycle_period
real(kind=wp), intent(in), optional :: t_offset
real(kind=wp), intent(in), optional :: t_scale
real(kind=wp), intent(in), optional :: scale
real(kind=wp), intent(in), optional :: add_offset
integer, intent(in), optional :: oor
integer, intent(in), optional :: nx_extra
integer, intent(in), optional :: ny_extra
integer, intent(out), optional :: ierr

Non-zero (OCEAN_STATUS_ERR_SETUP/OCEAN_STATUS_ERR_IO) on a registry/file/dimension failure when present; absent behaves as today (error stop).


Calls

proc~~ocean_data_input_register_2d~~CallsGraph proc~ocean_data_input_register_2d ocean_data_input_register_2d proc~register_common register_common proc~ocean_data_input_register_2d->proc~register_common error error proc~register_common->error nf90_inq_varid nf90_inq_varid proc~register_common->nf90_inq_varid nf90_inquire_dimension nf90_inquire_dimension proc~register_common->nf90_inquire_dimension nf90_inquire_variable nf90_inquire_variable proc~register_common->nf90_inquire_variable proc~data_input_read_slab_impl data_input_read_slab_impl proc~register_common->proc~data_input_read_slab_impl proc~data_input_time_mode_from_string data_input_time_mode_from_string proc~register_common->proc~data_input_time_mode_from_string proc~data_input_time_scale_from_units data_input_time_scale_from_units proc~register_common->proc~data_input_time_scale_from_units proc~dims_geometry_ok dims_geometry_ok proc~register_common->proc~dims_geometry_ok proc~fail fail proc~register_common->proc~fail proc~nc_check nc_check proc~register_common->proc~nc_check proc~nc_close nc_close proc~register_common->proc~nc_close proc~nc_get_att_text nc_get_att_text proc~register_common->proc~nc_get_att_text proc~nc_get_var_1d nc_get_var_1d proc~register_common->proc~nc_get_var_1d proc~nc_open_read nc_open_read proc~register_common->proc~nc_open_read proc~reg_io_ok reg_io_ok proc~register_common->proc~reg_io_ok proc~resolve_time_var resolve_time_var proc~register_common->proc~resolve_time_var to_string to_string proc~register_common->to_string proc~data_input_workspace_ensure data_input_workspace_ensure proc~data_input_read_slab_impl->proc~data_input_workspace_ensure proc~nc_get_var_slab_3d nc_get_var_slab_3d proc~data_input_read_slab_impl->proc~nc_get_var_slab_3d proc~data_input_time_mode_from_string->error to_lower to_lower proc~data_input_time_mode_from_string->to_lower proc~data_input_time_scale_from_units->to_lower proc~fail->error proc~error_ring_push error_ring_push proc~fail->proc~error_ring_push proc~nc_check->proc~fail nf90_strerror nf90_strerror proc~nc_check->nf90_strerror proc~nc_close->proc~nc_check nf90_close nf90_close proc~nc_close->nf90_close nf90_get_att nf90_get_att proc~nc_get_att_text->nf90_get_att proc~nc_get_var_1d->proc~nc_check nf90_get_var nf90_get_var proc~nc_get_var_1d->nf90_get_var proc~nc_open_read->proc~nc_check nf90_open nf90_open proc~nc_open_read->nf90_open proc~reg_io_ok->proc~nc_close proc~resolve_time_var->nf90_inq_varid proc~resolve_time_var->nf90_inquire_dimension proc~nc_get_var_slab_3d->proc~nc_check proc~nc_get_var_slab_3d->nf90_get_var

Called by

proc~~ocean_data_input_register_2d~~CalledByGraph proc~ocean_data_input_register_2d ocean_data_input_register_2d proc~ocean_data_input_load_static_2d ocean_data_input_load_static_2d proc~ocean_data_input_load_static_2d->proc~ocean_data_input_register_2d proc~register_tag register_tag proc~register_tag->proc~ocean_data_input_register_2d proc~ocean_data_forcing_configure ocean_data_forcing_configure proc~ocean_data_forcing_configure->proc~register_tag proc~seed_cavity_draft seed_cavity_draft proc~seed_cavity_draft->proc~ocean_data_input_load_static_2d proc~engine_setup engine_setup proc~engine_setup->proc~ocean_data_forcing_configure proc~ocean_state_seed_from_cfg ocean_state_seed_from_cfg proc~engine_setup->proc~ocean_state_seed_from_cfg proc~ocean_state_seed_from_cfg->proc~seed_cavity_draft proc~complete_ocean_create complete_ocean_create proc~complete_ocean_create->proc~engine_setup proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_setup proc~driver_validate driver_validate proc~driver_validate->proc~engine_setup proc~driver_run driver_run proc~driver_run->proc~driver_run_ocean proc~rdb_ocean_create_finalize rdb_ocean_create_finalize proc~rdb_ocean_create_finalize->proc~complete_ocean_create proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~complete_ocean_create

Variables

Type Visibility Attributes Name Initial
integer, private :: nxe
integer, private :: nye

Source Code

   subroutine ocean_data_input_register_2d(this, file, var, grid, dest_n1, dest_n2, &
                                           dest_i0, dest_j0, id, time_mode, cycle_period, &
                                           t_offset, t_scale, scale, add_offset, oor, &
                                           nx_extra, ny_extra, ierr)
      !! Register a 2-D time-varying field `f(x, y, t)`.  Opens the file
      !! now and keeps the handle for the run.  See the module docstring
      !! for the destination-offset contract.
      !!
      !! `nx_extra`/`ny_extra` (default 0) widen this rank's slab by that
      !! many values in x/y.  They exist for C-grid FACE fields: an
      !! x-face array spans `nx_phys + 1` faces, not `nx_phys`, and the
      !! trailing face is OWNED by this rank (the west/south-owns-the-seam
      !! rule), so no exchange can supply it — it has to come from the
      !! file.  A cell-centred field leaves both at 0.
      class(ocean_data_input_t), intent(inout) :: this
      character(len=*), intent(in) :: file, var
      type(hgrid_t), intent(in) :: grid
      integer, intent(in) :: dest_n1, dest_n2, dest_i0, dest_j0
      integer, intent(out) :: id
      character(len=*), intent(in), optional :: time_mode
      real(wp), intent(in), optional :: cycle_period, t_offset, t_scale, scale, add_offset
      integer, intent(in), optional :: oor
      integer, intent(in), optional :: nx_extra, ny_extra
      integer, intent(out), optional :: ierr
         !! Non-zero (`OCEAN_STATUS_ERR_SETUP`/`OCEAN_STATUS_ERR_IO`) on a
         !! registry/file/dimension failure when present; absent behaves
         !! as today (`error stop`).

      integer :: nxe, nye

      nxe = 0
      if (present(nx_extra)) nxe = nx_extra
      nye = 0
      if (present(ny_extra)) nye = ny_extra

      call register_common(this, file, var, .false., &
                           grid%i_offset_global + 1, grid%j_offset_global + 1, &
                           grid%nx_phys + nxe, grid%ny_phys + nye, 1, &
                           dest_i0, dest_j0, dest_n1, dest_n2, 1, &
                           time_mode, cycle_period, t_offset, t_scale, scale, add_offset, oor, id, &
                           ierr=ierr)
   end subroutine ocean_data_input_register_2d