MOM6
mom_io::mom_read_vector Interface Reference

Detailed Description

Read a pair of data fields representing the two components of a vector from a file.

Definition at line 82 of file MOM_io.F90.

Private functions

subroutine mom_read_vector_3d (filename, u_fieldname, v_fieldname, u_data, v_data, MOM_Domain, timelevel, stagger, scalar_pair, scale)
 This function uses the fms_io function read_data to read a pair of distributed 3-D data fields with names given by "[uv]_fieldname" from file "filename". Valid values for "stagger" include CGRID_NE, BGRID_NE, and AGRID. More...
 
subroutine mom_read_vector_2d (filename, u_fieldname, v_fieldname, u_data, v_data, MOM_Domain, timelevel, stagger, scalar_pair, scale)
 This function uses the fms_io function read_data to read a pair of distributed 2-D data fields with names given by "[uv]_fieldname" from file "filename". Valid values for "stagger" include CGRID_NE, BGRID_NE, and AGRID. More...
 

Functions and subroutines

◆ mom_read_vector_2d()

subroutine mom_io::mom_read_vector::mom_read_vector_2d ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  u_fieldname,
character(len=*), intent(in)  v_fieldname,
real, dimension(:,:), intent(inout)  u_data,
real, dimension(:,:), intent(inout)  v_data,
type(mom_domain_type), intent(in)  MOM_Domain,
integer, intent(in), optional  timelevel,
integer, intent(in), optional  stagger,
logical, intent(in), optional  scalar_pair,
real, intent(in), optional  scale 
)
private

This function uses the fms_io function read_data to read a pair of distributed 2-D data fields with names given by "[uv]_fieldname" from file "filename". Valid values for "stagger" include CGRID_NE, BGRID_NE, and AGRID.

Parameters
[in]filenameThe name of the file to read
[in]u_fieldnameThe variable name of the u data in the file
[in]v_fieldnameThe variable name of the v data in the file
[in,out]u_dataThe 2 dimensional array into which the u-component of the data should be read
[in,out]v_dataThe 2 dimensional array into which the v-component of the data should be read
[in]mom_domainThe MOM_Domain that describes the decomposition
[in]timelevelThe time level in the file to read
[in]staggerA flag indicating where this vector is discretized
[in]scalar_pairIf true, a pair of scalars are to be read.cretized
[in]scaleA scaling factor that the fields are multiplied by before they are returned.

Definition at line 955 of file MOM_io.F90.

955  character(len=*), intent(in) :: filename !< The name of the file to read
956  character(len=*), intent(in) :: u_fieldname !< The variable name of the u data in the file
957  character(len=*), intent(in) :: v_fieldname !< The variable name of the v data in the file
958  real, dimension(:,:), intent(inout) :: u_data !< The 2 dimensional array into which the
959  !! u-component of the data should be read
960  real, dimension(:,:), intent(inout) :: v_data !< The 2 dimensional array into which the
961  !! v-component of the data should be read
962  type(MOM_domain_type), intent(in) :: MOM_Domain !< The MOM_Domain that describes the decomposition
963  integer, optional, intent(in) :: timelevel !< The time level in the file to read
964  integer, optional, intent(in) :: stagger !< A flag indicating where this vector is discretized
965  logical, optional, intent(in) :: scalar_pair !< If true, a pair of scalars are to be read.cretized
966  real, optional, intent(in) :: scale !< A scaling factor that the fields are multiplied
967  !! by before they are returned.
968  integer :: is, ie, js, je
969  integer :: u_pos, v_pos
970 
971  u_pos = east_face ; v_pos = north_face
972  if (present(stagger)) then
973  if (stagger == cgrid_ne) then ; u_pos = east_face ; v_pos = north_face
974  elseif (stagger == bgrid_ne) then ; u_pos = corner ; v_pos = corner
975  elseif (stagger == agrid) then ; u_pos = center ; v_pos = center ; endif
976  endif
977 
978  call read_data(filename, u_fieldname, u_data, mom_domain%mpp_domain, &
979  timelevel=timelevel, position=u_pos)
980  call read_data(filename, v_fieldname, v_data, mom_domain%mpp_domain, &
981  timelevel=timelevel, position=v_pos)
982 
983  if (present(scale)) then ; if (scale /= 1.0) then
984  call get_simple_array_i_ind(mom_domain, size(u_data,1), is, ie)
985  call get_simple_array_j_ind(mom_domain, size(u_data,2), js, je)
986  u_data(is:ie,js:je) = scale*u_data(is:ie,js:je)
987  call get_simple_array_i_ind(mom_domain, size(v_data,1), is, ie)
988  call get_simple_array_j_ind(mom_domain, size(v_data,2), js, je)
989  v_data(is:ie,js:je) = scale*v_data(is:ie,js:je)
990  endif ; endif
991 

◆ mom_read_vector_3d()

subroutine mom_io::mom_read_vector::mom_read_vector_3d ( character(len=*), intent(in)  filename,
character(len=*), intent(in)  u_fieldname,
character(len=*), intent(in)  v_fieldname,
real, dimension(:,:,:), intent(inout)  u_data,
real, dimension(:,:,:), intent(inout)  v_data,
type(mom_domain_type), intent(in)  MOM_Domain,
integer, intent(in), optional  timelevel,
integer, intent(in), optional  stagger,
logical, intent(in), optional  scalar_pair,
real, intent(in), optional  scale 
)
private

This function uses the fms_io function read_data to read a pair of distributed 3-D data fields with names given by "[uv]_fieldname" from file "filename". Valid values for "stagger" include CGRID_NE, BGRID_NE, and AGRID.

Parameters
[in]filenameThe name of the file to read
[in]u_fieldnameThe variable name of the u data in the file
[in]v_fieldnameThe variable name of the v data in the file
[in,out]u_dataThe 3 dimensional array into which the u-component of the data should be read
[in,out]v_dataThe 3 dimensional array into which the v-component of the data should be read
[in]mom_domainThe MOM_Domain that describes the decomposition
[in]timelevelThe time level in the file to read
[in]staggerA flag indicating where this vector is discretized
[in]scalar_pairIf true, a pair of scalars are to be read.cretized
[in]scaleA scaling factor that the fields are multiplied by before they are returned.

Definition at line 1000 of file MOM_io.F90.

1000  character(len=*), intent(in) :: filename !< The name of the file to read
1001  character(len=*), intent(in) :: u_fieldname !< The variable name of the u data in the file
1002  character(len=*), intent(in) :: v_fieldname !< The variable name of the v data in the file
1003  real, dimension(:,:,:), intent(inout) :: u_data !< The 3 dimensional array into which the
1004  !! u-component of the data should be read
1005  real, dimension(:,:,:), intent(inout) :: v_data !< The 3 dimensional array into which the
1006  !! v-component of the data should be read
1007  type(MOM_domain_type), intent(in) :: MOM_Domain !< The MOM_Domain that describes the decomposition
1008  integer, optional, intent(in) :: timelevel !< The time level in the file to read
1009  integer, optional, intent(in) :: stagger !< A flag indicating where this vector is discretized
1010  logical, optional, intent(in) :: scalar_pair !< If true, a pair of scalars are to be read.cretized
1011  real, optional, intent(in) :: scale !< A scaling factor that the fields are multiplied
1012  !! by before they are returned.
1013 
1014  integer :: is, ie, js, je
1015  integer :: u_pos, v_pos
1016 
1017  u_pos = east_face ; v_pos = north_face
1018  if (present(stagger)) then
1019  if (stagger == cgrid_ne) then ; u_pos = east_face ; v_pos = north_face
1020  elseif (stagger == bgrid_ne) then ; u_pos = corner ; v_pos = corner
1021  elseif (stagger == agrid) then ; u_pos = center ; v_pos = center ; endif
1022  endif
1023 
1024  call read_data(filename, u_fieldname, u_data, mom_domain%mpp_domain, &
1025  timelevel=timelevel, position=u_pos)
1026  call read_data(filename, v_fieldname, v_data, mom_domain%mpp_domain, &
1027  timelevel=timelevel, position=v_pos)
1028 
1029  if (present(scale)) then ; if (scale /= 1.0) then
1030  call get_simple_array_i_ind(mom_domain, size(u_data,1), is, ie)
1031  call get_simple_array_j_ind(mom_domain, size(u_data,2), js, je)
1032  u_data(is:ie,js:je,:) = scale*u_data(is:ie,js:je,:)
1033  call get_simple_array_i_ind(mom_domain, size(v_data,1), is, ie)
1034  call get_simple_array_j_ind(mom_domain, size(v_data,2), js, je)
1035  v_data(is:ie,js:je,:) = scale*v_data(is:ie,js:je,:)
1036  endif ; endif
1037 

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