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 14789 for NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/TRA/trasbc.F90 – NEMO

Ignore:
Timestamp:
2021-05-05T13:18:04+02:00 (3 years ago)
Author:
mcastril
Message:

[2021/HPC-11_mcastril_HPDAonline_DiagGPU] Update externals

Location:
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
         5^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8^/vendors/PPR@HEAD            ext/PPR 
        89 
        910# SETTE 
        10 ^/utils/CI/sette@13559        sette 
         11^/utils/CI/sette@14244        sette 
  • NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/TRA/trasbc.F90

    r13497 r14789  
    99   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  Forcing averaged over 2 time steps 
    1010   !!             -   !  2010-09  (C. Ethe, G. Madec) Merge TRA-TRC 
    11    !!            3.6  !  2014-11  (P. Mathiot) isf melting forcing  
     11   !!            3.6  !  2014-11  (P. Mathiot) isf melting forcing 
    1212   !!            4.1  !  2019-09  (P. Mathiot) isf moved in traisf 
    1313   !!---------------------------------------------------------------------- 
     
    2121   USE phycst         ! physical constant 
    2222   USE eosbn2         ! Equation Of State 
    23    USE sbcmod         ! ln_rnf   
    24    USE sbcrnf         ! River runoff   
     23   USE sbcmod         ! ln_rnf 
     24   USE sbcrnf         ! River runoff 
    2525   USE traqsr         ! solar radiation penetration 
    2626   USE trd_oce        ! trends: ocean variables 
    27    USE trdtra         ! trends manager: tracers  
    28 #if defined key_asminc    
     27   USE trdtra         ! trends manager: tracers 
     28#if defined key_asminc 
    2929   USE asminc         ! Assimilation increment 
    3030#endif 
     
    5454      !!---------------------------------------------------------------------- 
    5555      !!                  ***  ROUTINE tra_sbc  *** 
    56       !!                    
     56      !! 
    5757      !! ** Purpose :   Compute the tracer surface boundary condition trend of 
    5858      !!      (flux through the interface, concentration/dilution effect) 
    5959      !!      and add it to the general trend of tracer equations. 
    6060      !! 
    61       !! ** Method :   The (air+ice)-sea flux has two components:  
    62       !!      (1) Fext, external forcing (i.e. flux through the (air+ice)-sea interface);  
    63       !!      (2) Fwe , tracer carried with the water that is exchanged with air+ice.  
     61      !! ** Method :   The (air+ice)-sea flux has two components: 
     62      !!      (1) Fext, external forcing (i.e. flux through the (air+ice)-sea interface); 
     63      !!      (2) Fwe , tracer carried with the water that is exchanged with air+ice. 
    6464      !!               The input forcing fields (emp, rnf, sfx) contain Fext+Fwe, 
    6565      !!             they are simply added to the tracer trend (ts(Krhs)). 
     
    6969      !!             concentration/dilution effect associated with water exchanges. 
    7070      !! 
    71       !! ** Action  : - Update ts(Krhs) with the surface boundary condition trend  
     71      !! ** Action  : - Update ts(Krhs) with the surface boundary condition trend 
    7272      !!              - send trends to trdtra module for further diagnostics(l_trdtra=T) 
    7373      !!---------------------------------------------------------------------- 
    74       INTEGER,                                   INTENT(in   ) :: kt         ! ocean time-step index 
    75       INTEGER,                                   INTENT(in   ) :: Kmm, Krhs  ! time level indices 
    76       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts        ! active tracers and RHS of tracer equation 
    77       ! 
    78       INTEGER  ::   ji, jj, jk, jn              ! dummy loop indices   
    79       INTEGER  ::   ikt, ikb                    ! local integers 
    80       REAL(wp) ::   zfact, z1_e3t, zdep, ztim   ! local scalar 
     74      INTEGER,                                   INTENT(in   ) ::   kt         ! ocean time-step index 
     75      INTEGER,                                   INTENT(in   ) ::   Kmm, Krhs  ! time level indices 
     76      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) ::   pts        ! active tracers and RHS of tracer Eq. 
     77      ! 
     78      INTEGER  ::   ji, jj, jk, jn               ! dummy loop indices 
     79      INTEGER  ::   ikt, ikb, isi, iei, isj, iej ! local integers 
     80      REAL(wp) ::   zfact, z1_e3t, zdep, ztim    ! local scalar 
    8181      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::  ztrdt, ztrds 
    8282      !!---------------------------------------------------------------------- 
     
    8484      IF( ln_timing )   CALL timing_start('tra_sbc') 
    8585      ! 
    86       IF( kt == nit000 ) THEN 
    87          IF(lwp) WRITE(numout,*) 
    88          IF(lwp) WRITE(numout,*) 'tra_sbc : TRAcer Surface Boundary Condition' 
    89          IF(lwp) WRITE(numout,*) '~~~~~~~ ' 
     86      IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
     87         IF( kt == nit000 ) THEN 
     88            IF(lwp) WRITE(numout,*) 
     89            IF(lwp) WRITE(numout,*) 'tra_sbc : TRAcer Surface Boundary Condition' 
     90            IF(lwp) WRITE(numout,*) '~~~~~~~ ' 
     91         ENDIF 
    9092      ENDIF 
    9193      ! 
    9294      IF( l_trdtra ) THEN                    !* Save ta and sa trends 
    93          ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) )  
     95         ALLOCATE( ztrdt(jpi,jpj,jpk), ztrds(jpi,jpj,jpk) ) 
    9496         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) 
    9597         ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) 
    9698      ENDIF 
    9799      ! 
     100      IF( ntsi == Nis0 ) THEN ; isi = nn_hls ; ELSE ; isi = 0 ; ENDIF    ! Avoid double-counting when using tiling 
     101      IF( ntsj == Njs0 ) THEN ; isj = nn_hls ; ELSE ; isj = 0 ; ENDIF 
     102      IF( ntei == Nie0 ) THEN ; iei = nn_hls ; ELSE ; iei = 0 ; ENDIF 
     103      IF( ntej == Nje0 ) THEN ; iej = nn_hls ; ELSE ; iej = 0 ; ENDIF 
     104 
    98105!!gm  This should be moved into sbcmod.F90 module ? (especially now that ln_traqsr is read in namsbc namelist) 
    99106      IF( .NOT.ln_traqsr ) THEN     ! no solar radiation penetration 
    100          qns(:,:) = qns(:,:) + qsr(:,:)      ! total heat flux in qns 
    101          qsr(:,:) = 0._wp                     ! qsr set to zero 
     107         DO_2D( isi, iei, isj, iej ) 
     108            qns(ji,jj) = qns(ji,jj) + qsr(ji,jj)      ! total heat flux in qns 
     109            qsr(ji,jj) = 0._wp                        ! qsr set to zero 
     110         END_2D 
    102111      ENDIF 
    103112 
     
    107116      !                             !==  Set before sbc tracer content fields  ==! 
    108117      IF( kt == nit000 ) THEN             !* 1st time-step 
    109          IF( ln_rstart .AND.    &               ! Restart: read in restart file 
    110               & iom_varid( numror, 'sbc_hc_b', ldstop = .FALSE. ) > 0 ) THEN 
    111             IF(lwp) WRITE(numout,*) '          nit000-1 sbc tracer content field read in the restart file' 
     118         IF( ln_rstart .AND. .NOT.l_1st_euler ) THEN      ! Restart: read in restart file 
    112119            zfact = 0.5_wp 
    113             sbc_tsc(:,:,:) = 0._wp 
    114             CALL iom_get( numror, jpdom_auto, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem), ldxios = lrxios )   ! before heat content sbc trend 
    115             CALL iom_get( numror, jpdom_auto, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal), ldxios = lrxios )   ! before salt content sbc trend 
    116          ELSE                                   ! No restart or restart not found: Euler forward time stepping 
     120            IF( ntile == 0 .OR. ntile == 1 )  THEN                       ! Do only on the first tile 
     121               IF(lwp) WRITE(numout,*) '          nit000-1 sbc tracer content field read in the restart file' 
     122               sbc_tsc(:,:,:) = 0._wp 
     123               CALL iom_get( numror, jpdom_auto, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem) )   ! before heat content sbc trend 
     124               CALL iom_get( numror, jpdom_auto, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal) )   ! before salt content sbc trend 
     125            ENDIF 
     126         ELSE                                             ! No restart or restart not found: Euler forward time stepping 
    117127            zfact = 1._wp 
    118             sbc_tsc(:,:,:) = 0._wp 
    119             sbc_tsc_b(:,:,:) = 0._wp 
     128            DO_2D( isi, iei, isj, iej ) 
     129               sbc_tsc(ji,jj,:) = 0._wp 
     130               sbc_tsc_b(ji,jj,:) = 0._wp 
     131            END_2D 
    120132         ENDIF 
    121133      ELSE                                !* other time-steps: swap of forcing fields 
    122134         zfact = 0.5_wp 
    123          sbc_tsc_b(:,:,:) = sbc_tsc(:,:,:) 
     135         DO_2D( isi, iei, isj, iej ) 
     136            sbc_tsc_b(ji,jj,:) = sbc_tsc(ji,jj,:) 
     137         END_2D 
    124138      ENDIF 
    125139      !                             !==  Now sbc tracer content fields  ==! 
    126       DO_2D( 0, 1, 0, 0 ) 
     140      DO_2D( isi, iei, isj, iej ) 
    127141         sbc_tsc(ji,jj,jp_tem) = r1_rho0_rcp * qns(ji,jj)   ! non solar heat flux 
    128142         sbc_tsc(ji,jj,jp_sal) = r1_rho0     * sfx(ji,jj)   ! salt flux due to freezing/melting 
    129143      END_2D 
    130       IF( ln_linssh ) THEN                !* linear free surface   
    131          DO_2D( 0, 1, 0, 0 )                    !==>> add concentration/dilution effect due to constant volume cell 
     144      IF( ln_linssh ) THEN                !* linear free surface 
     145         DO_2D( isi, iei, isj, iej )                    !==>> add concentration/dilution effect due to constant volume cell 
    132146            sbc_tsc(ji,jj,jp_tem) = sbc_tsc(ji,jj,jp_tem) + r1_rho0 * emp(ji,jj) * pts(ji,jj,1,jp_tem,Kmm) 
    133147            sbc_tsc(ji,jj,jp_sal) = sbc_tsc(ji,jj,jp_sal) + r1_rho0 * emp(ji,jj) * pts(ji,jj,1,jp_sal,Kmm) 
    134148         END_2D                                 !==>> output c./d. term 
    135          IF( iom_use('emp_x_sst') )   CALL iom_put( "emp_x_sst", emp (:,:) * pts(:,:,1,jp_tem,Kmm) ) 
    136          IF( iom_use('emp_x_sss') )   CALL iom_put( "emp_x_sss", emp (:,:) * pts(:,:,1,jp_sal,Kmm) ) 
     149         IF( ntile == 0 .OR. ntile == nijtile )  THEN             ! Do only on the last tile 
     150            IF( iom_use('emp_x_sst') )   CALL iom_put( "emp_x_sst", emp (:,:) * pts(:,:,1,jp_tem,Kmm) ) 
     151            IF( iom_use('emp_x_sss') )   CALL iom_put( "emp_x_sss", emp (:,:) * pts(:,:,1,jp_sal,Kmm) ) 
     152         ENDIF 
    137153      ENDIF 
    138154      ! 
    139155      DO jn = 1, jpts               !==  update tracer trend  ==! 
    140          DO_2D( 0, 1, 0, 0 ) 
     156         DO_2D( 0, 0, 0, 0 ) 
    141157            pts(ji,jj,1,jn,Krhs) = pts(ji,jj,1,jn,Krhs) + zfact * ( sbc_tsc_b(ji,jj,jn) + sbc_tsc(ji,jj,jn) )    & 
    142158               &                                                / e3t(ji,jj,1,Kmm) 
    143159         END_2D 
    144160      END DO 
    145       !                   
    146       IF( lrst_oce ) THEN           !==  write sbc_tsc in the ocean restart file  ==! 
    147          IF( lwxios ) CALL iom_swap(      cwxios_context          ) 
    148          CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem), ldxios = lwxios ) 
    149          CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_tsc(:,:,jp_sal), ldxios = lwxios ) 
    150          IF( lwxios ) CALL iom_swap(      cxios_context          ) 
     161      ! 
     162      IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
     163         IF( lrst_oce ) THEN           !==  write sbc_tsc in the ocean restart file  ==! 
     164            CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem) ) 
     165            CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_tsc(:,:,jp_sal) ) 
     166         ENDIF 
    151167      ENDIF 
    152168      ! 
     
    155171      !---------------------------------------- 
    156172      ! 
    157       IF( ln_rnf ) THEN         ! input of heat and salt due to river runoff  
     173      IF( ln_rnf ) THEN         ! input of heat and salt due to river runoff 
    158174         zfact = 0.5_wp 
    159          DO_2D( 0, 1, 0, 0 ) 
     175         DO_2D( 0, 0, 0, 0 ) 
    160176            IF( rnf(ji,jj) /= 0._wp ) THEN 
    161177               zdep = zfact / h_rnf(ji,jj) 
     
    164180                                        &                      +  ( rnf_tsc_b(ji,jj,jp_tem) + rnf_tsc(ji,jj,jp_tem) ) * zdep 
    165181                  IF( ln_rnf_sal )   pts(ji,jj,jk,jp_sal,Krhs) = pts(ji,jj,jk,jp_sal,Krhs)                                  & 
    166                                         &                      +  ( rnf_tsc_b(ji,jj,jp_sal) + rnf_tsc(ji,jj,jp_sal) ) * zdep  
     182                                        &                      +  ( rnf_tsc_b(ji,jj,jp_sal) + rnf_tsc(ji,jj,jp_sal) ) * zdep 
    167183               END DO 
    168184            ENDIF 
     
    170186      ENDIF 
    171187 
    172       IF( iom_use('rnf_x_sst') )   CALL iom_put( "rnf_x_sst", rnf*pts(:,:,1,jp_tem,Kmm) )   ! runoff term on sst 
    173       IF( iom_use('rnf_x_sss') )   CALL iom_put( "rnf_x_sss", rnf*pts(:,:,1,jp_sal,Kmm) )   ! runoff term on sss 
     188      IF( ntile == 0 .OR. ntile == nijtile )  THEN                ! Do only on the last tile 
     189         IF( iom_use('rnf_x_sst') )   CALL iom_put( "rnf_x_sst", rnf*pts(:,:,1,jp_tem,Kmm) )   ! runoff term on sst 
     190         IF( iom_use('rnf_x_sss') )   CALL iom_put( "rnf_x_sss", rnf*pts(:,:,1,jp_sal,Kmm) )   ! runoff term on sss 
     191      ENDIF 
    174192 
    175193#if defined key_asminc 
     
    181199      IF( ln_sshinc ) THEN         ! input of heat and salt due to assimilation 
    182200          ! 
    183          IF( ln_linssh ) THEN  
    184             DO_2D( 0, 1, 0, 0 ) 
     201         IF( ln_linssh ) THEN 
     202            DO_2D( 0, 0, 0, 0 ) 
    185203               ztim = ssh_iau(ji,jj) / e3t(ji,jj,1,Kmm) 
    186204               pts(ji,jj,1,jp_tem,Krhs) = pts(ji,jj,1,jp_tem,Krhs) + pts(ji,jj,1,jp_tem,Kmm) * ztim 
     
    188206            END_2D 
    189207         ELSE 
    190             DO_2D( 0, 1, 0, 0 ) 
     208            DO_2D( 0, 0, 0, 0 ) 
    191209               ztim = ssh_iau(ji,jj) / ( ht(ji,jj) + 1. - ssmask(ji, jj) ) 
    192210               pts(ji,jj,:,jp_tem,Krhs) = pts(ji,jj,:,jp_tem,Krhs) + pts(ji,jj,:,jp_tem,Kmm) * ztim 
     
    204222         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_nsr, ztrdt ) 
    205223         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_nsr, ztrds ) 
    206          DEALLOCATE( ztrdt , ztrds )  
     224         DEALLOCATE( ztrdt , ztrds ) 
    207225      ENDIF 
    208226      ! 
Note: See TracChangeset for help on using the changeset viewer.