MOM6
mom_ale_sponge::set_up_ale_sponge_vel_field Interface Reference

Detailed Description

This subroutine stores the reference profile at u and v points for a vector.

Definition at line 39 of file MOM_ALE_sponge.F90.

Private functions

subroutine set_up_ale_sponge_vel_field_fixed (u_val, v_val, G, u_ptr, v_ptr, CS)
 This subroutine stores the reference profile at u and v points for the variable whose address is given by u_ptr and v_ptr. More...
 
subroutine set_up_ale_sponge_vel_field_varying (filename_u, fieldname_u, filename_v, fieldname_v, Time, G, US, CS, u_ptr, v_ptr)
 This subroutine stores the reference profile at uand v points for the variable whose address is given by u_ptr and v_ptr. More...
 

Functions and subroutines

◆ set_up_ale_sponge_vel_field_fixed()

subroutine mom_ale_sponge::set_up_ale_sponge_vel_field::set_up_ale_sponge_vel_field_fixed ( real, dimension( g %isdb: g %iedb, g %jsd: g %jed,cs%nz_data), intent(in)  u_val,
real, dimension( g %isd: g %ied, g %jsdb: g %jedb,cs%nz_data), intent(in)  v_val,
type(ocean_grid_type), intent(in)  G,
real, dimension( g %isdb: g %iedb, g %jsd: g %jed, g %ke), intent(in), target  u_ptr,
real, dimension( g %isd: g %ied, g %jsdb: g %jedb, g %ke), intent(in), target  v_ptr,
type(ale_sponge_cs), pointer  CS 
)
private

This subroutine stores the reference profile at u and v points for the variable whose address is given by u_ptr and v_ptr.

Parameters
[in]gGrid structure (in).
csSponge structure (in/out).
[in]u_valu field to be used in the sponge, it has arbritary number of layers.
[in]v_valv field to be used in the sponge, it has arbritary number of layers.
[in]u_ptru pointer to the field to be damped
[in]v_ptrv pointer to the field to be damped

Definition at line 636 of file MOM_ALE_sponge.F90.

636  type(ocean_grid_type), intent(in) :: G !< Grid structure (in).
637  type(ALE_sponge_CS), pointer :: CS !< Sponge structure (in/out).
638  real, dimension(SZIB_(G),SZJ_(G),CS%nz_data), &
639  intent(in) :: u_val !< u field to be used in the sponge, it has arbritary number of layers.
640  real, dimension(SZI_(G),SZJB_(G),CS%nz_data), &
641  intent(in) :: v_val !< v field to be used in the sponge, it has arbritary number of layers.
642  real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), target, intent(in) :: u_ptr !< u pointer to the field to be damped
643  real, dimension(SZI_(G),SZJB_(G),SZK_(G)), target, intent(in) :: v_ptr !< v pointer to the field to be damped
644 
645  integer :: j, k, col
646  character(len=256) :: mesg ! String for error messages
647 
648  if (.not.associated(cs)) return
649 
650  ! stores the reference profile
651  allocate(cs%Ref_val_u%p(cs%nz_data,cs%num_col_u))
652  cs%Ref_val_u%p(:,:) = 0.0
653  do col=1,cs%num_col_u
654  do k=1,cs%nz_data
655  cs%Ref_val_u%p(k,col) = u_val(cs%col_i_u(col),cs%col_j_u(col),k)
656  enddo
657  enddo
658  cs%var_u%p => u_ptr
659  allocate(cs%Ref_val_v%p(cs%nz_data,cs%num_col_v))
660  cs%Ref_val_v%p(:,:) = 0.0
661  do col=1,cs%num_col_v
662  do k=1,cs%nz_data
663  cs%Ref_val_v%p(k,col) = v_val(cs%col_i_v(col),cs%col_j_v(col),k)
664  enddo
665  enddo
666  cs%var_v%p => v_ptr
667 

◆ set_up_ale_sponge_vel_field_varying()

subroutine mom_ale_sponge::set_up_ale_sponge_vel_field::set_up_ale_sponge_vel_field_varying ( character(len=*), intent(in)  filename_u,
character(len=*), intent(in)  fieldname_u,
character(len=*), intent(in)  filename_v,
character(len=*), intent(in)  fieldname_v,
type(time_type), intent(in)  Time,
type(ocean_grid_type), intent(inout)  G,
type(unit_scale_type), intent(in)  US,
type(ale_sponge_cs), pointer  CS,
real, dimension( g %isdb: g %iedb, g %jsd: g %jed, g %ke), intent(in), target  u_ptr,
real, dimension( g %isd: g %ied, g %jsdb: g %jedb, g %ke), intent(in), target  v_ptr 
)
private

This subroutine stores the reference profile at uand v points for the variable whose address is given by u_ptr and v_ptr.

Parameters
[in]filename_uFile name for u field
[in]fieldname_uName of u variable in file
[in]filename_vFile name for v field
[in]fieldname_vName of v variable in file
[in]timeModel time
[in,out]gOcean grid (in)
[in]usA dimensional unit scaling type
csSponge structure (in/out).
[in]u_ptru pointer to the field to be damped (in).
[in]v_ptrv pointer to the field to be damped (in).

Definition at line 674 of file MOM_ALE_sponge.F90.

674  character(len=*), intent(in) :: filename_u !< File name for u field
675  character(len=*), intent(in) :: fieldname_u !< Name of u variable in file
676  character(len=*), intent(in) :: filename_v !< File name for v field
677  character(len=*), intent(in) :: fieldname_v !< Name of v variable in file
678  type(time_type), intent(in) :: Time !< Model time
679  type(ocean_grid_type), intent(inout) :: G !< Ocean grid (in)
680  type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
681  type(ALE_sponge_CS), pointer :: CS !< Sponge structure (in/out).
682  real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), target, intent(in) :: u_ptr !< u pointer to the field to be damped (in).
683  real, dimension(SZI_(G),SZJB_(G),SZK_(G)), target, intent(in) :: v_ptr !< v pointer to the field to be damped (in).
684  ! Local variables
685  real, allocatable, dimension(:,:,:) :: u_val !< U field to be used in the sponge.
686  real, allocatable, dimension(:,:,:) :: mask_u !< U field mask for the sponge data.
687  real, allocatable, dimension(:,:,:) :: v_val !< V field to be used in the sponge.
688  real, allocatable, dimension(:,:,:) :: mask_v !< V field mask for the sponge data.
689 
690  real, allocatable, dimension(:), target :: z_in, z_edges_in
691  real :: missing_value
692 
693  integer :: j, k, col
694  integer :: isd, ied, jsd, jed
695  integer :: isdB, iedB, jsdB, jedB
696  integer, dimension(4) :: fld_sz
697  character(len=256) :: mesg ! String for error messages
698 
699  if (.not.associated(cs)) return
700 
701  isd = g%isd; ied = g%ied; jsd = g%jsd; jed = g%jed
702  isdb = g%isdB; iedb = g%iedB; jsdb = g%jsdB; jedb = g%jedB
703  ! get a unique id for this field which will allow us to return an array
704  ! containing time-interpolated values from an external file corresponding
705  ! to the current model date.
706  cs%Ref_val_u%id = init_external_field(filename_u, fieldname_u)
707  fld_sz(1:4)=-1
708  fld_sz = get_external_field_size(cs%Ref_val_u%id)
709  cs%Ref_val_u%nz_data = fld_sz(3)
710  cs%Ref_val_u%num_tlevs = fld_sz(4)
711  cs%Ref_val_v%id = init_external_field(filename_v, fieldname_v)
712  fld_sz(1:4)=-1
713  fld_sz = get_external_field_size(cs%Ref_val_v%id)
714  cs%Ref_val_v%nz_data = fld_sz(3)
715  cs%Ref_val_v%num_tlevs = fld_sz(4)
716  allocate( u_val(isdb:iedb,jsd:jed, fld_sz(3)) )
717  allocate( mask_u(isdb:iedb,jsd:jed, fld_sz(3)) )
718  allocate( v_val(isd:ied,jsdb:jedb, fld_sz(3)) )
719  allocate( mask_v(isd:ied,jsdb:jedb, fld_sz(3)) )
720  ! Interpolate external file data to the model grid
721  ! I am hard-wiring this call to assume that the input grid is zonally re-entrant
722  ! In the future, this should be generalized using an interface to return the
723  ! modulo attribute of the zonal axis (mjh).
724  call horiz_interp_and_extrap_tracer(cs%Ref_val_u%id,time, 1.0,g,u_val,mask_u,z_in,z_edges_in,&
725  missing_value,.true.,.false.,.false., m_to_z=us%m_to_Z)
726  !!! TODO: add a velocity interface! (mjh)
727  ! Interpolate external file data to the model grid
728  ! I am hard-wiring this call to assume that the input grid is zonally re-entrant
729  ! In the future, this should be generalized using an interface to return the
730  ! modulo attribute of the zonal axis (mjh).
731  call horiz_interp_and_extrap_tracer(cs%Ref_val_v%id,time, 1.0,g,v_val,mask_v,z_in,z_edges_in, &
732  missing_value,.true.,.false.,.false., m_to_z=us%m_to_Z)
733  ! stores the reference profile
734  allocate(cs%Ref_val_u%p(fld_sz(3),cs%num_col_u))
735  cs%Ref_val_u%p(:,:) = 0.0
736  do col=1,cs%num_col_u
737  do k=1,fld_sz(3)
738  cs%Ref_val_u%p(k,col) = u_val(cs%col_i_u(col),cs%col_j_u(col),k)
739  enddo
740  enddo
741  cs%var_u%p => u_ptr
742  allocate(cs%Ref_val_v%p(fld_sz(3),cs%num_col_v))
743  cs%Ref_val_v%p(:,:) = 0.0
744  do col=1,cs%num_col_v
745  do k=1,fld_sz(3)
746  cs%Ref_val_v%p(k,col) = v_val(cs%col_i_v(col),cs%col_j_v(col),k)
747  enddo
748  enddo
749  cs%var_v%p => v_ptr
750 

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