\hypertarget{interfacemom__io_1_1mom__read__vector}{}\doxysection{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}}


\doxysubsection{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.

\doxysubsection*{Private functions}
\begin{DoxyCompactItemize}
\item 
subroutine \mbox{\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 \mbox{\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}


\doxysubsection{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.



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


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


\begin{DoxyCode}{0}
\DoxyCodeLine{955   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)}    :: filename\textcolor{comment}{  !< The name of the file to read}}
\DoxyCodeLine{956   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)}    :: u\_fieldname\textcolor{comment}{ !< The variable name of the u data in the file}}
\DoxyCodeLine{957   \textcolor{keywordtype}{character(len=*)},       \textcolor{keywordtype}{intent(in)}    :: v\_fieldname\textcolor{comment}{ !< The variable name of the v data in the file}}
\DoxyCodeLine{958 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: u\_data\textcolor{comment}{    !< The 2 dimensional array into which the}}
\DoxyCodeLine{959 \textcolor{comment}{                                                     !! u-\/component of the data should be read}}
\DoxyCodeLine{960 \textcolor{keywordtype}{  real}, \textcolor{keywordtype}{dimension(:,:)},   \textcolor{keywordtype}{intent(inout)} :: v\_data\textcolor{comment}{    !< The 2 dimensional array into which the}}
\DoxyCodeLine{961 \textcolor{comment}{                                                     !! v-\/component of the data should be read}}
\DoxyCodeLine{962   \textcolor{keywordtype}{type}(MOM\_domain\_type),  \textcolor{keywordtype}{intent(in)}    :: MOM\_Domain\textcolor{comment}{ !< The MOM\_Domain that describes the decomposition}}
\DoxyCodeLine{963   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: timelevel\textcolor{comment}{ !< The time level in the file to read}}
\DoxyCodeLine{964   \textcolor{keywordtype}{integer},      \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: stagger\textcolor{comment}{   !< A flag indicating where this vector is discretized}}
\DoxyCodeLine{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}}
\DoxyCodeLine{966 \textcolor{keywordtype}{  real},         \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)}    :: scale\textcolor{comment}{     !< A scaling factor that the fields are multiplied}}
\DoxyCodeLine{967 \textcolor{comment}{                                                     !! by before they are returned.}}
\DoxyCodeLine{968   \textcolor{keywordtype}{integer} :: is, ie, js, je}
\DoxyCodeLine{969   \textcolor{keywordtype}{integer} :: u\_pos, v\_pos}
\DoxyCodeLine{970 }
\DoxyCodeLine{971   u\_pos = east\_face ; v\_pos = north\_face}
\DoxyCodeLine{972   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stagger)) \textcolor{keywordflow}{then}}
\DoxyCodeLine{973     \textcolor{keywordflow}{if} (stagger == cgrid\_ne) \textcolor{keywordflow}{then} ; u\_pos = east\_face ; v\_pos = north\_face}
\DoxyCodeLine{974     \textcolor{keywordflow}{elseif} (stagger == bgrid\_ne) \textcolor{keywordflow}{then} ; u\_pos = corner ; v\_pos = corner}
\DoxyCodeLine{975     \textcolor{keywordflow}{elseif} (stagger == agrid) \textcolor{keywordflow}{then} ; u\_pos = center ; v\_pos = center ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{976 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{977 }
\DoxyCodeLine{978   \textcolor{keyword}{call }read\_data(filename, u\_fieldname, u\_data, mom\_domain\%mpp\_domain, \&}
\DoxyCodeLine{979                  timelevel=timelevel, position=u\_pos)}
\DoxyCodeLine{980   \textcolor{keyword}{call }read\_data(filename, v\_fieldname, v\_data, mom\_domain\%mpp\_domain, \&}
\DoxyCodeLine{981                  timelevel=timelevel, position=v\_pos)}
\DoxyCodeLine{982 }
\DoxyCodeLine{983   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(scale)) \textcolor{keywordflow}{then} ; \textcolor{keywordflow}{if} (scale /= 1.0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{984     \textcolor{keyword}{call }get\_simple\_array\_i\_ind(mom\_domain, \textcolor{keyword}{size}(u\_data,1), is, ie)}
\DoxyCodeLine{985     \textcolor{keyword}{call }get\_simple\_array\_j\_ind(mom\_domain, \textcolor{keyword}{size}(u\_data,2), js, je)}
\DoxyCodeLine{986     u\_data(is:ie,js:je) = scale*u\_data(is:ie,js:je)}
\DoxyCodeLine{987     \textcolor{keyword}{call }get\_simple\_array\_i\_ind(mom\_domain, \textcolor{keyword}{size}(v\_data,1), is, ie)}
\DoxyCodeLine{988     \textcolor{keyword}{call }get\_simple\_array\_j\_ind(mom\_domain, \textcolor{keyword}{size}(v\_data,2), js, je)}
\DoxyCodeLine{989     v\_data(is:ie,js:je) = scale*v\_data(is:ie,js:je)}
\DoxyCodeLine{990 \textcolor{keywordflow}{  endif} ;\textcolor{keywordflow}{ endif}}
\DoxyCodeLine{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}}
\doxysubsubsection{\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{\texttt{ in}}  & {\em filename} & The name of the file to read \\
\hline
\mbox{\texttt{ in}}  & {\em u\+\_\+fieldname} & The variable name of the u data in the file \\
\hline
\mbox{\texttt{ in}}  & {\em v\+\_\+fieldname} & The variable name of the v data in the file \\
\hline
\mbox{\texttt{ in,out}}  & {\em u\+\_\+data} & The 3 dimensional array into which the u-\/component of the data should be read \\
\hline
\mbox{\texttt{ in,out}}  & {\em v\+\_\+data} & The 3 dimensional array into which the v-\/component of the data should be read \\
\hline
\mbox{\texttt{ in}}  & {\em mom\+\_\+domain} & The M\+O\+M\+\_\+\+Domain that describes the decomposition \\
\hline
\mbox{\texttt{ in}}  & {\em timelevel} & The time level in the file to read \\
\hline
\mbox{\texttt{ in}}  & {\em stagger} & A flag indicating where this vector is discretized \\
\hline
\mbox{\texttt{ in}}  & {\em scalar\+\_\+pair} & If true, a pair of scalars are to be read.\+cretized \\
\hline
\mbox{\texttt{ in}}  & {\em scale} & A scaling factor that the fields are multiplied by before they are returned. \\
\hline
\end{DoxyParams}


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


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