⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 par_xsum.f90

📁 CCSM Research Tools: Community Atmosphere Model (CAM)
💻 F90
字号:
#include <misc.h>!-----------------------------------------------------------------------!BOP! !ROUTINE: par_xsum --- Calculate x-sum bit-wise consistently!! !INTERFACE:!****6***0*********0*********0*********0*********0*********0**********72      subroutine par_xsum(a, ifirst, ilast, im, ltot, sum)!****6***0*********0*********0*********0*********0*********0**********72!! !USES:      use pmgrid#if defined ( SPMD )      use spmd_dyn, only : commxy_x      use parutilitiesmodule, only : parexchangevector#endif      use precision      implicit none! !INPUT PARAMETERS:      integer im                     ! global longitudes      integer ifirst                 ! first longitude on this PE      integer ilast                  ! last longitude on this PE      integer ltot                   ! number of quantities to be summed      real (r8) a(ifirst:ilast,ltot) ! input vector to be summed! !OUTPUT PARAMETERS:      real (r8) sum(ltot)           ! sum of all vector entries! !DESCRIPTION:!     This subroutine calculates the sum of "a" in a reproducible!     (sequentialized) fashion which should give bit-wise identical!     results irrespective of the number of MPI processes.!! !CALLED FROM:!     te_map!! !REVISION HISTORY:!!     AAM 00.11.01 : Created!!EOP!---------------------------------------------------------------------!BOC ! !Local      real (r8) quan_all(im*ltot)      integer i,l,icount,ipe#if defined ( SPMD )      real (r8) quan_send(nprxy_x*ltot*(ilast-ifirst+1))      integer  sendcount(nprxy_x)      integer  recvcount(nprxy_x)#endif#if defined ( SPMD )       icount=0      do ipe=1,nprxy_x        sendcount(ipe) = ltot*(ilast-ifirst+1)        do i=ifirst,ilast        do l=1,ltot          icount=icount+1              quan_send(icount)=a(i,l)        enddo        enddo      enddo      call parexchangevector( commxy_x, sendcount, quan_send,     &                                          recvcount, quan_all )#else      do l=1,ltot        do i=i,im          quan_all((i-1)*ltot+l)=a(i,l)        enddo      enddo#endif      do l=1,ltot        sum(l)=0.        do i=1,im          sum(l) = sum(l) + quan_all((i-1)*ltot+l)        enddo      enddo      return!EOC      end!-----------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -