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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 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: 12 2 plev*numm*numlats (e.g. grt1)!               2  2     *numm*numlats (grlps1, grlps2)!               2             *numlats (begirow, endirow)!     maxcount(1) = maxlats*(2*maxm*(plev*12 + 2) + 2)!! realloc6 max: 4 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 + 4*plev) + 2      !! realloc5 max: 3                 (len,beglat,numlats)!               6 numlats         (tmass)!               5 numlats  *pcnst (e.g. hw1lat)!               2 4*numlats*pcnst (e.g.hw2al)!     maxcount(3) = 3 + maxlats*(6 + (5 + 2*4)*pcnst)!! realloc7 max: 2                  (beglat, numlats)!               3 plev *numlats    (e.g. vmax2d)!               4      *numlats    (e.g. psurf)!     maxcount(4) = maxlats*(3*plev + 4) + 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲福利视频一区二区| 国产精品天天摸av网| 日韩avvvv在线播放| 日韩欧美一级二级三级| 久久av老司机精品网站导航| 精品sm在线观看| 丁香另类激情小说| 中文字幕一区视频| 99亚偷拍自图区亚洲| 亚洲综合丁香婷婷六月香| 这里只有精品电影| 国模娜娜一区二区三区| 国产精品麻豆久久久| 色av综合在线| 国产成人日日夜夜| 亚洲欧洲精品一区二区三区不卡| 色婷婷激情一区二区三区| 日韩精品乱码av一区二区| 久久久精品国产免费观看同学| 成人精品gif动图一区| 亚洲小说春色综合另类电影| 欧美草草影院在线视频| 国产精品自拍av| 亚洲猫色日本管| 欧美高清视频在线高清观看mv色露露十八| 蜜桃视频第一区免费观看| 中文欧美字幕免费| 91精品国产综合久久久久久| 国产夫妻精品视频| 亚洲国产一区二区视频| 国产欧美1区2区3区| 欧美中文字幕一二三区视频| 国产一区二区在线电影| 亚洲美女淫视频| 久久在线观看免费| 欧美少妇一区二区| 国产91精品久久久久久久网曝门| 夜色激情一区二区| 久久女同互慰一区二区三区| 91精彩视频在线| 懂色av中文字幕一区二区三区| 国模一区二区三区白浆| 一区二区三区四区精品在线视频| 欧美成人aa大片| 欧美视频第二页| 91视频在线看| 国产不卡在线视频| 久久精品国产网站| 午夜精品久久久久久久99水蜜桃| 肉肉av福利一精品导航| 精品国产亚洲在线| 69堂精品视频| 欧美性猛交一区二区三区精品| 成人黄色一级视频| 韩国精品在线观看| 久久国产精品区| 视频在线在亚洲| 亚洲自拍偷拍欧美| 亚洲女人****多毛耸耸8| 久久久www免费人成精品| 日韩欧美在线一区二区三区| 精品视频在线免费| 欧美综合亚洲图片综合区| 95精品视频在线| 成人激情文学综合网| 国产成人av影院| 国产成人av一区二区三区在线观看| 精品亚洲成a人| 日本不卡高清视频| 天堂蜜桃91精品| 日韩影院精彩在线| 日韩不卡一区二区| 免费高清在线一区| 麻豆一区二区99久久久久| 免费观看久久久4p| 精品一区二区三区免费| 精品一区二区免费| 国产乱码字幕精品高清av| 国产精品综合在线视频| 国产suv精品一区二区883| 国产美女在线观看一区| 国产成人亚洲综合色影视| 国产成人亚洲综合a∨婷婷图片| 国产99久久久国产精品免费看| 国产成人高清视频| 色综合天天性综合| 久久日韩粉嫩一区二区三区| 26uuu亚洲综合色| 久久久久国产精品麻豆ai换脸| 欧美激情在线看| 国产精品情趣视频| 一区二区三区视频在线看| 亚洲综合免费观看高清完整版在线| 亚洲一区二区中文在线| 婷婷中文字幕一区三区| 精品一区二区国语对白| fc2成人免费人成在线观看播放| 91免费小视频| 欧美裸体bbwbbwbbw| 精品国产区一区| 国产精品色哟哟网站| 亚洲欧美日韩国产综合在线| 偷偷要91色婷婷| 国产原创一区二区| 91免费观看国产| 91精选在线观看| 国产日韩欧美精品在线| 一区二区在线观看av| 青青草视频一区| 99免费精品视频| 538prom精品视频线放| 国产色婷婷亚洲99精品小说| 亚洲一区二区三区在线播放| 久久精品国产色蜜蜜麻豆| 99精品久久只有精品| 4438x成人网最大色成网站| 国产欧美日韩在线观看| 午夜不卡av在线| 国产91在线看| 在线播放欧美女士性生活| 国产欧美1区2区3区| 日韩中文字幕91| 99久久99久久久精品齐齐| 91精品国产91久久综合桃花| 一区在线中文字幕| 91美女在线看| 日韩精品一区二区在线| 一区二区三区在线视频免费观看| 久久超碰97人人做人人爱| 91成人免费在线视频| 国产亚洲污的网站| 日韩av不卡在线观看| 色94色欧美sute亚洲线路一久| 久久蜜桃一区二区| 日日欢夜夜爽一区| 色综合色综合色综合| 欧美激情在线观看视频免费| 奇米色一区二区三区四区| 色综合久久久久综合体桃花网| 久久女同性恋中文字幕| 青青草97国产精品免费观看| 在线观看一区日韩| 国产精品美女久久福利网站| 国产一区在线观看视频| 91.麻豆视频| 亚洲国产一区视频| 色狠狠桃花综合| 国产精品久久久久久亚洲毛片| 韩国av一区二区三区在线观看| 欧美日韩国产一级二级| 亚洲日本va在线观看| 丁香婷婷综合色啪| 日本一区二区在线不卡| 极品美女销魂一区二区三区免费| 欧美二区三区的天堂| 亚洲h动漫在线| 欧美在线你懂的| 一区二区三区在线高清| 色婷婷一区二区三区四区| 中文字幕一区二| 91蜜桃在线免费视频| 国产精品久久久久一区二区三区共| 国产一区免费电影| 精品国一区二区三区| 韩国女主播一区| 久久久亚洲午夜电影| 国产精品一二三区在线| 亚洲国产成人在线| 99久久综合精品| 亚洲人成网站在线| 日本久久电影网| 亚洲福利一区二区三区| 在线播放中文一区| 久久精品国产精品亚洲红杏| 欧美变态口味重另类| 国产美女在线精品| 成人欧美一区二区三区1314| 色香蕉成人二区免费| 亚洲国产成人tv| 日韩一区二区在线观看| 精品一区二区免费视频| 中文一区二区在线观看| 99久久国产综合精品女不卡| 亚洲精品写真福利| 91.com在线观看| 国产69精品久久久久777| 亚洲婷婷综合色高清在线| 欧美亚洲免费在线一区| 奇米一区二区三区av| 欧美国产精品专区| 一本到不卡免费一区二区| 亚洲国产综合91精品麻豆| 日韩精品一区二区三区视频在线观看| 国产美女精品人人做人人爽| 综合色天天鬼久久鬼色| 7777女厕盗摄久久久| 成人精品鲁一区一区二区| 亚洲精品成人天堂一二三| 欧美一二区视频| 99精品热视频|