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 14017 for NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/TRA/traatf.F90 – NEMO

Ignore:
Timestamp:
2020-12-02T16:32:24+01:00 (4 years ago)
Author:
laurent
Message:

Keep up with trunk revision 13999

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/TRA/traatf.F90

    r13295 r14017  
    2626   !!---------------------------------------------------------------------- 
    2727   USE oce             ! ocean dynamics and tracers variables 
    28    USE dom_oce         ! ocean space and time domain variables  
     28   USE dom_oce         ! ocean space and time domain variables 
    2929   USE sbc_oce         ! surface boundary condition: ocean 
    3030   USE sbcrnf          ! river runoffs 
     
    3333   USE domvvl          ! variable volume 
    3434   USE trd_oce         ! trends: ocean variables 
    35    USE trdtra          ! trends manager: tracers  
     35   USE trdtra          ! trends manager: tracers 
    3636   USE traqsr          ! penetrative solar radiation (needed for nksr) 
    3737   USE phycst          ! physical constant 
     
    7070      !!                   ***  ROUTINE traatf  *** 
    7171      !! 
    72       !! ** Purpose :   Apply the boundary condition on the after temperature   
     72      !! ** Purpose :   Apply the boundary condition on the after temperature 
    7373      !!             and salinity fields and add the Asselin time filter on now fields. 
    74       !!  
    75       !! ** Method  :   At this stage of the computation, ta and sa are the  
     74      !! 
     75      !! ** Method  :   At this stage of the computation, ta and sa are the 
    7676      !!             after temperature and salinity as the time stepping has 
    7777      !!             been performed in trazdf_imp or trazdf_exp module. 
    7878      !! 
    79       !!              - Apply lateral boundary conditions on (ta,sa)  
    80       !!             at the local domain   boundaries through lbc_lnk call,  
    81       !!             at the one-way open boundaries (ln_bdy=T),  
     79      !!              - Apply lateral boundary conditions on (ta,sa) 
     80      !!             at the local domain   boundaries through lbc_lnk call, 
     81      !!             at the one-way open boundaries (ln_bdy=T), 
    8282      !!             at the AGRIF zoom   boundaries (lk_agrif=T) 
    8383      !! 
     
    8989      INTEGER                                  , INTENT(in   ) :: kt             ! ocean time-step index 
    9090      INTEGER                                  , INTENT(in   ) :: Kbb, Kmm, Kaa  ! time level indices 
    91       REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts            ! active tracers  
     91      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts            ! active tracers 
    9292      !! 
    9393      INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices 
     
    105105 
    106106      ! Update after tracer on domain lateral boundaries 
    107       !  
     107      ! 
    108108#if defined key_agrif 
    109109      CALL Agrif_tra                     ! AGRIF zoom boundaries 
     
    113113      ! 
    114114      IF( ln_bdy )   CALL bdy_tra( kt, Kbb, pts, Kaa )  ! BDY open boundaries 
    115   
     115 
    116116      ! trends computation initialisation 
    117       IF( l_trdtra )   THEN                     
     117      IF( l_trdtra )   THEN 
    118118         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
    119119         ztrdt(:,:,jpk) = 0._wp 
    120120         ztrds(:,:,jpk) = 0._wp 
    121          IF( ln_traldf_iso ) THEN              ! diagnose the "pure" Kz diffusive trend  
     121         IF( ln_traldf_iso ) THEN              ! diagnose the "pure" Kz diffusive trend 
    122122            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_tem, jptra_zdfp, ztrdt ) 
    123123            CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_zdfp, ztrds ) 
    124124         ENDIF 
    125          ! total trend for the non-time-filtered variables.  
     125         ! total trend for the non-time-filtered variables. 
    126126         zfact = 1.0 / rn_Dt 
    127127         ! G Nurser 23 Mar 2017. Recalculate trend as Delta(e3t*T)/e3tn; e3tn cancel from pts(Kmm) terms 
     
    133133         CALL trd_tra( kt, Kmm, Kaa, 'TRA', jp_sal, jptra_tot, ztrds ) 
    134134         IF( ln_linssh ) THEN       ! linear sea surface height only 
    135             ! Store now fields before applying the Asselin filter  
     135            ! Store now fields before applying the Asselin filter 
    136136            ! in order to calculate Asselin filter trend later. 
    137             ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kmm)  
     137            ztrdt(:,:,:) = pts(:,:,:,jp_tem,Kmm) 
    138138            ztrds(:,:,:) = pts(:,:,:,jp_sal,Kmm) 
    139139         ENDIF 
    140140      ENDIF 
    141141 
    142       IF( l_1st_euler ) THEN       ! Euler time-stepping  
     142      IF( l_1st_euler ) THEN       ! Euler time-stepping 
    143143         ! 
    144144         IF (l_trdtra .AND. .NOT. ln_linssh ) THEN   ! Zero Asselin filter contribution must be explicitly written out since for vvl 
     
    152152      ELSE                                            ! Leap-Frog + Asselin filter time stepping 
    153153         ! 
    154          IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000,        'TRA', pts, jpts )  ! linear free surface  
     154         IF( ln_linssh ) THEN   ;   CALL tra_atf_fix( kt, Kbb, Kmm, Kaa, nit000,        'TRA', pts, jpts )  ! linear free surface 
    155155         ELSE                   ;   CALL tra_atf_vvl( kt, Kbb, Kmm, Kaa, nit000, rn_Dt, 'TRA', pts, sbc_tsc, sbc_tsc_b, jpts )  ! non-linear free surface 
    156156         ENDIF 
    157157         ! 
    158          CALL lbc_lnk_multi( 'traatf', pts(:,:,:,jp_tem,Kbb) , 'T', 1.0_wp, pts(:,:,:,jp_sal,Kbb) , 'T', 1.0_wp, & 
    159                   &                    pts(:,:,:,jp_tem,Kmm) , 'T', 1.0_wp, pts(:,:,:,jp_sal,Kmm) , 'T', 1.0_wp, & 
    160                   &                    pts(:,:,:,jp_tem,Kaa), 'T', 1.0_wp, pts(:,:,:,jp_sal,Kaa), 'T', 1.0_wp  ) 
    161          ! 
    162       ENDIF      
    163       ! 
    164       IF( l_trdtra .AND. ln_linssh ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt      
     158         CALL lbc_lnk_multi( 'traatf',  pts(:,:,:,jp_tem,Kmm) , 'T', 1.0_wp, pts(:,:,:,jp_sal,Kmm) , 'T', 1.0_wp ) 
     159 
     160      ENDIF 
     161      ! 
     162      IF( l_trdtra .AND. ln_linssh ) THEN      ! trend of the Asselin filter (tb filtered - tb)/dt 
    165163         DO jk = 1, jpkm1 
    166164            ztrdt(:,:,jk) = ( pts(:,:,jk,jp_tem,Kmm) - ztrdt(:,:,jk) ) * r1_Dt 
     
    186184      !! 
    187185      !! ** Purpose :   fixed volume: apply the Asselin time filter to the "now" field 
    188       !!  
     186      !! 
    189187      !! ** Method  : - Apply a Asselin time filter on now fields. 
    190188      !! 
     
    210208      DO jn = 1, kjpt 
    211209         ! 
    212          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
    213             ztn = pt(ji,jj,jk,jn,Kmm)                                     
     210         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 ) 
     211            ztn = pt(ji,jj,jk,jn,Kmm) 
    214212            ztd = pt(ji,jj,jk,jn,Kaa) - 2._wp * ztn + pt(ji,jj,jk,jn,Kbb)  ! time laplacian on tracers 
    215213            ! 
     
    226224      !!                   ***  ROUTINE tra_atf_vvl  *** 
    227225      !! 
    228       !! ** Purpose :   Time varying volume: apply the Asselin time filter   
    229       !!  
     226      !! ** Purpose :   Time varying volume: apply the Asselin time filter 
     227      !! 
    230228      !! ** Method  : - Apply a thickness weighted Asselin time filter on now fields. 
    231229      !!             pt(Kmm)  = ( e3t_Kmm*pt(Kmm) + rn_atfp*[ e3t_Kbb*pt(Kbb) - 2 e3t_Kmm*pt(Kmm) + e3t_Kaa*pt(Kaa) ] ) 
     
    257255      ENDIF 
    258256      ! 
    259       IF( cdtype == 'TRA' )  THEN    
     257      IF( cdtype == 'TRA' )  THEN 
    260258         ll_traqsr  = ln_traqsr        ! active  tracers case  and  solar penetration 
    261259         ll_rnf     = ln_rnf           ! active  tracers case  and  river runoffs 
     
    263261      ELSE                          ! passive tracers case 
    264262         ll_traqsr  = .FALSE.          ! NO solar penetration 
    265          ll_rnf     = .FALSE.          ! NO river runoffs ????          !!gm BUG ?   
    266          ll_isf     = .FALSE.          ! NO ice shelf melting/freezing  !!gm BUG ??  
     263         ll_rnf     = .FALSE.          ! NO river runoffs ????          !!gm BUG ? 
     264         ll_isf     = .FALSE.          ! NO ice shelf melting/freezing  !!gm BUG ?? 
    267265      ENDIF 
    268266      ! 
     
    274272      zfact1 = rn_atfp * p2dt 
    275273      zfact2 = zfact1 * r1_rho0 
    276       DO jn = 1, kjpt       
    277          DO_3D( 0, 0, 0, 0, 1, jpkm1 ) 
     274      DO jn = 1, kjpt 
     275         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 ) 
    278276            ze3t_b = e3t(ji,jj,jk,Kbb) 
    279277            ze3t_n = e3t(ji,jj,jk,Kmm) 
     
    291289            ! 
    292290            ! Add asselin correction on scale factors: 
    293             zscale = tmask(ji,jj,jk) * e3t(ji,jj,jk,Kmm) / ( ht(ji,jj) + 1._wp - ssmask(ji,jj) )  
    294             ze3t_f = ze3t_f - zfact2 * zscale * ( emp_b(ji,jj) - emp(ji,jj) )  
    295             IF ( ll_rnf ) ze3t_f = ze3t_f + zfact2 * zscale * (    rnf_b(ji,jj) -    rnf(ji,jj) )  
     291            zscale = tmask(ji,jj,jk) * e3t(ji,jj,jk,Kmm) / ( ht(ji,jj) + 1._wp - ssmask(ji,jj) ) 
     292            ze3t_f = ze3t_f - zfact2 * zscale * ( emp_b(ji,jj) - emp(ji,jj) ) 
     293            IF ( ll_rnf ) ze3t_f = ze3t_f + zfact2 * zscale * (    rnf_b(ji,jj) -    rnf(ji,jj) ) 
    296294            IF ( ll_isf ) THEN 
    297295               IF ( ln_isfcav_mlt ) ze3t_f = ze3t_f - zfact2 * zscale * ( fwfisf_cav_b(ji,jj) - fwfisf_cav(ji,jj) ) 
     
    299297            ENDIF 
    300298            ! 
    301             IF( jk == mikt(ji,jj) ) THEN           ! first level  
     299            IF( jk == mikt(ji,jj) ) THEN           ! first level 
    302300               ztc_f  = ztc_f  - zfact1 * ( psbc_tc(ji,jj,jn) - psbc_tc_b(ji,jj,jn) ) 
    303301            ENDIF 
    304302            ! 
    305303            ! solar penetration (temperature only) 
    306             IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )                            &  
    307                &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) )  
     304            IF( ll_traqsr .AND. jn == jp_tem .AND. jk <= nksr )                            & 
     305               &     ztc_f  = ztc_f  - zfact1 * ( qsr_hc(ji,jj,jk) - qsr_hc_b(ji,jj,jk) ) 
    308306               ! 
    309307            ! 
    310308            IF( ll_rnf .AND. jk <= nk_rnf(ji,jj) )                                          & 
    311                &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) &  
     309               &     ztc_f  = ztc_f  - zfact1 * ( rnf_tsc(ji,jj,jn) - rnf_tsc_b(ji,jj,jn) ) & 
    312310               &                              * e3t(ji,jj,jk,Kmm) / h_rnf(ji,jj) 
    313311 
     
    323321                        &                     * e3t(ji,jj,jk,Kmm) / rhisf_tbl_cav(ji,jj) 
    324322                  END IF 
    325                   ! level partially include in Losch_2008 ice shelf boundary layer  
     323                  ! level partially include in Losch_2008 ice shelf boundary layer 
    326324                  IF ( jk == misfkb_cav(ji,jj) ) THEN 
    327325                     ztc_f  = ztc_f  - zfact1 * ( risf_cav_tsc(ji,jj,jn) - risf_cav_tsc_b(ji,jj,jn) )  & 
     
    337335                            &                 * e3t(ji,jj,jk,Kmm) / rhisf_tbl_par(ji,jj) 
    338336                  END IF 
    339                   ! level partially include in Losch_2008 ice shelf boundary layer  
     337                  ! level partially include in Losch_2008 ice shelf boundary layer 
    340338                  IF ( jk == misfkb_par(ji,jj) ) THEN 
    341339                     ztc_f  = ztc_f  - zfact1 * ( risf_par_tsc(ji,jj,jn) - risf_par_tsc_b(ji,jj,jn) )  & 
     
    366364            ! 
    367365         END_3D 
    368          !  
     366         ! 
    369367      END DO 
    370368      ! 
    371369      IF( ( l_trdtra .AND. cdtype == 'TRA' ) .OR. ( l_trdtrc .AND. cdtype == 'TRC' ) )   THEN 
    372          IF( l_trdtra .AND. cdtype == 'TRA' ) THEN  
     370         IF( l_trdtra .AND. cdtype == 'TRA' ) THEN 
    373371            CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_tem, jptra_atf, ztrd_atf(:,:,:,jp_tem) ) 
    374372            CALL trd_tra( kt, Kmm, Kaa, cdtype, jp_sal, jptra_atf, ztrd_atf(:,:,:,jp_sal) ) 
Note: See TracChangeset for help on using the changeset viewer.