\hypertarget{namespacew__module__interpolate}{}\doxysection{w\+\_\+module\+\_\+interpolate Module Reference}
\label{namespacew__module__interpolate}\index{w\_module\_interpolate@{w\_module\_interpolate}}


\doxysubsection{Detailed Description}
\mbox{\hyperlink{namespacew__module}{w\+\_\+module}} の下部モジュール\+: 補間計算 

\begin{DoxyAuthor}{Author}
Shin-\/ichi Takehiro, Youhei S\+A\+S\+A\+KI 
\end{DoxyAuthor}
\begin{DoxyCopyright}{Copyright}
Copyright (C) S\+P\+M\+O\+D\+EL Development Group, 2019. License is M\+I\+T/\+X11. see \mbox{\hyperlink{COPYRIGHT}{C\+O\+P\+Y\+R\+I\+G\+HT}} in detail 
\end{DoxyCopyright}
\begin{DoxyNote}{Note}
補間計算の方法については doc/w\+\_\+module.\+tex を参照のこと. 
\end{DoxyNote}
\begin{DoxyWarning}{Warning}

\begin{DoxyItemize}
\item 本モジュールを直接呼ぶ事は想定されていないことに注意されたい． ユーザは \mbox{\hyperlink{namespacew__module}{w\+\_\+module}} を呼ぶこと．
\item 変換する格子点データ, スペクトルデータの配列の大きさは決めうちである 
\end{DoxyItemize}
\end{DoxyWarning}
\doxysubsection*{Data Types}
\begin{DoxyCompactItemize}
\item 
interface \mbox{\hyperlink{interfacew__module__interpolate_1_1alpha}{alpha}}
\item 
interface \mbox{\hyperlink{interfacew__module__interpolate_1_1interpolate__w}{interpolate\+\_\+w}}
\item 
interface \mbox{\hyperlink{interfacew__module__interpolate_1_1pmm}{pmm}}
\end{DoxyCompactItemize}
\doxysubsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
real(dp) function \mbox{\hyperlink{namespacew__module__interpolate_a73df26b126d54d88a9065cb5a6feb394}{interpolate\+\_\+array00\+\_\+w}} (w\+\_\+data, alon, alat)
\begin{DoxyCompactList}\small\item\em 緯度 alat, 経度 alon における関数値を その球面調和変換係数 w\+\_\+data から補間計算する \end{DoxyCompactList}\item 
real(dp) function \mbox{\hyperlink{namespacew__module__interpolate_a404a4c9c5a90800cff83c10a1654780f}{alpha\+\_\+array0}} (n, m, x)
\begin{DoxyCompactList}\small\item\em 漸化式の $P_{n}^{m}$ の係数 \end{DoxyCompactList}\item 
real(dp) function \mbox{\hyperlink{namespacew__module__interpolate_a0109a119419d3f89a99169f233aa03be}{beta}} (n, m)
\begin{DoxyCompactList}\small\item\em 漸化式の $P_{n-1}^m$ の係数 \end{DoxyCompactList}\item 
real(dp) function \mbox{\hyperlink{namespacew__module__interpolate_a4bfd17366b7fab88ca4f650d5815b4fc}{pmm\+\_\+array0}} (m, x)
\begin{DoxyCompactList}\small\item\em ルジャンドル陪函数 P\+\_\+m$^\wedge$m(x) の計算 \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacew__module__interpolate_a404a4c9c5a90800cff83c10a1654780f}\label{namespacew__module__interpolate_a404a4c9c5a90800cff83c10a1654780f}} 
\index{w\_module\_interpolate@{w\_module\_interpolate}!alpha\_array0@{alpha\_array0}}
\index{alpha\_array0@{alpha\_array0}!w\_module\_interpolate@{w\_module\_interpolate}}
\doxysubsubsection{\texorpdfstring{alpha\_array0()}{alpha\_array0()}}
{\footnotesize\ttfamily real(dp) function w\+\_\+module\+\_\+interpolate\+::alpha\+\_\+array0 (\begin{DoxyParamCaption}\item[{integer(8), intent(in)}]{n,  }\item[{integer(8), intent(in)}]{m,  }\item[{real(dp), intent(in)}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



漸化式の $P_{n}^{m}$ の係数 



Definition at line 129 of file w\+\_\+module\+\_\+interpolate.\+f90.


\begin{DoxyCode}{0}
\DoxyCodeLine{129       \textcolor{keywordtype}{integer(8)}, \textcolor{keywordtype}{intent(IN)}  :: n}
\DoxyCodeLine{130       \textcolor{keywordtype}{integer(8)}, \textcolor{keywordtype}{intent(IN)}  :: m}
\DoxyCodeLine{131 \textcolor{keywordtype}{      real}(DP), \textcolor{keywordtype}{intent(IN)} :: x}
\DoxyCodeLine{132 \textcolor{keywordtype}{      real}(DP)             :: alpha\_array0}
\DoxyCodeLine{133 }
\DoxyCodeLine{134       alpha\_array0 = dsqrt( (2.0d0*n+3)*(2.0d0*n+1)/((n-\/m+1)*(n+m+1)) ) * x}

\end{DoxyCode}
\mbox{\Hypertarget{namespacew__module__interpolate_a0109a119419d3f89a99169f233aa03be}\label{namespacew__module__interpolate_a0109a119419d3f89a99169f233aa03be}} 
\index{w\_module\_interpolate@{w\_module\_interpolate}!beta@{beta}}
\index{beta@{beta}!w\_module\_interpolate@{w\_module\_interpolate}}
\doxysubsubsection{\texorpdfstring{beta()}{beta()}}
{\footnotesize\ttfamily real(dp) function w\+\_\+module\+\_\+interpolate\+::beta (\begin{DoxyParamCaption}\item[{integer(8), intent(in)}]{n,  }\item[{integer(8), intent(in)}]{m }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



漸化式の $P_{n-1}^m$ の係数 



Definition at line 141 of file w\+\_\+module\+\_\+interpolate.\+f90.


\begin{DoxyCode}{0}
\DoxyCodeLine{141       \textcolor{keywordtype}{integer(8)}, \textcolor{keywordtype}{intent(IN)} :: n}
\DoxyCodeLine{142       \textcolor{keywordtype}{integer(8)}, \textcolor{keywordtype}{intent(IN)} :: m}
\DoxyCodeLine{143 \textcolor{keywordtype}{      real}(DP)               :: beta}
\DoxyCodeLine{144 }
\DoxyCodeLine{145       beta = -\/ dsqrt( (2.0d0*n+3)*(n+m)*(n-\/m)/((2*n-\/1)*(n+m+1)*(n-\/m+1)) )}

\end{DoxyCode}


Referenced by interpolate\+\_\+array00\+\_\+w().

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=345pt]{namespacew__module__interpolate_a0109a119419d3f89a99169f233aa03be_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacew__module__interpolate_a73df26b126d54d88a9065cb5a6feb394}\label{namespacew__module__interpolate_a73df26b126d54d88a9065cb5a6feb394}} 
\index{w\_module\_interpolate@{w\_module\_interpolate}!interpolate\_array00\_w@{interpolate\_array00\_w}}
\index{interpolate\_array00\_w@{interpolate\_array00\_w}!w\_module\_interpolate@{w\_module\_interpolate}}
\doxysubsubsection{\texorpdfstring{interpolate\_array00\_w()}{interpolate\_array00\_w()}}
{\footnotesize\ttfamily real(dp) function w\+\_\+module\+\_\+interpolate\+::interpolate\+\_\+array00\+\_\+w (\begin{DoxyParamCaption}\item[{real(dp), dimension((nm+1)$\ast$(nm+1)), intent(in)}]{w\+\_\+data,  }\item[{real(dp), intent(in)}]{alon,  }\item[{real(dp), intent(in)}]{alat }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



緯度 alat, 経度 alon における関数値を その球面調和変換係数 w\+\_\+data から補間計算する 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em w\+\_\+data} & スペクトルデータ \\
\hline
\mbox{\texttt{ in}}  & {\em alon} & 補間する位置(経度) \\
\hline
\mbox{\texttt{ in}}  & {\em alat} & 補間する位置(緯度) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
補間した値 
\end{DoxyReturn}


Definition at line 48 of file w\+\_\+module\+\_\+interpolate.\+f90.


\begin{DoxyCode}{0}
\DoxyCodeLine{48 }
\DoxyCodeLine{49 \textcolor{keywordtype}{    real}(DP), \textcolor{keywordtype}{intent(IN)} :: w\_data((nm+1)*(nm+1))}
\DoxyCodeLine{51 \textcolor{keywordtype}{    real}(DP), \textcolor{keywordtype}{intent(IN)} :: alon}
\DoxyCodeLine{53 \textcolor{keywordtype}{    real}(DP), \textcolor{keywordtype}{intent(IN)} :: alat}
\DoxyCodeLine{55 \textcolor{keywordtype}{    real}(DP)             :: Interpolate\_array00\_w}
\DoxyCodeLine{56 }
\DoxyCodeLine{57 \textcolor{keywordtype}{    real}(DP)   :: mu}
\DoxyCodeLine{58 \textcolor{keywordtype}{    real}(DP)   :: y0}
\DoxyCodeLine{59 \textcolor{keywordtype}{    real}(DP)   :: y1}
\DoxyCodeLine{60 \textcolor{keywordtype}{    real}(DP)   :: y2}
\DoxyCodeLine{61 \textcolor{keywordtype}{    real}(DP)   :: AnmPnm}
\DoxyCodeLine{62     \textcolor{keywordtype}{integer(8)} :: k}
\DoxyCodeLine{63     \textcolor{keywordtype}{integer(8)} :: m}
\DoxyCodeLine{64 }
\DoxyCodeLine{65     mu = sin(alat)}
\DoxyCodeLine{66     interpolate\_array00\_w = 0.0d0}
\DoxyCodeLine{67 }
\DoxyCodeLine{68     \textcolor{comment}{!-\/-\/-\/-\/ Σa\_n\string^0 P\_n\string^0 の計算}}
\DoxyCodeLine{69     y2 = 0.0d0}
\DoxyCodeLine{70     y1 = 0.0d0}
\DoxyCodeLine{71     \textcolor{keywordflow}{do} k=nm,1,-\/1}
\DoxyCodeLine{72       y0 =   alpha(k,0\_8,mu) * y1  \&}
\DoxyCodeLine{73         \&  + beta(k+1\_8,0\_8) * y2  \&}
\DoxyCodeLine{74         \&  + w\_data(l\_nm(int(k),0))}
\DoxyCodeLine{75       y2 = y1}
\DoxyCodeLine{76       y1 = y0}
\DoxyCodeLine{77 \textcolor{keywordflow}{    enddo}}
\DoxyCodeLine{78     interpolate\_array00\_w =  \&}
\DoxyCodeLine{79       \& ( beta(1\_8,0\_8) * y2 + mu*sqrt(3.0d0) * y1 \&}
\DoxyCodeLine{80       \&   + w\_data(l\_nm(0,0))  ) * pmm(0\_8,mu)}
\DoxyCodeLine{81 }
\DoxyCodeLine{82     \textcolor{comment}{!-\/-\/-\/-\/  Σ Re[s\_n\string^m] P\_n\string^m exp(imλ)の計算}}
\DoxyCodeLine{83     \textcolor{keywordflow}{do} m=1,nm}
\DoxyCodeLine{84       y2 = 0.0d0}
\DoxyCodeLine{85       y1 = 0.0d0}
\DoxyCodeLine{86       \textcolor{keywordflow}{do} k=nm,m+1,-\/1}
\DoxyCodeLine{87         y0 =   alpha(k,m,mu) * y1  \&}
\DoxyCodeLine{88           \&  + beta(k+1\_8,m) * y2  \&}
\DoxyCodeLine{89           \&  + w\_data(l\_nm(int(k),int(m)))}
\DoxyCodeLine{90         y2 = y1}
\DoxyCodeLine{91         y1 = y0}
\DoxyCodeLine{92 \textcolor{keywordflow}{      enddo}}
\DoxyCodeLine{93 }
\DoxyCodeLine{94       anmpnm = ( w\_data(l\_nm(int(m),int(m))) \&}
\DoxyCodeLine{95         \&        + beta(m+1\_8,m)*y2 \&}
\DoxyCodeLine{96         \&        + mu*sqrt(2.0d0*m+3) * y1 ) * pmm(m,mu)}
\DoxyCodeLine{97 }
\DoxyCodeLine{98       interpolate\_array00\_w = interpolate\_array00\_w \&}
\DoxyCodeLine{99         \&                     + anmpnm * 2 * cos(m*alon)}
\DoxyCodeLine{100 \textcolor{keywordflow}{      end do}}
\DoxyCodeLine{101 }
\DoxyCodeLine{102       \textcolor{comment}{!-\/-\/-\/-\/  Σ Im[s\_n\string^m] P\_n\string^m exp(imλ)の計算}}
\DoxyCodeLine{103       \textcolor{keywordflow}{do} m=1,nm}
\DoxyCodeLine{104         y2 = 0.0d0}
\DoxyCodeLine{105         y1 = 0.0d0}
\DoxyCodeLine{106         \textcolor{keywordflow}{do} k=nm,m+1,-\/1}
\DoxyCodeLine{107           y0 =   alpha(k,m,mu) * y1 \&}
\DoxyCodeLine{108             \&  + beta(k+1\_8,m) * y2 \&}
\DoxyCodeLine{109             \&  + w\_data(l\_nm(int(k),-\/int(m)))}
\DoxyCodeLine{110           y2 = y1}
\DoxyCodeLine{111           y1 = y0}
\DoxyCodeLine{112 \textcolor{keywordflow}{        enddo}}
\DoxyCodeLine{113 }
\DoxyCodeLine{114         anmpnm =( w\_data(l\_nm(int(m),-\/int(m)))  \&}
\DoxyCodeLine{115           \&       + beta(m+1\_8,m) * y2          \&}
\DoxyCodeLine{116           \&       + mu*dsqrt(2.0d0*m+3) * y1 ) * pmm(m,mu)}
\DoxyCodeLine{117 }
\DoxyCodeLine{118 }
\DoxyCodeLine{119         interpolate\_array00\_w = interpolate\_array00\_w \&}
\DoxyCodeLine{120           \&                     -\/ anmpnm * 2 * sin(m*alon)}
\DoxyCodeLine{121 \textcolor{keywordflow}{      end do}}
\DoxyCodeLine{122 }

\end{DoxyCode}


References beta(), and w\+\_\+module\+\_\+base\+::nm.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=345pt]{namespacew__module__interpolate_a73df26b126d54d88a9065cb5a6feb394_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{namespacew__module__interpolate_a4bfd17366b7fab88ca4f650d5815b4fc}\label{namespacew__module__interpolate_a4bfd17366b7fab88ca4f650d5815b4fc}} 
\index{w\_module\_interpolate@{w\_module\_interpolate}!pmm\_array0@{pmm\_array0}}
\index{pmm\_array0@{pmm\_array0}!w\_module\_interpolate@{w\_module\_interpolate}}
\doxysubsubsection{\texorpdfstring{pmm\_array0()}{pmm\_array0()}}
{\footnotesize\ttfamily real(dp) function w\+\_\+module\+\_\+interpolate\+::pmm\+\_\+array0 (\begin{DoxyParamCaption}\item[{integer(8), intent(in)}]{m,  }\item[{real(dp), intent(in)}]{x }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



ルジャンドル陪函数 P\+\_\+m$^\wedge$m(x) の計算 

\begin{DoxyVerb}    sqrt( factrl(2*m+1) )/(2.0D0**m * factrl(m)) &
     * (1-x**2)**(m/2.0D0)
\end{DoxyVerb}


係数が発散しないように対数で計算する 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em m} & ルジャンドル陪函数の次数 \\
\hline
\mbox{\texttt{ in}}  & {\em x} & 引き数 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
ルジャンドル陪函数の値 
\end{DoxyReturn}


Definition at line 157 of file w\+\_\+module\+\_\+interpolate.\+f90.


\begin{DoxyCode}{0}
\DoxyCodeLine{157 }
\DoxyCodeLine{158       \textcolor{keywordtype}{integer(8)},  \textcolor{keywordtype}{intent(IN)} :: m}
\DoxyCodeLine{160 \textcolor{keywordtype}{      real}(DP), \textcolor{keywordtype}{intent(IN)} :: x}
\DoxyCodeLine{162 \textcolor{keywordtype}{      real}(DP)             :: Pmm\_array0}
\DoxyCodeLine{163 }
\DoxyCodeLine{164       \textcolor{keywordflow}{if} ( m < 0 ) \textcolor{keyword}{call }messagenotify(\textcolor{stringliteral}{'E'}, \&}
\DoxyCodeLine{165         \& \textcolor{stringliteral}{'Pmm in w\_Intepolate\_module'},    \&}
\DoxyCodeLine{166         \& \textcolor{stringliteral}{'order m should be larger equal to zero'})}
\DoxyCodeLine{167 }
\DoxyCodeLine{168       pmm\_array0 = 1.0d0}
\DoxyCodeLine{169       \textcolor{keywordflow}{if} ( m > 0 )\textcolor{keywordflow}{then}}
\DoxyCodeLine{170         pmm\_array0 = exp(gammaln(2.0d0*m+2.0d0)/2.0d0        \&}
\DoxyCodeLine{171           \&              -\/ m*dlog(2.0d0) -\/ gammaln(m+1.0d0)) \&}
\DoxyCodeLine{172           \&          *(1-\/x**2)**(m/2.0d0)}
\DoxyCodeLine{173 \textcolor{keywordflow}{      endif}}

\end{DoxyCode}
