Ignore:
Timestamp:
06/29/16 16:21:13 (8 years ago)
Author:
dumas
Message:

OpenMP parallelization in conserv-mass-adv-diff_sept2009_mod.f90, diffusiv-polyn-0.6.f90, dragging_neff_slope_mod.f90, eaubasale-0.5_mod.f90 and relaxation_water_diffusion.f90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SOURCES/dragging_neff_slope_mod.f90

    r66 r76  
    168168!------------------------------------------------------------------------- 
    169169subroutine dragging   ! defini la localisation des streams et le frottement basal 
    170  
     170!$ USE OMP_LIB 
    171171 
    172172!         les iles n'ont pas de condition neff mais ont la condition toblim 
    173173!         (ce bloc etait avant dans flottab) 
    174174 
    175  
     175!$OMP PARALLEL 
     176!$OMP DO 
    176177do j=2,ny 
    177178   do i=2,nx 
     
    180181   end do 
    181182end do 
     183!$OMP END DO 
    182184 
    183185! le calcul des fleuves se fait sur les mailles majeures en partant de la cote 
     
    193195! Attention : ce systeme ne permet pas d'avoir des fleuves convergents 
    194196!             et les fleuves n'ont une épaisseur que de 1 noeud. 
    195  
     197!$OMP WORKSHARE 
    196198fleuvemx(:,:)=.false. 
    197199fleuvemy(:,:)=.false. 
    198200fleuve(:,:)=.false. 
    199201cote(:,:)=.false. 
     202!$OMP END WORKSHARE 
    200203 
    201204! detection des cotes 
     205!$OMP DO 
    202206do  j=2,ny-1   
    203207   do i=2,nx-1   
     
    208212   end do 
    209213end do 
     214!$OMP END DO 
    210215 
    211216! calcul de neff (pression effective sur noeuds majeurs) 
     217!$OMP DO 
    212218do j=1,ny-1 
    213219   do i=1,nx-1 
     
    215221   enddo 
    216222enddo 
     223!$OMP END DO 
    217224!aurel, for the borders: 
     225!$OMP WORKSHARE 
    218226neff(:,ny)=1.e5 
    219227neff(nx,:)=1.e5 
     228 
    220229 
    221230!!$ 
     
    277286! aurel, we add the neff threshold: 
    278287where ((neff(:,:).le.seuil_neff).and.(.not.flot(:,:)).and.(H(:,:).gt.1.)) fleuve(:,:)=.true. 
    279  
     288!$OMP END WORKSHARE 
     289 
     290!$OMP DO 
    280291do j=1,ny-1 
    281292   do i=1,nx-1 
     
    288299   end do 
    289300end do 
     301!$OMP END DO 
    290302 
    291303! we look for the warm based points that will not be treated as stream (ub from SSA): 
     304!$OMP WORKSHARE 
    292305slowssa(:,:)=.false. 
    293306slowssamx(:,:)=.false. 
    294307slowssamy(:,:)=.false. 
     308!$OMP END WORKSHARE 
     309!$OMP DO 
    295310do  j=1,ny 
    296311   do i=1,nx 
     
    299314   end do 
    300315end do 
     316!$OMP END DO 
     317!$OMP DO 
    301318do j=1,ny-1 
    302319   do i=1,nx-1 
     
    309326   end do 
    310327end do 
    311  
     328!$OMP END DO 
     329!$OMP DO 
    312330do j=1,ny 
    313331   do i=1,nx 
     
    354372   end do 
    355373end do 
    356  
     374!$OMP END DO 
     375 
     376!$OMP DO 
    357377do j=1,ny 
    358378   do i=1,nx 
     
    399419   end do 
    400420end do 
    401  
    402  
     421!$OMP END DO 
     422 
     423!$OMP DO 
    403424do j=2,ny-1 
    404425   do i=2,nx-1 
     
    407428   end do 
    408429end do 
    409  
    410  
    411 where (fleuve(:,:)) 
    412    debug_3D(:,:,1)=1 
    413 elsewhere (flot(:,:)) 
    414    debug_3D(:,:,1)=2 
    415 elsewhere 
    416    debug_3D(:,:,1)=0 
    417 endwhere 
    418  
    419 where (cote(:,:)) 
    420    debug_3D(:,:,2)=1 
    421 elsewhere 
    422    debug_3D(:,:,2)=0 
    423 endwhere 
    424  
    425 where (fleuvemx(:,:)) 
    426    debug_3D(:,:,3)=1 
    427 elsewhere 
    428    debug_3D(:,:,3)=0 
    429 endwhere 
    430  
    431 where (flotmx(:,:)) 
    432    debug_3D(:,:,3)=-1 
    433 endwhere 
     430!$OMP END DO 
     431!$OMP END PARALLEL 
     432 
     433!~ where (fleuve(:,:)) 
     434!~    debug_3D(:,:,1)=1 
     435!~ elsewhere (flot(:,:)) 
     436!~    debug_3D(:,:,1)=2 
     437!~ elsewhere 
     438!~    debug_3D(:,:,1)=0 
     439!~ endwhere 
     440!~  
     441!~ where (cote(:,:)) 
     442!~    debug_3D(:,:,2)=1 
     443!~ elsewhere 
     444!~    debug_3D(:,:,2)=0 
     445!~ endwhere 
     446!~  
     447!~ where (fleuvemx(:,:)) 
     448!~    debug_3D(:,:,3)=1 
     449!~ elsewhere 
     450!~    debug_3D(:,:,3)=0 
     451!~ endwhere 
     452!~  
     453!~ where (flotmx(:,:)) 
     454!~    debug_3D(:,:,3)=-1 
     455!~ endwhere 
    434456 
    435457!_____________________ 
    436458 
    437459 
    438 where (fleuvemy(:,:)) 
    439    debug_3D(:,:,4)=1 
    440 elsewhere 
    441    debug_3D(:,:,4)=0 
    442 endwhere 
    443  
    444 where (flotmy(:,:)) 
    445    debug_3D(:,:,4)=-1 
    446 end where 
    447  
    448 debug_3D(:,:,23)= abs(RO*G*HMX(:,:)*sdx(:,:)*1.e-5)  
    449 debug_3D(:,:,24)= abs(RO*G*HMY(:,:)*sdy(:,:)*1.e-5)  
     460!~ where (fleuvemy(:,:)) 
     461!~    debug_3D(:,:,4)=1 
     462!~ elsewhere 
     463!~    debug_3D(:,:,4)=0 
     464!~ endwhere 
     465!~  
     466!~ where (flotmy(:,:)) 
     467!~    debug_3D(:,:,4)=-1 
     468!~ end where 
     469!~  
     470!~ debug_3D(:,:,23)= abs(RO*G*HMX(:,:)*sdx(:,:)*1.e-5)  
     471!~ debug_3D(:,:,24)= abs(RO*G*HMY(:,:)*sdy(:,:)*1.e-5)  
    450472 
    451473return 
Note: See TracChangeset for help on using the changeset viewer.