MOM6
ocean_model_mod::ocean_model_data_get Interface Reference

Detailed Description

This interface extracts a named scalar field or array from the ocean surface or public type.

Definition at line 84 of file ocean_model_MOM.F90.

Private functions

subroutine ocean_model_data1d_get (OS, Ocean, name, value)
 This subroutine extracts a named scalar field from the ocean surface or public type. More...
 
subroutine ocean_model_data2d_get (OS, Ocean, name, array2D, isc, jsc)
 This subroutine extracts a named 2-D field from the ocean surface or public type. More...
 

Detailed Description

This interface extracts a named scalar field or array from the ocean surface or public type.

Definition at line 84 of file ocean_model_MOM.F90.

Functions and subroutines

◆ ocean_model_data1d_get()

subroutine ocean_model_mod::ocean_model_data_get::ocean_model_data1d_get ( type(ocean_state_type), pointer  OS,
type(ocean_public_type), intent(in)  Ocean,
character(len=*), intent(in)  name,
real, intent(out)  value 
)
private

This subroutine extracts a named scalar field from the ocean surface or public type.

Parameters
osA pointer to the structure containing the internal ocean state (intent in).
[in]oceanA structure containing various publicly visible ocean surface fields.
[in]nameThe name of the field to extract
[out]valueThe value of the named field

Definition at line 1075 of file ocean_model_MOM.F90.

1075  type(ocean_state_type), pointer :: OS !< A pointer to the structure containing the
1076  !! internal ocean state (intent in).
1077  type(ocean_public_type), intent(in) :: Ocean !< A structure containing various publicly
1078  !! visible ocean surface fields.
1079  character(len=*) , intent(in) :: name !< The name of the field to extract
1080  real , intent(out):: value !< The value of the named field
1081 
1082  if (.not.associated(os)) return
1083  if (.not.os%is_ocean_pe) return
1084 
1085  select case(name)
1086  case('c_p')
1087  value = os%C_p
1088  case default
1089  call mom_error(fatal,'get_ocean_grid_data1D: unknown argument name='//name)
1090  end select
1091 

◆ ocean_model_data2d_get()

subroutine ocean_model_mod::ocean_model_data_get::ocean_model_data2d_get ( type(ocean_state_type), pointer  OS,
type(ocean_public_type), intent(in)  Ocean,
character(len=*), intent(in)  name,
real, dimension(isc:,jsc:), intent(out)  array2D,
integer, intent(in)  isc,
integer, intent(in)  jsc 
)
private

This subroutine extracts a named 2-D field from the ocean surface or public type.

Parameters
osA pointer to the structure containing the internal ocean state (intent in).
[in]oceanA structure containing various publicly visible ocean surface fields.
[in]nameThe name of the field to extract
[out]array2dThe values of the named field, it must cover only the computational domain
[in]iscThe starting i-index of array2D
[in]jscThe starting j-index of array2D

Definition at line 1013 of file ocean_model_MOM.F90.

1013  use mom_constants, only : celsius_kelvin_offset
1014  type(ocean_state_type), pointer :: OS !< A pointer to the structure containing the
1015  !! internal ocean state (intent in).
1016  type(ocean_public_type), intent(in) :: Ocean !< A structure containing various publicly
1017  !! visible ocean surface fields.
1018  character(len=*) , intent(in) :: name !< The name of the field to extract
1019  real, dimension(isc:,jsc:), intent(out):: array2D !< The values of the named field, it must
1020  !! cover only the computational domain
1021  integer , intent(in) :: isc !< The starting i-index of array2D
1022  integer , intent(in) :: jsc !< The starting j-index of array2D
1023 
1024  integer :: g_isc, g_iec, g_jsc, g_jec,g_isd, g_ied, g_jsd, g_jed, i, j
1025 
1026  if (.not.associated(os)) return
1027  if (.not.os%is_ocean_pe) return
1028 
1029 ! The problem is %areaT is on MOM domain but Ice_Ocean_Boundary%... is on mpp domain.
1030 ! We want to return the MOM data on the mpp (compute) domain
1031 ! Get MOM domain extents
1032  call mpp_get_compute_domain(os%grid%Domain%mpp_domain, g_isc, g_iec, g_jsc, g_jec)
1033  call mpp_get_data_domain (os%grid%Domain%mpp_domain, g_isd, g_ied, g_jsd, g_jed)
1034 
1035  g_isc = g_isc-g_isd+1 ; g_iec = g_iec-g_isd+1 ; g_jsc = g_jsc-g_jsd+1 ; g_jec = g_jec-g_jsd+1
1036 
1037 
1038  select case(name)
1039  case('area')
1040  array2d(isc:,jsc:) = os%US%L_to_m**2*os%grid%areaT(g_isc:g_iec,g_jsc:g_jec)
1041  case('mask')
1042  array2d(isc:,jsc:) = os%grid%mask2dT(g_isc:g_iec,g_jsc:g_jec)
1043 !OR same result
1044 ! do j=g_jsc,g_jec ; do i=g_isc,g_iec
1045 ! array2D(isc+i-g_isc,jsc+j-g_jsc) = OS%grid%mask2dT(i,j)
1046 ! enddo ; enddo
1047  case('t_surf')
1048  array2d(isc:,jsc:) = ocean%t_surf(isc:,jsc:)-celsius_kelvin_offset
1049  case('t_pme')
1050  array2d(isc:,jsc:) = ocean%t_surf(isc:,jsc:)-celsius_kelvin_offset
1051  case('t_runoff')
1052  array2d(isc:,jsc:) = ocean%t_surf(isc:,jsc:)-celsius_kelvin_offset
1053  case('t_calving')
1054  array2d(isc:,jsc:) = ocean%t_surf(isc:,jsc:)-celsius_kelvin_offset
1055  case('btfHeat')
1056  array2d(isc:,jsc:) = 0
1057  case('cos_rot')
1058  array2d(isc:,jsc:) = os%grid%cos_rot(g_isc:g_iec,g_jsc:g_jec) ! =1
1059  case('sin_rot')
1060  array2d(isc:,jsc:) = os%grid%sin_rot(g_isc:g_iec,g_jsc:g_jec) ! =0
1061  case('s_surf')
1062  array2d(isc:,jsc:) = ocean%s_surf(isc:,jsc:)
1063  case('sea_lev')
1064  array2d(isc:,jsc:) = ocean%sea_lev(isc:,jsc:)
1065  case('frazil')
1066  array2d(isc:,jsc:) = ocean%frazil(isc:,jsc:)
1067  case default
1068  call mom_error(fatal,'get_ocean_grid_data2D: unknown argument name='//name)
1069  end select
1070 

The documentation for this interface was generated from the following file:
mom_constants
Provides a few physical constants.
Definition: MOM_constants.F90:2