\hypertarget{interfacemom__io_1_1mom__read__vector}{}\section{mom\+\_\+io\+:\+:mom\+\_\+read\+\_\+vector Interface Reference}
\label{interfacemom__io_1_1mom__read__vector}\index{mom\+\_\+io\+::mom\+\_\+read\+\_\+vector@{mom\+\_\+io\+::mom\+\_\+read\+\_\+vector}}


\subsection{Detailed Description}
Read a pair of data fields representing the two components of a vector from a file. 

Definition at line 82 of file M\+O\+M\+\_\+io.\+F90.

\subsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{interfacemom__io_1_1mom__read__vector_ae6c389d606c63292d978aa94db76d32b}{mom\+\_\+read\+\_\+vector\+\_\+3d} (filename, u\+\_\+fieldname, v\+\_\+fieldname, u\+\_\+data, v\+\_\+data, M\+O\+M\+\_\+\+Domain, timelevel, stagger, scalar\+\_\+pair, scale)
\begin{DoxyCompactList}\small\item\em This function uses the fms\+\_\+io function read\+\_\+data to read a pair of distributed 3-\/D data fields with names given by \char`\"{}\mbox{[}uv\mbox{]}\+\_\+fieldname\char`\"{} from file \char`\"{}filename\char`\"{}. Valid values for \char`\"{}stagger\char`\"{} include C\+G\+R\+I\+D\+\_\+\+NE, B\+G\+R\+I\+D\+\_\+\+NE, and A\+G\+R\+ID. \end{DoxyCompactList}\item 
subroutine \hyperlink{interfacemom__io_1_1mom__read__vector_afa1f6b837c14b60ba44b048ffc7e7988}{mom\+\_\+read\+\_\+vector\+\_\+2d} (filename, u\+\_\+fieldname, v\+\_\+fieldname, u\+\_\+data, v\+\_\+data, M\+O\+M\+\_\+\+Domain, timelevel, stagger, scalar\+\_\+pair, scale)
\begin{DoxyCompactList}\small\item\em This function uses the fms\+\_\+io function read\+\_\+data to read a pair of distributed 2-\/D data fields with names given by \char`\"{}\mbox{[}uv\mbox{]}\+\_\+fieldname\char`\"{} from file \char`\"{}filename\char`\"{}. Valid values for \char`\"{}stagger\char`\"{} include C\+G\+R\+I\+D\+\_\+\+NE, B\+G\+R\+I\+D\+\_\+\+NE, and A\+G\+R\+ID. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Read a pair of data fields representing the two components of a vector from a file. 

Definition at line 82 of file M\+O\+M\+\_\+io.\+F90.



\subsection{Functions and subroutines}
\mbox{\Hypertarget{interfacemom__io_1_1mom__read__vector_afa1f6b837c14b60ba44b048ffc7e7988}\label{interfacemom__io_1_1mom__read__vector_afa1f6b837c14b60ba44b048ffc7e7988}} 
\index{mom\+\_\+io\+::mom\+\_\+read\+\_\+vector@{mom\+\_\+io\+::mom\+\_\+read\+\_\+vector}!mom\+\_\+read\+\_\+vector\+\_\+2d@{mom\+\_\+read\+\_\+vector\+\_\+2d}}
\index{mom\+\_\+read\+\_\+vector\+\_\+2d@{mom\+\_\+read\+\_\+vector\+\_\+2d}!mom\+\_\+io\+::mom\+\_\+read\+\_\+vector@{mom\+\_\+io\+::mom\+\_\+read\+\_\+vector}}
\subsubsection{\texorpdfstring{mom\+\_\+read\+\_\+vector\+\_\+2d()}{mom\_read\_vector\_2d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+io\+::mom\+\_\+read\+\_\+vector\+::mom\+\_\+read\+\_\+vector\+\_\+2d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{filename,  }\item[{character(len=$\ast$), intent(in)}]{u\+\_\+fieldname,  }\item[{character(len=$\ast$), intent(in)}]{v\+\_\+fieldname,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{u\+\_\+data,  }\item[{real, dimension(\+:,\+:), intent(inout)}]{v\+\_\+data,  }\item[{type(mom\+\_\+domain\+\_\+type), intent(in)}]{M\+O\+M\+\_\+\+Domain,  }\item[{integer, intent(in), optional}]{timelevel,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{logical, intent(in), optional}]{scalar\+\_\+pair,  }\item[{real, intent(in), optional}]{scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This function uses the fms\+\_\+io function read\+\_\+data to read a pair of distributed 2-\/D data fields with names given by \char`\"{}\mbox{[}uv\mbox{]}\+\_\+fieldname\char`\"{} from file \char`\"{}filename\char`\"{}. Valid values for \char`\"{}stagger\char`\"{} include C\+G\+R\+I\+D\+\_\+\+NE, B\+G\+R\+I\+D\+\_\+\+NE, and A\+G\+R\+ID. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em filename} & The name of the file to read\\
\hline
\mbox{\tt in}  & {\em u\+\_\+fieldname} & The variable name of the u data in the file\\
\hline
\mbox{\tt in}  & {\em v\+\_\+fieldname} & The variable name of the v data in the file\\
\hline
\mbox{\tt in,out}  & {\em u\+\_\+data} & The 2 dimensional array into which the u-\/component of the data should be read\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+data} & The 2 dimensional array into which the v-\/component of the data should be read\\
\hline
\mbox{\tt in}  & {\em mom\+\_\+domain} & The M\+O\+M\+\_\+\+Domain that describes the decomposition\\
\hline
\mbox{\tt in}  & {\em timelevel} & The time level in the file to read\\
\hline
\mbox{\tt in}  & {\em stagger} & A flag indicating where this vector is discretized\\
\hline
\mbox{\tt in}  & {\em scalar\+\_\+pair} & If true, a pair of scalars are to be read.\+cretized\\
\hline
\mbox{\tt in}  & {\em scale} & A scaling factor that the fields are multiplied by before they are returned. \\
\hline
\end{DoxyParams}


Definition at line 955 of file M\+O\+M\+\_\+io.\+F90.


\begin{DoxyCode}
955   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)}    :: filename\textcolor{comment}{  !< The name of the file to read}
956   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)}    :: u\_fieldname\textcolor{comment}{ !< The variable name of the u data in the file}
957   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)}    :: v\_fieldname\textcolor{comment}{ !< The variable name of the v data in the file}
958   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: u\_data\textcolor{comment}{    !< The 2 dimensional array into which the}
959 \textcolor{comment}{                                                     !! u-component of the data should be read}
960   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: v\_data\textcolor{comment}{    !< The 2 dimensional array into which the}
961 \textcolor{comment}{                                                     !! v-component of the data should be read}
962   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(in)}    :: mom\_domain\textcolor{comment}{ !< The MOM\_Domain that describes the decomposition}
963   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: timelevel\textcolor{comment}{ !< The time level in the file to read}
964   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{   !< A flag indicating where this vector is discretized}
965   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalar\_pair\textcolor{comment}{ !< If true, a pair of scalars are to be
       read.cretized}
966   \textcolor{keywordtype}{real},         \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{     !< A scaling factor that the fields are multiplied}
967 \textcolor{comment}{                                                     !! by before they are returned.}
968   \textcolor{keywordtype}{integer} :: is, ie, js, je
969   \textcolor{keywordtype}{integer} :: u\_pos, v\_pos
970 
971   u\_pos = east\_face ; v\_pos = north\_face
972   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) \textcolor{keywordflow}{then}
973     \textcolor{keywordflow}{if} (stagger == cgrid\_ne) \textcolor{keywordflow}{then} ; u\_pos = east\_face ; v\_pos = north\_face
974     \textcolor{keywordflow}{elseif} (stagger == bgrid\_ne) \textcolor{keywordflow}{then} ; u\_pos = corner ; v\_pos = corner
975     \textcolor{keywordflow}{elseif} (stagger == agrid) \textcolor{keywordflow}{then} ; u\_pos = center ; v\_pos = center ;\textcolor{keywordflow}{ endif}
976 \textcolor{keywordflow}{  endif}
977 
978   \textcolor{keyword}{call }read\_data(filename, u\_fieldname, u\_data, mom\_domain%mpp\_domain, &
979                  timelevel=timelevel, position=u\_pos)
980   \textcolor{keyword}{call }read\_data(filename, v\_fieldname, v\_data, mom\_domain%mpp\_domain, &
981                  timelevel=timelevel, position=v\_pos)
982 
983   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (scale /= 1.0) \textcolor{keywordflow}{then}
984     \textcolor{keyword}{call }get\_simple\_array\_i\_ind(mom\_domain, \textcolor{keyword}{size}(u\_data,1), is, ie)
985     \textcolor{keyword}{call }get\_simple\_array\_j\_ind(mom\_domain, \textcolor{keyword}{size}(u\_data,2), js, je)
986     u\_data(is:ie,js:je) = scale*u\_data(is:ie,js:je)
987     \textcolor{keyword}{call }get\_simple\_array\_i\_ind(mom\_domain, \textcolor{keyword}{size}(v\_data,1), is, ie)
988     \textcolor{keyword}{call }get\_simple\_array\_j\_ind(mom\_domain, \textcolor{keyword}{size}(v\_data,2), js, je)
989     v\_data(is:ie,js:je) = scale*v\_data(is:ie,js:je)
990 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
991 
\end{DoxyCode}
\mbox{\Hypertarget{interfacemom__io_1_1mom__read__vector_ae6c389d606c63292d978aa94db76d32b}\label{interfacemom__io_1_1mom__read__vector_ae6c389d606c63292d978aa94db76d32b}} 
\index{mom\+\_\+io\+::mom\+\_\+read\+\_\+vector@{mom\+\_\+io\+::mom\+\_\+read\+\_\+vector}!mom\+\_\+read\+\_\+vector\+\_\+3d@{mom\+\_\+read\+\_\+vector\+\_\+3d}}
\index{mom\+\_\+read\+\_\+vector\+\_\+3d@{mom\+\_\+read\+\_\+vector\+\_\+3d}!mom\+\_\+io\+::mom\+\_\+read\+\_\+vector@{mom\+\_\+io\+::mom\+\_\+read\+\_\+vector}}
\subsubsection{\texorpdfstring{mom\+\_\+read\+\_\+vector\+\_\+3d()}{mom\_read\_vector\_3d()}}
{\footnotesize\ttfamily subroutine mom\+\_\+io\+::mom\+\_\+read\+\_\+vector\+::mom\+\_\+read\+\_\+vector\+\_\+3d (\begin{DoxyParamCaption}\item[{character(len=$\ast$), intent(in)}]{filename,  }\item[{character(len=$\ast$), intent(in)}]{u\+\_\+fieldname,  }\item[{character(len=$\ast$), intent(in)}]{v\+\_\+fieldname,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{u\+\_\+data,  }\item[{real, dimension(\+:,\+:,\+:), intent(inout)}]{v\+\_\+data,  }\item[{type(mom\+\_\+domain\+\_\+type), intent(in)}]{M\+O\+M\+\_\+\+Domain,  }\item[{integer, intent(in), optional}]{timelevel,  }\item[{integer, intent(in), optional}]{stagger,  }\item[{logical, intent(in), optional}]{scalar\+\_\+pair,  }\item[{real, intent(in), optional}]{scale }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



This function uses the fms\+\_\+io function read\+\_\+data to read a pair of distributed 3-\/D data fields with names given by \char`\"{}\mbox{[}uv\mbox{]}\+\_\+fieldname\char`\"{} from file \char`\"{}filename\char`\"{}. Valid values for \char`\"{}stagger\char`\"{} include C\+G\+R\+I\+D\+\_\+\+NE, B\+G\+R\+I\+D\+\_\+\+NE, and A\+G\+R\+ID. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em filename} & The name of the file to read\\
\hline
\mbox{\tt in}  & {\em u\+\_\+fieldname} & The variable name of the u data in the file\\
\hline
\mbox{\tt in}  & {\em v\+\_\+fieldname} & The variable name of the v data in the file\\
\hline
\mbox{\tt in,out}  & {\em u\+\_\+data} & The 3 dimensional array into which the u-\/component of the data should be read\\
\hline
\mbox{\tt in,out}  & {\em v\+\_\+data} & The 3 dimensional array into which the v-\/component of the data should be read\\
\hline
\mbox{\tt in}  & {\em mom\+\_\+domain} & The M\+O\+M\+\_\+\+Domain that describes the decomposition\\
\hline
\mbox{\tt in}  & {\em timelevel} & The time level in the file to read\\
\hline
\mbox{\tt in}  & {\em stagger} & A flag indicating where this vector is discretized\\
\hline
\mbox{\tt in}  & {\em scalar\+\_\+pair} & If true, a pair of scalars are to be read.\+cretized\\
\hline
\mbox{\tt in}  & {\em scale} & A scaling factor that the fields are multiplied by before they are returned. \\
\hline
\end{DoxyParams}


Definition at line 1000 of file M\+O\+M\+\_\+io.\+F90.


\begin{DoxyCode}
1000   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)}    :: filename\textcolor{comment}{  !< The name of the file to read}
1001   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)}    :: u\_fieldname\textcolor{comment}{ !< The variable name of the u data in the file}
1002   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)}    :: v\_fieldname\textcolor{comment}{ !< The variable name of the v data in the file}
1003   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: u\_data\textcolor{comment}{    !< The 3 dimensional array into which the}
1004 \textcolor{comment}{                                                     !! u-component of the data should be read}
1005   \textcolor{keywordtype}{real}, \textcolor{keywordtype}{dimension(:,:,:)}, \textcolor{keywordtype}{intent(inout)} :: v\_data\textcolor{comment}{    !< The 3 dimensional array into which the}
1006 \textcolor{comment}{                                                     !! v-component of the data should be read}
1007   \textcolor{keywordtype}{type}(mom\_domain\_type),  \textcolor{keywordtype}{intent(in)}    :: mom\_domain\textcolor{comment}{ !< The MOM\_Domain that describes the decomposition}
1008   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: timelevel\textcolor{comment}{ !< The time level in the file to read}
1009   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{   !< A flag indicating where this vector is discretized}
1010   \textcolor{keywordtype}{logical},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scalar\_pair\textcolor{comment}{ !< If true, a pair of scalars are to be
       read.cretized}
1011   \textcolor{keywordtype}{real},         \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{     !< A scaling factor that the fields are multiplied}
1012 \textcolor{comment}{                                                     !! by before they are returned.}
1013 
1014   \textcolor{keywordtype}{integer} :: is, ie, js, je
1015   \textcolor{keywordtype}{integer} :: u\_pos, v\_pos
1016 
1017   u\_pos = east\_face ; v\_pos = north\_face
1018   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) \textcolor{keywordflow}{then}
1019     \textcolor{keywordflow}{if} (stagger == cgrid\_ne) \textcolor{keywordflow}{then} ; u\_pos = east\_face ; v\_pos = north\_face
1020     \textcolor{keywordflow}{elseif} (stagger == bgrid\_ne) \textcolor{keywordflow}{then} ; u\_pos = corner ; v\_pos = corner
1021     \textcolor{keywordflow}{elseif} (stagger == agrid) \textcolor{keywordflow}{then} ; u\_pos = center ; v\_pos = center ;\textcolor{keywordflow}{ endif}
1022 \textcolor{keywordflow}{  endif}
1023 
1024   \textcolor{keyword}{call }read\_data(filename, u\_fieldname, u\_data, mom\_domain%mpp\_domain, &
1025                  timelevel=timelevel, position=u\_pos)
1026   \textcolor{keyword}{call }read\_data(filename, v\_fieldname, v\_data, mom\_domain%mpp\_domain, &
1027                  timelevel=timelevel, position=v\_pos)
1028 
1029   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (scale /= 1.0) \textcolor{keywordflow}{then}
1030     \textcolor{keyword}{call }get\_simple\_array\_i\_ind(mom\_domain, \textcolor{keyword}{size}(u\_data,1), is, ie)
1031     \textcolor{keyword}{call }get\_simple\_array\_j\_ind(mom\_domain, \textcolor{keyword}{size}(u\_data,2), js, je)
1032     u\_data(is:ie,js:je,:) = scale*u\_data(is:ie,js:je,:)
1033     \textcolor{keyword}{call }get\_simple\_array\_i\_ind(mom\_domain, \textcolor{keyword}{size}(v\_data,1), is, ie)
1034     \textcolor{keyword}{call }get\_simple\_array\_j\_ind(mom\_domain, \textcolor{keyword}{size}(v\_data,2), js, je)
1035     v\_data(is:ie,js:je,:) = scale*v\_data(is:ie,js:je,:)
1036 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}
1037 
\end{DoxyCode}


The documentation for this interface was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
/home/cermak/src/\+M\+O\+M6.\+devrob/src/framework/M\+O\+M\+\_\+io.\+F90\end{DoxyCompactItemize}
