\hypertarget{interfacegtool__historyauto__internal_1_1averagereduce}{}\section{gtool\+\_\+historyauto\+\_\+internal\+:\+:averagereduce Interface Reference}
\label{interfacegtool__historyauto__internal_1_1averagereduce}\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_ad606a552895bbe6472e3e617a764fcd3}{averagereducereal1} (array, space\+\_\+average, weight1, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a32d74ab835190b34708e71fc5cf81b83}{averagereducereal2} (array, space\+\_\+average, weight1, weight2, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_ac133d4570ffbb0332b90ab83218bd859}{averagereducereal3} (array, space\+\_\+average, weight1, weight2, weight3, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a67627a9a8b8fa71ba573474cf5b0b37a}{averagereducereal4} (array, space\+\_\+average, weight1, weight2, weight3, weight4, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a0540eaafb3253f5fb9997468f697b369}{averagereducereal5} (array, space\+\_\+average, weight1, weight2, weight3, weight4, weight5, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a5c95e0297da728f43ca998539ddded1f}{averagereducereal6} (array, space\+\_\+average, weight1, weight2, weight3, weight4, weight5, weight6, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a8dcf56575faffc6a571f276589619cc7}{averagereducereal7} (array, space\+\_\+average, weight1, weight2, weight3, weight4, weight5, weight6, weight7, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a56f6ac83e0f769f8ba204e1b99c1a8b5}{averagereducedouble1} (array, space\+\_\+average, weight1, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a90c4011bb8b4d8989f06d46159926229}{averagereducedouble2} (array, space\+\_\+average, weight1, weight2, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a4389f793f1c533c8fd3a553cca25be65}{averagereducedouble3} (array, space\+\_\+average, weight1, weight2, weight3, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_afa2d6f0980a1161c2f12daf4e32218a9}{averagereducedouble4} (array, space\+\_\+average, weight1, weight2, weight3, weight4, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_ab2df8cdaae93aab3b433d7c2249ea0a7}{averagereducedouble5} (array, space\+\_\+average, weight1, weight2, weight3, weight4, weight5, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_acc4a46f62a605db34348b23addf73b83}{averagereducedouble6} (array, space\+\_\+average, weight1, weight2, weight3, weight4, weight5, weight6, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a1deab49d2b80f172e2f5290f3fd5d6a8}{averagereducedouble7} (array, space\+\_\+average, weight1, weight2, weight3, weight4, weight5, weight6, weight7, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a482a2c0fd5e6c320c094212b2c32a738}{averagereduceint1} (array, space\+\_\+average, weight1, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a5386450d0643bec26d40a18f69ae7324}{averagereduceint2} (array, space\+\_\+average, weight1, weight2, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a49c67f92705a932c25daa825de399f7f}{averagereduceint3} (array, space\+\_\+average, weight1, weight2, weight3, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_af4991de53efdfd86ba63362e1e729a8d}{averagereduceint4} (array, space\+\_\+average, weight1, weight2, weight3, weight4, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_a70e9530006a7d861ca58f6adcaa37d11}{averagereduceint5} (array, space\+\_\+average, weight1, weight2, weight3, weight4, weight5, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_af0e341bd3af7471a4af99a85c1ee7d92}{averagereduceint6} (array, space\+\_\+average, weight1, weight2, weight3, weight4, weight5, weight6, array\+\_\+avr)
\item 
subroutine \hyperlink{interfacegtool__historyauto__internal_1_1averagereduce_ab15de8d48086d4956e1cd8bbebe208f0}{averagereduceint7} (array, space\+\_\+average, weight1, weight2, weight3, weight4, weight5, weight6, weight7, array\+\_\+avr)
\end{DoxyCompactItemize}


\subsection{Detailed Description}


Definition at line 349 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.



\subsection{Member Function/\+Subroutine Documentation}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a56f6ac83e0f769f8ba204e1b99c1a8b5}\label{interfacegtool__historyauto__internal_1_1averagereduce_a56f6ac83e0f769f8ba204e1b99c1a8b5}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducedouble1@{averagereducedouble1}}
\index{averagereducedouble1@{averagereducedouble1}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducedouble1()}{averagereducedouble1()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducedouble1 (\begin{DoxyParamCaption}\item[{real(dp), dimension(\+:), intent(in), target}]{array,  }\item[{logical, dimension(1), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 2384 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
2384     \textcolor{comment}{!}
2385     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
2386     \textcolor{comment}{! array を平均化して array\_avr に返します.}
2387     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
2388     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
2389     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
2390     \textcolor{comment}{!}
2391     \textcolor{keywordtype}{implicit none}
2392     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:)
2393     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(1)
2394                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
2395                     
2396     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr(:) \textcolor{comment}{! (out)}
2397 
2398     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:)
2399 
2400                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:)
2401                     
2402 
2403     \textcolor{keywordtype}{integer}:: array\_shape(1)
2404     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
2405     \textcolor{keywordtype}{real(DP)}:: weight\_sum
2406   \textcolor{keywordflow}{continue}
2407 
2408     array\_shape = shape( array )
2409     array\_avr\_work => array
2410 
2411                     
2412                       
2413                         
2414     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
2415       dim\_size = array\_shape(1)
2416       array\_shape(1) = 1
2417       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
2418                           
2419         &  ) )
2420       array\_avr\_work1 = 0.0\_dp
2421       weight\_sum = 0.0\_dp
2422       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2423         array\_avr\_work1(1) = array\_avr\_work1(1) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2424         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2425 \textcolor{keywordflow}{      end do}
2426       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
2427       array\_avr\_work  => array\_avr\_work1
2428 \textcolor{keywordflow}{    end if}
2429 
2430                         
2431                       
2432 
2433                     
2434 
2435 
2436       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
2437                     
2438         & ) )
2439 
2440       array\_avr = array\_avr\_work
2441 
2442       \textcolor{keyword}{nullify}( array\_avr\_work )
2443 
2444                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
2445                     
2446 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a90c4011bb8b4d8989f06d46159926229}\label{interfacegtool__historyauto__internal_1_1averagereduce_a90c4011bb8b4d8989f06d46159926229}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducedouble2@{averagereducedouble2}}
\index{averagereducedouble2@{averagereducedouble2}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducedouble2()}{averagereducedouble2()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducedouble2 (\begin{DoxyParamCaption}\item[{real(dp), dimension(\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(2), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 2458 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
2458     \textcolor{comment}{!}
2459     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
2460     \textcolor{comment}{! array を平均化して array\_avr に返します.}
2461     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
2462     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
2463     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
2464     \textcolor{comment}{!}
2465     \textcolor{keywordtype}{implicit none}
2466     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:)
2467     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(2)
2468                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
2469                     
2470     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
2471                     
2472     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:) \textcolor{comment}{! (out)}
2473 
2474     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:)
2475 
2476                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:)
2477                     
2478     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:)
2479                     
2480 
2481     \textcolor{keywordtype}{integer}:: array\_shape(2)
2482     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
2483     \textcolor{keywordtype}{real(DP)}:: weight\_sum
2484   \textcolor{keywordflow}{continue}
2485 
2486     array\_shape = shape( array )
2487     array\_avr\_work => array
2488 
2489                     
2490                       
2491                         
2492     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
2493       dim\_size = array\_shape(1)
2494       array\_shape(1) = 1
2495       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
2496                                   & , array\_shape(2) &
2497                           
2498         &  ) )
2499       array\_avr\_work1 = 0.0\_dp
2500       weight\_sum = 0.0\_dp
2501       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2502         array\_avr\_work1(1,:) = array\_avr\_work1(1,:) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight1(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2503         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2504 \textcolor{keywordflow}{      end do}
2505       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
2506       array\_avr\_work  => array\_avr\_work1
2507 \textcolor{keywordflow}{    end if}
2508 
2509                         
2510 
2511     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
2512       dim\_size = array\_shape(2)
2513       array\_shape(2) = 1
2514       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
2515                                   & , array\_shape(2) &
2516                           
2517         &  ) )
2518       array\_avr\_work2 = 0.0\_dp
2519       weight\_sum = 0.0\_dp
2520       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2521         array\_avr\_work2(:,1) = array\_avr\_work2(:,1) + array\_avr\_work(:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight2(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2522         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2523 \textcolor{keywordflow}{      end do}
2524       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
2525       array\_avr\_work  => array\_avr\_work2
2526 \textcolor{keywordflow}{    end if}
2527 
2528                         
2529                       
2530 
2531                     
2532 
2533 
2534       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
2535                             & , array\_shape(2) &
2536                     
2537         & ) )
2538 
2539       array\_avr = array\_avr\_work
2540 
2541       \textcolor{keyword}{nullify}( array\_avr\_work )
2542 
2543                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
2544                     
2545       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
2546                     
2547 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a4389f793f1c533c8fd3a553cca25be65}\label{interfacegtool__historyauto__internal_1_1averagereduce_a4389f793f1c533c8fd3a553cca25be65}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducedouble3@{averagereducedouble3}}
\index{averagereducedouble3@{averagereducedouble3}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducedouble3()}{averagereducedouble3()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducedouble3 (\begin{DoxyParamCaption}\item[{real(dp), dimension(\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(3), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 2561 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
2561     \textcolor{comment}{!}
2562     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
2563     \textcolor{comment}{! array を平均化して array\_avr に返します.}
2564     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
2565     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
2566     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
2567     \textcolor{comment}{!}
2568     \textcolor{keywordtype}{implicit none}
2569     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:)
2570     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(3)
2571                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
2572                     
2573     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
2574                     
2575     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
2576                     
2577     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:) \textcolor{comment}{! (out)}
2578 
2579     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:)
2580 
2581                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:)
2582                     
2583     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:)
2584                     
2585     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:)
2586                     
2587 
2588     \textcolor{keywordtype}{integer}:: array\_shape(3)
2589     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
2590     \textcolor{keywordtype}{real(DP)}:: weight\_sum
2591   \textcolor{keywordflow}{continue}
2592 
2593     array\_shape = shape( array )
2594     array\_avr\_work => array
2595 
2596                     
2597                       
2598                         
2599     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
2600       dim\_size = array\_shape(1)
2601       array\_shape(1) = 1
2602       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
2603                                   & , array\_shape(2) &
2604                           
2605         & , array\_shape(3) &
2606                           
2607         &  ) )
2608       array\_avr\_work1 = 0.0\_dp
2609       weight\_sum = 0.0\_dp
2610       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2611         array\_avr\_work1(1,:,:) = array\_avr\_work1(1,:,:) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight1(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2612         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2613 \textcolor{keywordflow}{      end do}
2614       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
2615       array\_avr\_work  => array\_avr\_work1
2616 \textcolor{keywordflow}{    end if}
2617 
2618                         
2619 
2620     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
2621       dim\_size = array\_shape(2)
2622       array\_shape(2) = 1
2623       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
2624                                   & , array\_shape(2) &
2625                           
2626         & , array\_shape(3) &
2627                           
2628         &  ) )
2629       array\_avr\_work2 = 0.0\_dp
2630       weight\_sum = 0.0\_dp
2631       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2632         array\_avr\_work2(:,1,:) = array\_avr\_work2(:,1,:) + array\_avr\_work(:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight2(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2633         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2634 \textcolor{keywordflow}{      end do}
2635       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
2636       array\_avr\_work  => array\_avr\_work2
2637 \textcolor{keywordflow}{    end if}
2638 
2639                         
2640 
2641     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
2642       dim\_size = array\_shape(3)
2643       array\_shape(3) = 1
2644       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
2645                                   & , array\_shape(2) &
2646                           
2647         & , array\_shape(3) &
2648                           
2649         &  ) )
2650       array\_avr\_work3 = 0.0\_dp
2651       weight\_sum = 0.0\_dp
2652       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2653         array\_avr\_work3(:,:,1) = array\_avr\_work3(:,:,1) + array\_avr\_work(:,:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight3(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2654         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2655 \textcolor{keywordflow}{      end do}
2656       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
2657       array\_avr\_work  => array\_avr\_work3
2658 \textcolor{keywordflow}{    end if}
2659 
2660                         
2661                       
2662 
2663                     
2664 
2665 
2666       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
2667                             & , array\_shape(2) &
2668                     
2669         & , array\_shape(3) &
2670                     
2671         & ) )
2672 
2673       array\_avr = array\_avr\_work
2674 
2675       \textcolor{keyword}{nullify}( array\_avr\_work )
2676 
2677                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
2678                     
2679       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
2680                     
2681       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
2682                     
2683 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_afa2d6f0980a1161c2f12daf4e32218a9}\label{interfacegtool__historyauto__internal_1_1averagereduce_afa2d6f0980a1161c2f12daf4e32218a9}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducedouble4@{averagereducedouble4}}
\index{averagereducedouble4@{averagereducedouble4}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducedouble4()}{averagereducedouble4()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducedouble4 (\begin{DoxyParamCaption}\item[{real(dp), dimension(\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(4), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 2699 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
2699     \textcolor{comment}{!}
2700     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
2701     \textcolor{comment}{! array を平均化して array\_avr に返します.}
2702     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
2703     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
2704     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
2705     \textcolor{comment}{!}
2706     \textcolor{keywordtype}{implicit none}
2707     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:)
2708     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(4)
2709                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
2710                     
2711     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
2712                     
2713     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
2714                     
2715     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
2716                     
2717     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:) \textcolor{comment}{! (out)}
2718 
2719     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:)
2720 
2721                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:)
2722                     
2723     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:)
2724                     
2725     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:)
2726                     
2727     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:)
2728                     
2729 
2730     \textcolor{keywordtype}{integer}:: array\_shape(4)
2731     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
2732     \textcolor{keywordtype}{real(DP)}:: weight\_sum
2733   \textcolor{keywordflow}{continue}
2734 
2735     array\_shape = shape( array )
2736     array\_avr\_work => array
2737 
2738                     
2739                       
2740                         
2741     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
2742       dim\_size = array\_shape(1)
2743       array\_shape(1) = 1
2744       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
2745                                   & , array\_shape(2) &
2746                           
2747         & , array\_shape(3) &
2748                           
2749         & , array\_shape(4) &
2750                           
2751         &  ) )
2752       array\_avr\_work1 = 0.0\_dp
2753       weight\_sum = 0.0\_dp
2754       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2755         array\_avr\_work1(1,:,:,:) = array\_avr\_work1(1,:,:,:) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight1(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2756         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2757 \textcolor{keywordflow}{      end do}
2758       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
2759       array\_avr\_work  => array\_avr\_work1
2760 \textcolor{keywordflow}{    end if}
2761 
2762                         
2763 
2764     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
2765       dim\_size = array\_shape(2)
2766       array\_shape(2) = 1
2767       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
2768                                   & , array\_shape(2) &
2769                           
2770         & , array\_shape(3) &
2771                           
2772         & , array\_shape(4) &
2773                           
2774         &  ) )
2775       array\_avr\_work2 = 0.0\_dp
2776       weight\_sum = 0.0\_dp
2777       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2778         array\_avr\_work2(:,1,:,:) = array\_avr\_work2(:,1,:,:) + array\_avr\_work(:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight2(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2779         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2780 \textcolor{keywordflow}{      end do}
2781       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
2782       array\_avr\_work  => array\_avr\_work2
2783 \textcolor{keywordflow}{    end if}
2784 
2785                         
2786 
2787     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
2788       dim\_size = array\_shape(3)
2789       array\_shape(3) = 1
2790       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
2791                                   & , array\_shape(2) &
2792                           
2793         & , array\_shape(3) &
2794                           
2795         & , array\_shape(4) &
2796                           
2797         &  ) )
2798       array\_avr\_work3 = 0.0\_dp
2799       weight\_sum = 0.0\_dp
2800       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2801         array\_avr\_work3(:,:,1,:) = array\_avr\_work3(:,:,1,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2802         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2803 \textcolor{keywordflow}{      end do}
2804       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
2805       array\_avr\_work  => array\_avr\_work3
2806 \textcolor{keywordflow}{    end if}
2807 
2808                         
2809 
2810     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
2811       dim\_size = array\_shape(4)
2812       array\_shape(4) = 1
2813       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
2814                                   & , array\_shape(2) &
2815                           
2816         & , array\_shape(3) &
2817                           
2818         & , array\_shape(4) &
2819                           
2820         &  ) )
2821       array\_avr\_work4 = 0.0\_dp
2822       weight\_sum = 0.0\_dp
2823       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2824         array\_avr\_work4(:,:,:,1) = array\_avr\_work4(:,:,:,1) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2825         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2826 \textcolor{keywordflow}{      end do}
2827       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
2828       array\_avr\_work  => array\_avr\_work4
2829 \textcolor{keywordflow}{    end if}
2830 
2831                         
2832                       
2833 
2834                     
2835 
2836 
2837       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
2838                             & , array\_shape(2) &
2839                     
2840         & , array\_shape(3) &
2841                     
2842         & , array\_shape(4) &
2843                     
2844         & ) )
2845 
2846       array\_avr = array\_avr\_work
2847 
2848       \textcolor{keyword}{nullify}( array\_avr\_work )
2849 
2850                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
2851                     
2852       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
2853                     
2854       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
2855                     
2856       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
2857                     
2858 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_ab2df8cdaae93aab3b433d7c2249ea0a7}\label{interfacegtool__historyauto__internal_1_1averagereduce_ab2df8cdaae93aab3b433d7c2249ea0a7}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducedouble5@{averagereducedouble5}}
\index{averagereducedouble5@{averagereducedouble5}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducedouble5()}{averagereducedouble5()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducedouble5 (\begin{DoxyParamCaption}\item[{real(dp), dimension(\+:,\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(5), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight5,  }\item[{real(dp), dimension(\+:,\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 2876 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
2876     \textcolor{comment}{!}
2877     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
2878     \textcolor{comment}{! array を平均化して array\_avr に返します.}
2879     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
2880     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
2881     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
2882     \textcolor{comment}{!}
2883     \textcolor{keywordtype}{implicit none}
2884     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:,:)
2885     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(5)
2886                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
2887                     
2888     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
2889                     
2890     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
2891                     
2892     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
2893                     
2894     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight5(:)
2895                     
2896     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:,:) \textcolor{comment}{! (out)}
2897 
2898     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:,:)
2899 
2900                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:,:)
2901                     
2902     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:,:)
2903                     
2904     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:,:)
2905                     
2906     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:,:)
2907                     
2908     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work5(:,:,:,:,:)
2909                     
2910 
2911     \textcolor{keywordtype}{integer}:: array\_shape(5)
2912     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
2913     \textcolor{keywordtype}{real(DP)}:: weight\_sum
2914   \textcolor{keywordflow}{continue}
2915 
2916     array\_shape = shape( array )
2917     array\_avr\_work => array
2918 
2919                     
2920                       
2921                         
2922     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
2923       dim\_size = array\_shape(1)
2924       array\_shape(1) = 1
2925       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
2926                                   & , array\_shape(2) &
2927                           
2928         & , array\_shape(3) &
2929                           
2930         & , array\_shape(4) &
2931                           
2932         & , array\_shape(5) &
2933                           
2934         &  ) )
2935       array\_avr\_work1 = 0.0\_dp
2936       weight\_sum = 0.0\_dp
2937       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2938         array\_avr\_work1(1,:,:,:,:) = array\_avr\_work1(1,:,:,:,:) + array\_avr\_work(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2939         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2940 \textcolor{keywordflow}{      end do}
2941       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
2942       array\_avr\_work  => array\_avr\_work1
2943 \textcolor{keywordflow}{    end if}
2944 
2945                         
2946 
2947     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
2948       dim\_size = array\_shape(2)
2949       array\_shape(2) = 1
2950       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
2951                                   & , array\_shape(2) &
2952                           
2953         & , array\_shape(3) &
2954                           
2955         & , array\_shape(4) &
2956                           
2957         & , array\_shape(5) &
2958                           
2959         &  ) )
2960       array\_avr\_work2 = 0.0\_dp
2961       weight\_sum = 0.0\_dp
2962       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2963         array\_avr\_work2(:,1,:,:,:) = array\_avr\_work2(:,1,:,:,:) + array\_avr\_work(:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2964         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2965 \textcolor{keywordflow}{      end do}
2966       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
2967       array\_avr\_work  => array\_avr\_work2
2968 \textcolor{keywordflow}{    end if}
2969 
2970                         
2971 
2972     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
2973       dim\_size = array\_shape(3)
2974       array\_shape(3) = 1
2975       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
2976                                   & , array\_shape(2) &
2977                           
2978         & , array\_shape(3) &
2979                           
2980         & , array\_shape(4) &
2981                           
2982         & , array\_shape(5) &
2983                           
2984         &  ) )
2985       array\_avr\_work3 = 0.0\_dp
2986       weight\_sum = 0.0\_dp
2987       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2988         array\_avr\_work3(:,:,1,:,:) = array\_avr\_work3(:,:,1,:,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2989         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2990 \textcolor{keywordflow}{      end do}
2991       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
2992       array\_avr\_work  => array\_avr\_work3
2993 \textcolor{keywordflow}{    end if}
2994 
2995                         
2996 
2997     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
2998       dim\_size = array\_shape(4)
2999       array\_shape(4) = 1
3000       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
3001                                   & , array\_shape(2) &
3002                           
3003         & , array\_shape(3) &
3004                           
3005         & , array\_shape(4) &
3006                           
3007         & , array\_shape(5) &
3008                           
3009         &  ) )
3010       array\_avr\_work4 = 0.0\_dp
3011       weight\_sum = 0.0\_dp
3012       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3013         array\_avr\_work4(:,:,:,1,:) = array\_avr\_work4(:,:,:,1,:) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3014         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3015 \textcolor{keywordflow}{      end do}
3016       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
3017       array\_avr\_work  => array\_avr\_work4
3018 \textcolor{keywordflow}{    end if}
3019 
3020                         
3021 
3022     \textcolor{keywordflow}{if} ( space\_average(5) ) \textcolor{keywordflow}{then}
3023       dim\_size = array\_shape(5)
3024       array\_shape(5) = 1
3025       \textcolor{keyword}{allocate}( array\_avr\_work5( array\_shape(1) &
3026                                   & , array\_shape(2) &
3027                           
3028         & , array\_shape(3) &
3029                           
3030         & , array\_shape(4) &
3031                           
3032         & , array\_shape(5) &
3033                           
3034         &  ) )
3035       array\_avr\_work5 = 0.0\_dp
3036       weight\_sum = 0.0\_dp
3037       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3038         array\_avr\_work5(:,:,:,:,1) = array\_avr\_work5(:,:,:,:,1) + array\_avr\_work(:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3039         weight\_sum = weight\_sum + weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3040 \textcolor{keywordflow}{      end do}
3041       array\_avr\_work5 = array\_avr\_work5 / weight\_sum
3042       array\_avr\_work  => array\_avr\_work5
3043 \textcolor{keywordflow}{    end if}
3044 
3045                         
3046                       
3047 
3048                     
3049 
3050 
3051       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
3052                             & , array\_shape(2) &
3053                     
3054         & , array\_shape(3) &
3055                     
3056         & , array\_shape(4) &
3057                     
3058         & , array\_shape(5) &
3059                     
3060         & ) )
3061 
3062       array\_avr = array\_avr\_work
3063 
3064       \textcolor{keyword}{nullify}( array\_avr\_work )
3065 
3066                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
3067                     
3068       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
3069                     
3070       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
3071                     
3072       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
3073                     
3074       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work5 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work5 )
3075                     
3076 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_acc4a46f62a605db34348b23addf73b83}\label{interfacegtool__historyauto__internal_1_1averagereduce_acc4a46f62a605db34348b23addf73b83}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducedouble6@{averagereducedouble6}}
\index{averagereducedouble6@{averagereducedouble6}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducedouble6()}{averagereducedouble6()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducedouble6 (\begin{DoxyParamCaption}\item[{real(dp), dimension(\+:,\+:,\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(6), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight5,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight6,  }\item[{real(dp), dimension(\+:,\+:,\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 3096 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
3096     \textcolor{comment}{!}
3097     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
3098     \textcolor{comment}{! array を平均化して array\_avr に返します.}
3099     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
3100     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
3101     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
3102     \textcolor{comment}{!}
3103     \textcolor{keywordtype}{implicit none}
3104     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:,:,:)
3105     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(6)
3106                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
3107                     
3108     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
3109                     
3110     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
3111                     
3112     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
3113                     
3114     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight5(:)
3115                     
3116     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight6(:)
3117                     
3118     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:,:,:) \textcolor{comment}{! (out)}
3119 
3120     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:,:,:)
3121 
3122                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:,:,:)
3123                     
3124     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:,:,:)
3125                     
3126     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:,:,:)
3127                     
3128     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:,:,:)
3129                     
3130     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work5(:,:,:,:,:,:)
3131                     
3132     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work6(:,:,:,:,:,:)
3133                     
3134 
3135     \textcolor{keywordtype}{integer}:: array\_shape(6)
3136     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
3137     \textcolor{keywordtype}{real(DP)}:: weight\_sum
3138   \textcolor{keywordflow}{continue}
3139 
3140     array\_shape = shape( array )
3141     array\_avr\_work => array
3142 
3143                     
3144                       
3145                         
3146     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
3147       dim\_size = array\_shape(1)
3148       array\_shape(1) = 1
3149       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
3150                                   & , array\_shape(2) &
3151                           
3152         & , array\_shape(3) &
3153                           
3154         & , array\_shape(4) &
3155                           
3156         & , array\_shape(5) &
3157                           
3158         & , array\_shape(6) &
3159                           
3160         &  ) )
3161       array\_avr\_work1 = 0.0\_dp
3162       weight\_sum = 0.0\_dp
3163       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3164         array\_avr\_work1(1,:,:,:,:,:) = array\_avr\_work1(1,:,:,:,:,:) + array\_avr\_work(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:,:) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3165         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3166 \textcolor{keywordflow}{      end do}
3167       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
3168       array\_avr\_work  => array\_avr\_work1
3169 \textcolor{keywordflow}{    end if}
3170 
3171                         
3172 
3173     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
3174       dim\_size = array\_shape(2)
3175       array\_shape(2) = 1
3176       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
3177                                   & , array\_shape(2) &
3178                           
3179         & , array\_shape(3) &
3180                           
3181         & , array\_shape(4) &
3182                           
3183         & , array\_shape(5) &
3184                           
3185         & , array\_shape(6) &
3186                           
3187         &  ) )
3188       array\_avr\_work2 = 0.0\_dp
3189       weight\_sum = 0.0\_dp
3190       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3191         array\_avr\_work2(:,1,:,:,:,:) = array\_avr\_work2(:,1,:,:,:,:) + array\_avr\_work(:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:) * weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3192         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3193 \textcolor{keywordflow}{      end do}
3194       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
3195       array\_avr\_work  => array\_avr\_work2
3196 \textcolor{keywordflow}{    end if}
3197 
3198                         
3199 
3200     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
3201       dim\_size = array\_shape(3)
3202       array\_shape(3) = 1
3203       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
3204                                   & , array\_shape(2) &
3205                           
3206         & , array\_shape(3) &
3207                           
3208         & , array\_shape(4) &
3209                           
3210         & , array\_shape(5) &
3211                           
3212         & , array\_shape(6) &
3213                           
3214         &  ) )
3215       array\_avr\_work3 = 0.0\_dp
3216       weight\_sum = 0.0\_dp
3217       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3218         array\_avr\_work3(:,:,1,:,:,:) = array\_avr\_work3(:,:,1,:,:,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3219         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3220 \textcolor{keywordflow}{      end do}
3221       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
3222       array\_avr\_work  => array\_avr\_work3
3223 \textcolor{keywordflow}{    end if}
3224 
3225                         
3226 
3227     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
3228       dim\_size = array\_shape(4)
3229       array\_shape(4) = 1
3230       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
3231                                   & , array\_shape(2) &
3232                           
3233         & , array\_shape(3) &
3234                           
3235         & , array\_shape(4) &
3236                           
3237         & , array\_shape(5) &
3238                           
3239         & , array\_shape(6) &
3240                           
3241         &  ) )
3242       array\_avr\_work4 = 0.0\_dp
3243       weight\_sum = 0.0\_dp
3244       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3245         array\_avr\_work4(:,:,:,1,:,:) = array\_avr\_work4(:,:,:,1,:,:) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3246         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3247 \textcolor{keywordflow}{      end do}
3248       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
3249       array\_avr\_work  => array\_avr\_work4
3250 \textcolor{keywordflow}{    end if}
3251 
3252                         
3253 
3254     \textcolor{keywordflow}{if} ( space\_average(5) ) \textcolor{keywordflow}{then}
3255       dim\_size = array\_shape(5)
3256       array\_shape(5) = 1
3257       \textcolor{keyword}{allocate}( array\_avr\_work5( array\_shape(1) &
3258                                   & , array\_shape(2) &
3259                           
3260         & , array\_shape(3) &
3261                           
3262         & , array\_shape(4) &
3263                           
3264         & , array\_shape(5) &
3265                           
3266         & , array\_shape(6) &
3267                           
3268         &  ) )
3269       array\_avr\_work5 = 0.0\_dp
3270       weight\_sum = 0.0\_dp
3271       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3272         array\_avr\_work5(:,:,:,:,1,:) = array\_avr\_work5(:,:,:,:,1,:) + array\_avr\_work(:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3273         weight\_sum = weight\_sum + weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3274 \textcolor{keywordflow}{      end do}
3275       array\_avr\_work5 = array\_avr\_work5 / weight\_sum
3276       array\_avr\_work  => array\_avr\_work5
3277 \textcolor{keywordflow}{    end if}
3278 
3279                         
3280 
3281     \textcolor{keywordflow}{if} ( space\_average(6) ) \textcolor{keywordflow}{then}
3282       dim\_size = array\_shape(6)
3283       array\_shape(6) = 1
3284       \textcolor{keyword}{allocate}( array\_avr\_work6( array\_shape(1) &
3285                                   & , array\_shape(2) &
3286                           
3287         & , array\_shape(3) &
3288                           
3289         & , array\_shape(4) &
3290                           
3291         & , array\_shape(5) &
3292                           
3293         & , array\_shape(6) &
3294                           
3295         &  ) )
3296       array\_avr\_work6 = 0.0\_dp
3297       weight\_sum = 0.0\_dp
3298       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3299         array\_avr\_work6(:,:,:,:,:,1) = array\_avr\_work6(:,:,:,:,:,1) + array\_avr\_work(:,:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3300         weight\_sum = weight\_sum + weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3301 \textcolor{keywordflow}{      end do}
3302       array\_avr\_work6 = array\_avr\_work6 / weight\_sum
3303       array\_avr\_work  => array\_avr\_work6
3304 \textcolor{keywordflow}{    end if}
3305 
3306                         
3307                       
3308 
3309                     
3310 
3311 
3312       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
3313                             & , array\_shape(2) &
3314                     
3315         & , array\_shape(3) &
3316                     
3317         & , array\_shape(4) &
3318                     
3319         & , array\_shape(5) &
3320                     
3321         & , array\_shape(6) &
3322                     
3323         & ) )
3324 
3325       array\_avr = array\_avr\_work
3326 
3327       \textcolor{keyword}{nullify}( array\_avr\_work )
3328 
3329                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
3330                     
3331       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
3332                     
3333       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
3334                     
3335       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
3336                     
3337       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work5 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work5 )
3338                     
3339       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work6 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work6 )
3340                     
3341 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a1deab49d2b80f172e2f5290f3fd5d6a8}\label{interfacegtool__historyauto__internal_1_1averagereduce_a1deab49d2b80f172e2f5290f3fd5d6a8}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducedouble7@{averagereducedouble7}}
\index{averagereducedouble7@{averagereducedouble7}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducedouble7()}{averagereducedouble7()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducedouble7 (\begin{DoxyParamCaption}\item[{real(dp), dimension(\+:,\+:,\+:,\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(7), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight5,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight6,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight7,  }\item[{real(dp), dimension(\+:,\+:,\+:,\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 3363 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
3363     \textcolor{comment}{!}
3364     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
3365     \textcolor{comment}{! array を平均化して array\_avr に返します.}
3366     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
3367     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
3368     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
3369     \textcolor{comment}{!}
3370     \textcolor{keywordtype}{implicit none}
3371     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:,:,:,:)
3372     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(7)
3373                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
3374                     
3375     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
3376                     
3377     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
3378                     
3379     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
3380                     
3381     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight5(:)
3382                     
3383     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight6(:)
3384                     
3385     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight7(:)
3386                     
3387     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:,:,:,:) \textcolor{comment}{! (out)}
3388 
3389     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:,:,:,:)
3390 
3391                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:,:,:,:)
3392                     
3393     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:,:,:,:)
3394                     
3395     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:,:,:,:)
3396                     
3397     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:,:,:,:)
3398                     
3399     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work5(:,:,:,:,:,:,:)
3400                     
3401     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work6(:,:,:,:,:,:,:)
3402                     
3403     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{pointer}:: array\_avr\_work7(:,:,:,:,:,:,:)
3404                     
3405 
3406     \textcolor{keywordtype}{integer}:: array\_shape(7)
3407     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
3408     \textcolor{keywordtype}{real(DP)}:: weight\_sum
3409   \textcolor{keywordflow}{continue}
3410 
3411     array\_shape = shape( array )
3412     array\_avr\_work => array
3413 
3414                     
3415                       
3416                         
3417     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
3418       dim\_size = array\_shape(1)
3419       array\_shape(1) = 1
3420       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
3421                                   & , array\_shape(2) &
3422                           
3423         & , array\_shape(3) &
3424                           
3425         & , array\_shape(4) &
3426                           
3427         & , array\_shape(5) &
3428                           
3429         & , array\_shape(6) &
3430                           
3431         & , array\_shape(7) &
3432                           
3433         &  ) )
3434       array\_avr\_work1 = 0.0\_dp
3435       weight\_sum = 0.0\_dp
3436       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3437         array\_avr\_work1(1,:,:,:,:,:,:) = array\_avr\_work1(1,:,:,:,:,:,:) + array\_avr\_work(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:,:,:) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3438         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3439 \textcolor{keywordflow}{      end do}
3440       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
3441       array\_avr\_work  => array\_avr\_work1
3442 \textcolor{keywordflow}{    end if}
3443 
3444                         
3445 
3446     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
3447       dim\_size = array\_shape(2)
3448       array\_shape(2) = 1
3449       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
3450                                   & , array\_shape(2) &
3451                           
3452         & , array\_shape(3) &
3453                           
3454         & , array\_shape(4) &
3455                           
3456         & , array\_shape(5) &
3457                           
3458         & , array\_shape(6) &
3459                           
3460         & , array\_shape(7) &
3461                           
3462         &  ) )
3463       array\_avr\_work2 = 0.0\_dp
3464       weight\_sum = 0.0\_dp
3465       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3466         array\_avr\_work2(:,1,:,:,:,:,:) = array\_avr\_work2(:,1,:,:,:,:,:) + array\_avr\_work(:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:,:) * weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3467         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3468 \textcolor{keywordflow}{      end do}
3469       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
3470       array\_avr\_work  => array\_avr\_work2
3471 \textcolor{keywordflow}{    end if}
3472 
3473                         
3474 
3475     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
3476       dim\_size = array\_shape(3)
3477       array\_shape(3) = 1
3478       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
3479                                   & , array\_shape(2) &
3480                           
3481         & , array\_shape(3) &
3482                           
3483         & , array\_shape(4) &
3484                           
3485         & , array\_shape(5) &
3486                           
3487         & , array\_shape(6) &
3488                           
3489         & , array\_shape(7) &
3490                           
3491         &  ) )
3492       array\_avr\_work3 = 0.0\_dp
3493       weight\_sum = 0.0\_dp
3494       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3495         array\_avr\_work3(:,:,1,:,:,:,:) = array\_avr\_work3(:,:,1,:,:,:,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3496         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3497 \textcolor{keywordflow}{      end do}
3498       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
3499       array\_avr\_work  => array\_avr\_work3
3500 \textcolor{keywordflow}{    end if}
3501 
3502                         
3503 
3504     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
3505       dim\_size = array\_shape(4)
3506       array\_shape(4) = 1
3507       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
3508                                   & , array\_shape(2) &
3509                           
3510         & , array\_shape(3) &
3511                           
3512         & , array\_shape(4) &
3513                           
3514         & , array\_shape(5) &
3515                           
3516         & , array\_shape(6) &
3517                           
3518         & , array\_shape(7) &
3519                           
3520         &  ) )
3521       array\_avr\_work4 = 0.0\_dp
3522       weight\_sum = 0.0\_dp
3523       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3524         array\_avr\_work4(:,:,:,1,:,:,:) = array\_avr\_work4(:,:,:,1,:,:,:) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3525         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3526 \textcolor{keywordflow}{      end do}
3527       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
3528       array\_avr\_work  => array\_avr\_work4
3529 \textcolor{keywordflow}{    end if}
3530 
3531                         
3532 
3533     \textcolor{keywordflow}{if} ( space\_average(5) ) \textcolor{keywordflow}{then}
3534       dim\_size = array\_shape(5)
3535       array\_shape(5) = 1
3536       \textcolor{keyword}{allocate}( array\_avr\_work5( array\_shape(1) &
3537                                   & , array\_shape(2) &
3538                           
3539         & , array\_shape(3) &
3540                           
3541         & , array\_shape(4) &
3542                           
3543         & , array\_shape(5) &
3544                           
3545         & , array\_shape(6) &
3546                           
3547         & , array\_shape(7) &
3548                           
3549         &  ) )
3550       array\_avr\_work5 = 0.0\_dp
3551       weight\_sum = 0.0\_dp
3552       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3553         array\_avr\_work5(:,:,:,:,1,:,:) = array\_avr\_work5(:,:,:,:,1,:,:) + array\_avr\_work(:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3554         weight\_sum = weight\_sum + weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3555 \textcolor{keywordflow}{      end do}
3556       array\_avr\_work5 = array\_avr\_work5 / weight\_sum
3557       array\_avr\_work  => array\_avr\_work5
3558 \textcolor{keywordflow}{    end if}
3559 
3560                         
3561 
3562     \textcolor{keywordflow}{if} ( space\_average(6) ) \textcolor{keywordflow}{then}
3563       dim\_size = array\_shape(6)
3564       array\_shape(6) = 1
3565       \textcolor{keyword}{allocate}( array\_avr\_work6( array\_shape(1) &
3566                                   & , array\_shape(2) &
3567                           
3568         & , array\_shape(3) &
3569                           
3570         & , array\_shape(4) &
3571                           
3572         & , array\_shape(5) &
3573                           
3574         & , array\_shape(6) &
3575                           
3576         & , array\_shape(7) &
3577                           
3578         &  ) )
3579       array\_avr\_work6 = 0.0\_dp
3580       weight\_sum = 0.0\_dp
3581       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3582         array\_avr\_work6(:,:,:,:,:,1,:) = array\_avr\_work6(:,:,:,:,:,1,:) + array\_avr\_work(:,:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3583         weight\_sum = weight\_sum + weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3584 \textcolor{keywordflow}{      end do}
3585       array\_avr\_work6 = array\_avr\_work6 / weight\_sum
3586       array\_avr\_work  => array\_avr\_work6
3587 \textcolor{keywordflow}{    end if}
3588 
3589                         
3590 
3591     \textcolor{keywordflow}{if} ( space\_average(7) ) \textcolor{keywordflow}{then}
3592       dim\_size = array\_shape(7)
3593       array\_shape(7) = 1
3594       \textcolor{keyword}{allocate}( array\_avr\_work7( array\_shape(1) &
3595                                   & , array\_shape(2) &
3596                           
3597         & , array\_shape(3) &
3598                           
3599         & , array\_shape(4) &
3600                           
3601         & , array\_shape(5) &
3602                           
3603         & , array\_shape(6) &
3604                           
3605         & , array\_shape(7) &
3606                           
3607         &  ) )
3608       array\_avr\_work7 = 0.0\_dp
3609       weight\_sum = 0.0\_dp
3610       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3611         array\_avr\_work7(:,:,:,:,:,:,1) = array\_avr\_work7(:,:,:,:,:,:,1) + array\_avr\_work(:,:,:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight7(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3612         weight\_sum = weight\_sum + weight7(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3613 \textcolor{keywordflow}{      end do}
3614       array\_avr\_work7 = array\_avr\_work7 / weight\_sum
3615       array\_avr\_work  => array\_avr\_work7
3616 \textcolor{keywordflow}{    end if}
3617 
3618                         
3619                       
3620 
3621                     
3622 
3623 
3624       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
3625                             & , array\_shape(2) &
3626                     
3627         & , array\_shape(3) &
3628                     
3629         & , array\_shape(4) &
3630                     
3631         & , array\_shape(5) &
3632                     
3633         & , array\_shape(6) &
3634                     
3635         & , array\_shape(7) &
3636                     
3637         & ) )
3638 
3639       array\_avr = array\_avr\_work
3640 
3641       \textcolor{keyword}{nullify}( array\_avr\_work )
3642 
3643                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
3644                     
3645       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
3646                     
3647       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
3648                     
3649       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
3650                     
3651       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work5 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work5 )
3652                     
3653       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work6 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work6 )
3654                     
3655       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work7 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work7 )
3656                     
3657 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a482a2c0fd5e6c320c094212b2c32a738}\label{interfacegtool__historyauto__internal_1_1averagereduce_a482a2c0fd5e6c320c094212b2c32a738}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereduceint1@{averagereduceint1}}
\index{averagereduceint1@{averagereduceint1}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereduceint1()}{averagereduceint1()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereduceint1 (\begin{DoxyParamCaption}\item[{integer, dimension(\+:), intent(in), target}]{array,  }\item[{logical, dimension(1), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{integer, dimension(\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 3667 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
3667     \textcolor{comment}{!}
3668     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
3669     \textcolor{comment}{! array を平均化して array\_avr に返します.}
3670     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
3671     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
3672     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
3673     \textcolor{comment}{!}
3674     \textcolor{keywordtype}{implicit none}
3675     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:)
3676     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(1)
3677                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
3678                     
3679     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr(:) \textcolor{comment}{! (out)}
3680 
3681     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:)
3682 
3683                         \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:)
3684                     
3685 
3686     \textcolor{keywordtype}{integer}:: array\_shape(1)
3687     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
3688     \textcolor{keywordtype}{real(DP)}:: weight\_sum
3689   \textcolor{keywordflow}{continue}
3690 
3691     array\_shape = shape( array )
3692     array\_avr\_work => array
3693 
3694                     
3695                       
3696                         
3697     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
3698       dim\_size = array\_shape(1)
3699       array\_shape(1) = 1
3700       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
3701                           
3702         &  ) )
3703       array\_avr\_work1 = 0
3704       weight\_sum = 0.0\_dp
3705       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3706         array\_avr\_work1(1) = array\_avr\_work1(1) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3707         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3708 \textcolor{keywordflow}{      end do}
3709       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
3710       array\_avr\_work  => array\_avr\_work1
3711 \textcolor{keywordflow}{    end if}
3712 
3713                         
3714                       
3715 
3716                     
3717 
3718 
3719       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
3720                     
3721         & ) )
3722 
3723       array\_avr = array\_avr\_work
3724 
3725       \textcolor{keyword}{nullify}( array\_avr\_work )
3726 
3727                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
3728                     
3729 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a5386450d0643bec26d40a18f69ae7324}\label{interfacegtool__historyauto__internal_1_1averagereduce_a5386450d0643bec26d40a18f69ae7324}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereduceint2@{averagereduceint2}}
\index{averagereduceint2@{averagereduceint2}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereduceint2()}{averagereduceint2()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereduceint2 (\begin{DoxyParamCaption}\item[{integer, dimension(\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(2), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{integer, dimension(\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 3741 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
3741     \textcolor{comment}{!}
3742     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
3743     \textcolor{comment}{! array を平均化して array\_avr に返します.}
3744     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
3745     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
3746     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
3747     \textcolor{comment}{!}
3748     \textcolor{keywordtype}{implicit none}
3749     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:)
3750     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(2)
3751                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
3752                     
3753     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
3754                     
3755     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:) \textcolor{comment}{! (out)}
3756 
3757     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:)
3758 
3759                         \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:)
3760                     
3761     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:)
3762                     
3763 
3764     \textcolor{keywordtype}{integer}:: array\_shape(2)
3765     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
3766     \textcolor{keywordtype}{real(DP)}:: weight\_sum
3767   \textcolor{keywordflow}{continue}
3768 
3769     array\_shape = shape( array )
3770     array\_avr\_work => array
3771 
3772                     
3773                       
3774                         
3775     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
3776       dim\_size = array\_shape(1)
3777       array\_shape(1) = 1
3778       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
3779                                   & , array\_shape(2) &
3780                           
3781         &  ) )
3782       array\_avr\_work1 = 0
3783       weight\_sum = 0.0\_dp
3784       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3785         array\_avr\_work1(1,:) = array\_avr\_work1(1,:) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight1(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3786         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3787 \textcolor{keywordflow}{      end do}
3788       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
3789       array\_avr\_work  => array\_avr\_work1
3790 \textcolor{keywordflow}{    end if}
3791 
3792                         
3793 
3794     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
3795       dim\_size = array\_shape(2)
3796       array\_shape(2) = 1
3797       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
3798                                   & , array\_shape(2) &
3799                           
3800         &  ) )
3801       array\_avr\_work2 = 0
3802       weight\_sum = 0.0\_dp
3803       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3804         array\_avr\_work2(:,1) = array\_avr\_work2(:,1) + array\_avr\_work(:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight2(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3805         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3806 \textcolor{keywordflow}{      end do}
3807       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
3808       array\_avr\_work  => array\_avr\_work2
3809 \textcolor{keywordflow}{    end if}
3810 
3811                         
3812                       
3813 
3814                     
3815 
3816 
3817       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
3818                             & , array\_shape(2) &
3819                     
3820         & ) )
3821 
3822       array\_avr = array\_avr\_work
3823 
3824       \textcolor{keyword}{nullify}( array\_avr\_work )
3825 
3826                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
3827                     
3828       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
3829                     
3830 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a49c67f92705a932c25daa825de399f7f}\label{interfacegtool__historyauto__internal_1_1averagereduce_a49c67f92705a932c25daa825de399f7f}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereduceint3@{averagereduceint3}}
\index{averagereduceint3@{averagereduceint3}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereduceint3()}{averagereduceint3()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereduceint3 (\begin{DoxyParamCaption}\item[{integer, dimension(\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(3), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{integer, dimension(\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 3844 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
3844     \textcolor{comment}{!}
3845     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
3846     \textcolor{comment}{! array を平均化して array\_avr に返します.}
3847     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
3848     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
3849     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
3850     \textcolor{comment}{!}
3851     \textcolor{keywordtype}{implicit none}
3852     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:)
3853     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(3)
3854                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
3855                     
3856     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
3857                     
3858     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
3859                     
3860     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:) \textcolor{comment}{! (out)}
3861 
3862     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:)
3863 
3864                         \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:)
3865                     
3866     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:)
3867                     
3868     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:)
3869                     
3870 
3871     \textcolor{keywordtype}{integer}:: array\_shape(3)
3872     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
3873     \textcolor{keywordtype}{real(DP)}:: weight\_sum
3874   \textcolor{keywordflow}{continue}
3875 
3876     array\_shape = shape( array )
3877     array\_avr\_work => array
3878 
3879                     
3880                       
3881                         
3882     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
3883       dim\_size = array\_shape(1)
3884       array\_shape(1) = 1
3885       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
3886                                   & , array\_shape(2) &
3887                           
3888         & , array\_shape(3) &
3889                           
3890         &  ) )
3891       array\_avr\_work1 = 0
3892       weight\_sum = 0.0\_dp
3893       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3894         array\_avr\_work1(1,:,:) = array\_avr\_work1(1,:,:) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight1(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3895         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3896 \textcolor{keywordflow}{      end do}
3897       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
3898       array\_avr\_work  => array\_avr\_work1
3899 \textcolor{keywordflow}{    end if}
3900 
3901                         
3902 
3903     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
3904       dim\_size = array\_shape(2)
3905       array\_shape(2) = 1
3906       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
3907                                   & , array\_shape(2) &
3908                           
3909         & , array\_shape(3) &
3910                           
3911         &  ) )
3912       array\_avr\_work2 = 0
3913       weight\_sum = 0.0\_dp
3914       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3915         array\_avr\_work2(:,1,:) = array\_avr\_work2(:,1,:) + array\_avr\_work(:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight2(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3916         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3917 \textcolor{keywordflow}{      end do}
3918       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
3919       array\_avr\_work  => array\_avr\_work2
3920 \textcolor{keywordflow}{    end if}
3921 
3922                         
3923 
3924     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
3925       dim\_size = array\_shape(3)
3926       array\_shape(3) = 1
3927       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
3928                                   & , array\_shape(2) &
3929                           
3930         & , array\_shape(3) &
3931                           
3932         &  ) )
3933       array\_avr\_work3 = 0
3934       weight\_sum = 0.0\_dp
3935       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
3936         array\_avr\_work3(:,:,1) = array\_avr\_work3(:,:,1) + array\_avr\_work(:,:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight3(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3937         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
3938 \textcolor{keywordflow}{      end do}
3939       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
3940       array\_avr\_work  => array\_avr\_work3
3941 \textcolor{keywordflow}{    end if}
3942 
3943                         
3944                       
3945 
3946                     
3947 
3948 
3949       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
3950                             & , array\_shape(2) &
3951                     
3952         & , array\_shape(3) &
3953                     
3954         & ) )
3955 
3956       array\_avr = array\_avr\_work
3957 
3958       \textcolor{keyword}{nullify}( array\_avr\_work )
3959 
3960                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
3961                     
3962       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
3963                     
3964       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
3965                     
3966 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_af4991de53efdfd86ba63362e1e729a8d}\label{interfacegtool__historyauto__internal_1_1averagereduce_af4991de53efdfd86ba63362e1e729a8d}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereduceint4@{averagereduceint4}}
\index{averagereduceint4@{averagereduceint4}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereduceint4()}{averagereduceint4()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereduceint4 (\begin{DoxyParamCaption}\item[{integer, dimension(\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(4), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{integer, dimension(\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 3982 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
3982     \textcolor{comment}{!}
3983     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
3984     \textcolor{comment}{! array を平均化して array\_avr に返します.}
3985     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
3986     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
3987     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
3988     \textcolor{comment}{!}
3989     \textcolor{keywordtype}{implicit none}
3990     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:)
3991     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(4)
3992                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
3993                     
3994     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
3995                     
3996     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
3997                     
3998     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
3999                     
4000     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:) \textcolor{comment}{! (out)}
4001 
4002     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:)
4003 
4004                         \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:)
4005                     
4006     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:)
4007                     
4008     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:)
4009                     
4010     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:)
4011                     
4012 
4013     \textcolor{keywordtype}{integer}:: array\_shape(4)
4014     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
4015     \textcolor{keywordtype}{real(DP)}:: weight\_sum
4016   \textcolor{keywordflow}{continue}
4017 
4018     array\_shape = shape( array )
4019     array\_avr\_work => array
4020 
4021                     
4022                       
4023                         
4024     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
4025       dim\_size = array\_shape(1)
4026       array\_shape(1) = 1
4027       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
4028                                   & , array\_shape(2) &
4029                           
4030         & , array\_shape(3) &
4031                           
4032         & , array\_shape(4) &
4033                           
4034         &  ) )
4035       array\_avr\_work1 = 0
4036       weight\_sum = 0.0\_dp
4037       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4038         array\_avr\_work1(1,:,:,:) = array\_avr\_work1(1,:,:,:) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight1(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4039         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4040 \textcolor{keywordflow}{      end do}
4041       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
4042       array\_avr\_work  => array\_avr\_work1
4043 \textcolor{keywordflow}{    end if}
4044 
4045                         
4046 
4047     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
4048       dim\_size = array\_shape(2)
4049       array\_shape(2) = 1
4050       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
4051                                   & , array\_shape(2) &
4052                           
4053         & , array\_shape(3) &
4054                           
4055         & , array\_shape(4) &
4056                           
4057         &  ) )
4058       array\_avr\_work2 = 0
4059       weight\_sum = 0.0\_dp
4060       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4061         array\_avr\_work2(:,1,:,:) = array\_avr\_work2(:,1,:,:) + array\_avr\_work(:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight2(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4062         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4063 \textcolor{keywordflow}{      end do}
4064       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
4065       array\_avr\_work  => array\_avr\_work2
4066 \textcolor{keywordflow}{    end if}
4067 
4068                         
4069 
4070     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
4071       dim\_size = array\_shape(3)
4072       array\_shape(3) = 1
4073       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
4074                                   & , array\_shape(2) &
4075                           
4076         & , array\_shape(3) &
4077                           
4078         & , array\_shape(4) &
4079                           
4080         &  ) )
4081       array\_avr\_work3 = 0
4082       weight\_sum = 0.0\_dp
4083       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4084         array\_avr\_work3(:,:,1,:) = array\_avr\_work3(:,:,1,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4085         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4086 \textcolor{keywordflow}{      end do}
4087       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
4088       array\_avr\_work  => array\_avr\_work3
4089 \textcolor{keywordflow}{    end if}
4090 
4091                         
4092 
4093     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
4094       dim\_size = array\_shape(4)
4095       array\_shape(4) = 1
4096       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
4097                                   & , array\_shape(2) &
4098                           
4099         & , array\_shape(3) &
4100                           
4101         & , array\_shape(4) &
4102                           
4103         &  ) )
4104       array\_avr\_work4 = 0
4105       weight\_sum = 0.0\_dp
4106       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4107         array\_avr\_work4(:,:,:,1) = array\_avr\_work4(:,:,:,1) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4108         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4109 \textcolor{keywordflow}{      end do}
4110       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
4111       array\_avr\_work  => array\_avr\_work4
4112 \textcolor{keywordflow}{    end if}
4113 
4114                         
4115                       
4116 
4117                     
4118 
4119 
4120       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
4121                             & , array\_shape(2) &
4122                     
4123         & , array\_shape(3) &
4124                     
4125         & , array\_shape(4) &
4126                     
4127         & ) )
4128 
4129       array\_avr = array\_avr\_work
4130 
4131       \textcolor{keyword}{nullify}( array\_avr\_work )
4132 
4133                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
4134                     
4135       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
4136                     
4137       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
4138                     
4139       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
4140                     
4141 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a70e9530006a7d861ca58f6adcaa37d11}\label{interfacegtool__historyauto__internal_1_1averagereduce_a70e9530006a7d861ca58f6adcaa37d11}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereduceint5@{averagereduceint5}}
\index{averagereduceint5@{averagereduceint5}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereduceint5()}{averagereduceint5()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereduceint5 (\begin{DoxyParamCaption}\item[{integer, dimension(\+:,\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(5), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight5,  }\item[{integer, dimension(\+:,\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 4159 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
4159     \textcolor{comment}{!}
4160     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
4161     \textcolor{comment}{! array を平均化して array\_avr に返します.}
4162     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
4163     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
4164     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
4165     \textcolor{comment}{!}
4166     \textcolor{keywordtype}{implicit none}
4167     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:,:)
4168     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(5)
4169                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
4170                     
4171     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
4172                     
4173     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
4174                     
4175     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
4176                     
4177     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight5(:)
4178                     
4179     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:,:) \textcolor{comment}{! (out)}
4180 
4181     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:,:)
4182 
4183                         \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:,:)
4184                     
4185     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:,:)
4186                     
4187     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:,:)
4188                     
4189     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:,:)
4190                     
4191     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work5(:,:,:,:,:)
4192                     
4193 
4194     \textcolor{keywordtype}{integer}:: array\_shape(5)
4195     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
4196     \textcolor{keywordtype}{real(DP)}:: weight\_sum
4197   \textcolor{keywordflow}{continue}
4198 
4199     array\_shape = shape( array )
4200     array\_avr\_work => array
4201 
4202                     
4203                       
4204                         
4205     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
4206       dim\_size = array\_shape(1)
4207       array\_shape(1) = 1
4208       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
4209                                   & , array\_shape(2) &
4210                           
4211         & , array\_shape(3) &
4212                           
4213         & , array\_shape(4) &
4214                           
4215         & , array\_shape(5) &
4216                           
4217         &  ) )
4218       array\_avr\_work1 = 0
4219       weight\_sum = 0.0\_dp
4220       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4221         array\_avr\_work1(1,:,:,:,:) = array\_avr\_work1(1,:,:,:,:) + array\_avr\_work(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4222         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4223 \textcolor{keywordflow}{      end do}
4224       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
4225       array\_avr\_work  => array\_avr\_work1
4226 \textcolor{keywordflow}{    end if}
4227 
4228                         
4229 
4230     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
4231       dim\_size = array\_shape(2)
4232       array\_shape(2) = 1
4233       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
4234                                   & , array\_shape(2) &
4235                           
4236         & , array\_shape(3) &
4237                           
4238         & , array\_shape(4) &
4239                           
4240         & , array\_shape(5) &
4241                           
4242         &  ) )
4243       array\_avr\_work2 = 0
4244       weight\_sum = 0.0\_dp
4245       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4246         array\_avr\_work2(:,1,:,:,:) = array\_avr\_work2(:,1,:,:,:) + array\_avr\_work(:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4247         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4248 \textcolor{keywordflow}{      end do}
4249       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
4250       array\_avr\_work  => array\_avr\_work2
4251 \textcolor{keywordflow}{    end if}
4252 
4253                         
4254 
4255     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
4256       dim\_size = array\_shape(3)
4257       array\_shape(3) = 1
4258       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
4259                                   & , array\_shape(2) &
4260                           
4261         & , array\_shape(3) &
4262                           
4263         & , array\_shape(4) &
4264                           
4265         & , array\_shape(5) &
4266                           
4267         &  ) )
4268       array\_avr\_work3 = 0
4269       weight\_sum = 0.0\_dp
4270       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4271         array\_avr\_work3(:,:,1,:,:) = array\_avr\_work3(:,:,1,:,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4272         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4273 \textcolor{keywordflow}{      end do}
4274       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
4275       array\_avr\_work  => array\_avr\_work3
4276 \textcolor{keywordflow}{    end if}
4277 
4278                         
4279 
4280     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
4281       dim\_size = array\_shape(4)
4282       array\_shape(4) = 1
4283       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
4284                                   & , array\_shape(2) &
4285                           
4286         & , array\_shape(3) &
4287                           
4288         & , array\_shape(4) &
4289                           
4290         & , array\_shape(5) &
4291                           
4292         &  ) )
4293       array\_avr\_work4 = 0
4294       weight\_sum = 0.0\_dp
4295       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4296         array\_avr\_work4(:,:,:,1,:) = array\_avr\_work4(:,:,:,1,:) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4297         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4298 \textcolor{keywordflow}{      end do}
4299       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
4300       array\_avr\_work  => array\_avr\_work4
4301 \textcolor{keywordflow}{    end if}
4302 
4303                         
4304 
4305     \textcolor{keywordflow}{if} ( space\_average(5) ) \textcolor{keywordflow}{then}
4306       dim\_size = array\_shape(5)
4307       array\_shape(5) = 1
4308       \textcolor{keyword}{allocate}( array\_avr\_work5( array\_shape(1) &
4309                                   & , array\_shape(2) &
4310                           
4311         & , array\_shape(3) &
4312                           
4313         & , array\_shape(4) &
4314                           
4315         & , array\_shape(5) &
4316                           
4317         &  ) )
4318       array\_avr\_work5 = 0
4319       weight\_sum = 0.0\_dp
4320       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4321         array\_avr\_work5(:,:,:,:,1) = array\_avr\_work5(:,:,:,:,1) + array\_avr\_work(:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4322         weight\_sum = weight\_sum + weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4323 \textcolor{keywordflow}{      end do}
4324       array\_avr\_work5 = array\_avr\_work5 / weight\_sum
4325       array\_avr\_work  => array\_avr\_work5
4326 \textcolor{keywordflow}{    end if}
4327 
4328                         
4329                       
4330 
4331                     
4332 
4333 
4334       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
4335                             & , array\_shape(2) &
4336                     
4337         & , array\_shape(3) &
4338                     
4339         & , array\_shape(4) &
4340                     
4341         & , array\_shape(5) &
4342                     
4343         & ) )
4344 
4345       array\_avr = array\_avr\_work
4346 
4347       \textcolor{keyword}{nullify}( array\_avr\_work )
4348 
4349                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
4350                     
4351       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
4352                     
4353       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
4354                     
4355       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
4356                     
4357       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work5 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work5 )
4358                     
4359 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_af0e341bd3af7471a4af99a85c1ee7d92}\label{interfacegtool__historyauto__internal_1_1averagereduce_af0e341bd3af7471a4af99a85c1ee7d92}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereduceint6@{averagereduceint6}}
\index{averagereduceint6@{averagereduceint6}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereduceint6()}{averagereduceint6()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereduceint6 (\begin{DoxyParamCaption}\item[{integer, dimension(\+:,\+:,\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(6), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight5,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight6,  }\item[{integer, dimension(\+:,\+:,\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 4379 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
4379     \textcolor{comment}{!}
4380     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
4381     \textcolor{comment}{! array を平均化して array\_avr に返します.}
4382     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
4383     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
4384     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
4385     \textcolor{comment}{!}
4386     \textcolor{keywordtype}{implicit none}
4387     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:,:,:)
4388     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(6)
4389                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
4390                     
4391     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
4392                     
4393     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
4394                     
4395     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
4396                     
4397     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight5(:)
4398                     
4399     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight6(:)
4400                     
4401     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:,:,:) \textcolor{comment}{! (out)}
4402 
4403     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:,:,:)
4404 
4405                         \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:,:,:)
4406                     
4407     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:,:,:)
4408                     
4409     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:,:,:)
4410                     
4411     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:,:,:)
4412                     
4413     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work5(:,:,:,:,:,:)
4414                     
4415     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work6(:,:,:,:,:,:)
4416                     
4417 
4418     \textcolor{keywordtype}{integer}:: array\_shape(6)
4419     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
4420     \textcolor{keywordtype}{real(DP)}:: weight\_sum
4421   \textcolor{keywordflow}{continue}
4422 
4423     array\_shape = shape( array )
4424     array\_avr\_work => array
4425 
4426                     
4427                       
4428                         
4429     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
4430       dim\_size = array\_shape(1)
4431       array\_shape(1) = 1
4432       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
4433                                   & , array\_shape(2) &
4434                           
4435         & , array\_shape(3) &
4436                           
4437         & , array\_shape(4) &
4438                           
4439         & , array\_shape(5) &
4440                           
4441         & , array\_shape(6) &
4442                           
4443         &  ) )
4444       array\_avr\_work1 = 0
4445       weight\_sum = 0.0\_dp
4446       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4447         array\_avr\_work1(1,:,:,:,:,:) = array\_avr\_work1(1,:,:,:,:,:) + array\_avr\_work(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:,:) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4448         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4449 \textcolor{keywordflow}{      end do}
4450       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
4451       array\_avr\_work  => array\_avr\_work1
4452 \textcolor{keywordflow}{    end if}
4453 
4454                         
4455 
4456     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
4457       dim\_size = array\_shape(2)
4458       array\_shape(2) = 1
4459       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
4460                                   & , array\_shape(2) &
4461                           
4462         & , array\_shape(3) &
4463                           
4464         & , array\_shape(4) &
4465                           
4466         & , array\_shape(5) &
4467                           
4468         & , array\_shape(6) &
4469                           
4470         &  ) )
4471       array\_avr\_work2 = 0
4472       weight\_sum = 0.0\_dp
4473       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4474         array\_avr\_work2(:,1,:,:,:,:) = array\_avr\_work2(:,1,:,:,:,:) + array\_avr\_work(:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:) * weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4475         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4476 \textcolor{keywordflow}{      end do}
4477       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
4478       array\_avr\_work  => array\_avr\_work2
4479 \textcolor{keywordflow}{    end if}
4480 
4481                         
4482 
4483     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
4484       dim\_size = array\_shape(3)
4485       array\_shape(3) = 1
4486       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
4487                                   & , array\_shape(2) &
4488                           
4489         & , array\_shape(3) &
4490                           
4491         & , array\_shape(4) &
4492                           
4493         & , array\_shape(5) &
4494                           
4495         & , array\_shape(6) &
4496                           
4497         &  ) )
4498       array\_avr\_work3 = 0
4499       weight\_sum = 0.0\_dp
4500       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4501         array\_avr\_work3(:,:,1,:,:,:) = array\_avr\_work3(:,:,1,:,:,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4502         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4503 \textcolor{keywordflow}{      end do}
4504       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
4505       array\_avr\_work  => array\_avr\_work3
4506 \textcolor{keywordflow}{    end if}
4507 
4508                         
4509 
4510     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
4511       dim\_size = array\_shape(4)
4512       array\_shape(4) = 1
4513       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
4514                                   & , array\_shape(2) &
4515                           
4516         & , array\_shape(3) &
4517                           
4518         & , array\_shape(4) &
4519                           
4520         & , array\_shape(5) &
4521                           
4522         & , array\_shape(6) &
4523                           
4524         &  ) )
4525       array\_avr\_work4 = 0
4526       weight\_sum = 0.0\_dp
4527       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4528         array\_avr\_work4(:,:,:,1,:,:) = array\_avr\_work4(:,:,:,1,:,:) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4529         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4530 \textcolor{keywordflow}{      end do}
4531       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
4532       array\_avr\_work  => array\_avr\_work4
4533 \textcolor{keywordflow}{    end if}
4534 
4535                         
4536 
4537     \textcolor{keywordflow}{if} ( space\_average(5) ) \textcolor{keywordflow}{then}
4538       dim\_size = array\_shape(5)
4539       array\_shape(5) = 1
4540       \textcolor{keyword}{allocate}( array\_avr\_work5( array\_shape(1) &
4541                                   & , array\_shape(2) &
4542                           
4543         & , array\_shape(3) &
4544                           
4545         & , array\_shape(4) &
4546                           
4547         & , array\_shape(5) &
4548                           
4549         & , array\_shape(6) &
4550                           
4551         &  ) )
4552       array\_avr\_work5 = 0
4553       weight\_sum = 0.0\_dp
4554       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4555         array\_avr\_work5(:,:,:,:,1,:) = array\_avr\_work5(:,:,:,:,1,:) + array\_avr\_work(:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4556         weight\_sum = weight\_sum + weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4557 \textcolor{keywordflow}{      end do}
4558       array\_avr\_work5 = array\_avr\_work5 / weight\_sum
4559       array\_avr\_work  => array\_avr\_work5
4560 \textcolor{keywordflow}{    end if}
4561 
4562                         
4563 
4564     \textcolor{keywordflow}{if} ( space\_average(6) ) \textcolor{keywordflow}{then}
4565       dim\_size = array\_shape(6)
4566       array\_shape(6) = 1
4567       \textcolor{keyword}{allocate}( array\_avr\_work6( array\_shape(1) &
4568                                   & , array\_shape(2) &
4569                           
4570         & , array\_shape(3) &
4571                           
4572         & , array\_shape(4) &
4573                           
4574         & , array\_shape(5) &
4575                           
4576         & , array\_shape(6) &
4577                           
4578         &  ) )
4579       array\_avr\_work6 = 0
4580       weight\_sum = 0.0\_dp
4581       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4582         array\_avr\_work6(:,:,:,:,:,1) = array\_avr\_work6(:,:,:,:,:,1) + array\_avr\_work(:,:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4583         weight\_sum = weight\_sum + weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4584 \textcolor{keywordflow}{      end do}
4585       array\_avr\_work6 = array\_avr\_work6 / weight\_sum
4586       array\_avr\_work  => array\_avr\_work6
4587 \textcolor{keywordflow}{    end if}
4588 
4589                         
4590                       
4591 
4592                     
4593 
4594 
4595       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
4596                             & , array\_shape(2) &
4597                     
4598         & , array\_shape(3) &
4599                     
4600         & , array\_shape(4) &
4601                     
4602         & , array\_shape(5) &
4603                     
4604         & , array\_shape(6) &
4605                     
4606         & ) )
4607 
4608       array\_avr = array\_avr\_work
4609 
4610       \textcolor{keyword}{nullify}( array\_avr\_work )
4611 
4612                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
4613                     
4614       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
4615                     
4616       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
4617                     
4618       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
4619                     
4620       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work5 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work5 )
4621                     
4622       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work6 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work6 )
4623                     
4624 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_ab15de8d48086d4956e1cd8bbebe208f0}\label{interfacegtool__historyauto__internal_1_1averagereduce_ab15de8d48086d4956e1cd8bbebe208f0}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereduceint7@{averagereduceint7}}
\index{averagereduceint7@{averagereduceint7}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereduceint7()}{averagereduceint7()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereduceint7 (\begin{DoxyParamCaption}\item[{integer, dimension(\+:,\+:,\+:,\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(7), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight5,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight6,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight7,  }\item[{integer, dimension(\+:,\+:,\+:,\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 4646 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
4646     \textcolor{comment}{!}
4647     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
4648     \textcolor{comment}{! array を平均化して array\_avr に返します.}
4649     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
4650     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
4651     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
4652     \textcolor{comment}{!}
4653     \textcolor{keywordtype}{implicit none}
4654     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:,:,:,:)
4655     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(7)
4656                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
4657                     
4658     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
4659                     
4660     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
4661                     
4662     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
4663                     
4664     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight5(:)
4665                     
4666     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight6(:)
4667                     
4668     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight7(:)
4669                     
4670     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:,:,:,:) \textcolor{comment}{! (out)}
4671 
4672     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:,:,:,:)
4673 
4674                         \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:,:,:,:)
4675                     
4676     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:,:,:,:)
4677                     
4678     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:,:,:,:)
4679                     
4680     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:,:,:,:)
4681                     
4682     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work5(:,:,:,:,:,:,:)
4683                     
4684     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work6(:,:,:,:,:,:,:)
4685                     
4686     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{pointer}:: array\_avr\_work7(:,:,:,:,:,:,:)
4687                     
4688 
4689     \textcolor{keywordtype}{integer}:: array\_shape(7)
4690     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
4691     \textcolor{keywordtype}{real(DP)}:: weight\_sum
4692   \textcolor{keywordflow}{continue}
4693 
4694     array\_shape = shape( array )
4695     array\_avr\_work => array
4696 
4697                     
4698                       
4699                         
4700     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
4701       dim\_size = array\_shape(1)
4702       array\_shape(1) = 1
4703       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
4704                                   & , array\_shape(2) &
4705                           
4706         & , array\_shape(3) &
4707                           
4708         & , array\_shape(4) &
4709                           
4710         & , array\_shape(5) &
4711                           
4712         & , array\_shape(6) &
4713                           
4714         & , array\_shape(7) &
4715                           
4716         &  ) )
4717       array\_avr\_work1 = 0
4718       weight\_sum = 0.0\_dp
4719       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4720         array\_avr\_work1(1,:,:,:,:,:,:) = array\_avr\_work1(1,:,:,:,:,:,:) + array\_avr\_work(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:,:,:) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4721         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4722 \textcolor{keywordflow}{      end do}
4723       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
4724       array\_avr\_work  => array\_avr\_work1
4725 \textcolor{keywordflow}{    end if}
4726 
4727                         
4728 
4729     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
4730       dim\_size = array\_shape(2)
4731       array\_shape(2) = 1
4732       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
4733                                   & , array\_shape(2) &
4734                           
4735         & , array\_shape(3) &
4736                           
4737         & , array\_shape(4) &
4738                           
4739         & , array\_shape(5) &
4740                           
4741         & , array\_shape(6) &
4742                           
4743         & , array\_shape(7) &
4744                           
4745         &  ) )
4746       array\_avr\_work2 = 0
4747       weight\_sum = 0.0\_dp
4748       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4749         array\_avr\_work2(:,1,:,:,:,:,:) = array\_avr\_work2(:,1,:,:,:,:,:) + array\_avr\_work(:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:,:) * weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4750         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4751 \textcolor{keywordflow}{      end do}
4752       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
4753       array\_avr\_work  => array\_avr\_work2
4754 \textcolor{keywordflow}{    end if}
4755 
4756                         
4757 
4758     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
4759       dim\_size = array\_shape(3)
4760       array\_shape(3) = 1
4761       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
4762                                   & , array\_shape(2) &
4763                           
4764         & , array\_shape(3) &
4765                           
4766         & , array\_shape(4) &
4767                           
4768         & , array\_shape(5) &
4769                           
4770         & , array\_shape(6) &
4771                           
4772         & , array\_shape(7) &
4773                           
4774         &  ) )
4775       array\_avr\_work3 = 0
4776       weight\_sum = 0.0\_dp
4777       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4778         array\_avr\_work3(:,:,1,:,:,:,:) = array\_avr\_work3(:,:,1,:,:,:,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4779         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4780 \textcolor{keywordflow}{      end do}
4781       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
4782       array\_avr\_work  => array\_avr\_work3
4783 \textcolor{keywordflow}{    end if}
4784 
4785                         
4786 
4787     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
4788       dim\_size = array\_shape(4)
4789       array\_shape(4) = 1
4790       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
4791                                   & , array\_shape(2) &
4792                           
4793         & , array\_shape(3) &
4794                           
4795         & , array\_shape(4) &
4796                           
4797         & , array\_shape(5) &
4798                           
4799         & , array\_shape(6) &
4800                           
4801         & , array\_shape(7) &
4802                           
4803         &  ) )
4804       array\_avr\_work4 = 0
4805       weight\_sum = 0.0\_dp
4806       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4807         array\_avr\_work4(:,:,:,1,:,:,:) = array\_avr\_work4(:,:,:,1,:,:,:) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4808         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4809 \textcolor{keywordflow}{      end do}
4810       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
4811       array\_avr\_work  => array\_avr\_work4
4812 \textcolor{keywordflow}{    end if}
4813 
4814                         
4815 
4816     \textcolor{keywordflow}{if} ( space\_average(5) ) \textcolor{keywordflow}{then}
4817       dim\_size = array\_shape(5)
4818       array\_shape(5) = 1
4819       \textcolor{keyword}{allocate}( array\_avr\_work5( array\_shape(1) &
4820                                   & , array\_shape(2) &
4821                           
4822         & , array\_shape(3) &
4823                           
4824         & , array\_shape(4) &
4825                           
4826         & , array\_shape(5) &
4827                           
4828         & , array\_shape(6) &
4829                           
4830         & , array\_shape(7) &
4831                           
4832         &  ) )
4833       array\_avr\_work5 = 0
4834       weight\_sum = 0.0\_dp
4835       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4836         array\_avr\_work5(:,:,:,:,1,:,:) = array\_avr\_work5(:,:,:,:,1,:,:) + array\_avr\_work(:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4837         weight\_sum = weight\_sum + weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4838 \textcolor{keywordflow}{      end do}
4839       array\_avr\_work5 = array\_avr\_work5 / weight\_sum
4840       array\_avr\_work  => array\_avr\_work5
4841 \textcolor{keywordflow}{    end if}
4842 
4843                         
4844 
4845     \textcolor{keywordflow}{if} ( space\_average(6) ) \textcolor{keywordflow}{then}
4846       dim\_size = array\_shape(6)
4847       array\_shape(6) = 1
4848       \textcolor{keyword}{allocate}( array\_avr\_work6( array\_shape(1) &
4849                                   & , array\_shape(2) &
4850                           
4851         & , array\_shape(3) &
4852                           
4853         & , array\_shape(4) &
4854                           
4855         & , array\_shape(5) &
4856                           
4857         & , array\_shape(6) &
4858                           
4859         & , array\_shape(7) &
4860                           
4861         &  ) )
4862       array\_avr\_work6 = 0
4863       weight\_sum = 0.0\_dp
4864       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4865         array\_avr\_work6(:,:,:,:,:,1,:) = array\_avr\_work6(:,:,:,:,:,1,:) + array\_avr\_work(:,:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4866         weight\_sum = weight\_sum + weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4867 \textcolor{keywordflow}{      end do}
4868       array\_avr\_work6 = array\_avr\_work6 / weight\_sum
4869       array\_avr\_work  => array\_avr\_work6
4870 \textcolor{keywordflow}{    end if}
4871 
4872                         
4873 
4874     \textcolor{keywordflow}{if} ( space\_average(7) ) \textcolor{keywordflow}{then}
4875       dim\_size = array\_shape(7)
4876       array\_shape(7) = 1
4877       \textcolor{keyword}{allocate}( array\_avr\_work7( array\_shape(1) &
4878                                   & , array\_shape(2) &
4879                           
4880         & , array\_shape(3) &
4881                           
4882         & , array\_shape(4) &
4883                           
4884         & , array\_shape(5) &
4885                           
4886         & , array\_shape(6) &
4887                           
4888         & , array\_shape(7) &
4889                           
4890         &  ) )
4891       array\_avr\_work7 = 0
4892       weight\_sum = 0.0\_dp
4893       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
4894         array\_avr\_work7(:,:,:,:,:,:,1) = array\_avr\_work7(:,:,:,:,:,:,1) + array\_avr\_work(:,:,:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight7(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4895         weight\_sum = weight\_sum + weight7(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
4896 \textcolor{keywordflow}{      end do}
4897       array\_avr\_work7 = array\_avr\_work7 / weight\_sum
4898       array\_avr\_work  => array\_avr\_work7
4899 \textcolor{keywordflow}{    end if}
4900 
4901                         
4902                       
4903 
4904                     
4905 
4906 
4907       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
4908                             & , array\_shape(2) &
4909                     
4910         & , array\_shape(3) &
4911                     
4912         & , array\_shape(4) &
4913                     
4914         & , array\_shape(5) &
4915                     
4916         & , array\_shape(6) &
4917                     
4918         & , array\_shape(7) &
4919                     
4920         & ) )
4921 
4922       array\_avr = array\_avr\_work
4923 
4924       \textcolor{keyword}{nullify}( array\_avr\_work )
4925 
4926                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
4927                     
4928       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
4929                     
4930       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
4931                     
4932       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
4933                     
4934       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work5 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work5 )
4935                     
4936       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work6 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work6 )
4937                     
4938       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work7 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work7 )
4939                     
4940 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_ad606a552895bbe6472e3e617a764fcd3}\label{interfacegtool__historyauto__internal_1_1averagereduce_ad606a552895bbe6472e3e617a764fcd3}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducereal1@{averagereducereal1}}
\index{averagereducereal1@{averagereducereal1}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducereal1()}{averagereducereal1()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducereal1 (\begin{DoxyParamCaption}\item[{real, dimension(\+:), intent(in), target}]{array,  }\item[{logical, dimension(1), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real, dimension(\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1101 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
1101     \textcolor{comment}{!}
1102     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
1103     \textcolor{comment}{! array を平均化して array\_avr に返します.}
1104     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
1105     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
1106     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
1107     \textcolor{comment}{!}
1108     \textcolor{keywordtype}{implicit none}
1109     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:)
1110     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(1)
1111                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
1112                     
1113     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr(:) \textcolor{comment}{! (out)}
1114 
1115     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:)
1116 
1117                         \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:)
1118                     
1119 
1120     \textcolor{keywordtype}{integer}:: array\_shape(1)
1121     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
1122     \textcolor{keywordtype}{real(DP)}:: weight\_sum
1123   \textcolor{keywordflow}{continue}
1124 
1125     array\_shape = shape( array )
1126     array\_avr\_work => array
1127 
1128                     
1129                       
1130                         
1131     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
1132       dim\_size = array\_shape(1)
1133       array\_shape(1) = 1
1134       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
1135                           
1136         &  ) )
1137       array\_avr\_work1 = 0.0
1138       weight\_sum = 0.0\_dp
1139       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1140         array\_avr\_work1(1) = array\_avr\_work1(1) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1141         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1142 \textcolor{keywordflow}{      end do}
1143       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
1144       array\_avr\_work  => array\_avr\_work1
1145 \textcolor{keywordflow}{    end if}
1146 
1147                         
1148                       
1149 
1150                     
1151 
1152 
1153       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
1154                     
1155         & ) )
1156 
1157       array\_avr = array\_avr\_work
1158 
1159       \textcolor{keyword}{nullify}( array\_avr\_work )
1160 
1161                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
1162                     
1163 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a32d74ab835190b34708e71fc5cf81b83}\label{interfacegtool__historyauto__internal_1_1averagereduce_a32d74ab835190b34708e71fc5cf81b83}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducereal2@{averagereducereal2}}
\index{averagereducereal2@{averagereducereal2}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducereal2()}{averagereducereal2()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducereal2 (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(2), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real, dimension(\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1175 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
1175     \textcolor{comment}{!}
1176     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
1177     \textcolor{comment}{! array を平均化して array\_avr に返します.}
1178     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
1179     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
1180     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
1181     \textcolor{comment}{!}
1182     \textcolor{keywordtype}{implicit none}
1183     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:)
1184     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(2)
1185                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
1186                     
1187     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
1188                     
1189     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:) \textcolor{comment}{! (out)}
1190 
1191     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:)
1192 
1193                         \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:)
1194                     
1195     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:)
1196                     
1197 
1198     \textcolor{keywordtype}{integer}:: array\_shape(2)
1199     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
1200     \textcolor{keywordtype}{real(DP)}:: weight\_sum
1201   \textcolor{keywordflow}{continue}
1202 
1203     array\_shape = shape( array )
1204     array\_avr\_work => array
1205 
1206                     
1207                       
1208                         
1209     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
1210       dim\_size = array\_shape(1)
1211       array\_shape(1) = 1
1212       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
1213                                   & , array\_shape(2) &
1214                           
1215         &  ) )
1216       array\_avr\_work1 = 0.0
1217       weight\_sum = 0.0\_dp
1218       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1219         array\_avr\_work1(1,:) = array\_avr\_work1(1,:) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight1(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1220         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1221 \textcolor{keywordflow}{      end do}
1222       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
1223       array\_avr\_work  => array\_avr\_work1
1224 \textcolor{keywordflow}{    end if}
1225 
1226                         
1227 
1228     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
1229       dim\_size = array\_shape(2)
1230       array\_shape(2) = 1
1231       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
1232                                   & , array\_shape(2) &
1233                           
1234         &  ) )
1235       array\_avr\_work2 = 0.0
1236       weight\_sum = 0.0\_dp
1237       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1238         array\_avr\_work2(:,1) = array\_avr\_work2(:,1) + array\_avr\_work(:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight2(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1239         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1240 \textcolor{keywordflow}{      end do}
1241       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
1242       array\_avr\_work  => array\_avr\_work2
1243 \textcolor{keywordflow}{    end if}
1244 
1245                         
1246                       
1247 
1248                     
1249 
1250 
1251       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
1252                             & , array\_shape(2) &
1253                     
1254         & ) )
1255 
1256       array\_avr = array\_avr\_work
1257 
1258       \textcolor{keyword}{nullify}( array\_avr\_work )
1259 
1260                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
1261                     
1262       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
1263                     
1264 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_ac133d4570ffbb0332b90ab83218bd859}\label{interfacegtool__historyauto__internal_1_1averagereduce_ac133d4570ffbb0332b90ab83218bd859}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducereal3@{averagereducereal3}}
\index{averagereducereal3@{averagereducereal3}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducereal3()}{averagereducereal3()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducereal3 (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(3), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real, dimension(\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1278 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
1278     \textcolor{comment}{!}
1279     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
1280     \textcolor{comment}{! array を平均化して array\_avr に返します.}
1281     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
1282     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
1283     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
1284     \textcolor{comment}{!}
1285     \textcolor{keywordtype}{implicit none}
1286     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:)
1287     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(3)
1288                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
1289                     
1290     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
1291                     
1292     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
1293                     
1294     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:) \textcolor{comment}{! (out)}
1295 
1296     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:)
1297 
1298                         \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:)
1299                     
1300     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:)
1301                     
1302     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:)
1303                     
1304 
1305     \textcolor{keywordtype}{integer}:: array\_shape(3)
1306     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
1307     \textcolor{keywordtype}{real(DP)}:: weight\_sum
1308   \textcolor{keywordflow}{continue}
1309 
1310     array\_shape = shape( array )
1311     array\_avr\_work => array
1312 
1313                     
1314                       
1315                         
1316     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
1317       dim\_size = array\_shape(1)
1318       array\_shape(1) = 1
1319       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
1320                                   & , array\_shape(2) &
1321                           
1322         & , array\_shape(3) &
1323                           
1324         &  ) )
1325       array\_avr\_work1 = 0.0
1326       weight\_sum = 0.0\_dp
1327       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1328         array\_avr\_work1(1,:,:) = array\_avr\_work1(1,:,:) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight1(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1329         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1330 \textcolor{keywordflow}{      end do}
1331       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
1332       array\_avr\_work  => array\_avr\_work1
1333 \textcolor{keywordflow}{    end if}
1334 
1335                         
1336 
1337     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
1338       dim\_size = array\_shape(2)
1339       array\_shape(2) = 1
1340       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
1341                                   & , array\_shape(2) &
1342                           
1343         & , array\_shape(3) &
1344                           
1345         &  ) )
1346       array\_avr\_work2 = 0.0
1347       weight\_sum = 0.0\_dp
1348       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1349         array\_avr\_work2(:,1,:) = array\_avr\_work2(:,1,:) + array\_avr\_work(:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight2(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1350         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1351 \textcolor{keywordflow}{      end do}
1352       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
1353       array\_avr\_work  => array\_avr\_work2
1354 \textcolor{keywordflow}{    end if}
1355 
1356                         
1357 
1358     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
1359       dim\_size = array\_shape(3)
1360       array\_shape(3) = 1
1361       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
1362                                   & , array\_shape(2) &
1363                           
1364         & , array\_shape(3) &
1365                           
1366         &  ) )
1367       array\_avr\_work3 = 0.0
1368       weight\_sum = 0.0\_dp
1369       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1370         array\_avr\_work3(:,:,1) = array\_avr\_work3(:,:,1) + array\_avr\_work(:,:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight3(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1371         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1372 \textcolor{keywordflow}{      end do}
1373       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
1374       array\_avr\_work  => array\_avr\_work3
1375 \textcolor{keywordflow}{    end if}
1376 
1377                         
1378                       
1379 
1380                     
1381 
1382 
1383       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
1384                             & , array\_shape(2) &
1385                     
1386         & , array\_shape(3) &
1387                     
1388         & ) )
1389 
1390       array\_avr = array\_avr\_work
1391 
1392       \textcolor{keyword}{nullify}( array\_avr\_work )
1393 
1394                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
1395                     
1396       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
1397                     
1398       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
1399                     
1400 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a67627a9a8b8fa71ba573474cf5b0b37a}\label{interfacegtool__historyauto__internal_1_1averagereduce_a67627a9a8b8fa71ba573474cf5b0b37a}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducereal4@{averagereducereal4}}
\index{averagereducereal4@{averagereducereal4}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducereal4()}{averagereducereal4()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducereal4 (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(4), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real, dimension(\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1416 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
1416     \textcolor{comment}{!}
1417     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
1418     \textcolor{comment}{! array を平均化して array\_avr に返します.}
1419     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
1420     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
1421     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
1422     \textcolor{comment}{!}
1423     \textcolor{keywordtype}{implicit none}
1424     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:)
1425     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(4)
1426                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
1427                     
1428     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
1429                     
1430     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
1431                     
1432     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
1433                     
1434     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:) \textcolor{comment}{! (out)}
1435 
1436     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:)
1437 
1438                         \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:)
1439                     
1440     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:)
1441                     
1442     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:)
1443                     
1444     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:)
1445                     
1446 
1447     \textcolor{keywordtype}{integer}:: array\_shape(4)
1448     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
1449     \textcolor{keywordtype}{real(DP)}:: weight\_sum
1450   \textcolor{keywordflow}{continue}
1451 
1452     array\_shape = shape( array )
1453     array\_avr\_work => array
1454 
1455                     
1456                       
1457                         
1458     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
1459       dim\_size = array\_shape(1)
1460       array\_shape(1) = 1
1461       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
1462                                   & , array\_shape(2) &
1463                           
1464         & , array\_shape(3) &
1465                           
1466         & , array\_shape(4) &
1467                           
1468         &  ) )
1469       array\_avr\_work1 = 0.0
1470       weight\_sum = 0.0\_dp
1471       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1472         array\_avr\_work1(1,:,:,:) = array\_avr\_work1(1,:,:,:) + array\_avr\_work(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight1(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1473         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1474 \textcolor{keywordflow}{      end do}
1475       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
1476       array\_avr\_work  => array\_avr\_work1
1477 \textcolor{keywordflow}{    end if}
1478 
1479                         
1480 
1481     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
1482       dim\_size = array\_shape(2)
1483       array\_shape(2) = 1
1484       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
1485                                   & , array\_shape(2) &
1486                           
1487         & , array\_shape(3) &
1488                           
1489         & , array\_shape(4) &
1490                           
1491         &  ) )
1492       array\_avr\_work2 = 0.0
1493       weight\_sum = 0.0\_dp
1494       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1495         array\_avr\_work2(:,1,:,:) = array\_avr\_work2(:,1,:,:) + array\_avr\_work(:,\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight2(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1496         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1497 \textcolor{keywordflow}{      end do}
1498       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
1499       array\_avr\_work  => array\_avr\_work2
1500 \textcolor{keywordflow}{    end if}
1501 
1502                         
1503 
1504     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
1505       dim\_size = array\_shape(3)
1506       array\_shape(3) = 1
1507       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
1508                                   & , array\_shape(2) &
1509                           
1510         & , array\_shape(3) &
1511                           
1512         & , array\_shape(4) &
1513                           
1514         &  ) )
1515       array\_avr\_work3 = 0.0
1516       weight\_sum = 0.0\_dp
1517       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1518         array\_avr\_work3(:,:,1,:) = array\_avr\_work3(:,:,1,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1519         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1520 \textcolor{keywordflow}{      end do}
1521       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
1522       array\_avr\_work  => array\_avr\_work3
1523 \textcolor{keywordflow}{    end if}
1524 
1525                         
1526 
1527     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
1528       dim\_size = array\_shape(4)
1529       array\_shape(4) = 1
1530       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
1531                                   & , array\_shape(2) &
1532                           
1533         & , array\_shape(3) &
1534                           
1535         & , array\_shape(4) &
1536                           
1537         &  ) )
1538       array\_avr\_work4 = 0.0
1539       weight\_sum = 0.0\_dp
1540       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1541         array\_avr\_work4(:,:,:,1) = array\_avr\_work4(:,:,:,1) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1542         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1543 \textcolor{keywordflow}{      end do}
1544       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
1545       array\_avr\_work  => array\_avr\_work4
1546 \textcolor{keywordflow}{    end if}
1547 
1548                         
1549                       
1550 
1551                     
1552 
1553 
1554       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
1555                             & , array\_shape(2) &
1556                     
1557         & , array\_shape(3) &
1558                     
1559         & , array\_shape(4) &
1560                     
1561         & ) )
1562 
1563       array\_avr = array\_avr\_work
1564 
1565       \textcolor{keyword}{nullify}( array\_avr\_work )
1566 
1567                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
1568                     
1569       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
1570                     
1571       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
1572                     
1573       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
1574                     
1575 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a0540eaafb3253f5fb9997468f697b369}\label{interfacegtool__historyauto__internal_1_1averagereduce_a0540eaafb3253f5fb9997468f697b369}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducereal5@{averagereducereal5}}
\index{averagereducereal5@{averagereducereal5}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducereal5()}{averagereducereal5()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducereal5 (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(5), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight5,  }\item[{real, dimension(\+:,\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1593 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
1593     \textcolor{comment}{!}
1594     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
1595     \textcolor{comment}{! array を平均化して array\_avr に返します.}
1596     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
1597     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
1598     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
1599     \textcolor{comment}{!}
1600     \textcolor{keywordtype}{implicit none}
1601     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:,:)
1602     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(5)
1603                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
1604                     
1605     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
1606                     
1607     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
1608                     
1609     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
1610                     
1611     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight5(:)
1612                     
1613     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:,:) \textcolor{comment}{! (out)}
1614 
1615     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:,:)
1616 
1617                         \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:,:)
1618                     
1619     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:,:)
1620                     
1621     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:,:)
1622                     
1623     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:,:)
1624                     
1625     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work5(:,:,:,:,:)
1626                     
1627 
1628     \textcolor{keywordtype}{integer}:: array\_shape(5)
1629     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
1630     \textcolor{keywordtype}{real(DP)}:: weight\_sum
1631   \textcolor{keywordflow}{continue}
1632 
1633     array\_shape = shape( array )
1634     array\_avr\_work => array
1635 
1636                     
1637                       
1638                         
1639     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
1640       dim\_size = array\_shape(1)
1641       array\_shape(1) = 1
1642       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
1643                                   & , array\_shape(2) &
1644                           
1645         & , array\_shape(3) &
1646                           
1647         & , array\_shape(4) &
1648                           
1649         & , array\_shape(5) &
1650                           
1651         &  ) )
1652       array\_avr\_work1 = 0.0
1653       weight\_sum = 0.0\_dp
1654       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1655         array\_avr\_work1(1,:,:,:,:) = array\_avr\_work1(1,:,:,:,:) + array\_avr\_work(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1656         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1657 \textcolor{keywordflow}{      end do}
1658       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
1659       array\_avr\_work  => array\_avr\_work1
1660 \textcolor{keywordflow}{    end if}
1661 
1662                         
1663 
1664     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
1665       dim\_size = array\_shape(2)
1666       array\_shape(2) = 1
1667       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
1668                                   & , array\_shape(2) &
1669                           
1670         & , array\_shape(3) &
1671                           
1672         & , array\_shape(4) &
1673                           
1674         & , array\_shape(5) &
1675                           
1676         &  ) )
1677       array\_avr\_work2 = 0.0
1678       weight\_sum = 0.0\_dp
1679       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1680         array\_avr\_work2(:,1,:,:,:) = array\_avr\_work2(:,1,:,:,:) + array\_avr\_work(:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1681         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1682 \textcolor{keywordflow}{      end do}
1683       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
1684       array\_avr\_work  => array\_avr\_work2
1685 \textcolor{keywordflow}{    end if}
1686 
1687                         
1688 
1689     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
1690       dim\_size = array\_shape(3)
1691       array\_shape(3) = 1
1692       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
1693                                   & , array\_shape(2) &
1694                           
1695         & , array\_shape(3) &
1696                           
1697         & , array\_shape(4) &
1698                           
1699         & , array\_shape(5) &
1700                           
1701         &  ) )
1702       array\_avr\_work3 = 0.0
1703       weight\_sum = 0.0\_dp
1704       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1705         array\_avr\_work3(:,:,1,:,:) = array\_avr\_work3(:,:,1,:,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1706         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1707 \textcolor{keywordflow}{      end do}
1708       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
1709       array\_avr\_work  => array\_avr\_work3
1710 \textcolor{keywordflow}{    end if}
1711 
1712                         
1713 
1714     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
1715       dim\_size = array\_shape(4)
1716       array\_shape(4) = 1
1717       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
1718                                   & , array\_shape(2) &
1719                           
1720         & , array\_shape(3) &
1721                           
1722         & , array\_shape(4) &
1723                           
1724         & , array\_shape(5) &
1725                           
1726         &  ) )
1727       array\_avr\_work4 = 0.0
1728       weight\_sum = 0.0\_dp
1729       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1730         array\_avr\_work4(:,:,:,1,:) = array\_avr\_work4(:,:,:,1,:) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1731         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1732 \textcolor{keywordflow}{      end do}
1733       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
1734       array\_avr\_work  => array\_avr\_work4
1735 \textcolor{keywordflow}{    end if}
1736 
1737                         
1738 
1739     \textcolor{keywordflow}{if} ( space\_average(5) ) \textcolor{keywordflow}{then}
1740       dim\_size = array\_shape(5)
1741       array\_shape(5) = 1
1742       \textcolor{keyword}{allocate}( array\_avr\_work5( array\_shape(1) &
1743                                   & , array\_shape(2) &
1744                           
1745         & , array\_shape(3) &
1746                           
1747         & , array\_shape(4) &
1748                           
1749         & , array\_shape(5) &
1750                           
1751         &  ) )
1752       array\_avr\_work5 = 0.0
1753       weight\_sum = 0.0\_dp
1754       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1755         array\_avr\_work5(:,:,:,:,1) = array\_avr\_work5(:,:,:,:,1) + array\_avr\_work(:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1756         weight\_sum = weight\_sum + weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1757 \textcolor{keywordflow}{      end do}
1758       array\_avr\_work5 = array\_avr\_work5 / weight\_sum
1759       array\_avr\_work  => array\_avr\_work5
1760 \textcolor{keywordflow}{    end if}
1761 
1762                         
1763                       
1764 
1765                     
1766 
1767 
1768       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
1769                             & , array\_shape(2) &
1770                     
1771         & , array\_shape(3) &
1772                     
1773         & , array\_shape(4) &
1774                     
1775         & , array\_shape(5) &
1776                     
1777         & ) )
1778 
1779       array\_avr = array\_avr\_work
1780 
1781       \textcolor{keyword}{nullify}( array\_avr\_work )
1782 
1783                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
1784                     
1785       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
1786                     
1787       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
1788                     
1789       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
1790                     
1791       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work5 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work5 )
1792                     
1793 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a5c95e0297da728f43ca998539ddded1f}\label{interfacegtool__historyauto__internal_1_1averagereduce_a5c95e0297da728f43ca998539ddded1f}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducereal6@{averagereducereal6}}
\index{averagereducereal6@{averagereducereal6}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducereal6()}{averagereducereal6()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducereal6 (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(6), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight5,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight6,  }\item[{real, dimension(\+:,\+:,\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 1813 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
1813     \textcolor{comment}{!}
1814     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
1815     \textcolor{comment}{! array を平均化して array\_avr に返します.}
1816     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
1817     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
1818     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
1819     \textcolor{comment}{!}
1820     \textcolor{keywordtype}{implicit none}
1821     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:,:,:)
1822     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(6)
1823                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
1824                     
1825     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
1826                     
1827     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
1828                     
1829     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
1830                     
1831     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight5(:)
1832                     
1833     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight6(:)
1834                     
1835     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:,:,:) \textcolor{comment}{! (out)}
1836 
1837     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:,:,:)
1838 
1839                         \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:,:,:)
1840                     
1841     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:,:,:)
1842                     
1843     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:,:,:)
1844                     
1845     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:,:,:)
1846                     
1847     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work5(:,:,:,:,:,:)
1848                     
1849     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work6(:,:,:,:,:,:)
1850                     
1851 
1852     \textcolor{keywordtype}{integer}:: array\_shape(6)
1853     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
1854     \textcolor{keywordtype}{real(DP)}:: weight\_sum
1855   \textcolor{keywordflow}{continue}
1856 
1857     array\_shape = shape( array )
1858     array\_avr\_work => array
1859 
1860                     
1861                       
1862                         
1863     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
1864       dim\_size = array\_shape(1)
1865       array\_shape(1) = 1
1866       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
1867                                   & , array\_shape(2) &
1868                           
1869         & , array\_shape(3) &
1870                           
1871         & , array\_shape(4) &
1872                           
1873         & , array\_shape(5) &
1874                           
1875         & , array\_shape(6) &
1876                           
1877         &  ) )
1878       array\_avr\_work1 = 0.0
1879       weight\_sum = 0.0\_dp
1880       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1881         array\_avr\_work1(1,:,:,:,:,:) = array\_avr\_work1(1,:,:,:,:,:) + array\_avr\_work(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:,:) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1882         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1883 \textcolor{keywordflow}{      end do}
1884       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
1885       array\_avr\_work  => array\_avr\_work1
1886 \textcolor{keywordflow}{    end if}
1887 
1888                         
1889 
1890     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
1891       dim\_size = array\_shape(2)
1892       array\_shape(2) = 1
1893       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
1894                                   & , array\_shape(2) &
1895                           
1896         & , array\_shape(3) &
1897                           
1898         & , array\_shape(4) &
1899                           
1900         & , array\_shape(5) &
1901                           
1902         & , array\_shape(6) &
1903                           
1904         &  ) )
1905       array\_avr\_work2 = 0.0
1906       weight\_sum = 0.0\_dp
1907       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1908         array\_avr\_work2(:,1,:,:,:,:) = array\_avr\_work2(:,1,:,:,:,:) + array\_avr\_work(:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:) * weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1909         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1910 \textcolor{keywordflow}{      end do}
1911       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
1912       array\_avr\_work  => array\_avr\_work2
1913 \textcolor{keywordflow}{    end if}
1914 
1915                         
1916 
1917     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
1918       dim\_size = array\_shape(3)
1919       array\_shape(3) = 1
1920       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
1921                                   & , array\_shape(2) &
1922                           
1923         & , array\_shape(3) &
1924                           
1925         & , array\_shape(4) &
1926                           
1927         & , array\_shape(5) &
1928                           
1929         & , array\_shape(6) &
1930                           
1931         &  ) )
1932       array\_avr\_work3 = 0.0
1933       weight\_sum = 0.0\_dp
1934       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1935         array\_avr\_work3(:,:,1,:,:,:) = array\_avr\_work3(:,:,1,:,:,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1936         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1937 \textcolor{keywordflow}{      end do}
1938       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
1939       array\_avr\_work  => array\_avr\_work3
1940 \textcolor{keywordflow}{    end if}
1941 
1942                         
1943 
1944     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
1945       dim\_size = array\_shape(4)
1946       array\_shape(4) = 1
1947       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
1948                                   & , array\_shape(2) &
1949                           
1950         & , array\_shape(3) &
1951                           
1952         & , array\_shape(4) &
1953                           
1954         & , array\_shape(5) &
1955                           
1956         & , array\_shape(6) &
1957                           
1958         &  ) )
1959       array\_avr\_work4 = 0.0
1960       weight\_sum = 0.0\_dp
1961       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1962         array\_avr\_work4(:,:,:,1,:,:) = array\_avr\_work4(:,:,:,1,:,:) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1963         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1964 \textcolor{keywordflow}{      end do}
1965       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
1966       array\_avr\_work  => array\_avr\_work4
1967 \textcolor{keywordflow}{    end if}
1968 
1969                         
1970 
1971     \textcolor{keywordflow}{if} ( space\_average(5) ) \textcolor{keywordflow}{then}
1972       dim\_size = array\_shape(5)
1973       array\_shape(5) = 1
1974       \textcolor{keyword}{allocate}( array\_avr\_work5( array\_shape(1) &
1975                                   & , array\_shape(2) &
1976                           
1977         & , array\_shape(3) &
1978                           
1979         & , array\_shape(4) &
1980                           
1981         & , array\_shape(5) &
1982                           
1983         & , array\_shape(6) &
1984                           
1985         &  ) )
1986       array\_avr\_work5 = 0.0
1987       weight\_sum = 0.0\_dp
1988       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
1989         array\_avr\_work5(:,:,:,:,1,:) = array\_avr\_work5(:,:,:,:,1,:) + array\_avr\_work(:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1990         weight\_sum = weight\_sum + weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
1991 \textcolor{keywordflow}{      end do}
1992       array\_avr\_work5 = array\_avr\_work5 / weight\_sum
1993       array\_avr\_work  => array\_avr\_work5
1994 \textcolor{keywordflow}{    end if}
1995 
1996                         
1997 
1998     \textcolor{keywordflow}{if} ( space\_average(6) ) \textcolor{keywordflow}{then}
1999       dim\_size = array\_shape(6)
2000       array\_shape(6) = 1
2001       \textcolor{keyword}{allocate}( array\_avr\_work6( array\_shape(1) &
2002                                   & , array\_shape(2) &
2003                           
2004         & , array\_shape(3) &
2005                           
2006         & , array\_shape(4) &
2007                           
2008         & , array\_shape(5) &
2009                           
2010         & , array\_shape(6) &
2011                           
2012         &  ) )
2013       array\_avr\_work6 = 0.0
2014       weight\_sum = 0.0\_dp
2015       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2016         array\_avr\_work6(:,:,:,:,:,1) = array\_avr\_work6(:,:,:,:,:,1) + array\_avr\_work(:,:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2017         weight\_sum = weight\_sum + weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2018 \textcolor{keywordflow}{      end do}
2019       array\_avr\_work6 = array\_avr\_work6 / weight\_sum
2020       array\_avr\_work  => array\_avr\_work6
2021 \textcolor{keywordflow}{    end if}
2022 
2023                         
2024                       
2025 
2026                     
2027 
2028 
2029       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
2030                             & , array\_shape(2) &
2031                     
2032         & , array\_shape(3) &
2033                     
2034         & , array\_shape(4) &
2035                     
2036         & , array\_shape(5) &
2037                     
2038         & , array\_shape(6) &
2039                     
2040         & ) )
2041 
2042       array\_avr = array\_avr\_work
2043 
2044       \textcolor{keyword}{nullify}( array\_avr\_work )
2045 
2046                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
2047                     
2048       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
2049                     
2050       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
2051                     
2052       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
2053                     
2054       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work5 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work5 )
2055                     
2056       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work6 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work6 )
2057                     
2058 
\end{DoxyCode}
\mbox{\Hypertarget{interfacegtool__historyauto__internal_1_1averagereduce_a8dcf56575faffc6a571f276589619cc7}\label{interfacegtool__historyauto__internal_1_1averagereduce_a8dcf56575faffc6a571f276589619cc7}} 
\index{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}!averagereducereal7@{averagereducereal7}}
\index{averagereducereal7@{averagereducereal7}!gtool\+\_\+historyauto\+\_\+internal\+::averagereduce@{gtool\+\_\+historyauto\+\_\+internal\+::averagereduce}}
\subsubsection{\texorpdfstring{averagereducereal7()}{averagereducereal7()}}
{\footnotesize\ttfamily subroutine gtool\+\_\+historyauto\+\_\+internal\+::averagereduce\+::averagereducereal7 (\begin{DoxyParamCaption}\item[{real, dimension(\+:,\+:,\+:,\+:,\+:,\+:,\+:), intent(in), target}]{array,  }\item[{logical, dimension(7), intent(in)}]{space\+\_\+average,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight1,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight2,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight3,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight4,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight5,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight6,  }\item[{real(dp), dimension(\+:), intent(in)}]{weight7,  }\item[{real, dimension(\+:,\+:,\+:,\+:,\+:,\+:,\+:), pointer}]{array\+\_\+avr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 2080 of file gtool\+\_\+historyauto\+\_\+internal.\+f90.


\begin{DoxyCode}
2080     \textcolor{comment}{!}
2081     \textcolor{comment}{! space\_average で .true. に指定された次元に対して,}
2082     \textcolor{comment}{! array を平均化して array\_avr に返します.}
2083     \textcolor{comment}{! 平均化には重み weight1 〜 weight7 が用いられます.}
2084     \textcolor{comment}{! array\_avr の配列の次元そのものは減りません. その代わり,}
2085     \textcolor{comment}{! 平均化された次元の配列のサイズは 1 になります.}
2086     \textcolor{comment}{!}
2087     \textcolor{keywordtype}{implicit none}
2088     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{target}:: array(:,:,:,:,:,:,:)
2089     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}:: space\_average(7)
2090                         \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight1(:)
2091                     
2092     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight2(:)
2093                     
2094     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight3(:)
2095                     
2096     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight4(:)
2097                     
2098     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight5(:)
2099                     
2100     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight6(:)
2101                     
2102     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}:: weight7(:)
2103                     
2104     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr(:,:,:,:,:,:,:) \textcolor{comment}{! (out)}
2105 
2106     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work(:,:,:,:,:,:,:)
2107 
2108                         \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work1(:,:,:,:,:,:,:)
2109                     
2110     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work2(:,:,:,:,:,:,:)
2111                     
2112     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work3(:,:,:,:,:,:,:)
2113                     
2114     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work4(:,:,:,:,:,:,:)
2115                     
2116     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work5(:,:,:,:,:,:,:)
2117                     
2118     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work6(:,:,:,:,:,:,:)
2119                     
2120     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: array\_avr\_work7(:,:,:,:,:,:,:)
2121                     
2122 
2123     \textcolor{keywordtype}{integer}:: array\_shape(7)
2124     \textcolor{keywordtype}{integer}:: \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}, dim\_size
2125     \textcolor{keywordtype}{real(DP)}:: weight\_sum
2126   \textcolor{keywordflow}{continue}
2127 
2128     array\_shape = shape( array )
2129     array\_avr\_work => array
2130 
2131                     
2132                       
2133                         
2134     \textcolor{keywordflow}{if} ( space\_average(1) ) \textcolor{keywordflow}{then}
2135       dim\_size = array\_shape(1)
2136       array\_shape(1) = 1
2137       \textcolor{keyword}{allocate}( array\_avr\_work1( array\_shape(1) &
2138                                   & , array\_shape(2) &
2139                           
2140         & , array\_shape(3) &
2141                           
2142         & , array\_shape(4) &
2143                           
2144         & , array\_shape(5) &
2145                           
2146         & , array\_shape(6) &
2147                           
2148         & , array\_shape(7) &
2149                           
2150         &  ) )
2151       array\_avr\_work1 = 0.0
2152       weight\_sum = 0.0\_dp
2153       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2154         array\_avr\_work1(1,:,:,:,:,:,:) = array\_avr\_work1(1,:,:,:,:,:,:) + array\_avr\_work(
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:,:,:) * weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2155         weight\_sum = weight\_sum + weight1(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2156 \textcolor{keywordflow}{      end do}
2157       array\_avr\_work1 = array\_avr\_work1 / weight\_sum
2158       array\_avr\_work  => array\_avr\_work1
2159 \textcolor{keywordflow}{    end if}
2160 
2161                         
2162 
2163     \textcolor{keywordflow}{if} ( space\_average(2) ) \textcolor{keywordflow}{then}
2164       dim\_size = array\_shape(2)
2165       array\_shape(2) = 1
2166       \textcolor{keyword}{allocate}( array\_avr\_work2( array\_shape(1) &
2167                                   & , array\_shape(2) &
2168                           
2169         & , array\_shape(3) &
2170                           
2171         & , array\_shape(4) &
2172                           
2173         & , array\_shape(5) &
2174                           
2175         & , array\_shape(6) &
2176                           
2177         & , array\_shape(7) &
2178                           
2179         &  ) )
2180       array\_avr\_work2 = 0.0
2181       weight\_sum = 0.0\_dp
2182       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2183         array\_avr\_work2(:,1,:,:,:,:,:) = array\_avr\_work2(:,1,:,:,:,:,:) + array\_avr\_work(:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:,:) * weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2184         weight\_sum = weight\_sum + weight2(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2185 \textcolor{keywordflow}{      end do}
2186       array\_avr\_work2 = array\_avr\_work2 / weight\_sum
2187       array\_avr\_work  => array\_avr\_work2
2188 \textcolor{keywordflow}{    end if}
2189 
2190                         
2191 
2192     \textcolor{keywordflow}{if} ( space\_average(3) ) \textcolor{keywordflow}{then}
2193       dim\_size = array\_shape(3)
2194       array\_shape(3) = 1
2195       \textcolor{keyword}{allocate}( array\_avr\_work3( array\_shape(1) &
2196                                   & , array\_shape(2) &
2197                           
2198         & , array\_shape(3) &
2199                           
2200         & , array\_shape(4) &
2201                           
2202         & , array\_shape(5) &
2203                           
2204         & , array\_shape(6) &
2205                           
2206         & , array\_shape(7) &
2207                           
2208         &  ) )
2209       array\_avr\_work3 = 0.0
2210       weight\_sum = 0.0\_dp
2211       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2212         array\_avr\_work3(:,:,1,:,:,:,:) = array\_avr\_work3(:,:,1,:,:,:,:) + array\_avr\_work(:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:,:) * weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2213         weight\_sum = weight\_sum + weight3(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2214 \textcolor{keywordflow}{      end do}
2215       array\_avr\_work3 = array\_avr\_work3 / weight\_sum
2216       array\_avr\_work  => array\_avr\_work3
2217 \textcolor{keywordflow}{    end if}
2218 
2219                         
2220 
2221     \textcolor{keywordflow}{if} ( space\_average(4) ) \textcolor{keywordflow}{then}
2222       dim\_size = array\_shape(4)
2223       array\_shape(4) = 1
2224       \textcolor{keyword}{allocate}( array\_avr\_work4( array\_shape(1) &
2225                                   & , array\_shape(2) &
2226                           
2227         & , array\_shape(3) &
2228                           
2229         & , array\_shape(4) &
2230                           
2231         & , array\_shape(5) &
2232                           
2233         & , array\_shape(6) &
2234                           
2235         & , array\_shape(7) &
2236                           
2237         &  ) )
2238       array\_avr\_work4 = 0.0
2239       weight\_sum = 0.0\_dp
2240       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2241         array\_avr\_work4(:,:,:,1,:,:,:) = array\_avr\_work4(:,:,:,1,:,:,:) + array\_avr\_work(:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:,:) * weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2242         weight\_sum = weight\_sum + weight4(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2243 \textcolor{keywordflow}{      end do}
2244       array\_avr\_work4 = array\_avr\_work4 / weight\_sum
2245       array\_avr\_work  => array\_avr\_work4
2246 \textcolor{keywordflow}{    end if}
2247 
2248                         
2249 
2250     \textcolor{keywordflow}{if} ( space\_average(5) ) \textcolor{keywordflow}{then}
2251       dim\_size = array\_shape(5)
2252       array\_shape(5) = 1
2253       \textcolor{keyword}{allocate}( array\_avr\_work5( array\_shape(1) &
2254                                   & , array\_shape(2) &
2255                           
2256         & , array\_shape(3) &
2257                           
2258         & , array\_shape(4) &
2259                           
2260         & , array\_shape(5) &
2261                           
2262         & , array\_shape(6) &
2263                           
2264         & , array\_shape(7) &
2265                           
2266         &  ) )
2267       array\_avr\_work5 = 0.0
2268       weight\_sum = 0.0\_dp
2269       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2270         array\_avr\_work5(:,:,:,:,1,:,:) = array\_avr\_work5(:,:,:,:,1,:,:) + array\_avr\_work(:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:,:) * weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2271         weight\_sum = weight\_sum + weight5(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2272 \textcolor{keywordflow}{      end do}
2273       array\_avr\_work5 = array\_avr\_work5 / weight\_sum
2274       array\_avr\_work  => array\_avr\_work5
2275 \textcolor{keywordflow}{    end if}
2276 
2277                         
2278 
2279     \textcolor{keywordflow}{if} ( space\_average(6) ) \textcolor{keywordflow}{then}
2280       dim\_size = array\_shape(6)
2281       array\_shape(6) = 1
2282       \textcolor{keyword}{allocate}( array\_avr\_work6( array\_shape(1) &
2283                                   & , array\_shape(2) &
2284                           
2285         & , array\_shape(3) &
2286                           
2287         & , array\_shape(4) &
2288                           
2289         & , array\_shape(5) &
2290                           
2291         & , array\_shape(6) &
2292                           
2293         & , array\_shape(7) &
2294                           
2295         &  ) )
2296       array\_avr\_work6 = 0.0
2297       weight\_sum = 0.0\_dp
2298       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2299         array\_avr\_work6(:,:,:,:,:,1,:) = array\_avr\_work6(:,:,:,:,:,1,:) + array\_avr\_work(:,:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i},:) * weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2300         weight\_sum = weight\_sum + weight6(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2301 \textcolor{keywordflow}{      end do}
2302       array\_avr\_work6 = array\_avr\_work6 / weight\_sum
2303       array\_avr\_work  => array\_avr\_work6
2304 \textcolor{keywordflow}{    end if}
2305 
2306                         
2307 
2308     \textcolor{keywordflow}{if} ( space\_average(7) ) \textcolor{keywordflow}{then}
2309       dim\_size = array\_shape(7)
2310       array\_shape(7) = 1
2311       \textcolor{keyword}{allocate}( array\_avr\_work7( array\_shape(1) &
2312                                   & , array\_shape(2) &
2313                           
2314         & , array\_shape(3) &
2315                           
2316         & , array\_shape(4) &
2317                           
2318         & , array\_shape(5) &
2319                           
2320         & , array\_shape(6) &
2321                           
2322         & , array\_shape(7) &
2323                           
2324         &  ) )
2325       array\_avr\_work7 = 0.0
2326       weight\_sum = 0.0\_dp
2327       \textcolor{keywordflow}{do} \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i} = 1, dim\_size
2328         array\_avr\_work7(:,:,:,:,:,:,1) = array\_avr\_work7(:,:,:,:,:,:,1) + array\_avr\_work(:,:,:,:,:,:,
      \hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i}) * weight7(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2329         weight\_sum = weight\_sum + weight7(\hyperlink{namespacedcunits__com_a5742752149f55f07bd09fc85d59f7319}{i})
2330 \textcolor{keywordflow}{      end do}
2331       array\_avr\_work7 = array\_avr\_work7 / weight\_sum
2332       array\_avr\_work  => array\_avr\_work7
2333 \textcolor{keywordflow}{    end if}
2334 
2335                         
2336                       
2337 
2338                     
2339 
2340 
2341       \textcolor{keyword}{allocate}( array\_avr( array\_shape(1) &
2342                             & , array\_shape(2) &
2343                     
2344         & , array\_shape(3) &
2345                     
2346         & , array\_shape(4) &
2347                     
2348         & , array\_shape(5) &
2349                     
2350         & , array\_shape(6) &
2351                     
2352         & , array\_shape(7) &
2353                     
2354         & ) )
2355 
2356       array\_avr = array\_avr\_work
2357 
2358       \textcolor{keyword}{nullify}( array\_avr\_work )
2359 
2360                           \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work1 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work1 )
2361                     
2362       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work2 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work2 )
2363                     
2364       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work3 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work3 )
2365                     
2366       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work4 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work4 )
2367                     
2368       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work5 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work5 )
2369                     
2370       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work6 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work6 )
2371                     
2372       \textcolor{keywordflow}{if} ( \textcolor{keyword}{associated}( array\_avr\_work7 ) ) \textcolor{keyword}{deallocate}( array\_avr\_work7 )
2373                     
2374 
\end{DoxyCode}


The documentation for this interface was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
gtool/gtool\+\_\+historyauto/\hyperlink{gtool__historyauto__internal_8f90}{gtool\+\_\+historyauto\+\_\+internal.\+f90}\end{DoxyCompactItemize}
