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