MOM6
mom_ale_sponge::set_up_ale_sponge_field Interface Reference

Detailed Description

Store the reference profile at h points for a variable.

Definition at line 33 of file MOM_ALE_sponge.F90.

Private functions

subroutine set_up_ale_sponge_field_fixed (sp_val, G, f_ptr, CS)
 This subroutine stores the reference profile at h points for the variable whose address is given by f_ptr. More...
 
subroutine set_up_ale_sponge_field_varying (filename, fieldname, Time, G, GV, US, f_ptr, CS)
 This subroutine stores the reference profile at h points for the variable whose address is given by filename and fieldname. More...
 

Functions and subroutines

◆ set_up_ale_sponge_field_fixed()

subroutine mom_ale_sponge::set_up_ale_sponge_field::set_up_ale_sponge_field_fixed ( real, dimension( g %isd: g %ied, g %jsd: g %jed,cs%nz_data), intent(in)  sp_val,
type(ocean_grid_type), intent(in)  G,
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in), target  f_ptr,
type(ale_sponge_cs), pointer  CS 
)
private

This subroutine stores the reference profile at h points for the variable whose address is given by f_ptr.

Parameters
[in]gGrid structure
csALE sponge control structure (in/out).
[in]sp_valField to be used in the sponge, it has arbitrary number of layers.
[in]f_ptrPointer to the field to be damped

Definition at line 534 of file MOM_ALE_sponge.F90.

534  type(ocean_grid_type), intent(in) :: G !< Grid structure
535  type(ALE_sponge_CS), pointer :: CS !< ALE sponge control structure (in/out).
536  real, dimension(SZI_(G),SZJ_(G),CS%nz_data), &
537  intent(in) :: sp_val !< Field to be used in the sponge, it has arbitrary number of layers.
538  real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
539  target, intent(in) :: f_ptr !< Pointer to the field to be damped
540 
541  integer :: j, k, col
542  character(len=256) :: mesg ! String for error messages
543 
544  if (.not.associated(cs)) return
545 
546  cs%fldno = cs%fldno + 1
547 
548  if (cs%fldno > max_fields_) then
549  write(mesg,'("Increase MAX_FIELDS_ to at least ",I3," in MOM_memory.h or decrease &
550  &the number of fields to be damped in the call to &
551  &initialize_sponge." )') cs%fldno
552  call mom_error(fatal,"set_up_ALE_sponge_field: "//mesg)
553  endif
554 
555  ! stores the reference profile
556  allocate(cs%Ref_val(cs%fldno)%p(cs%nz_data,cs%num_col))
557  cs%Ref_val(cs%fldno)%p(:,:) = 0.0
558  do col=1,cs%num_col
559  do k=1,cs%nz_data
560  cs%Ref_val(cs%fldno)%p(k,col) = sp_val(cs%col_i(col),cs%col_j(col),k)
561  enddo
562  enddo
563 
564  cs%var(cs%fldno)%p => f_ptr
565 

◆ set_up_ale_sponge_field_varying()

subroutine mom_ale_sponge::set_up_ale_sponge_field::set_up_ale_sponge_field_varying ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  fieldname,
type(time_type), intent(in)  Time,
type(ocean_grid_type), intent(in)  G,
type(verticalgrid_type), intent(in)  GV,
type(unit_scale_type), intent(in)  US,
real, dimension( g %isd: g %ied, g %jsd: g %jed, g %ke), intent(in), target  f_ptr,
type(ale_sponge_cs), pointer  CS 
)
private

This subroutine stores the reference profile at h points for the variable whose address is given by filename and fieldname.

Parameters
[in]filenameThe name of the file with the time varying field data
[in]fieldnameThe name of the field in the file with the time varying field data
[in]timeThe current model time
[in]gGrid structure (in).
[in]gvocean vertical grid structure
[in]usA dimensional unit scaling type
[in]f_ptrPointer to the field to be damped (in).
csSponge control structure (in/out).

Definition at line 571 of file MOM_ALE_sponge.F90.

571  character(len=*), intent(in) :: filename !< The name of the file with the
572  !! time varying field data
573  character(len=*), intent(in) :: fieldname !< The name of the field in the file
574  !! with the time varying field data
575  type(time_type), intent(in) :: Time !< The current model time
576  type(ocean_grid_type), intent(in) :: G !< Grid structure (in).
577  type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure
578  type(unit_scale_type), intent(in) :: US !< A dimensional unit scaling type
579  real, dimension(SZI_(G),SZJ_(G),SZK_(G)), &
580  target, intent(in) :: f_ptr !< Pointer to the field to be damped (in).
581  type(ALE_sponge_CS), pointer :: CS !< Sponge control structure (in/out).
582 
583  ! Local variables
584  real, allocatable, dimension(:,:,:) :: sp_val !< Field to be used in the sponge
585  real, allocatable, dimension(:,:,:) :: mask_z !< Field mask for the sponge data
586  real, allocatable, dimension(:), target :: z_in, z_edges_in ! Heights [Z ~> m].
587  real :: missing_value
588  integer :: j, k, col
589  integer :: isd,ied,jsd,jed
590  integer :: nPoints
591  integer, dimension(4) :: fld_sz
592  integer :: nz_data !< the number of vertical levels in this input field
593  character(len=256) :: mesg ! String for error messages
594  ! Local variables for ALE remapping
595  real, dimension(:), allocatable :: tmpT1d
596  real :: zTopOfCell, zBottomOfCell ! Heights [Z ~> m].
597  type(remapping_CS) :: remapCS ! Remapping parameters and work arrays
598 
599  if (.not.associated(cs)) return
600  ! initialize time interpolator module
601  call time_interp_external_init()
602  isd = g%isd; ied = g%ied; jsd = g%jsd; jed = g%jed
603  cs%fldno = cs%fldno + 1
604  if (cs%fldno > max_fields_) then
605  write(mesg,'("Increase MAX_FIELDS_ to at least ",I3," in MOM_memory.h or decrease &
606  &the number of fields to be damped in the call to &
607  &initialize_sponge." )') cs%fldno
608  call mom_error(fatal,"set_up_ALE_sponge_field: "//mesg)
609  endif
610  ! get a unique time interp id for this field. If sponge data is ongrid, then setup
611  ! to only read on the computational domain
612  if (cs%spongeDataOngrid) then
613  cs%Ref_val(cs%fldno)%id = init_external_field(filename, fieldname,domain=g%Domain%mpp_domain)
614  else
615  cs%Ref_val(cs%fldno)%id = init_external_field(filename, fieldname)
616  endif
617  fld_sz(1:4)=-1
618  fld_sz = get_external_field_size(cs%Ref_val(cs%fldno)%id)
619  nz_data = fld_sz(3)
620  cs%Ref_val(cs%fldno)%nz_data = nz_data !< individual sponge fields may reside on a different vertical grid
621  cs%Ref_val(cs%fldno)%num_tlevs = fld_sz(4)
622  ! initializes the target profile array for this field
623  ! for all columns which will be masked
624  allocate(cs%Ref_val(cs%fldno)%p(nz_data,cs%num_col))
625  cs%Ref_val(cs%fldno)%p(:,:) = 0.0
626  allocate( cs%Ref_val(cs%fldno)%h(nz_data,cs%num_col) )
627  cs%Ref_val(cs%fldno)%h(:,:) = 0.0
628  cs%var(cs%fldno)%p => f_ptr
629 
630 

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