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 10985 for NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/TRA/trabbl.F90 – NEMO

Ignore:
Timestamp:
2019-05-15T21:19:35+02:00 (5 years ago)
Author:
acc
Message:

2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps : interface changes to tra and trc routines for design compliance and consistency. Fully SETTE tested (non-AGRIF, only)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/TRA/trabbl.F90

    r10954 r10985  
    8989 
    9090 
    91    SUBROUTINE tra_bbl( kt, Kbb, Kmm, Krhs ) 
     91   SUBROUTINE tra_bbl( kt, Kbb, Kmm, pts, Krhs ) 
    9292      !!---------------------------------------------------------------------- 
    9393      !!                  ***  ROUTINE bbl  *** 
     
    101101      !!              is added to the general tracer trend 
    102102      !!---------------------------------------------------------------------- 
    103       INTEGER, INTENT( in ) ::   kt   ! ocean time-step 
    104       INTEGER, INTENT( in ) ::   Kbb, Kmm, Krhs  ! time level indices 
     103      INTEGER,                                   INTENT(in   ) :: kt              ! ocean time-step 
     104      INTEGER,                                   INTENT(in   ) :: Kbb, Kmm, Krhs  ! time level indices 
     105      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts             ! active tracers and RHS of tracer equation 
    105106      ! 
    106107      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) ::   ztrdt, ztrds 
     
    111112      IF( l_trdtra )   THEN                         !* Save the T-S input trends 
    112113         ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) 
    113          ztrdt(:,:,:) = ts(:,:,:,jp_tem,Krhs) 
    114          ztrds(:,:,:) = ts(:,:,:,jp_sal,Krhs) 
     114         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) 
     115         ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) 
    115116      ENDIF 
    116117 
     
    119120      IF( nn_bbl_ldf == 1 ) THEN                    !* Diffusive bbl 
    120121         ! 
    121          CALL tra_bbl_dif( ts(:,:,:,:,Kbb), ts(:,:,:,:,Krhs), jpts, Kmm ) 
     122         CALL tra_bbl_dif( pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts, Kmm ) 
    122123         IF( ln_ctl )  & 
    123          CALL prt_ctl( tab3d_1=ts(:,:,:,jp_tem,Krhs), clinfo1=' bbl_ldf  - Ta: ', mask1=tmask, & 
    124             &          tab3d_2=ts(:,:,:,jp_sal,Krhs), clinfo2=           ' Sa: ', mask2=tmask, clinfo3='tra' ) 
     124         CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' bbl_ldf  - Ta: ', mask1=tmask, & 
     125            &          tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2=           ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    125126         ! lateral boundary conditions ; just need for outputs 
    126127         CALL lbc_lnk_multi( 'trabbl', ahu_bbl, 'U', 1. , ahv_bbl, 'V', 1. ) 
     
    132133      IF( nn_bbl_adv /= 0 ) THEN                    !* Advective bbl 
    133134         ! 
    134          CALL tra_bbl_adv( ts(:,:,:,:,Kbb), ts(:,:,:,:,Krhs), jpts, Kmm ) 
     135         CALL tra_bbl_adv( pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts, Kmm ) 
    135136         IF(ln_ctl)   & 
    136          CALL prt_ctl( tab3d_1=ts(:,:,:,jp_tem,Krhs), clinfo1=' bbl_adv  - Ta: ', mask1=tmask,   & 
    137             &          tab3d_2=ts(:,:,:,jp_sal,Krhs), clinfo2=           ' Sa: ', mask2=tmask, clinfo3='tra' ) 
     137         CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' bbl_adv  - Ta: ', mask1=tmask,   & 
     138            &          tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2=           ' Sa: ', mask2=tmask, clinfo3='tra' ) 
    138139         ! lateral boundary conditions ; just need for outputs 
    139140         CALL lbc_lnk_multi( 'trabbl', utr_bbl, 'U', 1. , vtr_bbl, 'V', 1. ) 
     
    144145 
    145146      IF( l_trdtra )   THEN                      ! send the trends for further diagnostics 
    146          ztrdt(:,:,:) = ts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:) 
    147          ztrds(:,:,:) = ts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:) 
     147         ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:) 
     148         ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:) 
    148149         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_bbl, ztrdt ) 
    149150         CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_bbl, ztrds ) 
     
    156157 
    157158 
    158    SUBROUTINE tra_bbl_dif( ptb, pta, kjpt, Kmm ) 
     159   SUBROUTINE tra_bbl_dif( pt, pt_rhs, kjpt, Kmm ) 
    159160      !!---------------------------------------------------------------------- 
    160161      !!                  ***  ROUTINE tra_bbl_dif  *** 
     
    172173      !!      convection is satified) 
    173174      !! 
    174       !! ** Action  :   pta   increased by the bbl diffusive trend 
     175      !! ** Action  :   pt_rhs   increased by the bbl diffusive trend 
    175176      !! 
    176177      !! References : Beckmann, A., and R. Doscher, 1997, J. Phys.Oceanogr., 581-591. 
     
    178179      !!---------------------------------------------------------------------- 
    179180      INTEGER                              , INTENT(in   ) ::   kjpt   ! number of tracers 
    180       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb    ! before and now tracer fields 
    181       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta    ! tracer trend 
     181      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   pt     ! before and now tracer fields 
     182      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pt_rhs ! tracer trend 
    182183      INTEGER                              , INTENT(in   ) ::   Kmm    ! time level indices 
    183184      ! 
     
    193194            DO ji = 1, jpi 
    194195               ik = mbkt(ji,jj)                             ! bottom T-level index 
    195                zptb(ji,jj) = ptb(ji,jj,ik,jn)               ! bottom before T and S 
     196               zptb(ji,jj) = pt(ji,jj,ik,jn)                ! bottom before T and S 
    196197            END DO 
    197198         END DO 
     
    200201            DO ji = 2, jpim1 
    201202               ik = mbkt(ji,jj)                            ! bottom T-level index 
    202                pta(ji,jj,ik,jn) = pta(ji,jj,ik,jn)                                                  & 
    203                   &             + (  ahu_bbl(ji  ,jj  ) * ( zptb(ji+1,jj  ) - zptb(ji  ,jj  ) )     & 
    204                   &                - ahu_bbl(ji-1,jj  ) * ( zptb(ji  ,jj  ) - zptb(ji-1,jj  ) )     & 
    205                   &                + ahv_bbl(ji  ,jj  ) * ( zptb(ji  ,jj+1) - zptb(ji  ,jj  ) )     & 
    206                   &                - ahv_bbl(ji  ,jj-1) * ( zptb(ji  ,jj  ) - zptb(ji  ,jj-1) )  )  & 
    207                   &             * r1_e1e2t(ji,jj) / e3t(ji,jj,ik,Kmm) 
     203               pt_rhs(ji,jj,ik,jn) = pt_rhs(ji,jj,ik,jn)                                                  & 
     204                  &                + (  ahu_bbl(ji  ,jj  ) * ( zptb(ji+1,jj  ) - zptb(ji  ,jj  ) )     & 
     205                  &                   - ahu_bbl(ji-1,jj  ) * ( zptb(ji  ,jj  ) - zptb(ji-1,jj  ) )     & 
     206                  &                   + ahv_bbl(ji  ,jj  ) * ( zptb(ji  ,jj+1) - zptb(ji  ,jj  ) )     & 
     207                  &                   - ahv_bbl(ji  ,jj-1) * ( zptb(ji  ,jj  ) - zptb(ji  ,jj-1) )  )  & 
     208                  &                * r1_e1e2t(ji,jj) / e3t(ji,jj,ik,Kmm) 
    208209            END DO 
    209210         END DO 
     
    214215 
    215216 
    216    SUBROUTINE tra_bbl_adv( ptb, pta, kjpt, Kmm ) 
     217   SUBROUTINE tra_bbl_adv( pt, pt_rhs, kjpt, Kmm ) 
    217218      !!---------------------------------------------------------------------- 
    218219      !!                  ***  ROUTINE trc_bbl  *** 
     
    230231      !!---------------------------------------------------------------------- 
    231232      INTEGER                              , INTENT(in   ) ::   kjpt   ! number of tracers 
    232       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   ptb    ! before and now tracer fields 
    233       REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pta    ! tracer trend 
     233      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(in   ) ::   pt     ! before and now tracer fields 
     234      REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt), INTENT(inout) ::   pt_rhs ! tracer trend 
    234235      INTEGER                              , INTENT(in   ) ::   Kmm    ! time level indices 
    235236      ! 
     
    254255                  !                                               ! up  -slope T-point (shelf bottom point) 
    255256                  zbtr = r1_e1e2t(iis,jj) / e3t(iis,jj,ikus,Kmm) 
    256                   ztra = zu_bbl * ( ptb(iid,jj,ikus,jn) - ptb(iis,jj,ikus,jn) ) * zbtr 
    257                   pta(iis,jj,ikus,jn) = pta(iis,jj,ikus,jn) + ztra 
     257                  ztra = zu_bbl * ( pt(iid,jj,ikus,jn) - pt(iis,jj,ikus,jn) ) * zbtr 
     258                  pt_rhs(iis,jj,ikus,jn) = pt_rhs(iis,jj,ikus,jn) + ztra 
    258259                  ! 
    259260                  DO jk = ikus, ikud-1                            ! down-slope upper to down T-point (deep column) 
    260261                     zbtr = r1_e1e2t(iid,jj) / e3t(iid,jj,jk,Kmm) 
    261                      ztra = zu_bbl * ( ptb(iid,jj,jk+1,jn) - ptb(iid,jj,jk,jn) ) * zbtr 
    262                      pta(iid,jj,jk,jn) = pta(iid,jj,jk,jn) + ztra 
     262                     ztra = zu_bbl * ( pt(iid,jj,jk+1,jn) - pt(iid,jj,jk,jn) ) * zbtr 
     263                     pt_rhs(iid,jj,jk,jn) = pt_rhs(iid,jj,jk,jn) + ztra 
    263264                  END DO 
    264265                  ! 
    265266                  zbtr = r1_e1e2t(iid,jj) / e3t(iid,jj,ikud,Kmm) 
    266                   ztra = zu_bbl * ( ptb(iis,jj,ikus,jn) - ptb(iid,jj,ikud,jn) ) * zbtr 
    267                   pta(iid,jj,ikud,jn) = pta(iid,jj,ikud,jn) + ztra 
     267                  ztra = zu_bbl * ( pt(iis,jj,ikus,jn) - pt(iid,jj,ikud,jn) ) * zbtr 
     268                  pt_rhs(iid,jj,ikud,jn) = pt_rhs(iid,jj,ikud,jn) + ztra 
    268269               ENDIF 
    269270               ! 
     
    276277                  ! up  -slope T-point (shelf bottom point) 
    277278                  zbtr = r1_e1e2t(ji,ijs) / e3t(ji,ijs,ikvs,Kmm) 
    278                   ztra = zv_bbl * ( ptb(ji,ijd,ikvs,jn) - ptb(ji,ijs,ikvs,jn) ) * zbtr 
    279                   pta(ji,ijs,ikvs,jn) = pta(ji,ijs,ikvs,jn) + ztra 
     279                  ztra = zv_bbl * ( pt(ji,ijd,ikvs,jn) - pt(ji,ijs,ikvs,jn) ) * zbtr 
     280                  pt_rhs(ji,ijs,ikvs,jn) = pt_rhs(ji,ijs,ikvs,jn) + ztra 
    280281                  ! 
    281282                  DO jk = ikvs, ikvd-1                            ! down-slope upper to down T-point (deep column) 
    282283                     zbtr = r1_e1e2t(ji,ijd) / e3t(ji,ijd,jk,Kmm) 
    283                      ztra = zv_bbl * ( ptb(ji,ijd,jk+1,jn) - ptb(ji,ijd,jk,jn) ) * zbtr 
    284                      pta(ji,ijd,jk,jn) = pta(ji,ijd,jk,jn)  + ztra 
     284                     ztra = zv_bbl * ( pt(ji,ijd,jk+1,jn) - pt(ji,ijd,jk,jn) ) * zbtr 
     285                     pt_rhs(ji,ijd,jk,jn) = pt_rhs(ji,ijd,jk,jn)  + ztra 
    285286                  END DO 
    286287                  !                                               ! down-slope T-point (deep bottom point) 
    287288                  zbtr = r1_e1e2t(ji,ijd) / e3t(ji,ijd,ikvd,Kmm) 
    288                   ztra = zv_bbl * ( ptb(ji,ijs,ikvs,jn) - ptb(ji,ijd,ikvd,jn) ) * zbtr 
    289                   pta(ji,ijd,ikvd,jn) = pta(ji,ijd,ikvd,jn) + ztra 
     289                  ztra = zv_bbl * ( pt(ji,ijs,ikvs,jn) - pt(ji,ijd,ikvd,jn) ) * zbtr 
     290                  pt_rhs(ji,ijd,ikvd,jn) = pt_rhs(ji,ijd,ikvd,jn) + ztra 
    290291               ENDIF 
    291292            END DO 
     
    348349         DO ji = 1, jpi 
    349350            ik = mbkt(ji,jj)                             ! bottom T-level index 
    350             zts (ji,jj,jp_tem) = ts(ji,jj,ik,jp_tem,Kbb)    ! bottom before T and S 
     351            zts (ji,jj,jp_tem) = ts(ji,jj,ik,jp_tem,Kbb) ! bottom before T and S 
    351352            zts (ji,jj,jp_sal) = ts(ji,jj,ik,jp_sal,Kbb) 
    352353            ! 
    353             zdep(ji,jj) = gdept(ji,jj,ik,Kmm)              ! bottom T-level reference depth 
    354             zub (ji,jj) = uu(ji,jj,mbku(ji,jj),Kmm)          ! bottom velocity 
     354            zdep(ji,jj) = gdept(ji,jj,ik,Kmm)            ! bottom T-level reference depth 
     355            zub (ji,jj) = uu(ji,jj,mbku(ji,jj),Kmm)      ! bottom velocity 
    355356            zvb (ji,jj) = vv(ji,jj,mbkv(ji,jj),Kmm) 
    356357         END DO 
Note: See TracChangeset for help on using the changeset viewer.