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 14033 – NEMO

Changeset 14033


Ignore:
Timestamp:
2020-12-03T11:30:33+01:00 (3 years ago)
Author:
epico
Message:

changes in module_example

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/module_example

    r13472 r14033  
    4949 
    5050   !! * Substitutions 
     51   ! for DO macro 
     52#  include "do_loop_substitute.h90" 
     53   !for other substitutions 
    5154#  include "exampl_substitute.h90" 
    5255   !!---------------------------------------------------------------------- 
     
    9598      REAL(wp) ::   zmlmin, zbbrho   ! temporary scalars     (DOCTOR : start with z) 
    9699      REAL(wp) ::   zfact1, zfact2   ! do not use continuation lines in declaration 
    97       REAL(wp), DIMENSION(jpi,jpj) ::   zwrk_2d   ! 2D workspace 
     100      REAL(wp), DIMENSION(A2D(nn_hls))     ::   zwrk_2d   ! 2D workspace 
     101      REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zwrk_3d   ! 3D workspace 
    98102      !!-------------------------------------------------------------------- 
    99103      ! 
    100       IF( kt == nit000  )   CALL exa_mpl_init    ! Initialization (first time-step only) 
     104      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
     105         IF( kt == nit000  )   CALL exa_mpl_init    ! Initialization (first time-step only) 
    101106 
    102       zmlmin = 1.e-8                             ! Local constant initialization 
    103       zbbrho =  .5 * ebb / rho0 
    104       zfact1 = -.5 * rdt * efave 
    105       zfact2 = 1.5 * rdt * ediss 
    106  
     107         zmlmin = 1.e-8                             ! Local constant initialization 
     108         zbbrho =  .5 * ebb / rho0 
     109         zfact1 = -.5 * rdt * efave 
     110         zfact2 = 1.5 * rdt * ediss 
     111      ENDIF 
     112      
    107113      SELECT CASE ( npdl )                       ! short description of the action 
    108114      ! 
    109115      CASE ( 0 )                                      ! describe case 1 
    110          DO jk = 2, jpkm1 
    111             DO jj = 2, jpjm1 
    112                DO ji = fs_2, fs_jpim1   ! vector opt. 
    113                   avm(ji,jj,jk) = .... 
    114                END DO 
    115             END DO 
    116          END DO 
     116         DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 ) 
     117            avm(ji,jj,jk) = .... 
     118         END_3D 
    117119         ! 
    118120      CASE ( 1 )                                      ! describe case 2 
    119          DO jk = 2, jpkm1 
    120             DO jj = 2, jpjm1 
    121                DO ji = fs_2, fs_jpim1   ! vector opt. 
    122                   avm(ji,jj,jk) = ... 
    123                END DO 
    124             END DO 
    125          END DO 
     121         DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 ) 
     122            avm(ji,jj,jk) = .... 
     123         END_3D 
    126124         ! 
    127125      END SELECT 
    128126      ! 
    129       CALL lbc_lnk( 'module_example', avm, 'T', 1. )              ! Lateral boundary conditions (unchanged sign) 
     127      CALL lbc_lnk( 'module_example', avm, 'T', 1., ncsten=true )     ! Lateral boundary conditions (unchanged sign) 
     128      !                                                                ! ncsten=false for 5-points stencil communication 
     129      !                                                                ! ncsten=true (default)  for 9-points stencil communication 
    130130      ! 
    131131   END SUBROUTINE exa_mpl 
Note: See TracChangeset for help on using the changeset viewer.