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.
|
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...
|
|
◆ 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] | filename | The name of the file to read |
[in] | u_fieldname | The variable name of the u data in the file |
[in] | v_fieldname | The variable name of the v data in the file |
[in,out] | u_data | The 2 dimensional array into which the u-component of the data should be read |
[in,out] | v_data | The 2 dimensional array into which the v-component of the data should be read |
[in] | mom_domain | The MOM_Domain that describes the decomposition |
[in] | timelevel | The time level in the file to read |
[in] | stagger | A flag indicating where this vector is discretized |
[in] | scalar_pair | If true, a pair of scalars are to be read.cretized |
[in] | scale | A 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
956 character(len=*),
intent(in) :: u_fieldname
957 character(len=*),
intent(in) :: v_fieldname
958 real,
dimension(:,:),
intent(inout) :: u_data
960 real,
dimension(:,:),
intent(inout) :: v_data
962 type(MOM_domain_type),
intent(in) :: MOM_Domain
963 integer,
optional,
intent(in) :: timelevel
964 integer,
optional,
intent(in) :: stagger
965 logical,
optional,
intent(in) :: scalar_pair
966 real,
optional,
intent(in) :: scale
968 integer :: is, ie, js, je
969 integer :: u_pos, v_pos
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
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)
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)
◆ 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] | filename | The name of the file to read |
[in] | u_fieldname | The variable name of the u data in the file |
[in] | v_fieldname | The variable name of the v data in the file |
[in,out] | u_data | The 3 dimensional array into which the u-component of the data should be read |
[in,out] | v_data | The 3 dimensional array into which the v-component of the data should be read |
[in] | mom_domain | The MOM_Domain that describes the decomposition |
[in] | timelevel | The time level in the file to read |
[in] | stagger | A flag indicating where this vector is discretized |
[in] | scalar_pair | If true, a pair of scalars are to be read.cretized |
[in] | scale | A 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
1001 character(len=*),
intent(in) :: u_fieldname
1002 character(len=*),
intent(in) :: v_fieldname
1003 real,
dimension(:,:,:),
intent(inout) :: u_data
1005 real,
dimension(:,:,:),
intent(inout) :: v_data
1007 type(MOM_domain_type),
intent(in) :: MOM_Domain
1008 integer,
optional,
intent(in) :: timelevel
1009 integer,
optional,
intent(in) :: stagger
1010 logical,
optional,
intent(in) :: scalar_pair
1011 real,
optional,
intent(in) :: scale
1014 integer :: is, ie, js, je
1015 integer :: u_pos, v_pos
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
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)
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,:)
The documentation for this interface was generated from the following file:
- /glade/work/altuntas/cesm.sandboxes/cesm2_2_alpha_X_mom/components/mom/MOM6/src/framework/MOM_io.F90