New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 6004 for branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90 – NEMO

Ignore:
Timestamp:
2015-12-04T17:05:58+01:00 (8 years ago)
Author:
gm
Message:

#1613: vvl by default, step III: Merge with the trunk (free surface simplification) (see wiki)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/LBC/lib_mpp.F90

    r5883 r6004  
    2727 
    2828   !!---------------------------------------------------------------------- 
    29    !!   ctl_stop   : update momentum and tracer Kz from a tke scheme 
    30    !!   ctl_warn   : initialization, namelist read, and parameters control 
    31    !!   ctl_opn    : Open file and check if required file is available. 
    32    !!   ctl_nam    : Prints informations when an error occurs while reading a namelist 
    33    !!   get_unit   : give the index of an unused logical unit 
     29   !!   ctl_stop      : update momentum and tracer Kz from a tke scheme 
     30   !!   ctl_warn      : initialization, namelist read, and parameters control 
     31   !!   ctl_opn       : Open file and check if required file is available. 
     32   !!   ctl_nam       : Prints informations when an error occurs while reading a namelist 
     33   !!   get_unit      : give the index of an unused logical unit 
    3434   !!---------------------------------------------------------------------- 
    3535#if   defined key_mpp_mpi 
     
    4343   !!   mpp_lnk_e     : interface (defined in lbclnk) for message passing of 2d array with extra halo (mpp_lnk_2d_e) 
    4444   !!   mpp_lnk_icb   : interface for message passing of 2d arrays with extra halo for icebergs (mpp_lnk_2d_icb) 
    45    !!   mpprecv         : 
     45   !!   mpprecv       : 
    4646   !!   mppsend       :   SUBROUTINE mpp_ini_znl 
    4747   !!   mppscatter    : 
     
    9494   END INTERFACE 
    9595   INTERFACE mpp_sum 
    96       MODULE PROCEDURE mppsum_a_int, mppsum_int, mppsum_a_real, mppsum_real, & 
     96      MODULE PROCEDURE mppsum_a_int, mppsum_int, mppsum_a_real, mppsum_real,   & 
    9797                       mppsum_realdd, mppsum_a_realdd 
    9898   END INTERFACE 
     
    175175      !! ** Purpose :   Find processor unit 
    176176      !!---------------------------------------------------------------------- 
    177       CHARACTER(len=*),DIMENSION(:), INTENT(  out) ::   ldtxt 
    178       CHARACTER(len=*)             , INTENT(in   ) ::   ldname 
    179       INTEGER                      , INTENT(in   ) ::   kumnam_ref     ! logical unit for reference namelist 
    180       INTEGER                      , INTENT(in   ) ::   kumnam_cfg     ! logical unit for configuration namelist 
    181       INTEGER                      , INTENT(inout) ::   kumond         ! logical unit for namelist output 
    182       INTEGER                      , INTENT(inout) ::   kstop          ! stop indicator 
    183       INTEGER, OPTIONAL            , INTENT(in   ) ::   localComm 
     177      CHARACTER(len=*),DIMENSION(:), INTENT(  out) ::   ldtxt        ! 
     178      CHARACTER(len=*)             , INTENT(in   ) ::   ldname       ! 
     179      INTEGER                      , INTENT(in   ) ::   kumnam_ref   ! logical unit for reference namelist 
     180      INTEGER                      , INTENT(in   ) ::   kumnam_cfg   ! logical unit for configuration namelist 
     181      INTEGER                      , INTENT(inout) ::   kumond       ! logical unit for namelist output 
     182      INTEGER                      , INTENT(inout) ::   kstop        ! stop indicator 
     183      INTEGER         , OPTIONAL   , INTENT(in   ) ::   localComm    ! 
    184184      ! 
    185185      INTEGER ::   mynode, ierr, code, ji, ii, ios 
     
    190190      ! 
    191191      ii = 1 
    192       WRITE(ldtxt(ii),*)                                                                          ;   ii = ii + 1 
    193       WRITE(ldtxt(ii),*) 'mynode : mpi initialisation'                                            ;   ii = ii + 1 
    194       WRITE(ldtxt(ii),*) '~~~~~~ '                                                                ;   ii = ii + 1 
     192      WRITE(ldtxt(ii),*)                                                                  ;   ii = ii + 1 
     193      WRITE(ldtxt(ii),*) 'mynode : mpi initialisation'                                    ;   ii = ii + 1 
     194      WRITE(ldtxt(ii),*) '~~~~~~ '                                                        ;   ii = ii + 1 
    195195      ! 
    196196 
     
    204204 
    205205      !                              ! control print 
    206       WRITE(ldtxt(ii),*) '   Namelist nammpp'                                                     ;   ii = ii + 1 
    207       WRITE(ldtxt(ii),*) '      mpi send type                      cn_mpi_send = ', cn_mpi_send   ;   ii = ii + 1 
    208       WRITE(ldtxt(ii),*) '      size in bytes of exported buffer   nn_buffer   = ', nn_buffer     ;   ii = ii + 1 
     206      WRITE(ldtxt(ii),*) '   Namelist nammpp'                                             ;   ii = ii + 1 
     207      WRITE(ldtxt(ii),*) '      mpi send type          cn_mpi_send = ', cn_mpi_send       ;   ii = ii + 1 
     208      WRITE(ldtxt(ii),*) '      size exported buffer   nn_buffer   = ', nn_buffer,' bytes';   ii = ii + 1 
    209209 
    210210#if defined key_agrif 
     
    223223 
    224224      IF( (jpni < 1) .OR. (jpnj < 1) )THEN 
    225          WRITE(ldtxt(ii),*) '      jpni, jpnj and jpnij will be calculated automatically'; ii = ii + 1 
     225         WRITE(ldtxt(ii),*) '      jpni, jpnj and jpnij will be calculated automatically' ;  ii = ii + 1 
    226226      ELSE 
    227          WRITE(ldtxt(ii),*) '      processor grid extent in i         jpni = ',jpni; ii = ii + 1 
    228          WRITE(ldtxt(ii),*) '      processor grid extent in j         jpnj = ',jpnj; ii = ii + 1 
    229          WRITE(ldtxt(ii),*) '      number of local domains           jpnij = ',jpnij; ii = ii +1 
     227         WRITE(ldtxt(ii),*) '      processor grid extent in i         jpni = ',jpni       ;  ii = ii + 1 
     228         WRITE(ldtxt(ii),*) '      processor grid extent in j         jpnj = ',jpnj       ;  ii = ii + 1 
     229         WRITE(ldtxt(ii),*) '      number of local domains           jpnij = ',jpnij      ;   ii = ii + 1 
    230230      END IF 
    231231 
     
    246246         SELECT CASE ( cn_mpi_send ) 
    247247         CASE ( 'S' )                ! Standard mpi send (blocking) 
    248             WRITE(ldtxt(ii),*) '           Standard blocking mpi send (send)'                     ;   ii = ii + 1 
     248            WRITE(ldtxt(ii),*) '           Standard blocking mpi send (send)'             ;   ii = ii + 1 
    249249         CASE ( 'B' )                ! Buffer mpi send (blocking) 
    250             WRITE(ldtxt(ii),*) '           Buffer blocking mpi send (bsend)'                      ;   ii = ii + 1 
     250            WRITE(ldtxt(ii),*) '           Buffer blocking mpi send (bsend)'              ;   ii = ii + 1 
    251251            IF( Agrif_Root() )   CALL mpi_init_opa( ldtxt, ii, ierr ) 
    252252         CASE ( 'I' )                ! Immediate mpi send (non-blocking send) 
    253             WRITE(ldtxt(ii),*) '           Immediate non-blocking send (isend)'                   ;   ii = ii + 1 
     253            WRITE(ldtxt(ii),*) '           Immediate non-blocking send (isend)'           ;   ii = ii + 1 
    254254            l_isend = .TRUE. 
    255255         CASE DEFAULT 
    256             WRITE(ldtxt(ii),cform_err)                                                            ;   ii = ii + 1 
    257             WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send             ;   ii = ii + 1 
     256            WRITE(ldtxt(ii),cform_err)                                                    ;   ii = ii + 1 
     257            WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send     ;   ii = ii + 1 
    258258            kstop = kstop + 1 
    259259         END SELECT 
    260260      ELSE IF ( PRESENT(localComm) .and. .not. mpi_was_called ) THEN 
    261          WRITE(ldtxt(ii),*) ' lib_mpp: You cannot provide a local communicator '                  ;   ii = ii + 1 
    262          WRITE(ldtxt(ii),*) '          without calling MPI_Init before ! '                        ;   ii = ii + 1 
     261         WRITE(ldtxt(ii),*) ' lib_mpp: You cannot provide a local communicator '          ;   ii = ii + 1 
     262         WRITE(ldtxt(ii),*) '          without calling MPI_Init before ! '                ;   ii = ii + 1 
    263263         kstop = kstop + 1 
    264264      ELSE 
    265265         SELECT CASE ( cn_mpi_send ) 
    266266         CASE ( 'S' )                ! Standard mpi send (blocking) 
    267             WRITE(ldtxt(ii),*) '           Standard blocking mpi send (send)'                     ;   ii = ii + 1 
     267            WRITE(ldtxt(ii),*) '           Standard blocking mpi send (send)'             ;   ii = ii + 1 
    268268            CALL mpi_init( ierr ) 
    269269         CASE ( 'B' )                ! Buffer mpi send (blocking) 
    270             WRITE(ldtxt(ii),*) '           Buffer blocking mpi send (bsend)'                      ;   ii = ii + 1 
     270            WRITE(ldtxt(ii),*) '           Buffer blocking mpi send (bsend)'              ;   ii = ii + 1 
    271271            IF( Agrif_Root() )   CALL mpi_init_opa( ldtxt, ii, ierr ) 
    272272         CASE ( 'I' )                ! Immediate mpi send (non-blocking send) 
    273             WRITE(ldtxt(ii),*) '           Immediate non-blocking send (isend)'                   ;   ii = ii + 1 
     273            WRITE(ldtxt(ii),*) '           Immediate non-blocking send (isend)'           ;   ii = ii + 1 
    274274            l_isend = .TRUE. 
    275275            CALL mpi_init( ierr ) 
    276276         CASE DEFAULT 
    277             WRITE(ldtxt(ii),cform_err)                                                            ;   ii = ii + 1 
    278             WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send             ;   ii = ii + 1 
     277            WRITE(ldtxt(ii),cform_err)                                                    ;   ii = ii + 1 
     278            WRITE(ldtxt(ii),*) '           bad value for cn_mpi_send = ', cn_mpi_send     ;   ii = ii + 1 
    279279            kstop = kstop + 1 
    280280         END SELECT 
     
    319319   END FUNCTION mynode 
    320320 
     321 
    321322   SUBROUTINE mpp_lnk_3d( ptab, cd_type, psgn, cd_mpp, pval ) 
    322323      !!---------------------------------------------------------------------- 
     
    347348      CHARACTER(len=3), OPTIONAL      , INTENT(in   ) ::   cd_mpp   ! fill the overlap area only 
    348349      REAL(wp)        , OPTIONAL      , INTENT(in   ) ::   pval     ! background value (used at closed boundaries) 
    349       !! 
     350      ! 
    350351      INTEGER  ::   ji, jj, jk, jl             ! dummy loop indices 
    351352      INTEGER  ::   imigr, iihom, ijhom        ! temporary integers 
    352353      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
    353354      REAL(wp) ::   zland 
    354       INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    355       ! 
     355      INTEGER , DIMENSION(MPI_STATUS_SIZE)      ::   ml_stat        ! for key_mpi_isend 
    356356      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ns, zt3sn   ! 3d for north-south & south-north 
    357357      REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::   zt3ew, zt3we   ! 3d for east-west & west-east 
    358  
    359358      !!---------------------------------------------------------------------- 
    360359       
     
    364363      ! 
    365364      IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value 
    366       ELSE                         ;   zland = 0.e0      ! zero by default 
     365      ELSE                         ;   zland = 0._wp     ! zero by default 
    367366      ENDIF 
    368367 
     
    455454      END SELECT 
    456455 
    457  
    458456      ! 3. North and south directions 
    459457      ! ----------------------------- 
     
    508506      END SELECT 
    509507 
    510  
    511508      ! 4. north fold treatment 
    512509      ! ----------------------- 
     
    524521      ! 
    525522   END SUBROUTINE mpp_lnk_3d 
     523 
    526524 
    527525   SUBROUTINE mpp_lnk_2d_multiple( pt2d_array , type_array , psgn_array , num_fields , cd_mpp, pval ) 
     
    542540      !!                    noso   : number for local neighboring processors 
    543541      !!                    nono   : number for local neighboring processors 
    544       !! 
    545       !!---------------------------------------------------------------------- 
    546  
    547       INTEGER :: num_fields 
    548       TYPE( arrayptr ), DIMENSION(:) :: pt2d_array 
     542      !!---------------------------------------------------------------------- 
    549543      CHARACTER(len=1), DIMENSION(:), INTENT(in   ) ::   type_array   ! define the nature of ptab array grid-points 
    550544      !                                                               ! = T , U , V , F , W and I points 
     
    558552      INTEGER  ::   imigr, iihom, ijhom        ! temporary integers 
    559553      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
    560  
     554      INTEGER :: num_fields 
     555      TYPE( arrayptr ), DIMENSION(:) :: pt2d_array 
    561556      REAL(wp) ::   zland 
    562       INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    563       ! 
     557      INTEGER , DIMENSION(MPI_STATUS_SIZE)    ::   ml_stat       ! for key_mpi_isend 
    564558      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north 
    565559      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east 
    566560 
    567561      !!---------------------------------------------------------------------- 
    568  
     562      ! 
    569563      ALLOCATE( zt2ns(jpi,jprecj,2*num_fields), zt2sn(jpi,jprecj,2*num_fields),  & 
    570564         &      zt2ew(jpj,jpreci,2*num_fields), zt2we(jpj,jpreci,2*num_fields)   ) 
    571  
    572565      ! 
    573566      IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value 
    574       ELSE                         ;   zland = 0.e0      ! zero by default 
     567      ELSE                         ;   zland = 0._wp     ! zero by default 
    575568      ENDIF 
    576569 
     
    744737         ! 
    745738      END DO 
    746        
     739      ! 
    747740      DEALLOCATE( zt2ns, zt2sn, zt2ew, zt2we ) 
    748741      ! 
     
    750743 
    751744    
    752    SUBROUTINE load_array(pt2d,cd_type,psgn,pt2d_array, type_array, psgn_array,num_fields) 
     745   SUBROUTINE load_array( pt2d, cd_type, psgn, pt2d_array, type_array, psgn_array, num_fields ) 
    753746      !!--------------------------------------------------------------------- 
    754       REAL(wp), DIMENSION(jpi,jpj), TARGET   ,  INTENT(inout) ::   pt2d    ! Second 2D array on which the boundary condition is applied 
    755       CHARACTER(len=1)            , INTENT(in   ) ::   cd_type ! define the nature of ptab array grid-points 
    756       REAL(wp)                    , INTENT(in   ) ::   psgn    ! =-1 the sign change across the north fold boundary 
     747      REAL(wp), DIMENSION(jpi,jpj), TARGET, INTENT(inout) ::   pt2d    ! Second 2D array on which the boundary condition is applied 
     748      CHARACTER(len=1)                    , INTENT(in   ) ::   cd_type ! define the nature of ptab array grid-points 
     749      REAL(wp)                            , INTENT(in   ) ::   psgn    ! =-1 the sign change across the north fold boundary 
    757750      TYPE(arrayptr)   , DIMENSION(9) ::   pt2d_array 
    758751      CHARACTER(len=1) , DIMENSION(9) ::   type_array    ! define the nature of ptab array grid-points 
    759752      REAL(wp)         , DIMENSION(9) ::   psgn_array    ! =-1 the sign change across the north fold boundary 
    760       INTEGER                      , INTENT (inout):: num_fields  
     753      INTEGER                            , INTENT (inout) :: num_fields  
    761754      !!--------------------------------------------------------------------- 
    762       num_fields=num_fields+1 
    763       pt2d_array(num_fields)%pt2d=>pt2d 
    764       type_array(num_fields)=cd_type 
    765       psgn_array(num_fields)=psgn 
     755      num_fields = num_fields + 1 
     756      pt2d_array(num_fields)%pt2d => pt2d 
     757      type_array(num_fields)      =  cd_type 
     758      psgn_array(num_fields)      =  psgn 
    766759   END SUBROUTINE load_array 
    767760    
     
    792785      INTEGER :: num_fields 
    793786      !!--------------------------------------------------------------------- 
    794  
     787      ! 
    795788      num_fields = 0 
    796  
    797       !! Load the first array 
    798       CALL load_array(pt2dA,cd_typeA,psgnA,pt2d_array, type_array, psgn_array,num_fields) 
    799  
    800       !! Look if more arrays are added 
    801       IF(PRESENT (psgnB) )CALL load_array(pt2dB,cd_typeB,psgnB,pt2d_array, type_array, psgn_array,num_fields) 
    802       IF(PRESENT (psgnC) )CALL load_array(pt2dC,cd_typeC,psgnC,pt2d_array, type_array, psgn_array,num_fields) 
    803       IF(PRESENT (psgnD) )CALL load_array(pt2dD,cd_typeD,psgnD,pt2d_array, type_array, psgn_array,num_fields) 
    804       IF(PRESENT (psgnE) )CALL load_array(pt2dE,cd_typeE,psgnE,pt2d_array, type_array, psgn_array,num_fields) 
    805       IF(PRESENT (psgnF) )CALL load_array(pt2dF,cd_typeF,psgnF,pt2d_array, type_array, psgn_array,num_fields) 
    806       IF(PRESENT (psgnG) )CALL load_array(pt2dG,cd_typeG,psgnG,pt2d_array, type_array, psgn_array,num_fields) 
    807       IF(PRESENT (psgnH) )CALL load_array(pt2dH,cd_typeH,psgnH,pt2d_array, type_array, psgn_array,num_fields) 
    808       IF(PRESENT (psgnI) )CALL load_array(pt2dI,cd_typeI,psgnI,pt2d_array, type_array, psgn_array,num_fields) 
    809        
    810       CALL mpp_lnk_2d_multiple(pt2d_array,type_array,psgn_array,num_fields,cd_mpp,pval) 
     789      ! 
     790      ! Load the first array 
     791      CALL load_array( pt2dA, cd_typeA, psgnA, pt2d_array, type_array, psgn_array, num_fields ) 
     792      ! 
     793      ! Look if more arrays are added 
     794      IF( PRESENT(psgnB) )   CALL load_array(pt2dB,cd_typeB,psgnB,pt2d_array, type_array, psgn_array,num_fields) 
     795      IF( PRESENT(psgnC) )   CALL load_array(pt2dC,cd_typeC,psgnC,pt2d_array, type_array, psgn_array,num_fields) 
     796      IF( PRESENT(psgnD) )   CALL load_array(pt2dD,cd_typeD,psgnD,pt2d_array, type_array, psgn_array,num_fields) 
     797      IF( PRESENT(psgnE) )   CALL load_array(pt2dE,cd_typeE,psgnE,pt2d_array, type_array, psgn_array,num_fields) 
     798      IF( PRESENT(psgnF) )   CALL load_array(pt2dF,cd_typeF,psgnF,pt2d_array, type_array, psgn_array,num_fields) 
     799      IF( PRESENT(psgnG) )   CALL load_array(pt2dG,cd_typeG,psgnG,pt2d_array, type_array, psgn_array,num_fields) 
     800      IF( PRESENT(psgnH) )   CALL load_array(pt2dH,cd_typeH,psgnH,pt2d_array, type_array, psgn_array,num_fields) 
     801      IF( PRESENT(psgnI) )   CALL load_array(pt2dI,cd_typeI,psgnI,pt2d_array, type_array, psgn_array,num_fields) 
     802      ! 
     803      CALL mpp_lnk_2d_multiple( pt2d_array, type_array, psgn_array, num_fields, cd_mpp,pval ) 
     804      ! 
    811805   END SUBROUTINE mpp_lnk_2d_9 
    812806 
     
    843837      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
    844838      REAL(wp) ::   zland 
    845       INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    846       ! 
     839      INTEGER, DIMENSION(MPI_STATUS_SIZE)     ::   ml_stat       ! for key_mpi_isend 
    847840      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ns, zt2sn   ! 2d for north-south & south-north 
    848841      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  zt2ew, zt2we   ! 2d for east-west & west-east 
    849  
    850       !!---------------------------------------------------------------------- 
    851  
     842      !!---------------------------------------------------------------------- 
     843      ! 
    852844      ALLOCATE( zt2ns(jpi,jprecj,2), zt2sn(jpi,jprecj,2),  & 
    853845         &      zt2ew(jpj,jpreci,2), zt2we(jpj,jpreci,2)   ) 
    854  
    855846      ! 
    856847      IF( PRESENT( pval ) ) THEN   ;   zland = pval      ! set land value 
    857       ELSE                         ;   zland = 0.e0      ! zero by default 
     848      ELSE                         ;   zland = 0._wp     ! zero by default 
    858849      ENDIF 
    859850 
     
    10461037      INTEGER  ::   imigr, iihom, ijhom        ! temporary integers 
    10471038      INTEGER  ::   ml_req1, ml_req2, ml_err   ! for key_mpi_isend 
    1048       INTEGER, DIMENSION(MPI_STATUS_SIZE) ::   ml_stat   ! for key_mpi_isend 
    1049       ! 
     1039      INTEGER , DIMENSION(MPI_STATUS_SIZE)        ::   ml_stat   ! for key_mpi_isend 
    10501040      REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE ::   zt4ns, zt4sn   ! 2 x 3d for north-south & south-north 
    10511041      REAL(wp), DIMENSION(:,:,:,:,:), ALLOCATABLE ::   zt4ew, zt4we   ! 2 x 3d for east-west & west-east 
    1052  
    1053       !!---------------------------------------------------------------------- 
     1042      !!---------------------------------------------------------------------- 
     1043      ! 
    10541044      ALLOCATE( zt4ns(jpi,jprecj,jpk,2,2), zt4sn(jpi,jprecj,jpk,2,2) ,    & 
    10551045         &      zt4ew(jpj,jpreci,jpk,2,2), zt4we(jpj,jpreci,jpk,2,2) ) 
    1056  
    1057  
     1046      ! 
    10581047      ! 1. standard boundary treatment 
    10591048      ! ------------------------------ 
     
    13991388         END DO 
    14001389      END SELECT 
    1401  
     1390      ! 
    14021391   END SUBROUTINE mpp_lnk_2d_e 
    14031392 
     
    14491438      !!---------------------------------------------------------------------- 
    14501439      ! 
    1451  
    14521440      ! If a specific process number has been passed to the receive call, 
    14531441      ! use that one. Default is to use mpi_any_source 
    1454       use_source=mpi_any_source 
    1455       if(present(ksource)) then 
    1456          use_source=ksource 
    1457       end if 
    1458  
     1442      use_source = mpi_any_source 
     1443      IF( PRESENT(ksource) )   use_source = ksource 
     1444      ! 
    14591445      CALL mpi_recv( pmess, kbytes, mpi_double_precision, use_source, ktyp, mpi_comm_opa, istatus, iflag ) 
    14601446      ! 
     
    14701456      !! 
    14711457      !!---------------------------------------------------------------------- 
    1472       REAL(wp), DIMENSION(jpi,jpj),      INTENT(in   ) ::   ptab   ! subdomain input array 
    1473       INTEGER ,                          INTENT(in   ) ::   kp     ! record length 
     1458      REAL(wp), DIMENSION(jpi,jpj)      , INTENT(in   ) ::   ptab   ! subdomain input array 
     1459      INTEGER                           , INTENT(in   ) ::   kp     ! record length 
    14741460      REAL(wp), DIMENSION(jpi,jpj,jpnij), INTENT(  out) ::   pio    ! subdomain input array 
    14751461      !! 
     
    14921478      !! 
    14931479      !!---------------------------------------------------------------------- 
    1494       REAL(wp), DIMENSION(jpi,jpj,jpnij)  ::  pio        ! output array 
    1495       INTEGER                             ::   kp        ! Tag (not used with MPI 
    1496       REAL(wp), DIMENSION(jpi,jpj)        ::  ptab       ! subdomain array input 
     1480      REAL(wp), DIMENSION(jpi,jpj,jpnij)  ::   pio    ! output array 
     1481      INTEGER                             ::   kp     ! Tag (not used with MPI 
     1482      REAL(wp), DIMENSION(jpi,jpj)        ::   ptab   ! subdomain array input 
    14971483      !! 
    14981484      INTEGER :: itaille, ierror   ! temporary integer 
    14991485      !!--------------------------------------------------------------------- 
    15001486      ! 
    1501       itaille=jpi*jpj 
     1487      itaille = jpi * jpj 
    15021488      ! 
    15031489      CALL mpi_scatter( pio, itaille, mpi_double_precision, ptab, itaille     ,   & 
     
    15171503      INTEGER , INTENT(inout), DIMENSION(kdim) ::   ktab   ! input array 
    15181504      INTEGER , INTENT(in   ), OPTIONAL        ::   kcom   ! 
    1519       !! 
     1505      ! 
    15201506      INTEGER :: ierror, localcomm   ! temporary integer 
    15211507      INTEGER, DIMENSION(kdim) ::   iwork 
     
    15391525      !! 
    15401526      !!---------------------------------------------------------------------- 
    1541       INTEGER, INTENT(inout)           ::   ktab      ! ??? 
    1542       INTEGER, INTENT(in   ), OPTIONAL ::   kcom      ! ??? 
    1543       !! 
     1527      INTEGER, INTENT(inout)           ::   ktab   ! ??? 
     1528      INTEGER, INTENT(in   ), OPTIONAL ::   kcom   ! ??? 
     1529      ! 
    15441530      INTEGER ::   ierror, iwork, localcomm   ! temporary integer 
    15451531      !!---------------------------------------------------------------------- 
     
    15481534      IF( PRESENT(kcom) )   localcomm = kcom 
    15491535      ! 
    1550       CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_max, localcomm, ierror) 
     1536      CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_max, localcomm, ierror ) 
    15511537      ! 
    15521538      ktab = iwork 
     
    15621548      !! 
    15631549      !!---------------------------------------------------------------------- 
    1564       INTEGER , INTENT( in  )                  ::   kdim        ! size of array 
    1565       INTEGER , INTENT(inout), DIMENSION(kdim) ::   ktab        ! input array 
    1566       INTEGER , INTENT( in  ), OPTIONAL        ::   kcom        ! input array 
     1550      INTEGER , INTENT( in  )                  ::   kdim   ! size of array 
     1551      INTEGER , INTENT(inout), DIMENSION(kdim) ::   ktab   ! input array 
     1552      INTEGER , INTENT( in  ), OPTIONAL        ::   kcom   ! input array 
    15671553      !! 
    15681554      INTEGER ::   ierror, localcomm   ! temporary integer 
     
    15961582      IF( PRESENT(kcom) )   localcomm = kcom 
    15971583      ! 
    1598      CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_min, localcomm, ierror ) 
     1584      CALL mpi_allreduce( ktab, iwork, 1, mpi_integer, mpi_min, localcomm, ierror ) 
    15991585      ! 
    16001586      ktab = iwork 
     
    16101596      !! 
    16111597      !!---------------------------------------------------------------------- 
    1612       INTEGER, INTENT(in   )                   ::   kdim      ! ??? 
    1613       INTEGER, INTENT(inout), DIMENSION (kdim) ::   ktab      ! ??? 
    1614       !! 
     1598      INTEGER, INTENT(in   )                   ::   kdim   ! ??? 
     1599      INTEGER, INTENT(inout), DIMENSION (kdim) ::   ktab   ! ??? 
     1600      ! 
    16151601      INTEGER :: ierror 
    16161602      INTEGER, DIMENSION (kdim) ::  iwork 
     
    16531639      REAL(wp), INTENT(inout), DIMENSION(kdim) ::   ptab 
    16541640      INTEGER , INTENT(in   ), OPTIONAL        ::   kcom 
    1655       !! 
     1641      ! 
    16561642      INTEGER :: ierror, localcomm 
    16571643      REAL(wp), DIMENSION(kdim) ::  zwork 
     
    17851771   END SUBROUTINE mppsum_real 
    17861772 
     1773 
    17871774   SUBROUTINE mppsum_realdd( ytab, kcom ) 
    17881775      !!---------------------------------------------------------------------- 
     
    17931780      !! 
    17941781      !!----------------------------------------------------------------------- 
    1795       COMPLEX(wp), INTENT(inout)         :: ytab    ! input scalar 
    1796       INTEGER , INTENT( in  ), OPTIONAL :: kcom 
    1797  
    1798       !! * Local variables   (MPI version) 
    1799       INTEGER  ::    ierror 
    1800       INTEGER  ::   localcomm 
    1801       COMPLEX(wp) :: zwork 
    1802  
     1782      COMPLEX(wp), INTENT(inout)           ::  ytab    ! input scalar 
     1783      INTEGER    , INTENT(in   ), OPTIONAL ::  kcom 
     1784      ! 
     1785      INTEGER     ::   ierror 
     1786      INTEGER     ::   localcomm 
     1787      COMPLEX(wp) ::   zwork 
     1788      !!----------------------------------------------------------------------- 
     1789      ! 
    18031790      localcomm = mpi_comm_opa 
    1804       IF( PRESENT(kcom) ) localcomm = kcom 
    1805  
     1791      IF( PRESENT(kcom) )   localcomm = kcom 
     1792      ! 
    18061793      ! reduce local sums into global sum 
    1807       CALL MPI_ALLREDUCE (ytab, zwork, 1, MPI_DOUBLE_COMPLEX, & 
    1808                        MPI_SUMDD,localcomm,ierror) 
     1794      CALL MPI_ALLREDUCE (ytab, zwork, 1, MPI_DOUBLE_COMPLEX, MPI_SUMDD, localcomm, ierror ) 
    18091795      ytab = zwork 
    1810  
     1796      ! 
    18111797   END SUBROUTINE mppsum_realdd 
    18121798 
     
    18201806      !! 
    18211807      !!----------------------------------------------------------------------- 
    1822       INTEGER , INTENT( in )                        ::   kdim      ! size of ytab 
    1823       COMPLEX(wp), DIMENSION(kdim), INTENT( inout ) ::   ytab      ! input array 
    1824       INTEGER , INTENT( in  ), OPTIONAL :: kcom 
    1825  
    1826       !! * Local variables   (MPI version) 
    1827       INTEGER                      :: ierror    ! temporary integer 
    1828       INTEGER                      ::   localcomm 
     1808      INTEGER                     , INTENT(in   ) ::   kdim   ! size of ytab 
     1809      COMPLEX(wp), DIMENSION(kdim), INTENT(inout) ::   ytab   ! input array 
     1810      INTEGER    , OPTIONAL       , INTENT(in   ) ::   kcom 
     1811      ! 
     1812      INTEGER:: ierror, localcomm    ! local integer 
    18291813      COMPLEX(wp), DIMENSION(kdim) :: zwork     ! temporary workspace 
    1830  
     1814      !!----------------------------------------------------------------------- 
     1815      ! 
    18311816      localcomm = mpi_comm_opa 
    1832       IF( PRESENT(kcom) ) localcomm = kcom 
    1833  
    1834       CALL MPI_ALLREDUCE (ytab, zwork, kdim, MPI_DOUBLE_COMPLEX, & 
    1835                        MPI_SUMDD,localcomm,ierror) 
     1817      IF( PRESENT(kcom) )   localcomm = kcom 
     1818      ! 
     1819      CALL MPI_ALLREDUCE( ytab, zwork, kdim, MPI_DOUBLE_COMPLEX, MPI_SUMDD, localcomm, ierror ) 
    18361820      ytab(:) = zwork(:) 
    1837  
     1821      ! 
    18381822   END SUBROUTINE mppsum_a_realdd 
     1823 
    18391824 
    18401825   SUBROUTINE mpp_minloc2d( ptab, pmask, pmin, ki,kj ) 
     
    18521837      REAL(wp)                     , INTENT(  out) ::   pmin    ! Global minimum of ptab 
    18531838      INTEGER                      , INTENT(  out) ::   ki, kj   ! index of minimum in global frame 
    1854       !! 
     1839      ! 
     1840      INTEGER :: ierror 
    18551841      INTEGER , DIMENSION(2)   ::   ilocs 
    1856       INTEGER :: ierror 
    18571842      REAL(wp) ::   zmin   ! local minimum 
    18581843      REAL(wp), DIMENSION(2,1) ::   zain, zaout 
     
    27042689         &      zt3ew(jpj,jpreci,jpk,2), zt3we(jpj,jpreci,jpk,2)  ) 
    27052690 
    2706       zland = 0.-WP 
     2691      zland = 0._wp 
    27072692 
    27082693      ! 1. standard boundary treatment 
Note: See TracChangeset for help on using the changeset viewer.