# 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 10893 – NEMO

# Changeset 10893

Ignore:
Timestamp:
2019-04-25T12:05:42+02:00 (5 years ago)
Message:

branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps : update with Gurvan's stylistic modifications.

Location:
NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src
Files:
12 edited

Unmodified
Removed

• ## NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DYN/dynkeg.F90

 r10877 !!              * kscheme = nkeg_HW : Hollingsworth correction following !!      Arakawa (2001). The now horizontal kinetic energy is given by: !!         zhke = 1/6 [ mi-1(  2 * un^2 + ((puu(j+1,Kmm)+puu(j-1,Kmm))/2)^2  ) !!                    + mj-1(  2 * vn^2 + ((pvv(i+1,Kmm)+pvv(i-1,Kmm))/2)^2  ) ] !!         zhke = 1/6 [ mi-1(  2 * un^2 + ((u(j+1)+u(j-1))/2)^2  ) !!                    + mj-1(  2 * vn^2 + ((v(i+1)+v(i-1))/2)^2  ) ] !! !!      Take its horizontal gradient and add it to the general momentum !!      trend (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)). !!         puu(:,:,:,Krhs) = puu(:,:,:,Krhs) - 1/e1u di[ zhke ] !!         pvv(:,:,:,Krhs) = pvv(:,:,:,Krhs) - 1/e2v dj[ zhke ] !!      trend. !!         u(rhs) = u(rhs) - 1/e1u di[ zhke ] !!         v(rhs) = v(rhs) - 1/e2v dj[ zhke ] !! !! ** Action : - Update the (puu(:,:,:,Krhs), pvv(:,:,:,Krhs)) with the hor. ke gradient trend
• ## NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DYN/dynvor.F90

 r10877 !! !! ** Method  :   The now vertical advection of momentum is given by: !!         w dz(u) = puu(:,:,:,Krhs) + 1/(e1e2u*e3u) mk+1[ mi(e1e2t*ww) dk(puu(:,:,:,Kmm)) ] !!         w dz(v) = pvv(:,:,:,Krhs) + 1/(e1e2v*e3v) mk+1[ mj(e1e2t*ww) dk(pvv(:,:,:,Kmm)) ] !!         w dz(u) = u(rhs) + 1/(e1e2u*e3u) mk+1[ mi(e1e2t*ww) dk(u) ] !!         w dz(v) = v(rhs) + 1/(e1e2v*e3v) mk+1[ mj(e1e2t*ww) dk(v) ] !!      Add this trend to the general trend (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)): !!         (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)) = (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)) + w dz(u,v) !!         (u(rhs),v(rhs)) = (u(rhs),v(rhs)) + w dz(u,v) !! !! ** Action  : - Update (puu(:,:,:,Krhs),pvv(:,:,:,Krhs)) with the vert. momentum adv. trends
• ## NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/DYN/dynzdf.F90

 r10884 !! !! ** Method  :  - Leap-Frog time stepping on all trends but the vertical mixing !!         puu(:,:,:,Kaa) =         puu(:,:,:,Kbb) + 2*dt *       puu(:,:,:,Krhs)             vector form or linear free surf. !!         puu(:,:,:,Kaa) = ( e3u_b*puu(:,:,:,Kbb) + 2*dt * e3u_n*puu(:,:,:,Krhs) ) / e3u(:,:,:,Kaa)   otherwise !!         u(after) =         u(before) + 2*dt *       u(rhs)                vector form or linear free surf. !!         u(after) = ( e3u_b*u(before) + 2*dt * e3u_n*u(rhs) ) / e3u(after)   otherwise !!               - update the after velocity with the implicit vertical mixing. !!      This requires to solver the following system: !!         puu(:,:,:,Kaa) = puu(:,:,:,Kaa) + 1/e3u(:,:,:,Kaa) dk+1[ mi(avm) / e3uw(:,:,:,Kaa) dk[ua] ] !!         u(after) = u(after) + 1/e3u(after) dk+1[ mi(avm) / e3uw(after) dk[ua] ] !!      with the following surface/top/bottom boundary condition: !!      surface: wind stress input (averaged over kt-1/2 & kt+1/2)

 r10880 CONTAINS SUBROUTINE tra_adv_mus( kt, kit000, cdtype, p2dt, pu_mm, pv_mm, pww,             & SUBROUTINE tra_adv_mus( kt, kit000, cdtype, p2dt, pU, pV, pW,             & &                    Kbb, Kmm, pt, kjpt, Krhs, ld_msc_ups ) !!---------------------------------------------------------------------- LOGICAL                                  , INTENT(in   ) ::   ld_msc_ups      ! use upstream scheme within muscl REAL(wp)                                 , INTENT(in   ) ::   p2dt            ! tracer time-step REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pu_mm, pv_mm, pww   ! 3 ocean velocity components REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! active tracers and RHS of tracer equation REAL(wp), DIMENSION(jpi,jpj,jpk         ), INTENT(in   ) ::   pU, pV, pW      ! 3 ocean volume flux components REAL(wp), DIMENSION(jpi,jpj,jpk,kjpt,jpt), INTENT(inout) ::   pt              ! tracers and RHS of tracer equation ! INTEGER  ::   ji, jj, jk, jn   ! dummy loop indices DO ji = fs_2, fs_jpim1   ! vector opt. ! MUSCL fluxes z0u = SIGN( 0.5, pu_mm(ji,jj,jk) ) z0u = SIGN( 0.5, pU(ji,jj,jk) ) zalpha = 0.5 - z0u zu  = z0u - 0.5 * pu_mm(ji,jj,jk) * p2dt * r1_e1e2u(ji,jj) / e3u(ji,jj,jk,Kmm) zu  = z0u - 0.5 * pU(ji,jj,jk) * p2dt * r1_e1e2u(ji,jj) / e3u(ji,jj,jk,Kmm) zzwx = pt(ji+1,jj,jk,jn,Kbb) + xind(ji,jj,jk) * zu * zslpx(ji+1,jj,jk) zzwy = pt(ji  ,jj,jk,jn,Kbb) + xind(ji,jj,jk) * zu * zslpx(ji  ,jj,jk) zwx(ji,jj,jk) = pu_mm(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) zwx(ji,jj,jk) = pU(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) ! z0v = SIGN( 0.5, pv_mm(ji,jj,jk) ) z0v = SIGN( 0.5, pV(ji,jj,jk) ) zalpha = 0.5 - z0v zv  = z0v - 0.5 * pv_mm(ji,jj,jk) * p2dt * r1_e1e2v(ji,jj) / e3v(ji,jj,jk,Kmm) zv  = z0v - 0.5 * pV(ji,jj,jk) * p2dt * r1_e1e2v(ji,jj) / e3v(ji,jj,jk,Kmm) zzwx = pt(ji,jj+1,jk,jn,Kbb) + xind(ji,jj,jk) * zv * zslpy(ji,jj+1,jk) zzwy = pt(ji,jj  ,jk,jn,Kbb) + xind(ji,jj,jk) * zv * zslpy(ji,jj  ,jk) zwy(ji,jj,jk) = pv_mm(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) zwy(ji,jj,jk) = pV(ji,jj,jk) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) END DO END DO !                                ! trend diagnostics IF( l_trd )  THEN CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pu_mm, pt(:,:,:,jn,Kbb) ) CALL trd_tra( kt, cdtype, jn, jptra_yad, zwy, pv_mm, pt(:,:,:,jn,Kbb) ) CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pU, pt(:,:,:,jn,Kbb) ) CALL trd_tra( kt, cdtype, jn, jptra_yad, zwy, pV, pt(:,:,:,jn,Kbb) ) END IF !                                 ! "Poleward" heat and salt transports DO jj = 2, jpjm1 DO ji = fs_2, fs_jpim1   ! vector opt. z0w = SIGN( 0.5, pww(ji,jj,jk+1) ) z0w = SIGN( 0.5, pW(ji,jj,jk+1) ) zalpha = 0.5 + z0w zw  = z0w - 0.5 * pww(ji,jj,jk+1) * p2dt * r1_e1e2t(ji,jj) / e3w(ji,jj,jk+1,Kmm) zw  = z0w - 0.5 * pW(ji,jj,jk+1) * p2dt * r1_e1e2t(ji,jj) / e3w(ji,jj,jk+1,Kmm) zzwx = pt(ji,jj,jk+1,jn,Kbb) + xind(ji,jj,jk) * zw * zslpx(ji,jj,jk+1) zzwy = pt(ji,jj,jk  ,jn,Kbb) + xind(ji,jj,jk) * zw * zslpx(ji,jj,jk  ) zwx(ji,jj,jk+1) = pww(ji,jj,jk+1) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) * wmask(ji,jj,jk) zwx(ji,jj,jk+1) = pW(ji,jj,jk+1) * ( zalpha * zzwx + (1.-zalpha) * zzwy ) * wmask(ji,jj,jk) END DO END DO DO jj = 1, jpj DO ji = 1, jpi zwx(ji,jj, mikt(ji,jj) ) = pww(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb) zwx(ji,jj, mikt(ji,jj) ) = pW(ji,jj,mikt(ji,jj)) * pt(ji,jj,mikt(ji,jj),jn,Kbb) END DO END DO ELSE                                      ! no cavities: only at the ocean surface zwx(:,:,1) = pww(:,:,1) * pt(:,:,1,jn,Kbb) zwx(:,:,1) = pW(:,:,1) * pt(:,:,1,jn,Kbb) ENDIF ENDIF END DO !                                ! send trends for diagnostic IF( l_trd )  CALL trd_tra( kt, cdtype, jn, jptra_zad, zwx, pww, pt(:,:,:,jn,Kbb) ) IF( l_trd )  CALL trd_tra( kt, cdtype, jn, jptra_zad, zwx, pW, pt(:,:,:,jn,Kbb) ) ! END DO                     ! end of tracer loop