[5777] | 1 | MODULE divhor |
---|
[3] | 2 | !!============================================================================== |
---|
[5777] | 3 | !! *** MODULE divhor *** |
---|
| 4 | !! Ocean diagnostic variable : now horizontal divergence |
---|
[3] | 5 | !!============================================================================== |
---|
[5777] | 6 | !! History : 1.0 ! 2002-09 (G. Madec, E. Durand) Free form, F90 |
---|
[2528] | 7 | !! - ! 2005-01 (J. Chanut) Unstructured open boundaries |
---|
| 8 | !! - ! 2003-08 (G. Madec) merged of cur and div, free form, F90 |
---|
| 9 | !! - ! 2005-01 (J. Chanut, A. Sellar) unstructured open boundaries |
---|
| 10 | !! 3.3 ! 2010-09 (D.Storkey and E.O'Dea) bug fixes for BDY module |
---|
| 11 | !! - ! 2010-10 (R. Furner, G. Madec) runoff and cla added directly here |
---|
[5777] | 12 | !! 3.7 ! 2014-01 (G. Madec) suppression of velocity curl from in-core memory |
---|
| 13 | !! - ! 2014-12 (G. Madec) suppression of cross land advection option |
---|
| 14 | !! - ! 2015-10 (G. Madec) add velocity and rnf flag in argument of div_hor |
---|
[2528] | 15 | !!---------------------------------------------------------------------- |
---|
[3] | 16 | |
---|
| 17 | !!---------------------------------------------------------------------- |
---|
[5777] | 18 | !! div_hor : Compute the horizontal divergence field |
---|
[3] | 19 | !!---------------------------------------------------------------------- |
---|
| 20 | USE oce ! ocean dynamics and tracers |
---|
[11521] | 21 | USE isf |
---|
| 22 | USE isfutils |
---|
[3] | 23 | USE dom_oce ! ocean space and time domain |
---|
[11521] | 24 | USE sbc_oce, ONLY : ln_rnf ! surface boundary condition: ocean |
---|
[2528] | 25 | USE sbcrnf ! river runoff |
---|
[11395] | 26 | USE isfhdiv ! ice shelf |
---|
[9023] | 27 | #if defined key_asminc |
---|
| 28 | USE asminc ! Assimilation increment |
---|
| 29 | #endif |
---|
[5777] | 30 | ! |
---|
[3] | 31 | USE in_out_manager ! I/O manager |
---|
| 32 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
[2715] | 33 | USE lib_mpp ! MPP library |
---|
[3294] | 34 | USE timing ! Timing |
---|
[3] | 35 | |
---|
| 36 | IMPLICIT NONE |
---|
| 37 | PRIVATE |
---|
| 38 | |
---|
[5777] | 39 | PUBLIC div_hor ! routine called by step.F90 and istate.F90 |
---|
[3] | 40 | |
---|
| 41 | !! * Substitutions |
---|
| 42 | # include "vectopt_loop_substitute.h90" |
---|
| 43 | !!---------------------------------------------------------------------- |
---|
[9598] | 44 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[1152] | 45 | !! $Id$ |
---|
[10068] | 46 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[3] | 47 | !!---------------------------------------------------------------------- |
---|
| 48 | CONTAINS |
---|
| 49 | |
---|
[5777] | 50 | SUBROUTINE div_hor( kt ) |
---|
[3] | 51 | !!---------------------------------------------------------------------- |
---|
[5777] | 52 | !! *** ROUTINE div_hor *** |
---|
[3] | 53 | !! |
---|
[5777] | 54 | !! ** Purpose : compute the horizontal divergence at now time-step |
---|
[3] | 55 | !! |
---|
[5777] | 56 | !! ** Method : the now divergence is computed as : |
---|
| 57 | !! hdivn = 1/(e1e2t*e3t) ( di[e2u*e3u un] + dj[e1v*e3v vn] ) |
---|
| 58 | !! and correct with runoff inflow (div_rnf) and cross land flow (div_cla) |
---|
[3] | 59 | !! |
---|
[5777] | 60 | !! ** Action : - update hdivn, the now horizontal divergence |
---|
[3] | 61 | !!---------------------------------------------------------------------- |
---|
[2715] | 62 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
[2528] | 63 | ! |
---|
[2715] | 64 | INTEGER :: ji, jj, jk ! dummy loop indices |
---|
| 65 | REAL(wp) :: zraur, zdep ! local scalars |
---|
[11541] | 66 | REAL(wp), DIMENSION(jpi,jpj) :: ztmp |
---|
[3] | 67 | !!---------------------------------------------------------------------- |
---|
[3294] | 68 | ! |
---|
[9019] | 69 | IF( ln_timing ) CALL timing_start('div_hor') |
---|
[3294] | 70 | ! |
---|
[3] | 71 | IF( kt == nit000 ) THEN |
---|
| 72 | IF(lwp) WRITE(numout,*) |
---|
[5777] | 73 | IF(lwp) WRITE(numout,*) 'div_hor : horizontal velocity divergence ' |
---|
| 74 | IF(lwp) WRITE(numout,*) '~~~~~~~ ' |
---|
[3] | 75 | ENDIF |
---|
[5777] | 76 | ! |
---|
| 77 | DO jk = 1, jpkm1 !== Horizontal divergence ==! |
---|
[3] | 78 | DO jj = 2, jpjm1 |
---|
| 79 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[9019] | 80 | hdivn(ji,jj,jk) = ( e2u(ji ,jj) * e3u_n(ji ,jj,jk) * un(ji ,jj,jk) & |
---|
| 81 | & - e2u(ji-1,jj) * e3u_n(ji-1,jj,jk) * un(ji-1,jj,jk) & |
---|
| 82 | & + e1v(ji,jj ) * e3v_n(ji,jj ,jk) * vn(ji,jj ,jk) & |
---|
| 83 | & - e1v(ji,jj-1) * e3v_n(ji,jj-1,jk) * vn(ji,jj-1,jk) ) & |
---|
| 84 | & * r1_e1e2t(ji,jj) / e3t_n(ji,jj,jk) |
---|
[3] | 85 | END DO |
---|
| 86 | END DO |
---|
[5777] | 87 | END DO |
---|
[11541] | 88 | |
---|
| 89 | ztmp = 0.0 |
---|
| 90 | DO jk = jpkm1,1,-1 |
---|
| 91 | ztmp(:,:) = ztmp(:,:) + hdivn(:,:,jk) * e3t_n(:,:,jk) |
---|
| 92 | END DO |
---|
| 93 | CALL debug('divhor 1',ztmp) |
---|
| 94 | |
---|
[9019] | 95 | #if defined key_agrif |
---|
| 96 | IF( .NOT. Agrif_Root() ) THEN |
---|
[9116] | 97 | IF( nbondi == -1 .OR. nbondi == 2 ) hdivn( 2 , : ,:) = 0._wp ! west |
---|
| 98 | IF( nbondi == 1 .OR. nbondi == 2 ) hdivn( nlci-1, : ,:) = 0._wp ! east |
---|
| 99 | IF( nbondj == -1 .OR. nbondj == 2 ) hdivn( : , 2 ,:) = 0._wp ! south |
---|
| 100 | IF( nbondj == 1 .OR. nbondj == 2 ) hdivn( : ,nlcj-1,:) = 0._wp ! north |
---|
[9019] | 101 | ENDIF |
---|
| 102 | #endif |
---|
[2715] | 103 | ! |
---|
[9019] | 104 | IF( ln_rnf ) CALL sbc_rnf_div( hdivn ) !== runoffs ==! (update hdivn field) |
---|
[2528] | 105 | ! |
---|
[9023] | 106 | #if defined key_asminc |
---|
| 107 | IF( ln_sshinc .AND. ln_asmiau ) CALL ssh_asm_div( kt, hdivn ) !== SSH assimilation ==! (update hdivn field) |
---|
| 108 | ! |
---|
| 109 | #endif |
---|
[3294] | 110 | ! |
---|
[11529] | 111 | IF( ln_isf .OR. ln_isfcpl ) CALL isf_hdiv( kt, hdivn ) !== ice shelf ==! (update hdivn field) |
---|
| 112 | ! |
---|
[10425] | 113 | CALL lbc_lnk( 'divhor', hdivn, 'T', 1. ) ! (no sign change) |
---|
[6140] | 114 | ! |
---|
[11541] | 115 | ztmp = 0.0 |
---|
| 116 | DO jk = jpkm1,1,-1 |
---|
| 117 | ztmp(:,:) = ztmp(:,:) + hdivn(:,:,jk) * e3t_n(:,:,jk) |
---|
| 118 | END DO |
---|
| 119 | CALL debug('divhor 2',ztmp) |
---|
| 120 | ! |
---|
[9019] | 121 | IF( ln_timing ) CALL timing_stop('div_hor') |
---|
[5777] | 122 | ! |
---|
| 123 | END SUBROUTINE div_hor |
---|
[3] | 124 | |
---|
| 125 | !!====================================================================== |
---|
[5777] | 126 | END MODULE divhor |
---|