[1671] | 1 | MODULE dynbfr |
---|
| 2 | !!============================================================================== |
---|
| 3 | !! *** MODULE dynbfr *** |
---|
| 4 | !! Ocean dynamics : bottom friction component of the momentum mixing trend |
---|
| 5 | !!============================================================================== |
---|
[2528] | 6 | !! History : 3.2 ! 2008-11 (A. C. Coward) Original code |
---|
[1671] | 7 | !!---------------------------------------------------------------------- |
---|
| 8 | |
---|
| 9 | !!---------------------------------------------------------------------- |
---|
| 10 | !! dyn_bfr : Update the momentum trend with the bottom friction contribution |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
| 12 | USE oce ! ocean dynamics and tracers variables |
---|
| 13 | USE dom_oce ! ocean space and time domain variables |
---|
| 14 | USE zdf_oce ! ocean vertical physics variables |
---|
| 15 | USE trdmod ! ocean active dynamics and tracers trends |
---|
| 16 | USE trdmod_oce ! ocean variables trends |
---|
| 17 | USE in_out_manager ! I/O manager |
---|
| 18 | USE prtctl ! Print control |
---|
| 19 | |
---|
| 20 | IMPLICIT NONE |
---|
| 21 | PRIVATE |
---|
| 22 | |
---|
| 23 | PUBLIC dyn_bfr ! routine called by step.F90 |
---|
| 24 | |
---|
| 25 | !! * Substitutions |
---|
| 26 | # include "domzgr_substitute.h90" |
---|
| 27 | # include "zdfddm_substitute.h90" |
---|
| 28 | # include "vectopt_loop_substitute.h90" |
---|
| 29 | !!---------------------------------------------------------------------- |
---|
[2528] | 30 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
| 31 | !! $Id$ |
---|
| 32 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[1671] | 33 | !!---------------------------------------------------------------------- |
---|
| 34 | CONTAINS |
---|
| 35 | |
---|
| 36 | SUBROUTINE dyn_bfr( kt ) |
---|
| 37 | !!---------------------------------------------------------------------- |
---|
| 38 | !! *** ROUTINE dyn_bfr *** |
---|
| 39 | !! |
---|
| 40 | !! ** Purpose : compute the bottom friction ocean dynamics physics. |
---|
| 41 | !! |
---|
| 42 | !! ** Action : (ua,va) momentum trend increased by bottom friction trend |
---|
| 43 | !!--------------------------------------------------------------------- |
---|
[2715] | 44 | USE oce, ONLY: ztrduv => tsa ! tsa used as 4D workspace |
---|
[1708] | 45 | !! |
---|
[1671] | 46 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
| 47 | !! |
---|
[2528] | 48 | INTEGER :: ji, jj ! dummy loop indexes |
---|
| 49 | INTEGER :: ikbu, ikbv ! local integers |
---|
| 50 | REAL(wp) :: zm1_2dt ! local scalar |
---|
[1671] | 51 | !!--------------------------------------------------------------------- |
---|
| 52 | ! |
---|
[2528] | 53 | zm1_2dt = - 1._wp / ( 2._wp * rdt ) |
---|
[1708] | 54 | |
---|
| 55 | IF( l_trddyn ) THEN ! temporary save of ua and va trends |
---|
[2528] | 56 | ztrduv(:,:,:,1) = ua(:,:,:) |
---|
| 57 | ztrduv(:,:,:,2) = va(:,:,:) |
---|
[1671] | 58 | ENDIF |
---|
[1708] | 59 | |
---|
[1671] | 60 | # if defined key_vectopt_loop |
---|
| 61 | DO jj = 1, 1 |
---|
| 62 | DO ji = jpi+2, jpij-jpi-1 ! vector opt. (forced unrolling) |
---|
| 63 | # else |
---|
| 64 | DO jj = 2, jpjm1 |
---|
| 65 | DO ji = 2, jpim1 |
---|
| 66 | # endif |
---|
[2528] | 67 | ikbu = mbku(ji,jj) ! deepest ocean u- & v-levels |
---|
| 68 | ikbv = mbkv(ji,jj) |
---|
[1671] | 69 | ! |
---|
[2528] | 70 | ! Apply stability criteria on absolute value : abs(bfr/e3) < 1/(2dt) => bfr/e3 > -1/(2dt) |
---|
| 71 | ua(ji,jj,ikbu) = ua(ji,jj,ikbu) + MAX( bfrua(ji,jj) / fse3u(ji,jj,ikbu) , zm1_2dt ) * ub(ji,jj,ikbu) |
---|
[2547] | 72 | va(ji,jj,ikbv) = va(ji,jj,ikbv) + MAX( bfrva(ji,jj) / fse3v(ji,jj,ikbv) , zm1_2dt ) * vb(ji,jj,ikbv) |
---|
[1671] | 73 | END DO |
---|
| 74 | END DO |
---|
[1708] | 75 | |
---|
[1671] | 76 | ! |
---|
| 77 | IF( l_trddyn ) THEN ! save the vertical diffusive trends for further diagnostics |
---|
[2528] | 78 | ztrduv(:,:,:,1) = ua(:,:,:) - ztrduv(:,:,:,1) |
---|
| 79 | ztrduv(:,:,:,2) = va(:,:,:) - ztrduv(:,:,:,2) |
---|
| 80 | CALL trd_mod( ztrduv(:,:,:,1), ztrduv(:,:,:,2), jpdyn_trd_bfr, 'DYN', kt ) |
---|
[1671] | 81 | ENDIF |
---|
| 82 | ! ! print mean trends (used for debugging) |
---|
| 83 | IF(ln_ctl) CALL prt_ctl( tab3d_1=ua, clinfo1=' bfr - Ua: ', mask1=umask, & |
---|
| 84 | & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' ) |
---|
| 85 | ! |
---|
| 86 | END SUBROUTINE dyn_bfr |
---|
| 87 | |
---|
| 88 | !!============================================================================== |
---|
| 89 | END MODULE dynbfr |
---|