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 11949 for NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/divhor.F90 – NEMO

Ignore:
Timestamp:
2019-11-22T15:29:17+01:00 (4 years ago)
Author:
acc
Message:

Merge in changes from 2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps. This just creates a fresh copy of this branch to use as the merge base. See ticket #2341

Location:
NEMO/branches/2019/dev_r11943_MERGE_2019/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src

    • Property svn:mergeinfo deleted
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/DYN/divhor.F90

    r10425 r11949  
    4848CONTAINS 
    4949 
    50    SUBROUTINE div_hor( kt ) 
     50   SUBROUTINE div_hor( kt, Kbb, Kmm ) 
    5151      !!---------------------------------------------------------------------- 
    5252      !!                  ***  ROUTINE div_hor  *** 
     
    5555      !! 
    5656      !! ** Method  :   the now divergence is computed as : 
    57       !!         hdivn = 1/(e1e2t*e3t) ( di[e2u*e3u un] + dj[e1v*e3v vn] ) 
     57      !!         hdiv = 1/(e1e2t*e3t) ( di[e2u*e3u un] + dj[e1v*e3v vn] ) 
    5858      !!      and correct with runoff inflow (div_rnf) and cross land flow (div_cla)  
    5959      !! 
    60       !! ** Action  : - update hdivn, the now horizontal divergence 
     60      !! ** Action  : - update hdiv, the now horizontal divergence 
    6161      !!---------------------------------------------------------------------- 
    62       INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     62      INTEGER, INTENT(in) ::   kt        ! ocean time-step index 
     63      INTEGER, INTENT(in) ::   Kbb, Kmm  ! ocean time level indices 
    6364      ! 
    6465      INTEGER  ::   ji, jj, jk    ! dummy loop indices 
     
    7778         DO jj = 2, jpjm1 
    7879            DO ji = fs_2, fs_jpim1   ! vector opt. 
    79                hdivn(ji,jj,jk) = (  e2u(ji  ,jj) * e3u_n(ji  ,jj,jk) * un(ji  ,jj,jk)      & 
    80                   &               - e2u(ji-1,jj) * e3u_n(ji-1,jj,jk) * un(ji-1,jj,jk)      & 
    81                   &               + e1v(ji,jj  ) * e3v_n(ji,jj  ,jk) * vn(ji,jj  ,jk)      & 
    82                   &               - e1v(ji,jj-1) * e3v_n(ji,jj-1,jk) * vn(ji,jj-1,jk)  )   & 
    83                   &            * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) 
     80               hdiv(ji,jj,jk) = (  e2u(ji  ,jj) * e3u(ji  ,jj,jk,Kmm) * uu(ji  ,jj,jk,Kmm)      & 
     81                  &               - e2u(ji-1,jj) * e3u(ji-1,jj,jk,Kmm) * uu(ji-1,jj,jk,Kmm)      & 
     82                  &               + e1v(ji,jj  ) * e3v(ji,jj  ,jk,Kmm) * vv(ji,jj  ,jk,Kmm)      & 
     83                  &               - e1v(ji,jj-1) * e3v(ji,jj-1,jk,Kmm) * vv(ji,jj-1,jk,Kmm)  )   & 
     84                  &            * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm) 
    8485            END DO   
    8586         END DO   
     
    8788#if defined key_agrif 
    8889      IF( .NOT. Agrif_Root() ) THEN 
    89          IF( nbondi == -1 .OR. nbondi == 2 )   hdivn(   2   ,  :   ,:) = 0._wp      ! west 
    90          IF( nbondi ==  1 .OR. nbondi == 2 )   hdivn( nlci-1,  :   ,:) = 0._wp      ! east 
    91          IF( nbondj == -1 .OR. nbondj == 2 )   hdivn(   :   ,  2   ,:) = 0._wp      ! south 
    92          IF( nbondj ==  1 .OR. nbondj == 2 )   hdivn(   :   ,nlcj-1,:) = 0._wp      ! north 
     90         IF( nbondi == -1 .OR. nbondi == 2 )   hdiv(   2   ,  :   ,:) = 0._wp      ! west 
     91         IF( nbondi ==  1 .OR. nbondi == 2 )   hdiv( nlci-1,  :   ,:) = 0._wp      ! east 
     92         IF( nbondj == -1 .OR. nbondj == 2 )   hdiv(   :   ,  2   ,:) = 0._wp      ! south 
     93         IF( nbondj ==  1 .OR. nbondj == 2 )   hdiv(   :   ,nlcj-1,:) = 0._wp      ! north 
    9394      ENDIF 
    9495#endif 
    9596      ! 
    96       IF( ln_rnf )   CALL sbc_rnf_div( hdivn )              !==  runoffs    ==!   (update hdivn field) 
     97      IF( ln_rnf )   CALL sbc_rnf_div( hdiv, Kmm )                     !==  runoffs    ==!   (update hdiv field) 
    9798      ! 
    9899#if defined key_asminc  
    99       IF( ln_sshinc .AND. ln_asmiau )   CALL ssh_asm_div( kt, hdivn )   !==  SSH assimilation  ==!   (update hdivn field) 
     100      IF( ln_sshinc .AND. ln_asmiau )   CALL ssh_asm_div( kt, Kbb, Kmm, hdiv )   !==  SSH assimilation  ==!   (update hdiv field) 
    100101      !  
    101102#endif 
    102       IF( ln_isf )   CALL sbc_isf_div( hdivn )      !==  ice shelf  ==!   (update hdivn field) 
     103      IF( ln_isf )   CALL sbc_isf_div( hdiv, Kmm )                     !==  ice shelf  ==!   (update hdiv field) 
    103104      ! 
    104       IF( ln_iscpl .AND. ln_hsb )   CALL iscpl_div( hdivn ) !==  ice sheet  ==!   (update hdivn field) 
     105      IF( ln_iscpl .AND. ln_hsb )   CALL iscpl_div( Kmm, hdiv ) !==  ice sheet  ==!   (update hdiv field) 
    105106      ! 
    106       CALL lbc_lnk( 'divhor', hdivn, 'T', 1. )   !   (no sign change) 
     107      CALL lbc_lnk( 'divhor', hdiv, 'T', 1. )   !   (no sign change) 
    107108      ! 
    108109      IF( ln_timing )   CALL timing_stop('div_hor') 
Note: See TracChangeset for help on using the changeset viewer.