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/dynspg.F90 – NEMO

Ignore:
Timestamp:
2019-11-22T15:29:17+01:00 (5 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/dynspg.F90

    r11536 r11949  
    5353CONTAINS 
    5454 
    55    SUBROUTINE dyn_spg( kt ) 
     55   SUBROUTINE dyn_spg( kt, Kbb, Kmm, Krhs, puu, pvv, pssh, puu_b, pvv_b, Kaa ) 
    5656      !!---------------------------------------------------------------------- 
    5757      !!                  ***  ROUTINE dyn_spg  *** 
     
    7171      !!             period is used to prevent the divergence of odd and even time step. 
    7272      !!---------------------------------------------------------------------- 
    73       INTEGER, INTENT(in) ::   kt   ! ocean time-step index 
     73      INTEGER                             , INTENT( in )  ::  kt                  ! ocean time-step index 
     74      INTEGER                             , INTENT( in )  ::  Kbb, Kmm, Krhs, Kaa ! ocean time level indices 
     75      REAL(wp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) ::  puu, pvv            ! ocean velocities and RHS of momentum equation 
     76      REAL(wp), DIMENSION(jpi,jpj,jpt)    , INTENT(inout) ::  pssh, puu_b, pvv_b  ! SSH and barotropic velocities at main time levels 
    7477      ! 
    7578      INTEGER  ::   ji, jj, jk                   ! dummy loop indices 
     
    8386      IF( l_trddyn )   THEN                      ! temporary save of ta and sa trends 
    8487         ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) )  
    85          ztrdu(:,:,:) = ua(:,:,:) 
    86          ztrdv(:,:,:) = va(:,:,:) 
     88         ztrdu(:,:,:) = puu(:,:,:,Krhs) 
     89         ztrdv(:,:,:) = pvv(:,:,:,Krhs) 
    8790      ENDIF 
    8891      ! 
     
    126129               DO jj = 2, jpjm1                    ! add scalar approximation for load potential 
    127130                  DO ji = fs_2, fs_jpim1   ! vector opt. 
    128                      spgu(ji,jj) = spgu(ji,jj) + zld * ( sshn(ji+1,jj) - sshn(ji,jj) ) * r1_e1u(ji,jj) 
    129                      spgv(ji,jj) = spgv(ji,jj) + zld * ( sshn(ji,jj+1) - sshn(ji,jj) ) * r1_e2v(ji,jj) 
     131                     spgu(ji,jj) = spgu(ji,jj) + zld * ( pssh(ji+1,jj,Kmm) - pssh(ji,jj,Kmm) ) * r1_e1u(ji,jj) 
     132                     spgv(ji,jj) = spgv(ji,jj) + zld * ( pssh(ji,jj+1,Kmm) - pssh(ji,jj,Kmm) ) * r1_e2v(ji,jj) 
    130133                  END DO  
    131134               END DO 
     
    150153            DO jj = 2, jpjm1 
    151154               DO ji = fs_2, fs_jpim1   ! vector opt. 
    152                   ua(ji,jj,jk) = ua(ji,jj,jk) + spgu(ji,jj) 
    153                   va(ji,jj,jk) = va(ji,jj,jk) + spgv(ji,jj) 
     155                  puu(ji,jj,jk,Krhs) = puu(ji,jj,jk,Krhs) + spgu(ji,jj) 
     156                  pvv(ji,jj,jk,Krhs) = pvv(ji,jj,jk,Krhs) + spgv(ji,jj) 
    154157               END DO 
    155158            END DO 
     
    161164      ! 
    162165      SELECT CASE ( nspg )                   !== surface pressure gradient computed and add to the general trend ==! 
    163       CASE ( np_EXP )   ;   CALL dyn_spg_exp( kt )              ! explicit 
    164       CASE ( np_TS  )   ;   CALL dyn_spg_ts ( kt )              ! time-splitting 
     166      CASE ( np_EXP )   ;   CALL dyn_spg_exp( kt,      Kmm,       puu, pvv, Krhs )                    ! explicit 
     167      CASE ( np_TS  )   ;   CALL dyn_spg_ts ( kt, Kbb, Kmm, Krhs, puu, pvv, pssh, puu_b, pvv_b, Kaa ) ! time-splitting 
    165168      END SELECT 
    166169      !                     
    167170      IF( l_trddyn )   THEN                  ! save the surface pressure gradient trends for further diagnostics 
    168          ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 
    169          ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 
    170          CALL trd_dyn( ztrdu, ztrdv, jpdyn_spg, kt ) 
     171         ztrdu(:,:,:) = puu(:,:,:,Krhs) - ztrdu(:,:,:) 
     172         ztrdv(:,:,:) = pvv(:,:,:,Krhs) - ztrdv(:,:,:) 
     173         CALL trd_dyn( ztrdu, ztrdv, jpdyn_spg, kt, Kmm ) 
    171174         DEALLOCATE( ztrdu , ztrdv )  
    172175      ENDIF 
    173176      !                                      ! print mean trends (used for debugging) 
    174       IF(ln_ctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' spg  - Ua: ', mask1=umask, & 
    175          &                       tab3d_2=va, clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
     177      IF(ln_ctl)   CALL prt_ctl( tab3d_1=puu(:,:,:,Krhs), clinfo1=' spg  - Ua: ', mask1=umask, & 
     178         &                       tab3d_2=pvv(:,:,:,Krhs), clinfo2=       ' Va: ', mask2=vmask, clinfo3='dyn' ) 
    176179      ! 
    177180      IF( ln_timing )   CALL timing_stop('dyn_spg') 
Note: See TracChangeset for help on using the changeset viewer.