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 13517 for NEMO – NEMO

Changeset 13517 for NEMO


Ignore:
Timestamp:
2020-09-24T20:42:25+02:00 (4 years ago)
Author:
hadcv
Message:

Tiling for modules after tra_ldf

Location:
NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA/tranpc.F90

    r13295 r13517  
    1717   USE oce            ! ocean dynamics and active tracers 
    1818   USE dom_oce        ! ocean space and time domain 
     19   ! TEMP: This change not necessary after trd_tra is tiled and extra haloes development (lbc_lnk removed) 
     20   USE domain, ONLY : dom_tile 
    1921   USE phycst         ! physical constants 
    2022   USE zdf_oce        ! ocean vertical physics 
     
    3234 
    3335   PUBLIC   tra_npc    ! routine called by step.F90 
     36 
     37   INTEGER  ::   nnpcc        ! number of statically instable water column 
    3438 
    3539   !! * Substitutions 
     
    6468      ! 
    6569      INTEGER  ::   ji, jj, jk   ! dummy loop indices 
    66       INTEGER  ::   inpcc        ! number of statically instable water column 
    6770      INTEGER  ::   jiter, ikbot, ikp, ikup, ikdown, ilayer, ik_low   ! local integers 
    6871      LOGICAL  ::   l_bottom_reached, l_column_treated 
     
    7073      REAL(wp) ::   zsa, zbeta, zsum_sali, zsum_beta, zbw, zrw, z1_rDt 
    7174      REAL(wp), PARAMETER ::   zn2_zero = 1.e-14_wp             ! acceptance criteria for neutrality (N2==0) 
    72       REAL(wp), DIMENSION(        jpk     )   ::   zvn2         ! vertical profile of N2 at 1 given point... 
    73       REAL(wp), DIMENSION(        jpk,jpts)   ::   zvts, zvab   ! vertical profile of T & S , and  alpha & betaat 1 given point 
    74       REAL(wp), DIMENSION(jpi,jpj,jpk     )   ::   zn2          ! N^2  
    75       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts)   ::   zab          ! alpha and beta 
    76       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds ! 3D workspace 
     75      REAL(wp), DIMENSION(    jpk     )   ::   zvn2             ! vertical profile of N2 at 1 given point... 
     76      REAL(wp), DIMENSION(    jpk,jpts)   ::   zvts, zvab       ! vertical profile of T & S , and  alpha & betaat 1 given point 
     77      REAL(wp), DIMENSION(ST_2D(nn_hls),jpk     )   ::   zn2              ! N^2 
     78      REAL(wp), DIMENSION(ST_2D(nn_hls),jpk,jpts)   ::   zab              ! alpha and beta 
     79      ! TEMP: This change not necessary after trd_tra is tiled 
     80      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   ztrdt, ztrds ! 3D workspace 
    7781      ! 
    7882      LOGICAL, PARAMETER :: l_LB_debug = .FALSE. ! set to true if you want to follow what is 
     
    8286      ! 
    8387      IF( ln_timing )   CALL timing_start('tra_npc') 
     88 
     89      IF( l_trdtra )   THEN 
     90         IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
     91            ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled 
     92            ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) ) 
     93         ENDIF 
     94      ENDIF 
    8495      ! 
    8596      IF( MOD( kt, nn_npc ) == 0 ) THEN 
    8697         ! 
    8798         IF( l_trdtra )   THEN                    !* Save initial after fields 
    88             ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
    89             ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa)  
    90             ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa) 
    91          ENDIF 
    92          ! 
     99            DO_3D( 0, 0, 0, 0, 1, jpk ) 
     100               ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Kaa) 
     101               ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Kaa) 
     102            END_3D 
     103         ENDIF 
     104         ! 
     105         ! TODO: NOT TESTED- requires ORCA2 
    93106         IF( l_LB_debug ) THEN 
    94107            ! Location of 1 known convection site to follow what's happening in the water column 
     
    101114         CALL bn2    ( pts(:,:,:,:,Kaa), zab, zn2, Kmm )    ! after Brunt-Vaisala  (given on W-points) 
    102115         ! 
    103          inpcc = 0 
     116         IF( ntile == 0 .OR. ntile == 1 ) nnpcc = 0         ! Do only on the first tile 
    104117         ! 
    105118         DO_2D( 0, 0, 0, 0 ) 
     
    160173                        ENDIF 
    161174                        ! 
    162                         IF( jiter == 1 )   inpcc = inpcc + 1  
     175                        IF( jiter == 1 )   nnpcc = nnpcc + 1 
    163176                        ! 
    164177                        IF( lp_monitor_point )   WRITE(numout, *) 'Negative N2 at ikp =',ikp,' for layer #', ilayer 
     
    301314         END_2D 
    302315         ! 
    303          IF( l_trdtra ) THEN         ! send the Non penetrative mixing trends for diagnostic 
     316         ! TEMP: These changes not necessary after trd_tra is tiled and extra haloes development (lbc_lnk removed) 
     317         IF( l_trdtra ) THEN 
    304318            z1_rDt = 1._wp / (2._wp * rn_Dt) 
    305             ztrdt(:,:,:) = ( pts(:,:,:,jp_tem,Kaa) - ztrdt(:,:,:) ) * z1_rDt 
    306             ztrds(:,:,:) = ( pts(:,:,:,jp_sal,Kaa) - ztrds(:,:,:) ) * z1_rDt 
    307             CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_npc, ztrdt ) 
    308             CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_npc, ztrds ) 
    309             DEALLOCATE( ztrdt, ztrds ) 
    310          ENDIF 
    311          ! 
    312          CALL lbc_lnk_multi( 'tranpc', pts(:,:,:,jp_tem,Kaa), 'T', 1.0_wp, pts(:,:,:,jp_sal,Kaa), 'T', 1.0_wp ) 
    313          ! 
    314          IF( lwp .AND. l_LB_debug ) THEN 
    315             WRITE(numout,*) 'Exiting tra_npc , kt = ',kt,', => numb. of statically instable water-columns: ', inpcc 
    316             WRITE(numout,*) 
     319 
     320            DO_3D( 0, 0, 0, 0, 1, jpk ) 
     321               ztrdt(ji,jj,jk) = ( pts(ji,jj,jk,jp_tem,Kaa) - ztrdt(ji,jj,jk) ) * z1_rDt 
     322               ztrds(ji,jj,jk) = ( pts(ji,jj,jk,jp_sal,Kaa) - ztrds(ji,jj,jk) ) * z1_rDt 
     323            END_3D 
     324         ENDIF 
     325 
     326         IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain 
     327            IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )         ! Use full domain 
     328 
     329            IF( l_trdtra ) THEN         ! send the Non penetrative mixing trends for diagnostic 
     330               ! TODO: TO BE TILED- trd_tra 
     331               CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_npc, ztrdt ) 
     332               CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_npc, ztrds ) 
     333               DEALLOCATE( ztrdt, ztrds ) 
     334            ENDIF 
     335 
     336            IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile )   ! Revert to tile domain 
     337            ! 
     338            CALL lbc_lnk_multi( 'tranpc', pts(:,:,:,jp_tem,Kaa), 'T', 1.0_wp, pts(:,:,:,jp_sal,Kaa), 'T', 1.0_wp ) 
     339            ! 
     340            IF( lwp .AND. l_LB_debug ) THEN 
     341               WRITE(numout,*) 'Exiting tra_npc , kt = ',kt,', => numb. of statically instable water-columns: ', nnpcc 
     342               WRITE(numout,*) 
     343            ENDIF 
    317344         ENDIF 
    318345         ! 
  • NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/TRA/trazdf.F90

    r13295 r13517  
    1414   USE oce            ! ocean dynamics and tracers variables 
    1515   USE dom_oce        ! ocean space and time domain variables  
     16   ! TEMP: This change not necessary after trd_tra is tiled 
     17   USE domain, ONLY : dom_tile 
    1618   USE domvvl         ! variable volume 
    1719   USE phycst         ! physical constant 
     
    5557      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts                 ! active tracers and RHS of tracer equation 
    5658      ! 
    57       INTEGER  ::   jk   ! Dummy loop indices 
    58       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt, ztrds   ! 3D workspace 
     59      INTEGER  ::   ji, jj, jk   ! Dummy loop indices 
     60      ! TEMP: This change not necessary after trd_tra is tiled 
     61      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE ::   ztrdt, ztrds   ! 3D workspace 
    5962      !!--------------------------------------------------------------------- 
    6063      ! 
     
    6265      ! 
    6366      IF( kt == nit000 )  THEN 
    64          IF(lwp)WRITE(numout,*) 
    65          IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S' 
    66          IF(lwp)WRITE(numout,*) '~~~~~~~ ' 
     67         IF( ntile == 0 .OR. ntile == 1 )  THEN                   ! Do only on the first tile 
     68            IF(lwp)WRITE(numout,*) 
     69            IF(lwp)WRITE(numout,*) 'tra_zdf : implicit vertical mixing on T & S' 
     70            IF(lwp)WRITE(numout,*) '~~~~~~~ ' 
     71         ENDIF 
    6772      ENDIF 
    6873      ! 
    6974      IF( l_trdtra )   THEN                  !* Save ta and sa trends 
    70          ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
    71          ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kaa) 
    72          ztrds(:,:,:) = pts(:,:,:,jp_sal,Kaa) 
     75         IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
     76            ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled 
     77            ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) ) 
     78         ENDIF 
     79 
     80         DO_3D( 0, 0, 0, 0, 1, jpk ) 
     81            ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Kaa) 
     82            ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Kaa) 
     83         END_3D 
    7384      ENDIF 
    7485      ! 
     
    8091      ! JMM avoid negative salinities near river outlet ! Ugly fix 
    8192      ! JMM : restore negative salinities to small salinities: 
    82       WHERE( pts(:,:,:,jp_sal,Kaa) < 0._wp )   pts(:,:,:,jp_sal,Kaa) = 0.1_wp 
     93      WHERE( pts(ST_2D(0),:,jp_sal,Kaa) < 0._wp )   pts(ST_2D(0),:,jp_sal,Kaa) = 0.1_wp 
    8394!!gm 
    8495 
     96      ! TEMP: These changes not necessary after trd_tra is tiled 
    8597      IF( l_trdtra )   THEN                      ! save the vertical diffusive trends for further diagnostics 
    86          DO jk = 1, jpkm1 
    87             ztrdt(:,:,jk) = (   (  pts(:,:,jk,jp_tem,Kaa)*e3t(:,:,jk,Kaa)     & 
    88                &                 - pts(:,:,jk,jp_tem,Kbb)*e3t(:,:,jk,Kbb)  )  & 
    89                &              / (  e3t(:,:,jk,Kmm)*rDt  )   )                 & 
    90                &          - ztrdt(:,:,jk) 
    91             ztrds(:,:,jk) = (   (  pts(:,:,jk,jp_sal,Kaa)*e3t(:,:,jk,Kaa)     & 
    92                &                 - pts(:,:,jk,jp_sal,Kbb)*e3t(:,:,jk,Kbb)  )  & 
    93                &             / (   e3t(:,:,jk,Kmm)*rDt  )   )                 & 
    94                &          - ztrds(:,:,jk) 
    95          END DO 
    96 !!gm this should be moved in trdtra.F90 and done on all trends 
    97          CALL lbc_lnk_multi( 'trazdf', ztrdt, 'T', 1.0_wp , ztrds, 'T', 1.0_wp ) 
    98 !!gm 
    99          CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 
    100          CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_zdf, ztrds ) 
    101          DEALLOCATE( ztrdt , ztrds ) 
     98         DO_3D( 0, 0, 0, 0, 1, jpk ) 
     99            ztrdt(ji,jj,jk) = ( ( pts(ji,jj,jk,jp_tem,Kaa)*e3t(ji,jj,jk,Kaa) - pts(ji,jj,jk,jp_tem,Kbb)*e3t(ji,jj,jk,Kbb) ) & 
     100               &          / (e3t(ji,jj,jk,Kmm)*rDt) ) - ztrdt(ji,jj,jk) 
     101            ztrds(ji,jj,jk) = ( ( pts(ji,jj,jk,jp_sal,Kaa)*e3t(ji,jj,jk,Kaa) - pts(ji,jj,jk,jp_sal,Kbb)*e3t(ji,jj,jk,Kbb) ) & 
     102              &           / (e3t(ji,jj,jk,Kmm)*rDt) ) - ztrds(ji,jj,jk) 
     103         END_3D 
     104 
     105         IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain 
     106            IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )         ! Use full domain 
     107 
     108            ! TODO: TO BE TILED- trd_tra 
     109            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 
     110            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_zdf, ztrds ) 
     111            DEALLOCATE( ztrdt , ztrds ) 
     112 
     113            IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile )   ! Revert to tile domain 
     114         ENDIF 
    102115      ENDIF 
    103116      !                                          ! print mean trends (used for debugging) 
     
    140153      INTEGER  ::  ji, jj, jk, jn   ! dummy loop indices 
    141154      REAL(wp) ::  zrhs, zzwi, zzws ! local scalars 
    142       REAL(wp), DIMENSION(jpi,jpj,jpk) ::  zwi, zwt, zwd, zws 
     155      REAL(wp), DIMENSION(ST_2D(nn_hls),jpk) ::  zwi, zwt, zwd, zws 
    143156      !!--------------------------------------------------------------------- 
    144157      ! 
     
    154167            ! 
    155168            ! vertical mixing coef.: avt for temperature, avs for salinity and passive tracers 
    156             IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN   ;   zwt(:,:,2:jpk) = avt(:,:,2:jpk) 
    157             ELSE                                            ;   zwt(:,:,2:jpk) = avs(:,:,2:jpk) 
     169            IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN 
     170               DO_3D( 1, 1, 1, 1, 2, jpk ) 
     171                  zwt(ji,jj,jk) = avt(ji,jj,jk) 
     172               END_3D 
     173            ELSE 
     174               DO_3D( 1, 1, 1, 1, 2, jpk ) 
     175                  zwt(ji,jj,jk) = avs(ji,jj,jk) 
     176               END_3D 
    158177            ENDIF 
    159178            zwt(:,:,1) = 0._wp 
     
    222241         END_2D 
    223242         DO_3D( 0, 0, 0, 0, 2, jpkm1 ) 
    224             zrhs =        e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb)    &  
     243            zrhs =        e3t(ji,jj,jk,Kbb) * pt(ji,jj,jk,jn,Kbb)    & 
    225244               & + p2dt * e3t(ji,jj,jk,Kmm) * pt(ji,jj,jk,jn,Krhs)   ! zrhs=right hand side 
    226245            pt(ji,jj,jk,jn,Kaa) = zrhs - zwi(ji,jj,jk) / zwt(ji,jj,jk-1) * pt(ji,jj,jk-1,jn,Kaa) 
  • NEMO/branches/2020/dev_r13383_HPC-02_Daley_Tiling/src/OCE/ZDF/zdfosm.F90

    r13295 r13517  
    4444                      ! uses ww from previous time step (which is now wb) to calculate hbl 
    4545   USE dom_oce        ! ocean space and time domain 
     46   ! TEMP: This change not necessary after trd_tra is tiled 
     47   USE domain, ONLY : dom_tile 
    4648   USE zdf_oce        ! ocean vertical physics 
    4749   USE sbc_oce        ! surface boundary condition: ocean 
     
    14961498     !!----------------------------------------------------------------------------- 
    14971499     IF( TRIM(cdrw) == 'WRITE') THEN     !* Write hbli into the restart file, then return 
     1500        IF( ntile /= 0 .AND. ntile /= nijtile ) RETURN        ! Do only on the last tile 
     1501 
    14981502        IF(lwp) WRITE(numout,*) '---- osm-rst ----' 
    14991503         CALL iom_rstput( kt, nitrst, numrow, 'wn'     , ww  , ldxios = lwxios ) 
     
    15411545      !! ** Method  :   ??? 
    15421546      !!---------------------------------------------------------------------- 
    1543       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   ztrdt, ztrds   ! 3D workspace 
     1547      ! TEMP: This change not necessary after trd_tra is tiled 
     1548      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, SAVE ::   ztrdt, ztrds   ! 3D workspace 
    15441549      !!---------------------------------------------------------------------- 
    15451550      INTEGER                                  , INTENT(in)    :: kt        ! time step index 
     
    15501555      ! 
    15511556      IF( kt == nit000 ) THEN 
    1552          IF(lwp) WRITE(numout,*) 
    1553          IF(lwp) WRITE(numout,*) 'tra_osm : OSM non-local tracer fluxes' 
    1554          IF(lwp) WRITE(numout,*) '~~~~~~~   ' 
     1557         IF( ntile == 0 .OR. ntile == 1 ) THEN                    ! Do only on the first tile 
     1558            IF(lwp) WRITE(numout,*) 
     1559            IF(lwp) WRITE(numout,*) 'tra_osm : OSM non-local tracer fluxes' 
     1560            IF(lwp) WRITE(numout,*) '~~~~~~~   ' 
     1561         ENDIF 
    15551562      ENDIF 
    15561563 
    15571564      IF( l_trdtra )   THEN                    !* Save ta and sa trends 
    1558          ALLOCATE( ztrdt(jpi,jpj,jpk) )   ;    ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) 
    1559          ALLOCATE( ztrds(jpi,jpj,jpk) )   ;    ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) 
     1565         IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
     1566            ! TEMP: This can be ST_2D(nn_hls) after trd_tra is tiled 
     1567            ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) ) 
     1568         ENDIF 
     1569 
     1570         DO_3D( 0, 0, 0, 0, 1, jpk ) 
     1571            ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Krhs) 
     1572            ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Krhs) 
     1573         END_3D 
    15601574      ENDIF 
    15611575 
     
    15701584      END_3D 
    15711585 
    1572  
     1586      ! TEMP: These changes not necessary after trd_tra is tiled 
    15731587      ! save the non-local tracer flux trends for diagnostic 
    15741588      IF( l_trdtra )   THEN 
    1575          ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:) 
    1576          ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:) 
     1589         DO_3D( 0, 0, 0, 0, 1, jpk ) 
     1590            ztrdt(ji,jj,jk) = pts(ji,jj,jk,jp_tem,Krhs) - ztrdt(ji,jj,jk) 
     1591            ztrds(ji,jj,jk) = pts(ji,jj,jk,jp_sal,Krhs) - ztrds(ji,jj,jk) 
     1592         END_3D 
     1593 
     1594         IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only for the full domain 
     1595            IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = 0 )         ! Use full domain 
     1596 
    15771597!!bug gm jpttdzdf ==> jpttosm 
    1578          CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 
    1579          CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_zdf, ztrds ) 
    1580          DEALLOCATE( ztrdt )      ;     DEALLOCATE( ztrds ) 
     1598            ! TODO: TO BE TILED- trd_tra 
     1599            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_zdf, ztrdt ) 
     1600            CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_zdf, ztrds ) 
     1601            DEALLOCATE( ztrdt )      ;     DEALLOCATE( ztrds ) 
     1602 
     1603            IF( ln_tile ) CALL dom_tile( ntsi, ntsj, ntei, ntej, ktile = nijtile )   ! Revert to tile domain 
     1604         ENDIF 
    15811605      ENDIF 
    15821606 
Note: See TracChangeset for help on using the changeset viewer.