\hypertarget{namespacemom__transcribe__grid}{}\doxysection{mom\+\_\+transcribe\+\_\+grid Module Reference}
\label{namespacemom__transcribe__grid}\index{mom\_transcribe\_grid@{mom\_transcribe\_grid}}


\doxysubsection{Detailed Description}
Module with routines for copying information from a shared dynamic horizontal grid to an ocean-\/specific horizontal grid and the reverse. \doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine, public \mbox{\hyperlink{namespacemom__transcribe__grid_abe8bd4f6f75bf431d0b53ef702a91d8d}{copy\+\_\+dyngrid\+\_\+to\+\_\+mom\+\_\+grid}} (dG, oG, US)
\begin{DoxyCompactList}\small\item\em Copies information from a dynamic (shared) horizontal grid type into an ocean\+\_\+grid\+\_\+type. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__transcribe__grid_afe3cc701e19603d664699db7fe8d72a8}{copy\+\_\+mom\+\_\+grid\+\_\+to\+\_\+dyngrid}} (oG, dG, US)
\begin{DoxyCompactList}\small\item\em Copies information from an ocean\+\_\+grid\+\_\+type into a dynamic (shared) horizontal grid type. \end{DoxyCompactList}\item 
subroutine, public \mbox{\hyperlink{namespacemom__transcribe__grid_a6eb8778abd0e6800af90271536b19796}{rotate\+\_\+dyngrid}} (G\+\_\+in, G, US, turns)
\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacemom__transcribe__grid_abe8bd4f6f75bf431d0b53ef702a91d8d}\label{namespacemom__transcribe__grid_abe8bd4f6f75bf431d0b53ef702a91d8d}} 
\index{mom\_transcribe\_grid@{mom\_transcribe\_grid}!copy\_dyngrid\_to\_mom\_grid@{copy\_dyngrid\_to\_mom\_grid}}
\index{copy\_dyngrid\_to\_mom\_grid@{copy\_dyngrid\_to\_mom\_grid}!mom\_transcribe\_grid@{mom\_transcribe\_grid}}
\doxysubsubsection{\texorpdfstring{copy\_dyngrid\_to\_mom\_grid()}{copy\_dyngrid\_to\_mom\_grid()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+transcribe\+\_\+grid\+::copy\+\_\+dyngrid\+\_\+to\+\_\+mom\+\_\+grid (\begin{DoxyParamCaption}\item[{type(dyn\+\_\+horgrid\+\_\+type), intent(in)}]{dG,  }\item[{type(ocean\+\_\+grid\+\_\+type), intent(inout)}]{oG,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US }\end{DoxyParamCaption})}



Copies information from a dynamic (shared) horizontal grid type into an ocean\+\_\+grid\+\_\+type. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em dg} & Common horizontal grid type \\
\hline
\mbox{\texttt{ in,out}}  & {\em og} & Ocean grid type \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\end{DoxyParams}


Definition at line 25 of file M\+O\+M\+\_\+transcribe\+\_\+grid.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{25   \textcolor{keywordtype}{type}(dyn\_horgrid\_type), \textcolor{keywordtype}{intent(in)}    :: dG\textcolor{comment}{  !< Common horizontal grid type}}
\DoxyCodeLine{26   \textcolor{keywordtype}{type}(ocean\_grid\_type),  \textcolor{keywordtype}{intent(inout)} :: oG\textcolor{comment}{  !< Ocean grid type}}
\DoxyCodeLine{27   \textcolor{keywordtype}{type}(unit\_scale\_type),  \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{  !< A dimensional unit scaling type}}
\DoxyCodeLine{28 }
\DoxyCodeLine{29   \textcolor{keywordtype}{integer} :: isd, ied, jsd, jed      \textcolor{comment}{! Common data domains.}}
\DoxyCodeLine{30   \textcolor{keywordtype}{integer} :: IsdB, IedB, JsdB, JedB  \textcolor{comment}{! Common data domains.}}
\DoxyCodeLine{31   \textcolor{keywordtype}{integer} :: ido, jdo, Ido2, Jdo2    \textcolor{comment}{! Indexing offsets between the grids.}}
\DoxyCodeLine{32   \textcolor{keywordtype}{integer} :: Igst, Jgst              \textcolor{comment}{! Global starting indices.}}
\DoxyCodeLine{33   \textcolor{keywordtype}{integer} :: i, j}
\DoxyCodeLine{34 }
\DoxyCodeLine{35   \textcolor{comment}{! MOM\_grid\_init and create\_dyn\_horgrid are called outside of this routine.}}
\DoxyCodeLine{36   \textcolor{comment}{! This routine copies over the fields that were set by MOM\_initialized\_fixed.}}
\DoxyCodeLine{37 }
\DoxyCodeLine{38   \textcolor{comment}{! Determine the indexing offsets between the grids.}}
\DoxyCodeLine{39   ido = dg\%idg\_offset -\/ og\%idg\_offset}
\DoxyCodeLine{40   jdo = dg\%jdg\_offset -\/ og\%jdg\_offset}
\DoxyCodeLine{41 }
\DoxyCodeLine{42   isd = max(og\%isd, dg\%isd+ido) ; jsd = max(og\%jsd, dg\%jsd+jdo)}
\DoxyCodeLine{43   ied = min(og\%ied, dg\%ied+ido) ; jed = min(og\%jed, dg\%jed+jdo)}
\DoxyCodeLine{44   isdb = max(og\%IsdB, dg\%IsdB+ido) ; jsdb = max(og\%JsdB, dg\%JsdB+jdo)}
\DoxyCodeLine{45   iedb = min(og\%IedB, dg\%IedB+ido) ; jedb = min(og\%JedB, dg\%JedB+jdo)}
\DoxyCodeLine{46 }
\DoxyCodeLine{47   \textcolor{comment}{! Check that the grids conform.}}
\DoxyCodeLine{48   \textcolor{keywordflow}{if} ((isd > og\%isc) .or. (ied < og\%ied) .or. (jsd > og\%jsc) .or. (jed > og\%jed)) \&}
\DoxyCodeLine{49     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"copy\_dyngrid\_to\_MOM\_grid called with incompatible grids."})}
\DoxyCodeLine{50 }
\DoxyCodeLine{51   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{52     og\%geoLonT(i,j) = dg\%geoLonT(i+ido,j+jdo)}
\DoxyCodeLine{53     og\%geoLatT(i,j) = dg\%geoLatT(i+ido,j+jdo)}
\DoxyCodeLine{54     og\%dxT(i,j) = dg\%dxT(i+ido,j+jdo)}
\DoxyCodeLine{55     og\%dyT(i,j) = dg\%dyT(i+ido,j+jdo)}
\DoxyCodeLine{56     og\%areaT(i,j) = dg\%areaT(i+ido,j+jdo)}
\DoxyCodeLine{57     og\%bathyT(i,j) = dg\%bathyT(i+ido,j+jdo)}
\DoxyCodeLine{58 }
\DoxyCodeLine{59     og\%dF\_dx(i,j) = dg\%dF\_dx(i+ido,j+jdo)}
\DoxyCodeLine{60     og\%dF\_dy(i,j) = dg\%dF\_dy(i+ido,j+jdo)}
\DoxyCodeLine{61     og\%sin\_rot(i,j) = dg\%sin\_rot(i+ido,j+jdo)}
\DoxyCodeLine{62     og\%cos\_rot(i,j) = dg\%cos\_rot(i+ido,j+jdo)}
\DoxyCodeLine{63     og\%mask2dT(i,j) = dg\%mask2dT(i+ido,j+jdo)}
\DoxyCodeLine{64 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{65 }
\DoxyCodeLine{66   \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{67     og\%geoLonCu(i,j) = dg\%geoLonCu(i+ido,j+jdo)}
\DoxyCodeLine{68     og\%geoLatCu(i,j) = dg\%geoLatCu(i+ido,j+jdo)}
\DoxyCodeLine{69     og\%dxCu(i,j) = dg\%dxCu(i+ido,j+jdo)}
\DoxyCodeLine{70     og\%dyCu(i,j) = dg\%dyCu(i+ido,j+jdo)}
\DoxyCodeLine{71     og\%dy\_Cu(i,j) = dg\%dy\_Cu(i+ido,j+jdo)}
\DoxyCodeLine{72 }
\DoxyCodeLine{73     og\%mask2dCu(i,j) = dg\%mask2dCu(i+ido,j+jdo)}
\DoxyCodeLine{74     og\%areaCu(i,j) = dg\%areaCu(i+ido,j+jdo)}
\DoxyCodeLine{75     og\%IareaCu(i,j) = dg\%IareaCu(i+ido,j+jdo)}
\DoxyCodeLine{76 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{77 }
\DoxyCodeLine{78   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsdb,jedb}
\DoxyCodeLine{79     og\%geoLonCv(i,j) = dg\%geoLonCv(i+ido,j+jdo)}
\DoxyCodeLine{80     og\%geoLatCv(i,j) = dg\%geoLatCv(i+ido,j+jdo)}
\DoxyCodeLine{81     og\%dxCv(i,j) = dg\%dxCv(i+ido,j+jdo)}
\DoxyCodeLine{82     og\%dyCv(i,j) = dg\%dyCv(i+ido,j+jdo)}
\DoxyCodeLine{83     og\%dx\_Cv(i,j) = dg\%dx\_Cv(i+ido,j+jdo)}
\DoxyCodeLine{84 }
\DoxyCodeLine{85     og\%mask2dCv(i,j) = dg\%mask2dCv(i+ido,j+jdo)}
\DoxyCodeLine{86     og\%areaCv(i,j) = dg\%areaCv(i+ido,j+jdo)}
\DoxyCodeLine{87     og\%IareaCv(i,j) = dg\%IareaCv(i+ido,j+jdo)}
\DoxyCodeLine{88 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{89 }
\DoxyCodeLine{90   \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsdb,jedb}
\DoxyCodeLine{91     og\%geoLonBu(i,j) = dg\%geoLonBu(i+ido,j+jdo)}
\DoxyCodeLine{92     og\%geoLatBu(i,j) = dg\%geoLatBu(i+ido,j+jdo)}
\DoxyCodeLine{93     og\%dxBu(i,j) = dg\%dxBu(i+ido,j+jdo)}
\DoxyCodeLine{94     og\%dyBu(i,j) = dg\%dyBu(i+ido,j+jdo)}
\DoxyCodeLine{95     og\%areaBu(i,j) = dg\%areaBu(i+ido,j+jdo)}
\DoxyCodeLine{96     og\%CoriolisBu(i,j) = dg\%CoriolisBu(i+ido,j+jdo)}
\DoxyCodeLine{97     og\%mask2dBu(i,j) = dg\%mask2dBu(i+ido,j+jdo)}
\DoxyCodeLine{98 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{99 }
\DoxyCodeLine{100   og\%bathymetry\_at\_vel = dg\%bathymetry\_at\_vel}
\DoxyCodeLine{101   \textcolor{keywordflow}{if} (og\%bathymetry\_at\_vel) \textcolor{keywordflow}{then}}
\DoxyCodeLine{102     \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{103       og\%Dblock\_u(i,j) = dg\%Dblock\_u(i+ido,j+jdo)}
\DoxyCodeLine{104       og\%Dopen\_u(i,j) = dg\%Dopen\_u(i+ido,j+jdo)}
\DoxyCodeLine{105 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{106     \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsdb,jedb}
\DoxyCodeLine{107       og\%Dblock\_v(i,j) = dg\%Dblock\_v(i+ido,j+jdo)}
\DoxyCodeLine{108       og\%Dopen\_v(i,j) = dg\%Dopen\_v(i+ido,j+jdo)}
\DoxyCodeLine{109 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{110 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{111 }
\DoxyCodeLine{112   og\%gridLonT(og\%isg:og\%ieg) = dg\%gridLonT(dg\%isg:dg\%ieg)}
\DoxyCodeLine{113   og\%gridLatT(og\%jsg:og\%jeg) = dg\%gridLatT(dg\%jsg:dg\%jeg)}
\DoxyCodeLine{114   \textcolor{comment}{! The more complicated logic here avoids segmentation faults if one grid uses}}
\DoxyCodeLine{115   \textcolor{comment}{! global symmetric memory while the other does not.  Because a northeast grid}}
\DoxyCodeLine{116   \textcolor{comment}{! convention is being used, the upper bounds for each array correspond.}}
\DoxyCodeLine{117   \textcolor{comment}{!   Note that the dynamic grid always uses symmetric memory.}}
\DoxyCodeLine{118   ido2 = dg\%IegB-\/og\%IegB ; igst = max(og\%IsgB, (dg\%isg-\/1)-\/ido2)}
\DoxyCodeLine{119   jdo2 = dg\%JegB-\/og\%JegB ; jgst = max(og\%JsgB, (dg\%jsg-\/1)-\/jdo2)}
\DoxyCodeLine{120   \textcolor{keywordflow}{do} i=igst,og\%IegB ; og\%gridLonB(i) = dg\%gridLonB(i+ido2) ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{121   \textcolor{keywordflow}{do} j=jgst,og\%JegB ; og\%gridLatB(j) = dg\%gridLatB(j+jdo2) ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{122 }
\DoxyCodeLine{123   \textcolor{comment}{! Copy various scalar variables and strings.}}
\DoxyCodeLine{124   og\%x\_axis\_units = dg\%x\_axis\_units ; og\%y\_axis\_units = dg\%y\_axis\_units}
\DoxyCodeLine{125   og\%areaT\_global = dg\%areaT\_global ; og\%IareaT\_global = dg\%IareaT\_global}
\DoxyCodeLine{126   og\%south\_lat = dg\%south\_lat ; og\%west\_lon  = dg\%west\_lon}
\DoxyCodeLine{127   og\%len\_lat = dg\%len\_lat ; og\%len\_lon = dg\%len\_lon}
\DoxyCodeLine{128   og\%Rad\_Earth = dg\%Rad\_Earth ; og\%max\_depth = dg\%max\_depth}
\DoxyCodeLine{129 }
\DoxyCodeLine{130 \textcolor{comment}{! Update the halos in case the dynamic grid has smaller halos than the ocean grid.}}
\DoxyCodeLine{131   \textcolor{keyword}{call }pass\_var(og\%areaT, og\%Domain)}
\DoxyCodeLine{132   \textcolor{keyword}{call }pass\_var(og\%bathyT, og\%Domain)}
\DoxyCodeLine{133   \textcolor{keyword}{call }pass\_var(og\%geoLonT, og\%Domain)}
\DoxyCodeLine{134   \textcolor{keyword}{call }pass\_var(og\%geoLatT, og\%Domain)}
\DoxyCodeLine{135   \textcolor{keyword}{call }pass\_vector(og\%dxT, og\%dyT, og\%Domain, to\_all+scalar\_pair, agrid)}
\DoxyCodeLine{136   \textcolor{keyword}{call }pass\_vector(og\%dF\_dx, og\%dF\_dy, og\%Domain, to\_all, agrid)}
\DoxyCodeLine{137   \textcolor{keyword}{call }pass\_vector(og\%cos\_rot, og\%sin\_rot, og\%Domain, to\_all, agrid)}
\DoxyCodeLine{138   \textcolor{keyword}{call }pass\_var(og\%mask2dT, og\%Domain)}
\DoxyCodeLine{139 }
\DoxyCodeLine{140   \textcolor{keyword}{call }pass\_vector(og\%areaCu, og\%areaCv, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{141   \textcolor{keyword}{call }pass\_vector(og\%dyCu, og\%dxCv, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{142   \textcolor{keyword}{call }pass\_vector(og\%dxCu, og\%dyCv, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{143   \textcolor{keyword}{call }pass\_vector(og\%dy\_Cu, og\%dx\_Cv, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{144   \textcolor{keyword}{call }pass\_vector(og\%mask2dCu, og\%mask2dCv, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{145   \textcolor{keyword}{call }pass\_vector(og\%IareaCu, og\%IareaCv, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{146   \textcolor{keyword}{call }pass\_vector(og\%IareaCu, og\%IareaCv, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{147   \textcolor{keyword}{call }pass\_vector(og\%geoLatCu, og\%geoLatCv, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{148 }
\DoxyCodeLine{149   \textcolor{keyword}{call }pass\_var(og\%areaBu, og\%Domain, position=corner)}
\DoxyCodeLine{150   \textcolor{keyword}{call }pass\_var(og\%geoLonBu, og\%Domain, position=corner, inner\_halo=og\%isc-\/isd)}
\DoxyCodeLine{151   \textcolor{keyword}{call }pass\_var(og\%geoLatBu, og\%Domain, position=corner)}
\DoxyCodeLine{152   \textcolor{keyword}{call }pass\_vector(og\%dxBu, og\%dyBu, og\%Domain, to\_all+scalar\_pair, bgrid\_ne)}
\DoxyCodeLine{153   \textcolor{keyword}{call }pass\_var(og\%CoriolisBu, og\%Domain, position=corner)}
\DoxyCodeLine{154   \textcolor{keyword}{call }pass\_var(og\%mask2dBu, og\%Domain, position=corner)}
\DoxyCodeLine{155 }
\DoxyCodeLine{156   \textcolor{keywordflow}{if} (og\%bathymetry\_at\_vel) \textcolor{keywordflow}{then}}
\DoxyCodeLine{157     \textcolor{keyword}{call }pass\_vector(og\%Dblock\_u, og\%Dblock\_v, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{158     \textcolor{keyword}{call }pass\_vector(og\%Dopen\_u, og\%Dopen\_v, og\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{159 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{160 }
\DoxyCodeLine{161   \textcolor{keyword}{call }set\_derived\_metrics(og, us)}
\DoxyCodeLine{162 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__transcribe__grid_afe3cc701e19603d664699db7fe8d72a8}\label{namespacemom__transcribe__grid_afe3cc701e19603d664699db7fe8d72a8}} 
\index{mom\_transcribe\_grid@{mom\_transcribe\_grid}!copy\_mom\_grid\_to\_dyngrid@{copy\_mom\_grid\_to\_dyngrid}}
\index{copy\_mom\_grid\_to\_dyngrid@{copy\_mom\_grid\_to\_dyngrid}!mom\_transcribe\_grid@{mom\_transcribe\_grid}}
\doxysubsubsection{\texorpdfstring{copy\_mom\_grid\_to\_dyngrid()}{copy\_mom\_grid\_to\_dyngrid()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+transcribe\+\_\+grid\+::copy\+\_\+mom\+\_\+grid\+\_\+to\+\_\+dyngrid (\begin{DoxyParamCaption}\item[{type(ocean\+\_\+grid\+\_\+type), intent(in)}]{oG,  }\item[{type(dyn\+\_\+horgrid\+\_\+type), intent(inout)}]{dG,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in), optional}]{US }\end{DoxyParamCaption})}



Copies information from an ocean\+\_\+grid\+\_\+type into a dynamic (shared) horizontal grid type. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em og} & Ocean grid type \\
\hline
\mbox{\texttt{ in,out}}  & {\em dg} & Common horizontal grid type \\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type \\
\hline
\end{DoxyParams}


Definition at line 169 of file M\+O\+M\+\_\+transcribe\+\_\+grid.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{169   \textcolor{keywordtype}{type}(ocean\_grid\_type),  \textcolor{keywordtype}{intent(in)}    :: oG\textcolor{comment}{  !< Ocean grid type}}
\DoxyCodeLine{170   \textcolor{keywordtype}{type}(dyn\_horgrid\_type), \textcolor{keywordtype}{intent(inout)} :: dG\textcolor{comment}{  !< Common horizontal grid type}}
\DoxyCodeLine{171   \textcolor{keywordtype}{type}(unit\_scale\_type), \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{intent(in)} :: US\textcolor{comment}{ !< A dimensional unit scaling type}}
\DoxyCodeLine{172 }
\DoxyCodeLine{173   \textcolor{keywordtype}{integer} :: isd, ied, jsd, jed      \textcolor{comment}{! Common data domains.}}
\DoxyCodeLine{174   \textcolor{keywordtype}{integer} :: IsdB, IedB, JsdB, JedB  \textcolor{comment}{! Common data domains.}}
\DoxyCodeLine{175   \textcolor{keywordtype}{integer} :: ido, jdo, Ido2, Jdo2    \textcolor{comment}{! Indexing offsets between the grids.}}
\DoxyCodeLine{176   \textcolor{keywordtype}{integer} :: Igst, Jgst              \textcolor{comment}{! Global starting indices.}}
\DoxyCodeLine{177   \textcolor{keywordtype}{integer} :: i, j}
\DoxyCodeLine{178 }
\DoxyCodeLine{179   \textcolor{comment}{! MOM\_grid\_init and create\_dyn\_horgrid are called outside of this routine.}}
\DoxyCodeLine{180   \textcolor{comment}{! This routine copies over the fields that were set by MOM\_initialized\_fixed.}}
\DoxyCodeLine{181 }
\DoxyCodeLine{182   \textcolor{comment}{! Determine the indexing offsets between the grids.}}
\DoxyCodeLine{183   ido = og\%idG\_offset -\/ dg\%idG\_offset}
\DoxyCodeLine{184   jdo = og\%jdG\_offset -\/ dg\%jdG\_offset}
\DoxyCodeLine{185 }
\DoxyCodeLine{186   isd = max(dg\%isd, og\%isd+ido) ; jsd = max(dg\%jsd, og\%jsd+jdo)}
\DoxyCodeLine{187   ied = min(dg\%ied, og\%ied+ido) ; jed = min(dg\%jed, og\%jed+jdo)}
\DoxyCodeLine{188   isdb = max(dg\%IsdB, og\%IsdB+ido) ; jsdb = max(dg\%JsdB, og\%JsdB+jdo)}
\DoxyCodeLine{189   iedb = min(dg\%IedB, og\%IedB+ido) ; jedb = min(dg\%JedB, og\%JedB+jdo)}
\DoxyCodeLine{190 }
\DoxyCodeLine{191   \textcolor{comment}{! Check that the grids conform.}}
\DoxyCodeLine{192   \textcolor{keywordflow}{if} ((isd > dg\%isc) .or. (ied < dg\%ied) .or. (jsd > dg\%jsc) .or. (jed > dg\%jed)) \&}
\DoxyCodeLine{193     \textcolor{keyword}{call }mom\_error(fatal, \textcolor{stringliteral}{"copy\_dyngrid\_to\_MOM\_grid called with incompatible grids."})}
\DoxyCodeLine{194 }
\DoxyCodeLine{195   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{196     dg\%geoLonT(i,j) = og\%geoLonT(i+ido,j+jdo)}
\DoxyCodeLine{197     dg\%geoLatT(i,j) = og\%geoLatT(i+ido,j+jdo)}
\DoxyCodeLine{198     dg\%dxT(i,j) = og\%dxT(i+ido,j+jdo)}
\DoxyCodeLine{199     dg\%dyT(i,j) = og\%dyT(i+ido,j+jdo)}
\DoxyCodeLine{200     dg\%areaT(i,j) = og\%areaT(i+ido,j+jdo)}
\DoxyCodeLine{201     dg\%bathyT(i,j) = og\%bathyT(i+ido,j+jdo)}
\DoxyCodeLine{202 }
\DoxyCodeLine{203     dg\%dF\_dx(i,j) = og\%dF\_dx(i+ido,j+jdo)}
\DoxyCodeLine{204     dg\%dF\_dy(i,j) = og\%dF\_dy(i+ido,j+jdo)}
\DoxyCodeLine{205     dg\%sin\_rot(i,j) = og\%sin\_rot(i+ido,j+jdo)}
\DoxyCodeLine{206     dg\%cos\_rot(i,j) = og\%cos\_rot(i+ido,j+jdo)}
\DoxyCodeLine{207     dg\%mask2dT(i,j) = og\%mask2dT(i+ido,j+jdo)}
\DoxyCodeLine{208 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{209 }
\DoxyCodeLine{210   \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{211     dg\%geoLonCu(i,j) = og\%geoLonCu(i+ido,j+jdo)}
\DoxyCodeLine{212     dg\%geoLatCu(i,j) = og\%geoLatCu(i+ido,j+jdo)}
\DoxyCodeLine{213     dg\%dxCu(i,j) = og\%dxCu(i+ido,j+jdo)}
\DoxyCodeLine{214     dg\%dyCu(i,j) = og\%dyCu(i+ido,j+jdo)}
\DoxyCodeLine{215     dg\%dy\_Cu(i,j) = og\%dy\_Cu(i+ido,j+jdo)}
\DoxyCodeLine{216 }
\DoxyCodeLine{217     dg\%mask2dCu(i,j) = og\%mask2dCu(i+ido,j+jdo)}
\DoxyCodeLine{218     dg\%areaCu(i,j) = og\%areaCu(i+ido,j+jdo)}
\DoxyCodeLine{219     dg\%IareaCu(i,j) = og\%IareaCu(i+ido,j+jdo)}
\DoxyCodeLine{220 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{221 }
\DoxyCodeLine{222   \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsdb,jedb}
\DoxyCodeLine{223     dg\%geoLonCv(i,j) = og\%geoLonCv(i+ido,j+jdo)}
\DoxyCodeLine{224     dg\%geoLatCv(i,j) = og\%geoLatCv(i+ido,j+jdo)}
\DoxyCodeLine{225     dg\%dxCv(i,j) = og\%dxCv(i+ido,j+jdo)}
\DoxyCodeLine{226     dg\%dyCv(i,j) = og\%dyCv(i+ido,j+jdo)}
\DoxyCodeLine{227     dg\%dx\_Cv(i,j) = og\%dx\_Cv(i+ido,j+jdo)}
\DoxyCodeLine{228 }
\DoxyCodeLine{229     dg\%mask2dCv(i,j) = og\%mask2dCv(i+ido,j+jdo)}
\DoxyCodeLine{230     dg\%areaCv(i,j) = og\%areaCv(i+ido,j+jdo)}
\DoxyCodeLine{231     dg\%IareaCv(i,j) = og\%IareaCv(i+ido,j+jdo)}
\DoxyCodeLine{232 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{233 }
\DoxyCodeLine{234   \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsdb,jedb}
\DoxyCodeLine{235     dg\%geoLonBu(i,j) = og\%geoLonBu(i+ido,j+jdo)}
\DoxyCodeLine{236     dg\%geoLatBu(i,j) = og\%geoLatBu(i+ido,j+jdo)}
\DoxyCodeLine{237     dg\%dxBu(i,j) = og\%dxBu(i+ido,j+jdo)}
\DoxyCodeLine{238     dg\%dyBu(i,j) = og\%dyBu(i+ido,j+jdo)}
\DoxyCodeLine{239     dg\%areaBu(i,j) = og\%areaBu(i+ido,j+jdo)}
\DoxyCodeLine{240     dg\%CoriolisBu(i,j) = og\%CoriolisBu(i+ido,j+jdo)}
\DoxyCodeLine{241     dg\%mask2dBu(i,j) = og\%mask2dBu(i+ido,j+jdo)}
\DoxyCodeLine{242 \textcolor{keywordflow}{  enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{243 }
\DoxyCodeLine{244   dg\%bathymetry\_at\_vel = og\%bathymetry\_at\_vel}
\DoxyCodeLine{245   \textcolor{keywordflow}{if} (dg\%bathymetry\_at\_vel) \textcolor{keywordflow}{then}}
\DoxyCodeLine{246     \textcolor{keywordflow}{do} i=isdb,iedb ; \textcolor{keywordflow}{do} j=jsd,jed}
\DoxyCodeLine{247       dg\%Dblock\_u(i,j) = og\%Dblock\_u(i+ido,j+jdo)}
\DoxyCodeLine{248       dg\%Dopen\_u(i,j) = og\%Dopen\_u(i+ido,j+jdo)}
\DoxyCodeLine{249 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{250     \textcolor{keywordflow}{do} i=isd,ied ; \textcolor{keywordflow}{do} j=jsdb,jedb}
\DoxyCodeLine{251       dg\%Dblock\_v(i,j) = og\%Dblock\_v(i+ido,j+jdo)}
\DoxyCodeLine{252       dg\%Dopen\_v(i,j) = og\%Dopen\_v(i+ido,j+jdo)}
\DoxyCodeLine{253 \textcolor{keywordflow}{    enddo} ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{254 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{255 }
\DoxyCodeLine{256   dg\%gridLonT(dg\%isg:dg\%ieg) = og\%gridLonT(og\%isg:og\%ieg)}
\DoxyCodeLine{257   dg\%gridLatT(dg\%jsg:dg\%jeg) = og\%gridLatT(og\%jsg:og\%jeg)}
\DoxyCodeLine{258 }
\DoxyCodeLine{259   \textcolor{comment}{! The more complicated logic here avoids segmentation faults if one grid uses}}
\DoxyCodeLine{260   \textcolor{comment}{! global symmetric memory while the other does not.  Because a northeast grid}}
\DoxyCodeLine{261   \textcolor{comment}{! convention is being used, the upper bounds for each array correspond.}}
\DoxyCodeLine{262   \textcolor{comment}{!   Note that the dynamic grid always uses symmetric memory.}}
\DoxyCodeLine{263   ido2 = og\%IegB-\/dg\%IegB ; igst = max(dg\%isg-\/1, og\%IsgB-\/ido2)}
\DoxyCodeLine{264   jdo2 = og\%JegB-\/dg\%JegB ; jgst = max(dg\%jsg-\/1, og\%JsgB-\/jdo2)}
\DoxyCodeLine{265   \textcolor{keywordflow}{do} i=igst,dg\%IegB ; dg\%gridLonB(i) = og\%gridLonB(i+ido2) ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{266   \textcolor{keywordflow}{do} j=jgst,dg\%JegB ; dg\%gridLatB(j) = og\%gridLatB(j+jdo2) ;\textcolor{keywordflow}{ enddo}}
\DoxyCodeLine{267 }
\DoxyCodeLine{268   \textcolor{comment}{! Copy various scalar variables and strings.}}
\DoxyCodeLine{269   dg\%x\_axis\_units = og\%x\_axis\_units ; dg\%y\_axis\_units = og\%y\_axis\_units}
\DoxyCodeLine{270   dg\%areaT\_global = og\%areaT\_global ; dg\%IareaT\_global = og\%IareaT\_global}
\DoxyCodeLine{271   dg\%south\_lat = og\%south\_lat ; dg\%west\_lon  = og\%west\_lon}
\DoxyCodeLine{272   dg\%len\_lat = og\%len\_lat ; dg\%len\_lon = og\%len\_lon}
\DoxyCodeLine{273   dg\%Rad\_Earth = og\%Rad\_Earth ; dg\%max\_depth = og\%max\_depth}
\DoxyCodeLine{274 }
\DoxyCodeLine{275 \textcolor{comment}{! Update the halos in case the dynamic grid has smaller halos than the ocean grid.}}
\DoxyCodeLine{276   \textcolor{keyword}{call }pass\_var(dg\%areaT, dg\%Domain)}
\DoxyCodeLine{277   \textcolor{keyword}{call }pass\_var(dg\%bathyT, dg\%Domain)}
\DoxyCodeLine{278   \textcolor{keyword}{call }pass\_var(dg\%geoLonT, dg\%Domain)}
\DoxyCodeLine{279   \textcolor{keyword}{call }pass\_var(dg\%geoLatT, dg\%Domain)}
\DoxyCodeLine{280   \textcolor{keyword}{call }pass\_vector(dg\%dxT, dg\%dyT, dg\%Domain, to\_all+scalar\_pair, agrid)}
\DoxyCodeLine{281   \textcolor{keyword}{call }pass\_vector(dg\%dF\_dx, dg\%dF\_dy, dg\%Domain, to\_all, agrid)}
\DoxyCodeLine{282   \textcolor{keyword}{call }pass\_vector(dg\%cos\_rot, dg\%sin\_rot, dg\%Domain, to\_all, agrid)}
\DoxyCodeLine{283   \textcolor{keyword}{call }pass\_var(dg\%mask2dT, dg\%Domain)}
\DoxyCodeLine{284 }
\DoxyCodeLine{285   \textcolor{keyword}{call }pass\_vector(dg\%areaCu, dg\%areaCv, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{286   \textcolor{keyword}{call }pass\_vector(dg\%dyCu, dg\%dxCv, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{287   \textcolor{keyword}{call }pass\_vector(dg\%dxCu, dg\%dyCv, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{288   \textcolor{keyword}{call }pass\_vector(dg\%dy\_Cu, dg\%dx\_Cv, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{289   \textcolor{keyword}{call }pass\_vector(dg\%mask2dCu, dg\%mask2dCv, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{290   \textcolor{keyword}{call }pass\_vector(dg\%IareaCu, dg\%IareaCv, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{291   \textcolor{keyword}{call }pass\_vector(dg\%IareaCu, dg\%IareaCv, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{292   \textcolor{keyword}{call }pass\_vector(dg\%geoLatCu, dg\%geoLatCv, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{293 }
\DoxyCodeLine{294   \textcolor{keyword}{call }pass\_var(dg\%areaBu, dg\%Domain, position=corner)}
\DoxyCodeLine{295   \textcolor{keyword}{call }pass\_var(dg\%geoLonBu, dg\%Domain, position=corner, inner\_halo=dg\%isc-\/isd)}
\DoxyCodeLine{296   \textcolor{keyword}{call }pass\_var(dg\%geoLatBu, dg\%Domain, position=corner)}
\DoxyCodeLine{297   \textcolor{keyword}{call }pass\_vector(dg\%dxBu, dg\%dyBu, dg\%Domain, to\_all+scalar\_pair, bgrid\_ne)}
\DoxyCodeLine{298   \textcolor{keyword}{call }pass\_var(dg\%CoriolisBu, dg\%Domain, position=corner)}
\DoxyCodeLine{299   \textcolor{keyword}{call }pass\_var(dg\%mask2dBu, dg\%Domain, position=corner)}
\DoxyCodeLine{300 }
\DoxyCodeLine{301   \textcolor{keywordflow}{if} (dg\%bathymetry\_at\_vel) \textcolor{keywordflow}{then}}
\DoxyCodeLine{302     \textcolor{keyword}{call }pass\_vector(dg\%Dblock\_u, dg\%Dblock\_v, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{303     \textcolor{keyword}{call }pass\_vector(dg\%Dopen\_u, dg\%Dopen\_v, dg\%Domain, to\_all+scalar\_pair, cgrid\_ne)}
\DoxyCodeLine{304 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{305 }
\DoxyCodeLine{306   \textcolor{keyword}{call  }set\_derived\_dyn\_horgrid(dg, us)}
\DoxyCodeLine{307 }

\end{DoxyCode}
\mbox{\Hypertarget{namespacemom__transcribe__grid_a6eb8778abd0e6800af90271536b19796}\label{namespacemom__transcribe__grid_a6eb8778abd0e6800af90271536b19796}} 
\index{mom\_transcribe\_grid@{mom\_transcribe\_grid}!rotate\_dyngrid@{rotate\_dyngrid}}
\index{rotate\_dyngrid@{rotate\_dyngrid}!mom\_transcribe\_grid@{mom\_transcribe\_grid}}
\doxysubsubsection{\texorpdfstring{rotate\_dyngrid()}{rotate\_dyngrid()}}
{\footnotesize\ttfamily subroutine, public mom\+\_\+transcribe\+\_\+grid\+::rotate\+\_\+dyngrid (\begin{DoxyParamCaption}\item[{type(dyn\+\_\+horgrid\+\_\+type), intent(in)}]{G\+\_\+in,  }\item[{type(dyn\+\_\+horgrid\+\_\+type), intent(inout)}]{G,  }\item[{type(unit\+\_\+scale\+\_\+type), intent(in)}]{US,  }\item[{integer, intent(in)}]{turns }\end{DoxyParamCaption})}


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em g\+\_\+in} & Common horizontal grid type\\
\hline
\mbox{\texttt{ in,out}}  & {\em g} & Ocean grid type\\
\hline
\mbox{\texttt{ in}}  & {\em us} & A dimensional unit scaling type\\
\hline
\mbox{\texttt{ in}}  & {\em turns} & Number of quarter turns \\
\hline
\end{DoxyParams}


Definition at line 311 of file M\+O\+M\+\_\+transcribe\+\_\+grid.\+F90.


\begin{DoxyCode}{0}
\DoxyCodeLine{311   \textcolor{keywordtype}{type}(dyn\_horgrid\_type), \textcolor{keywordtype}{intent(in)}    :: G\_in\textcolor{comment}{   !< Common horizontal grid type}}
\DoxyCodeLine{312   \textcolor{keywordtype}{type}(dyn\_horgrid\_type), \textcolor{keywordtype}{intent(inout)} :: G\textcolor{comment}{      !< Ocean grid type}}
\DoxyCodeLine{313   \textcolor{keywordtype}{type}(unit\_scale\_type),  \textcolor{keywordtype}{intent(in)}    :: US\textcolor{comment}{     !< A dimensional unit scaling type}}
\DoxyCodeLine{314   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)} :: turns\textcolor{comment}{                    !< Number of quarter turns}}
\DoxyCodeLine{315 }
\DoxyCodeLine{316   \textcolor{keywordtype}{integer} :: jsc, jec, jscB, jecB}
\DoxyCodeLine{317   \textcolor{keywordtype}{integer} :: qturn}
\DoxyCodeLine{318 }
\DoxyCodeLine{319   \textcolor{comment}{! Center point}}
\DoxyCodeLine{320   \textcolor{keyword}{call }rotate\_array(g\_in\%geoLonT, turns, g\%geoLonT)}
\DoxyCodeLine{321   \textcolor{keyword}{call }rotate\_array(g\_in\%geoLatT, turns, g\%geoLatT)}
\DoxyCodeLine{322   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%dxT, g\_in\%dyT, turns, g\%dxT, g\%dyT)}
\DoxyCodeLine{323   \textcolor{keyword}{call }rotate\_array(g\_in\%areaT, turns, g\%areaT)}
\DoxyCodeLine{324   \textcolor{keyword}{call }rotate\_array(g\_in\%bathyT, turns, g\%bathyT)}
\DoxyCodeLine{325 }
\DoxyCodeLine{326   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%df\_dx, g\_in\%df\_dy, turns, g\%df\_dx, g\%df\_dy)}
\DoxyCodeLine{327   \textcolor{keyword}{call }rotate\_array(g\_in\%sin\_rot, turns, g\%sin\_rot)}
\DoxyCodeLine{328   \textcolor{keyword}{call }rotate\_array(g\_in\%cos\_rot, turns, g\%cos\_rot)}
\DoxyCodeLine{329   \textcolor{keyword}{call }rotate\_array(g\_in\%mask2dT, turns, g\%mask2dT)}
\DoxyCodeLine{330 }
\DoxyCodeLine{331   \textcolor{comment}{! Face point}}
\DoxyCodeLine{332   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%geoLonCu, g\_in\%geoLonCv, turns, \&}
\DoxyCodeLine{333       g\%geoLonCu, g\%geoLonCv)}
\DoxyCodeLine{334   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%geoLatCu, g\_in\%geoLatCv, turns, \&}
\DoxyCodeLine{335       g\%geoLatCu, g\%geoLatCv)}
\DoxyCodeLine{336   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%dxCu, g\_in\%dyCv, turns, g\%dxCu, g\%dyCv)}
\DoxyCodeLine{337   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%dxCv, g\_in\%dyCu, turns, g\%dxCv, g\%dyCu)}
\DoxyCodeLine{338   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%dx\_Cv, g\_in\%dy\_Cu, turns, g\%dx\_Cv, g\%dy\_Cu)}
\DoxyCodeLine{339 }
\DoxyCodeLine{340   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%mask2dCu, g\_in\%mask2dCv, turns, \&}
\DoxyCodeLine{341       g\%mask2dCu, g\%mask2dCv)}
\DoxyCodeLine{342   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%areaCu, g\_in\%areaCv, turns, \&}
\DoxyCodeLine{343       g\%areaCu, g\%areaCv)}
\DoxyCodeLine{344   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%IareaCu, g\_in\%IareaCv, turns, \&}
\DoxyCodeLine{345       g\%IareaCu, g\%IareaCv)}
\DoxyCodeLine{346 }
\DoxyCodeLine{347   \textcolor{comment}{! Vertex point}}
\DoxyCodeLine{348   \textcolor{keyword}{call }rotate\_array(g\_in\%geoLonBu, turns, g\%geoLonBu)}
\DoxyCodeLine{349   \textcolor{keyword}{call }rotate\_array(g\_in\%geoLatBu, turns, g\%geoLatBu)}
\DoxyCodeLine{350   \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%dxBu, g\_in\%dyBu, turns, g\%dxBu, g\%dyBu)}
\DoxyCodeLine{351   \textcolor{keyword}{call }rotate\_array(g\_in\%areaBu, turns, g\%areaBu)}
\DoxyCodeLine{352   \textcolor{keyword}{call }rotate\_array(g\_in\%CoriolisBu, turns, g\%CoriolisBu)}
\DoxyCodeLine{353   \textcolor{keyword}{call }rotate\_array(g\_in\%mask2dBu, turns, g\%mask2dBu)}
\DoxyCodeLine{354 }
\DoxyCodeLine{355   \textcolor{comment}{! Topographic}}
\DoxyCodeLine{356   g\%bathymetry\_at\_vel = g\_in\%bathymetry\_at\_vel}
\DoxyCodeLine{357   \textcolor{keywordflow}{if} (g\%bathymetry\_at\_vel) \textcolor{keywordflow}{then}}
\DoxyCodeLine{358     \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%Dblock\_u, g\_in\%Dblock\_v, turns, \&}
\DoxyCodeLine{359         g\%Dblock\_u, g\%Dblock\_v)}
\DoxyCodeLine{360     \textcolor{keyword}{call }rotate\_array\_pair(g\_in\%Dopen\_u, g\_in\%Dopen\_v, turns, \&}
\DoxyCodeLine{361         g\%Dopen\_u, g\%Dopen\_v)}
\DoxyCodeLine{362 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{363 }
\DoxyCodeLine{364   \textcolor{comment}{! Nominal grid axes}}
\DoxyCodeLine{365   \textcolor{comment}{! TODO: We should not assign lat values to the lon axis, and vice versa.}}
\DoxyCodeLine{366   \textcolor{comment}{!   We temporarily copy lat <-\/> lon since several components still expect}}
\DoxyCodeLine{367   \textcolor{comment}{!   lat and lon sizes to match the first and second dimension sizes.}}
\DoxyCodeLine{368   \textcolor{comment}{!   But we ought to instead leave them unchanged and adjust the references to}}
\DoxyCodeLine{369   \textcolor{comment}{!   these axes.}}
\DoxyCodeLine{370   \textcolor{keywordflow}{if} (modulo(turns, 2) /= 0) \textcolor{keywordflow}{then}}
\DoxyCodeLine{371     g\%gridLonT(:) = g\_in\%gridLatT(g\_in\%jeg:g\_in\%jsg:-\/1)}
\DoxyCodeLine{372     g\%gridLatT(:) = g\_in\%gridLonT(:)}
\DoxyCodeLine{373     g\%gridLonB(:) = g\_in\%gridLatB(g\_in\%jeg:(g\_in\%jsg-\/1):-\/1)}
\DoxyCodeLine{374     g\%gridLatB(:) = g\_in\%gridLonB(:)}
\DoxyCodeLine{375   \textcolor{keywordflow}{else}}
\DoxyCodeLine{376     g\%gridLonT(:) = g\_in\%gridLonT(:)}
\DoxyCodeLine{377     g\%gridLatT(:) = g\_in\%gridLatT(:)}
\DoxyCodeLine{378     g\%gridLonB(:) = g\_in\%gridLonB(:)}
\DoxyCodeLine{379     g\%gridLatB(:) = g\_in\%gridLatB(:)}
\DoxyCodeLine{380 \textcolor{keywordflow}{  endif}}
\DoxyCodeLine{381 }
\DoxyCodeLine{382   g\%x\_axis\_units = g\_in\%y\_axis\_units}
\DoxyCodeLine{383   g\%y\_axis\_units = g\_in\%x\_axis\_units}
\DoxyCodeLine{384   g\%south\_lat = g\_in\%south\_lat}
\DoxyCodeLine{385   g\%west\_lon = g\_in\%west\_lon}
\DoxyCodeLine{386   g\%len\_lat = g\_in\%len\_lat}
\DoxyCodeLine{387   g\%len\_lon = g\_in\%len\_lon}
\DoxyCodeLine{388 }
\DoxyCodeLine{389   \textcolor{comment}{! Rotation-\/invariant fields}}
\DoxyCodeLine{390   g\%areaT\_global = g\_in\%areaT\_global}
\DoxyCodeLine{391   g\%IareaT\_global = g\_in\%IareaT\_global}
\DoxyCodeLine{392   g\%Rad\_Earth = g\_in\%Rad\_Earth}
\DoxyCodeLine{393   g\%max\_depth = g\_in\%max\_depth}
\DoxyCodeLine{394 }
\DoxyCodeLine{395   \textcolor{keyword}{call }set\_derived\_dyn\_horgrid(g, us)}

\end{DoxyCode}
