Store the reference profile at h points for a variable.
Definition at line 34 of file MOM_ALE_sponge.F90.
|
| 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...
|
| |
Store the reference profile at h points for a variable.
Definition at line 34 of file MOM_ALE_sponge.F90.
◆ 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] | g | Grid structure |
| cs | ALE sponge control structure (in/out). |
| [in] | sp_val | Field to be used in the sponge, it has arbitrary number of layers. |
| [in] | f_ptr | Pointer to the field to be damped |
Definition at line 563 of file MOM_ALE_sponge.F90.
564 type(ocean_grid_type),
intent(in) :: G
565 type(ALE_sponge_CS),
pointer :: CS
566 real,
dimension(SZI_(G),SZJ_(G),CS%nz_data), &
568 real,
dimension(SZI_(G),SZJ_(G),SZK_(G)), &
569 target,
intent(in) :: f_ptr
572 character(len=256) :: mesg
574 if (.not.
associated(cs))
return
576 cs%fldno = cs%fldno + 1
578 if (cs%fldno > max_fields_)
then
579 write(mesg,
'("Increase MAX_FIELDS_ to at least ",I3," in MOM_memory.h or decrease &
580 &the number of fields to be damped in the call to &
581 &initialize_ALE_sponge." )') cs%fldno
582 call mom_error(fatal,
"set_up_ALE_sponge_field: "//mesg)
586 allocate(cs%Ref_val(cs%fldno)%p(cs%nz_data,cs%num_col))
587 cs%Ref_val(cs%fldno)%p(:,:) = 0.0
590 cs%Ref_val(cs%fldno)%p(k,col) = sp_val(cs%col_i(col),cs%col_j(col),k)
594 cs%var(cs%fldno)%p => f_ptr
◆ 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, gv %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] | filename | The name of the file with the time varying field data |
| [in] | fieldname | The name of the field in the file with the time varying field data |
| [in] | time | The current model time |
| [in] | g | Grid structure (in). |
| [in] | gv | ocean vertical grid structure |
| [in] | us | A dimensional unit scaling type |
| [in] | f_ptr | Pointer to the field to be damped (in). |
| cs | Sponge control structure (in/out). |
Definition at line 600 of file MOM_ALE_sponge.F90.
601 character(len=*),
intent(in) :: filename
603 character(len=*),
intent(in) :: fieldname
605 type(time_type),
intent(in) :: Time
606 type(ocean_grid_type),
intent(in) :: G
607 type(verticalGrid_type),
intent(in) :: GV
608 type(unit_scale_type),
intent(in) :: US
609 real,
dimension(SZI_(G),SZJ_(G),SZK_(GV)), &
610 target,
intent(in) :: f_ptr
611 type(ALE_sponge_CS),
pointer :: CS
614 real,
allocatable,
dimension(:,:,:) :: sp_val
615 real,
allocatable,
dimension(:,:,:) :: mask_z
616 real,
allocatable,
dimension(:),
target :: z_in, z_edges_in
617 real :: missing_value
619 integer :: isd,ied,jsd,jed
621 integer,
dimension(4) :: fld_sz
623 character(len=256) :: mesg
625 real,
dimension(:),
allocatable :: tmpT1d
626 real :: zTopOfCell, zBottomOfCell
627 type(remapping_CS) :: remapCS
629 if (.not.
associated(cs))
return
631 call time_interp_external_init()
632 isd = g%isd; ied = g%ied; jsd = g%jsd; jed = g%jed
633 cs%fldno = cs%fldno + 1
634 if (cs%fldno > max_fields_)
then
635 write(mesg,
'("Increase MAX_FIELDS_ to at least ",I3," in MOM_memory.h or decrease &
636 &the number of fields to be damped in the call to &
637 &initialize_ALE_sponge." )') cs%fldno
638 call mom_error(fatal,
"set_up_ALE_sponge_field: "//mesg)
642 if (cs%spongeDataOngrid)
then
643 cs%Ref_val(cs%fldno)%id = init_external_field(filename, fieldname,domain=g%Domain%mpp_domain)
645 cs%Ref_val(cs%fldno)%id = init_external_field(filename, fieldname)
648 fld_sz = get_external_field_size(cs%Ref_val(cs%fldno)%id)
650 cs%Ref_val(cs%fldno)%nz_data = nz_data
651 cs%Ref_val(cs%fldno)%num_tlevs = fld_sz(4)
654 allocate(cs%Ref_val(cs%fldno)%p(nz_data,cs%num_col))
655 cs%Ref_val(cs%fldno)%p(:,:) = 0.0
656 allocate( cs%Ref_val(cs%fldno)%h(nz_data,cs%num_col) )
657 cs%Ref_val(cs%fldno)%h(:,:) = 0.0
658 cs%var(cs%fldno)%p => f_ptr
The documentation for this interface was generated from the following file: