Ignore:
Timestamp:
Oct 21, 2024, 2:58:45 PM (23 hours ago)
Author:
abarral
Message:

Convert fixed-form to free-form sources .F -> .{f,F}90
(WIP: some .F remain, will be handled in subsequent commits)

File:
1 moved

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/dyn3dmem/groupe_loc.F90

    r5245 r5246  
    1       subroutine groupe_loc(pext,pbaru,pbarv,pbarum,pbarvm,wm)
    2       USE parallel_lmdz
    3       USE Write_field_loc
    4       USE groupe_mod
    5       USE comconst_mod, ONLY: ngroup
    6       implicit none
     1subroutine groupe_loc(pext,pbaru,pbarv,pbarum,pbarvm,wm)
     2  USE parallel_lmdz
     3  USE Write_field_loc
     4  USE groupe_mod
     5  USE comconst_mod, ONLY: ngroup
     6  implicit none
    77
    8 c   sous-programme servant a fitlrer les champs de flux de masse aux
    9 c   poles en "regroupant" les mailles 2 par 2 puis 4 par 4 etc. au fur
    10 c   et a mesure qu'on se rapproche du pole.
    11 c
    12 c   en entree: pext, pbaru et pbarv
    13 c
    14 c   en sortie:  pbarum,pbarvm et wm.
    15 c
    16 c   remarque, le wm est recalcule a partir des pbaru pbarv et on n'a donc
    17 c   pas besoin de w en entree.
     8  !   sous-programme servant a fitlrer les champs de flux de masse aux
     9  !   poles en "regroupant" les mailles 2 par 2 puis 4 par 4 etc. au fur
     10  !   et a mesure qu'on se rapproche du pole.
     11  !
     12  !   en entree: pext, pbaru et pbarv
     13  !
     14  !   en sortie:  pbarum,pbarvm et wm.
     15  !
     16  !   remarque, le wm est recalcule a partir des pbaru pbarv et on n'a donc
     17  !   pas besoin de w en entree.
    1818
    19       include "dimensions.h"
    20       include "paramet.h"
    21       include "comgeom2.h"
     19  include "dimensions.h"
     20  include "paramet.h"
     21  include "comgeom2.h"
    2222
    23 !    integer ngroup
    24 !    parameter (ngroup=3)
     23  ! integer ngroup
     24  ! parameter (ngroup=3)
    2525
    2626
    27       real pbaru(iip1,jjb_u:jje_u,llm),pbarv(iip1,jjb_v:jje_v,llm)
    28       real pext(iip1,jjb_u:jje_u,llm)
     27  real :: pbaru(iip1,jjb_u:jje_u,llm),pbarv(iip1,jjb_v:jje_v,llm)
     28  real :: pext(iip1,jjb_u:jje_u,llm)
    2929
    30       real pbarum(iip1,jjb_u:jje_u,llm),pbarvm(iip1,jjb_v:jje_v,llm)
    31       real wm(iip1,jjb_u:jje_u,llm)
     30  real :: pbarum(iip1,jjb_u:jje_u,llm),pbarvm(iip1,jjb_v:jje_v,llm)
     31  real :: wm(iip1,jjb_u:jje_u,llm)
    3232
    3333
    34       real uu
     34  real :: uu
    3535
    36       integer i,j,l
     36  integer :: i,j,l
    3737
    38       logical firstcall
    39       save firstcall
    40 c$OMP THREADPRIVATE(firstcall)
     38  logical :: firstcall
     39  save firstcall
     40!$OMP THREADPRIVATE(firstcall)
    4141
    42       integer ijb,ije,jjb,jje
    43      
    44 c   Champs 1D
     42  integer :: ijb,ije,jjb,jje
    4543
    46       call convflu_loc(pbaru,pbarv,llm,zconvm)
     44  !   Champs 1D
    4745
    48 c
    49 c      call scopy(ijp1llm,zconvm,1,zconvmm,1)
    50 c      call scopy(ijmllm,pbarv,1,pbarvm,1)
    51      
    52       jjb=jj_begin
    53       jje=jj_end
     46  call convflu_loc(pbaru,pbarv,llm,zconvm)
    5447
    55 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)     
    56       do l=1,llm
    57         zconvmm(:,jjb:jje,l)=zconvm(:,jjb:jje,l)
    58       enddo
    59 c$OMP END DO NOWAIT
     48  !
     49  !  call scopy(ijp1llm,zconvm,1,zconvmm,1)
     50  !  call scopy(ijmllm,pbarv,1,pbarvm,1)
    6051
    61       call groupeun_loc(jjp1,llm,jjb_u,jje_u,jjb,jje,zconvmm)
    62      
    63       jjb=jj_begin-1
    64       jje=jj_end
    65       if (pole_nord) jjb=jj_begin
    66       if (pole_sud)  jje=jj_end-1
    67 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)     
    68       do l=1,llm
    69         pbarvm(:,jjb:jje,l)=pbarv(:,jjb:jje,l)
    70       enddo
    71 c$OMP END DO NOWAIT
     52  jjb=jj_begin
     53  jje=jj_end
    7254
    73 #ifdef DEBUG_IO   
    74       CALL WriteField_v('pbarvm',reshape(pbarvm,(/ip1jm,llm/)))
     55!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
     56  do l=1,llm
     57    zconvmm(:,jjb:jje,l)=zconvm(:,jjb:jje,l)
     58  enddo
     59!$OMP END DO NOWAIT
     60
     61  call groupeun_loc(jjp1,llm,jjb_u,jje_u,jjb,jje,zconvmm)
     62
     63  jjb=jj_begin-1
     64  jje=jj_end
     65  if (pole_nord) jjb=jj_begin
     66  if (pole_sud)  jje=jj_end-1
     67!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
     68  do l=1,llm
     69    pbarvm(:,jjb:jje,l)=pbarv(:,jjb:jje,l)
     70  enddo
     71!$OMP END DO NOWAIT
     72
     73#ifdef DEBUG_IO
     74  CALL WriteField_v('pbarvm',reshape(pbarvm,(/ip1jm,llm/)))
    7575#endif
    76       call groupeun_loc(jjm,llm,jjb_v,jje_v,jjb,jje,pbarvm)
    77 #ifdef DEBUG_IO   
    78       CALL WriteField_v('pbarvm',reshape(pbarvm,(/ip1jm,llm/)))
     76  call groupeun_loc(jjm,llm,jjb_v,jje_v,jjb,jje,pbarvm)
     77#ifdef DEBUG_IO
     78  CALL WriteField_v('pbarvm',reshape(pbarvm,(/ip1jm,llm/)))
    7979#endif
    80 c   Champs 3D
    81    
    82       jjb=jj_begin
    83       jje=jj_end
    84       if (pole_nord) jjb=jj_begin+1
    85       if (pole_sud)  jje=jj_end-1
    86      
    87 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)     
    88       do l=1,llm
    89          do j=jjb,jje
    90             uu=pbaru(iim,j,l)
    91             do i=1,iim
    92                uu=uu+pbarvm(i,j,l)-pbarvm(i,j-1,l)-zconvmm(i,j,l)
    93                pbarum(i,j,l)=uu
    94 c     zconvm(i,j,l ) =  xflu(i-1,j,l)-xflu(i,j,l)+
    95 c    *                      yflu(i,j,l)-yflu(i,j-1,l)
    96             enddo
    97             pbarum(iip1,j,l)=pbarum(1,j,l)
     80  !   Champs 3D
     81
     82  jjb=jj_begin
     83  jje=jj_end
     84  if (pole_nord) jjb=jj_begin+1
     85  if (pole_sud)  jje=jj_end-1
     86
     87!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
     88  do l=1,llm
     89     do j=jjb,jje
     90        uu=pbaru(iim,j,l)
     91        do i=1,iim
     92           uu=uu+pbarvm(i,j,l)-pbarvm(i,j-1,l)-zconvmm(i,j,l)
     93           pbarum(i,j,l)=uu
     94  ! zconvm(i,j,l ) =  xflu(i-1,j,l)-xflu(i,j,l)+
     95  !    *                      yflu(i,j,l)-yflu(i,j-1,l)
     96        enddo
     97        pbarum(iip1,j,l)=pbarum(1,j,l)
     98     enddo
     99  enddo
     100!$OMP END DO NOWAIT
     101  !    integration de la convergence de masse de haut  en bas ......
     102
     103  jjb=jj_begin
     104  jje=jj_end
     105
     106!$OMP BARRIER
     107!$OMP MASTER
     108  do  l = llm-1,1,-1
     109      do j=jjb,jje
     110         do i=1,iip1
     111            zconvmm(i,j,l)=zconvmm(i,j,l)+zconvmm(i,j,l+1)
    98112         enddo
    99113      enddo
    100 c$OMP END DO NOWAIT
    101 c    integration de la convergence de masse de haut  en bas ......
    102    
    103       jjb=jj_begin
    104       jje=jj_end
     114  enddo
    105115
    106 c$OMP BARRIER
    107 c$OMP MASTER     
    108       do  l = llm-1,1,-1
    109           do j=jjb,jje
    110              do i=1,iip1
    111                 zconvmm(i,j,l)=zconvmm(i,j,l)+zconvmm(i,j,l+1)
    112              enddo
    113           enddo
    114       enddo
     116  if (.not. pole_sud) then
     117    zconvmm(:,jj_end+1,:)=0
     118  !ym   wm(:,jj_end+1,:)=0
     119  endif
    115120
    116       if (.not. pole_sud) then
    117         zconvmm(:,jj_end+1,:)=0
    118 cym     wm(:,jj_end+1,:)=0
    119       endif
    120      
    121 c$OMP END MASTER
    122 c$OMP BARRIER     
     121!$OMP END MASTER
     122!$OMP BARRIER
    123123
    124       CALL vitvert_loc(zconvmm,wm)
     124  CALL vitvert_loc(zconvmm,wm)
    125125
    126       return
    127       end
     126  return
     127end subroutine groupe_loc
    128128
Note: See TracChangeset for help on using the changeset viewer.