ocean_apply_ale_remap_faces Subroutine

public subroutine ocean_apply_ale_remap_faces(grid, h_old, h_new, u_face_x, v_face_y, method, conserve_ke, zlevel_faces, bnd_extrap, nonunif)

Face-velocity pass of the ALE remap. Remaps u_face_x_layer and v_face_y_layer h_old→h_new using arithmetic-mean face thicknesses and the per-column kernel. Public only for the unit-test suite. Velocity treated as the face “concentration” (analogous to T=hTr/h at centres); per-face conservation sum_k(h_face·u_face) preserved (momentum-conserving). Outer-wall faces take the adjacent cell’s thickness verbatim (no across-cell to average).

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
real(kind=wp), intent(in) :: h_old(:,:,:)
real(kind=wp), intent(in) :: h_new(:,:,:)
real(kind=wp), intent(inout) :: u_face_x(:,:,:)

Eastward face velocity, shape (nx+1, ny, nz).

real(kind=wp), intent(inout) :: v_face_y(:,:,:)

Northward face velocity, shape (nx, ny+1, nz).

integer, intent(in), optional :: method
logical, intent(in), optional :: conserve_ke

Enable the KE-conserving baroclinic-anomaly rescale (default .false. ⇒ momentum-only remap, bit-identical).

logical, intent(in), optional :: zlevel_faces

&vcoord_nml zfixed_closed_faces — build the face columns as min(h_L, h_R) and drop the closed layers, so the remap neither fills nor drains an inert filler. Default .false. ⇒ bit-identical. See remap_x_face_velocity.

logical, intent(in), optional :: bnd_extrap

Linear-exact boundary-cell reconstruction (default .false. ⇒ the PCM flatten, bit-identical).

logical, intent(in), optional :: nonunif

Non-uniform-grid PLM/PPM weights (default .false. ⇒ the equal-thickness specialisations, bit-identical).


Calls

proc~~ocean_apply_ale_remap_faces~~CallsGraph proc~ocean_apply_ale_remap_faces ocean_apply_ale_remap_faces proc~remap_x_face_velocity remap_x_face_velocity proc~ocean_apply_ale_remap_faces->proc~remap_x_face_velocity proc~remap_y_face_velocity remap_y_face_velocity proc~ocean_apply_ale_remap_faces->proc~remap_y_face_velocity local local proc~remap_x_face_velocity->local proc~remap_column remap_column proc~remap_x_face_velocity->proc~remap_column proc~rescale_anomaly_ke rescale_anomaly_ke proc~remap_x_face_velocity->proc~rescale_anomaly_ke proc~remap_y_face_velocity->local proc~remap_y_face_velocity->proc~remap_column proc~remap_y_face_velocity->proc~rescale_anomaly_ke proc~remap_column_pcm remap_column_pcm proc~remap_column->proc~remap_column_pcm proc~remap_column_plm remap_column_plm proc~remap_column->proc~remap_column_plm proc~remap_column_ppm remap_column_ppm proc~remap_column->proc~remap_column_ppm proc~remap_column_ppm_h4 remap_column_ppm_h4 proc~remap_column->proc~remap_column_ppm_h4 proc~remap_column_pqm remap_column_pqm proc~remap_column->proc~remap_column_pqm proc~boundary_half_jump boundary_half_jump proc~remap_column_plm->proc~boundary_half_jump proc~plm_slope_nonuniform plm_slope_nonuniform proc~remap_column_plm->proc~plm_slope_nonuniform proc~remap_column_ppm->proc~remap_column_plm proc~remap_column_ppm->proc~boundary_half_jump proc~ppm_edge_nonuniform ppm_edge_nonuniform proc~remap_column_ppm->proc~ppm_edge_nonuniform proc~ppm_edge_two_cell ppm_edge_two_cell proc~remap_column_ppm->proc~ppm_edge_two_cell proc~ppm_jump_nonuniform ppm_jump_nonuniform proc~remap_column_ppm->proc~ppm_jump_nonuniform proc~remap_column_ppm_h4->proc~remap_column_plm proc~remap_column_ppm_h4->proc~boundary_half_jump proc~remap_column_pqm->proc~remap_column_ppm proc~remap_column_pqm->proc~boundary_half_jump proc~pqm_end_value_h4 pqm_end_value_h4 proc~remap_column_pqm->proc~pqm_end_value_h4 proc~pqm_solve_diag_dominant pqm_solve_diag_dominant proc~remap_column_pqm->proc~pqm_solve_diag_dominant

Variables

Type Visibility Attributes Name Initial
logical, private :: be
logical, private :: ke
integer, private :: m
logical, private :: nu
integer, private :: nx
integer, private :: ny
integer, private :: nz
logical, private :: zf

Source Code

   subroutine ocean_apply_ale_remap_faces(grid, h_old, h_new, u_face_x, v_face_y, method, &
                                          conserve_ke, zlevel_faces, bnd_extrap, nonunif)
      !! Face-velocity pass of the ALE remap. Remaps u_face_x_layer and
      !! v_face_y_layer h_old→h_new using arithmetic-mean face thicknesses and
      !! the per-column kernel. Public only for the unit-test suite.
      !! Velocity treated as the face "concentration" (analogous to T=hTr/h at
      !! centres); per-face conservation sum_k(h_face·u_face) preserved
      !! (momentum-conserving). Outer-wall faces take the adjacent cell's
      !! thickness verbatim (no across-cell to average).
      type(hgrid_t), intent(in) :: grid
      real(wp), intent(in) :: h_old(:, :, :)
      real(wp), intent(in) :: h_new(:, :, :)
      real(wp), intent(inout) :: u_face_x(:, :, :)
         !! Eastward face velocity, shape `(nx+1, ny, nz)`.
      real(wp), intent(inout) :: v_face_y(:, :, :)
         !! Northward face velocity, shape `(nx, ny+1, nz)`.
      integer, intent(in), optional :: method
      logical, intent(in), optional :: conserve_ke
         !! Enable the KE-conserving baroclinic-anomaly rescale (default
         !! `.false.` ⇒ momentum-only remap, bit-identical).
      logical, intent(in), optional :: zlevel_faces
         !! `&vcoord_nml zfixed_closed_faces` — build the face columns as
         !! `min(h_L, h_R)` and drop the closed layers, so the remap
         !! neither fills nor drains an inert filler.  Default `.false.`
         !! ⇒ bit-identical.  See `remap_x_face_velocity`.
      logical, intent(in), optional :: bnd_extrap
         !! Linear-exact boundary-cell reconstruction (default `.false.`
         !! ⇒ the PCM flatten, bit-identical).
      logical, intent(in), optional :: nonunif
         !! Non-uniform-grid PLM/PPM weights (default `.false.` ⇒ the
         !! equal-thickness specialisations, bit-identical).

      integer :: m, nx, ny, nz
      logical :: ke, zf, be, nu
      m = REMAP_PPM
      if (present(method)) m = method
      ke = .false.
      if (present(conserve_ke)) ke = conserve_ke
      zf = .false.
      if (present(zlevel_faces)) zf = zlevel_faces
      be = .false.
      if (present(bnd_extrap)) be = bnd_extrap
      nu = .false.
      if (present(nonunif)) nu = nonunif
      nx = grid%nx_total
      ny = grid%ny_total
      nz = size(u_face_x, 3)

      call remap_x_face_velocity(nx, ny, nz, h_old, h_new, u_face_x, m, ke, zf, be, nu)
      call remap_y_face_velocity(nx, ny, nz, h_old, h_new, v_face_y, m, ke, zf, be, nu)
   end subroutine ocean_apply_ale_remap_faces