亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? spmd_dyn.f90

?? CCSM Research Tools: Community Atmosphere Model (CAM)
?? F90
字號:
#include <misc.h>#include <params.h>module spmd_dyn!----------------------------------------------------------------------- ! ! Purpose: SPMD implementation of CAM.  Currently used for both dynamics!          and physics, but ultimately the physics part should be broken off.! ! Author: CCM Core Group! !-----------------------------------------------------------------------#if (defined SPMD)   use precision, only: r8   use pmgrid, only: plat, masterproc, iam, beglatex, endlatex, numbnd, numlats, numlatsex, &                           beglat, endlat, begirow, endirow, plev   use constituents, only: pcnst   use mpishorthand, only: mpir8, mpicom   use infnan, only: inf   implicit none   private   public spmdinit_dyn, compute_gsfactors, pair, ceil2   save   integer, public :: npes                 ! Total number of MPI tasks   integer, public :: cut(2,0:plat-1)      ! partition for MPI tasks   integer, public :: cutex(2,0:plat-1)    ! extended partition    integer, public :: proc(plat)           ! MPI task id associated with a given lat.   integer, public :: neighs               ! number of south neighbors to comm guardcells   integer, public :: neighn               ! number of north neighbors to comm guardcells   integer, public :: npessp               ! number of MPI tasks in spectral space   integer, public :: maxm                 ! max number of Fourier wavenumbers per MPI task   integer, public :: numm(0:plat-1)       ! number of Fourier wavenumbers owned per task   integer, public :: bsiz                 ! buffer size   integer, public :: maxlats              ! max number of lats on any MPI task!  integer, public, allocatable :: nlat_p(:)    ! number of latitudes per MPI task   integer, public :: nlat_p(0:1000)    ! number of latitudes per MPI task   real(r8), public, allocatable :: buf1(:),buf2(:) ! buffers for packing MPI msgsCONTAINS!========================================================================   subroutine spmdinit_dyn ()!----------------------------------------------------------------------- ! ! Purpose: Distribute latitudes among available processors! ! Method: Distribution is S->N for processors 0->npes! ! Author: CCM Core Group! !-----------------------------------------------------------------------!     use pspect, only: maxlats!-----------------------------------------------------------------------!! Local workspace!      integer procid    ! processor id      integer procids   ! processor id SH      integer procidn   ! processor id NH      integer lat       ! latitude index      integer iend      ! ending latitude band of work for a given proc      integer workleft  ! amount of work still to be parcelled out      integer actual    ! actual amount of work parcelled out      integer ideal     ! ideal amt of work to parcel out      integer pesleft   ! number of procs still to be given work      integer isum      ! running total of work parcelled out      integer smostlat  ! southern-most latitude index      integer nmostlat  ! northern-most latitude index      integer m2,m3,m5  ! 2, 3, 5 prime factors for problem decomposition!!-----------------------------------------------------------------------!! Allocate memory for number of lats per proc!!     allocate (nlat_p (0:npes-1))      nlat_p(0:npes-1) = 0!! Make sure number of PEs and number of latitudes are kosher!      call factor (plat, m2, m3, m5)      if (m2 < 1) then         write(6,*) 'FACTOR: Problem size is not divisible by 2'         call endrun      end if      if (masterproc) then         write (6,*) 'Problem factors: 2**',m2,' * 3**',m3,' * 5**',m5      end if      call factor (npes, m2, m3, m5)            if (mod(npes,2) /= 0) then         write(6,*)'SPMDINIT_DYN: nprocs(',npes,') must be a multiple of 2'         call endrun      end if      workleft = plat/2      pesleft = npes/2      iend = 0         maxlats = 0      do procids=0,npes/2-1         procidn = npes - procids - 1         if (workleft > 0) then            ideal = workleft/pesleft            cut(1,procids) = iend + 1            lat = cut(1,procids)            actual = 110          if (lat+1 <= plat/2) then               if (actual+1 <= ideal .or. pesleft == 1) then                  lat = lat + 1                  actual = actual + 1                  goto 10               end if            end if            cut(2,procids) = lat!! Assign mirror latitudes!            cut(1,procidn) = plat - cut(2,procids) + 1            cut(2,procidn) = plat - cut(1,procids) + 1         else            write(6,*)'SPMDINIT_DYN: Ran out of work to parcel to processors'            call endrun         end if                  nlat_p(procids) = actual         nlat_p(procidn) = actual         maxlats = max (maxlats, actual)                  if (iam == procids .or. iam == procidn) then            beglat = cut(1,iam)            endlat = cut(2,iam)            numlats = actual            begirow = cut(1,procids)            endirow = cut(2,procids)         end if!! Prepare for next iteration!         iend = lat         workleft = workleft - actual         pesleft = pesleft - 1      end do      if (workleft /= 0) then         write(6,*)'SPMDINIT_DYN: Workleft not zero.  Value is ',workleft         call endrun      end if         do procid=0,npes-1         if (masterproc) then            write(6,*)'procid ',procid,' assigned ', &                      cut(2,procid)-cut(1,procid)+1,' latitude values from', &                      cut(1,procid),' through ',cut(2,procid)         end if!! Determine which processor is responsible for the defined latitudes!         do lat=cut(1,procid),cut(2,procid)            proc(lat) = procid         end do!! The extended regions are simply "numbnd" wider at each! side. The extended region do not go beyond 1 and plat, though!         cutex(1,procid) = cut(1,procid) - numbnd         cutex(2,procid) = cut(2,procid) + numbnd         if (iam == procid) then            beglatex = cutex(1,procid) + numbnd            endlatex = cutex(2,procid) + numbnd            numlatsex = endlatex - beglatex + 1         end if      end do!! Number of neighbor processors needed for boundary communication.  North! first.!      isum = 0      neighn = 0            do procid=iam+1,npes-1         nmostlat = cut(2,procid)         isum = isum + cut(2,procid) - cut(1,procid) + 1         neighn = neighn + 1         if (isum >= numbnd) goto 20      end do      20    if (iam /= npes-1 .and. isum < numbnd .and. nmostlat /= plat) then         write (6,*) 'SPMDINIT_DYN: Something wrong in computation of northern neighbors'         call endrun      end if            isum = 0      neighs = 0            do procid=iam-1,0,-1         smostlat = cut(1,procid)         isum = isum + cut(2,procid) - cut(1,procid) + 1         neighs = neighs + 1         if (isum >= numbnd) goto 30      end do30    if (iam /= 0 .and. isum < numbnd .and. smostlat /= 1) then         write(6,*)'Something wrong in computation of southern neighbors'         call endrun      end if      if (masterproc) then         write(6,*)'-----------------------------------------'         write(6,*)'Number of lats passed north & south = ',numbnd         write(6,*)'Node  Partition  Extended Partition'         write(6,*)'-----------------------------------------'         do procid=0,npes-1            write(6,200) procid,cut(1,procid),cut(2,procid) ,cutex(1,procid), cutex(2,procid)200         format(i3,4x,i3,'-',i3,7x,i3,'-',i3)         end do      end if!      write(6,*)'iam=',iam,'Number of south neighbors needed for bndry exchange = ',neighs!      write(6,*)'iam=',iam,'Number of north neighbors needed for bndry exchange = ',neighn      call decomp_wavenumbers ()      call spmdbuf ()      return   end subroutine spmdinit_dyn!========================================================================   subroutine factor (nitems, m2, m3, m5)!----------------------------------------------------------------------- ! ! Purpose: Factor a given number into powers of 2,3,5! ! Method: Brute force application of "mod" function! ! Author: CCM Core Group! !-----------------------------------------------------------------------!! Arguments!      integer, intent(in) :: nitems      ! Number to be factored into powers of 2,3,5      integer, intent(out) :: m2,m3,m5   ! Powers of 2, 3, and 5 respectively!! Local workspace!      integer num                        ! current number to be factored!!-----------------------------------------------------------------------!      num = nitems      m2 = 0      m3 = 0      m5 = 0      2     if (mod(num,2) == 0) then         m2 = m2 + 1         num = num/2         goto 2      end if      3     if (mod(num,3) == 0) then         m3 = m3 + 1         num = num/3         goto 3      end if      5     if (mod(num,5) == 0) then         m5 = m5 + 1         num = num/5         goto 5      end if            if (num /= 1) then         write(6,*) 'FACTOR: ',nitems,' has a prime factor other than 2, 3, or 5.  Aborting...'         call endrun      end if            return   end subroutine factor!========================================================================   subroutine decomp_wavenumbers!----------------------------------------------------------------------- ! ! Purpose: partition the spectral work among the given number of processors! ! Method: Make the labor division as equal as possible given loop lengths! ! Author: CCM Core Group! !-----------------------------------------------------------------------      use pspect, only: pmmax      use comspe, only: nlen, begm, endm, nstart!! Local workspace!      integer endfourier  ! ending fourier wavenumber               integer procid      ! processor id      integer m           ! fourier wavenumber index      integer workleft    ! amt of work still to be parceled out      integer actual      ! actual amt of work given to a particular proc      integer ideal       ! ideal amt of work given to a particular proc      integer pesleft     ! number of pes still to be given work      integer test        ! test value to compare to ideal amt of work!-----------------------------------------------------------------------      workleft = nstart(pmmax) + nlen(pmmax)      pesleft = min(pmmax,npes)      endfourier = 0      npessp = 0      maxm = 0      do procid = 0,npes-1         if (workleft > 0) then            npessp = npessp + 1            ideal = workleft / pesleft            begm(procid) = endfourier + 1            m = begm(procid)            actual = nlen(m)            1           if (m+1 <= pmmax) then               test = actual + nlen(m+1)               if (test <= ideal) then                  m = m + 1                  actual = test                  goto 1               else if (test > ideal) then                  if (test-ideal < ideal-actual) then                     m = m + 1                     actual = test                  end if               end if            end if                        endm(procid) = m            endfourier = m            workleft = workleft - actual            pesleft = pesleft - 1            if (masterproc) then               write(6,*)'procid ',procid,' assigned ', endm(procid)-begm(procid)+1, &                         ' m values from ', begm(procid),' through ',endm(procid)            end if         else            begm(procid) = 0            endm(procid) = -1         end if         numm(procid) = endm(procid) - begm(procid) + 1         if (numm(procid) > maxm) maxm = numm(procid)      end do      if (workleft/=0) then         write(6,*)'MCUTS: Workleft not zero.  Value is ',workleft         call endrun      end if         return   end subroutine decomp_wavenumbers!========================================================================   integer function pair(np,p,k)      integer np,p,k,q      q = ieor(p,k)      if(q.gt.np-1) then         pair = -1      else         pair = q      endif      return   end function pair!========================================================================  integer function ceil2(n)     integer n,p     p=1     do while(p.lt.n)        p=p*2     enddo     ceil2=p     return  end function ceil2  !========================================================================  subroutine spmdbuf!----------------------------------------------------------------------- ! ! Purpose: allocate spmd pack buffers used in pairwise all-all exchanges! ! Author: CCM Core Group! !-----------------------------------------------------------------------     use comspe, only: begm, endm, nlen     integer maxcount(4),m     integer length,i!! realloc4 max: 16 2 plev*numm*numlats (e.g. grt1)!               2  2     *numm*numlats (grlps1, grlps2)!               2             *numlats (begirow, endirow)!     maxcount(1) = maxlats*(2*maxm*(plev*16 + 2) + 2)!! realloc6 max: 3 plev*(nlen*numm)  (e.g. vz)!               1     *(nlen*numm)  (alps)!               2                   (length, mstrt)!     length = 0     do i=0,npessp-1        do m=begm(i),endm(i)           length = length + 2*nlen(m)        end do     end do     maxcount(2) = length*(1 + 3*plev) + 2      !! realloc5 max: 3                 (len,beglat,numlats)!               1 numlats         (tmass)!               5 numlats  *pcnst (e.g. hw1lat)!               2 4*numlats*pcnst (e.g.hw2al)!     maxcount(3) = 3 + maxlats*(1 + (5 + 2*4)*pcnst)!! realloc7 max: 2                  (beglat, numlats)!               3 plev *numlats    (e.g. vmax2d)!               5      *numlats    (e.g. psurf)!     maxcount(4) = maxlats*(3*plev + 5) + 2     m = maxval(maxcount)     call mpipack_size (m, mpir8, mpicom, bsiz)     write(6,*) 'SPMDBUF: Allocating SPMD buffers of size ',bsiz     allocate(buf1(bsiz/8+1))     allocate(buf2(bsiz/8+1))     return  end subroutine spmdbuf  subroutine compute_gsfactors (numperlat, numtot, numperproc, displs)!----------------------------------------------------------------------- ! ! Purpose: Compute arguments for gatherv, scatterv! ! Author: CCM Core Group! !-----------------------------------------------------------------------!! Input arguments!     integer, intent(in) :: numperlat    ! number of elements per latitude!! Output arguments!     integer, intent(out) :: numtot               ! total number of elements (to send or recv)     integer, intent(out) :: numperproc(0:npes-1) ! per-PE number of items to receive     integer, intent(out) :: displs(0:npes-1)     ! per-PE displacements!! Local variables!     integer :: p                    ! index        numtot = numperlat*numlats        do p=0,npes-1        numperproc(p) = numperlat*nlat_p(p)     end do          displs(0) = 0     do p=1,npes-1        displs(p) = displs(p-1) + numperproc(p-1)     end do       end subroutine compute_gsfactors#endifend module spmd_dyn

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜一区二区三区免费大片| 久久99久久99| 91欧美一区二区| 中文av一区二区| 国产 欧美在线| 欧美浪妇xxxx高跟鞋交| 日本不卡在线视频| 欧美一区二区黄| 美日韩一区二区| 欧美一区二区三级| 国产一区二区三区免费观看| 亚洲精品在线观看视频| 久久成人免费网| 日韩一二三区视频| 国产精品资源站在线| 久久精品人人做人人综合| 福利91精品一区二区三区| 国产婷婷色一区二区三区在线| 99国内精品久久| 中文字幕一区二区三区色视频| 成人高清视频在线观看| 日韩毛片一二三区| 欧美精品久久天天躁| 欧美aaaaaa午夜精品| 26uuu精品一区二区三区四区在线| 国产一区二区精品在线观看| 亚洲视频 欧洲视频| 欧美日韩在线三级| 久久99久久久久久久久久久| 久久久精品天堂| 94色蜜桃网一区二区三区| 亚洲1区2区3区视频| 日韩精品在线看片z| 粉嫩欧美一区二区三区高清影视| 亚洲综合在线免费观看| 日韩精品最新网址| 成熟亚洲日本毛茸茸凸凹| 亚洲精品美腿丝袜| 国产三级一区二区| 91国偷自产一区二区三区成为亚洲经典| 亚洲午夜久久久久久久久电影网 | 亚洲精品国产高清久久伦理二区| 91国模大尺度私拍在线视频| 狠狠色综合播放一区二区| 国产午夜精品美女毛片视频| 欧洲一区二区三区在线| 国产尤物一区二区在线| 国产精品情趣视频| 91精品久久久久久久99蜜桃| 成人免费三级在线| 日韩激情视频网站| 亚洲一区中文在线| 26uuu国产日韩综合| 欧美亚洲图片小说| 成人久久18免费网站麻豆| 青青草97国产精品免费观看无弹窗版 | 欧美经典一区二区| 欧美日韩亚洲不卡| 高清不卡一二三区| 国产精品 欧美精品| 午夜精品影院在线观看| 亚洲色图一区二区三区| 91网站最新网址| 国产一区美女在线| 日韩福利视频网| 亚洲男人天堂av网| 国产精品视频一二| 国产精品女同一区二区三区| 精品精品国产高清一毛片一天堂| 欧美人成免费网站| 91免费精品国自产拍在线不卡| 成人亚洲精品久久久久软件| 美女视频黄a大片欧美| 亚洲综合成人网| 日韩一区有码在线| 亚洲欧美国产77777| 国产欧美精品国产国产专区| 日韩欧美一区中文| 6080亚洲精品一区二区| 欧美挠脚心视频网站| 欧美午夜电影一区| 在线一区二区三区四区五区| 94-欧美-setu| 波多野结衣一区二区三区 | 色国产精品一区在线观看| 一本久久a久久免费精品不卡| 丁香婷婷综合色啪| 成人手机电影网| 粉嫩aⅴ一区二区三区四区五区| 日本成人超碰在线观看| 国产一区二区不卡在线| 日日夜夜一区二区| 日本中文字幕一区| 久久黄色级2电影| 久88久久88久久久| 激情五月播播久久久精品| 国产乱淫av一区二区三区| 国产精品一区一区三区| 国产成人综合自拍| 95精品视频在线| 成人性生交大片免费看在线播放| 99精品视频在线免费观看| 菠萝蜜视频在线观看一区| 成人免费视频app| 91麻豆自制传媒国产之光| 成人动漫一区二区三区| 欧美亚洲图片小说| 91麻豆精品国产91久久久| 日韩欧美一级精品久久| 久久久亚洲精品一区二区三区| 久久先锋影音av| 中文字幕在线免费不卡| 亚洲男女一区二区三区| 亚洲国产aⅴ成人精品无吗| 亚洲一级不卡视频| 激情综合色综合久久| 成人国产电影网| 欧美色视频在线| 久久免费视频一区| 中文字幕亚洲精品在线观看 | 最新日韩在线视频| 日韩福利视频网| 99久久免费精品高清特色大片| 777xxx欧美| 亚洲免费视频中文字幕| 久久国产精品99精品国产| 91精彩视频在线观看| 久久精品亚洲精品国产欧美| 亚洲成人精品在线观看| 国产v综合v亚洲欧| 欧美日韩不卡一区| 亚洲男同性视频| 国产精品18久久久久久久网站| 欧美日韩国产一二三| 成人免费在线播放视频| 免费观看在线色综合| 欧美又粗又大又爽| 中文字幕一区二区三区色视频| 紧缚奴在线一区二区三区| 欧美日韩国产精选| 有坂深雪av一区二区精品| 懂色av一区二区三区蜜臀| 欧美刺激脚交jootjob| 亚洲国产精品久久人人爱蜜臀 | 色综合天天综合网国产成人综合天| 日韩一卡二卡三卡国产欧美| 一区二区三区在线免费| av在线不卡电影| 国产日产欧美一区| 国产麻豆91精品| 精品盗摄一区二区三区| 日本va欧美va精品发布| 欧美性videosxxxxx| 亚洲免费av高清| 99热国产精品| 国产精品激情偷乱一区二区∴| 国产成人av一区| 久久久久亚洲蜜桃| 国产精品亚洲视频| 日本一区二区三区国色天香| 国产精品白丝jk黑袜喷水| 久久久久久久电影| 国产精品一区2区| 久久久久久麻豆| 国产精品资源在线看| 国产亚洲欧美日韩日本| 国产mv日韩mv欧美| 日本一区二区三区视频视频| 懂色av一区二区夜夜嗨| 国产精品动漫网站| 日本韩国视频一区二区| 一区二区久久久久久| 91啪在线观看| 亚洲第一在线综合网站| 7878成人国产在线观看| 美女在线一区二区| 久久五月婷婷丁香社区| 成人中文字幕电影| 亚洲图片欧美激情| 欧美性色aⅴ视频一区日韩精品| 亚洲国产精品影院| 精品免费日韩av| 国产成人三级在线观看| 自拍偷拍欧美激情| 欧美伦理视频网站| 久久se精品一区精品二区| 国产日韩欧美精品电影三级在线| 成人永久免费视频| 一区二区三区精品在线观看| 欧美精品tushy高清| 精品中文字幕一区二区小辣椒| 精品国产乱码91久久久久久网站| 国产精品一二三| 一区二区三区四区五区视频在线观看| 欧美色偷偷大香| 国产尤物一区二区| 一区二区三区欧美| 欧美精品一区二区三区视频| 99久久伊人网影院| 丝袜诱惑亚洲看片|