[458] | 1 | MODULE trazdf |
---|
| 2 | !!============================================================================== |
---|
| 3 | !! *** MODULE trazdf *** |
---|
| 4 | !! Ocean active tracers: vertical component of the tracer mixing trend |
---|
| 5 | !!============================================================================== |
---|
[503] | 6 | !! History : 9.0 ! 05-11 (G. Madec) Original code |
---|
[458] | 7 | !!---------------------------------------------------------------------- |
---|
[503] | 8 | |
---|
| 9 | !!---------------------------------------------------------------------- |
---|
[458] | 10 | !! tra_zdf : Update the tracer trend with the vertical diffusion |
---|
| 11 | !! zdf_ctl : ??? |
---|
| 12 | !!---------------------------------------------------------------------- |
---|
| 13 | USE oce ! ocean dynamics and tracers variables |
---|
| 14 | USE dom_oce ! ocean space and time domain variables |
---|
| 15 | USE zdf_oce ! ocean vertical physics variables |
---|
[888] | 16 | USE sbc_oce ! surface boundary condition: ocean |
---|
| 17 | USE dynspg_oce |
---|
[458] | 18 | |
---|
| 19 | USE trazdf_exp ! vertical diffusion: explicit (tra_zdf_exp routine) |
---|
| 20 | USE trazdf_imp ! vertical diffusion: implicit (tra_zdf_imp routine) |
---|
| 21 | |
---|
| 22 | USE ldftra_oce ! ocean active tracers: lateral physics |
---|
| 23 | USE trdmod ! ocean active tracers trends |
---|
| 24 | USE trdmod_oce ! ocean variables trends |
---|
| 25 | USE in_out_manager ! I/O manager |
---|
| 26 | USE prtctl ! Print control |
---|
| 27 | |
---|
[592] | 28 | USE phycst |
---|
| 29 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 30 | USE domvvl ! variable volume |
---|
| 31 | |
---|
[458] | 32 | IMPLICIT NONE |
---|
| 33 | PRIVATE |
---|
| 34 | |
---|
| 35 | PUBLIC tra_zdf ! routine called by step.F90 |
---|
| 36 | |
---|
[503] | 37 | INTEGER :: nzdf = 0 ! type vertical diffusion algorithm used |
---|
[458] | 38 | ! ! defined from ln_zdf... namlist logicals) |
---|
| 39 | |
---|
[503] | 40 | REAL(wp), DIMENSION(jpk) :: r2dt ! vertical profile time-step, = 2 rdttra |
---|
| 41 | ! ! except at nit000 (=rdttra) if neuler=0 |
---|
[458] | 42 | |
---|
| 43 | !! * Substitutions |
---|
| 44 | # include "domzgr_substitute.h90" |
---|
| 45 | # include "zdfddm_substitute.h90" |
---|
| 46 | # include "vectopt_loop_substitute.h90" |
---|
| 47 | !!---------------------------------------------------------------------- |
---|
| 48 | !! OPA 9.0 , LOCEAN-IPSL (2005) |
---|
[888] | 49 | !! $Id$ |
---|
[503] | 50 | !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) |
---|
[458] | 51 | !!---------------------------------------------------------------------- |
---|
| 52 | |
---|
| 53 | CONTAINS |
---|
| 54 | |
---|
| 55 | SUBROUTINE tra_zdf( kt ) |
---|
| 56 | !!---------------------------------------------------------------------- |
---|
| 57 | !! *** ROUTINE tra_zdf *** |
---|
| 58 | !! |
---|
| 59 | !! ** Purpose : compute the vertical ocean tracer physics. |
---|
| 60 | !!--------------------------------------------------------------------- |
---|
| 61 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
| 62 | |
---|
| 63 | INTEGER :: jk ! Dummy loop indices |
---|
[503] | 64 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztrdt, ztrds ! 3D workspace |
---|
[458] | 65 | !!--------------------------------------------------------------------- |
---|
| 66 | |
---|
| 67 | IF( kt == nit000 ) CALL zdf_ctl ! initialisation & control of options |
---|
| 68 | |
---|
| 69 | ! ! set time step |
---|
| 70 | IF( neuler == 0 .AND. kt == nit000 ) THEN ! at nit000 |
---|
| 71 | r2dt(:) = rdttra(:) ! = rdtra (restarting with Euler time stepping) |
---|
| 72 | ELSEIF( kt <= nit000 + 1) THEN ! at nit000 or nit000+1 |
---|
| 73 | r2dt(:) = 2. * rdttra(:) ! = 2 rdttra (leapfrog) |
---|
| 74 | ENDIF |
---|
| 75 | |
---|
| 76 | IF( l_trdtra ) THEN ! temporary save of ta and sa trends |
---|
| 77 | ztrdt(:,:,:) = ta(:,:,:) |
---|
| 78 | ztrds(:,:,:) = sa(:,:,:) |
---|
| 79 | ENDIF |
---|
| 80 | |
---|
[592] | 81 | IF( lk_vvl ) CALL dom_vvl_ssh( kt ) ! compute ssha field |
---|
| 82 | |
---|
[458] | 83 | SELECT CASE ( nzdf ) ! compute lateral mixing trend and add it to the general trend |
---|
| 84 | CASE ( -1 ) ! esopa: test all possibility with control print |
---|
| 85 | CALL tra_zdf_exp ( kt, r2dt ) |
---|
| 86 | CALL prt_ctl( tab3d_1=ta, clinfo1=' zdf0 - Ta: ', mask1=tmask, & |
---|
| 87 | & tab3d_2=sa, clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
| 88 | CALL tra_zdf_imp ( kt, r2dt ) |
---|
| 89 | CALL prt_ctl( tab3d_1=ta, clinfo1=' zdf1 - Ta: ', mask1=tmask, & |
---|
| 90 | & tab3d_2=sa, clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
| 91 | |
---|
| 92 | CASE ( 0 ) ! explicit scheme |
---|
| 93 | CALL tra_zdf_exp ( kt, r2dt ) |
---|
| 94 | |
---|
[789] | 95 | CASE ( 1 ) ! implicit scheme |
---|
[458] | 96 | CALL tra_zdf_imp ( kt, r2dt ) |
---|
| 97 | |
---|
| 98 | END SELECT |
---|
| 99 | |
---|
[1110] | 100 | IF( l_trdtra ) THEN ! save the vertical diffusive trends for further diagnostics |
---|
| 101 | DO jk = 1, jpkm1 |
---|
| 102 | ztrdt(:,:,jk) = ( ( ta(:,:,jk) - tb(:,:,jk) ) / r2dt(jk) ) - ztrdt(:,:,jk) |
---|
| 103 | ztrds(:,:,jk) = ( ( sa(:,:,jk) - sb(:,:,jk) ) / r2dt(jk) ) - ztrds(:,:,jk) |
---|
| 104 | END DO |
---|
| 105 | CALL trd_mod( ztrdt, ztrds, jptra_trd_zdf, 'TRA', kt ) |
---|
| 106 | ENDIF |
---|
| 107 | |
---|
| 108 | ! ! print mean trends (used for debugging) |
---|
[458] | 109 | IF(ln_ctl) CALL prt_ctl( tab3d_1=ta, clinfo1=' zdf - Ta: ', mask1=tmask, & |
---|
| 110 | & tab3d_2=sa, clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
| 111 | |
---|
| 112 | END SUBROUTINE tra_zdf |
---|
| 113 | |
---|
| 114 | |
---|
| 115 | SUBROUTINE zdf_ctl |
---|
| 116 | !!---------------------------------------------------------------------- |
---|
| 117 | !! *** ROUTINE zdf_ctl *** |
---|
| 118 | !! |
---|
| 119 | !! ** Purpose : Choose the vertical mixing scheme |
---|
| 120 | !! |
---|
[789] | 121 | !! ** Method : Set nzdf from ln_zdfexp |
---|
[458] | 122 | !! nzdf = 0 explicit (time-splitting) scheme (ln_zdfexp=T) |
---|
| 123 | !! = 1 implicit (euler backward) scheme (ln_zdfexp=F) |
---|
| 124 | !! NB: rotation of lateral mixing operator or TKE or KPP scheme, |
---|
| 125 | !! the implicit scheme is required. |
---|
| 126 | !!---------------------------------------------------------------------- |
---|
| 127 | USE zdftke |
---|
| 128 | USE zdfkpp |
---|
| 129 | !!---------------------------------------------------------------------- |
---|
| 130 | |
---|
| 131 | ! Define the vertical tracer physics scheme |
---|
| 132 | ! ========================================== |
---|
| 133 | |
---|
| 134 | ! Choice from ln_zdfexp already read in namelist in zdfini module |
---|
| 135 | IF( ln_zdfexp ) THEN ! use explicit scheme |
---|
| 136 | nzdf = 0 |
---|
| 137 | ELSE ! use implicit scheme |
---|
| 138 | nzdf = 1 |
---|
| 139 | ENDIF |
---|
| 140 | |
---|
| 141 | ! Force implicit schemes |
---|
| 142 | IF( lk_zdftke .OR. lk_zdfkpp ) nzdf = 1 ! TKE or KPP physics |
---|
| 143 | IF( ln_traldf_iso ) nzdf = 1 ! iso-neutral lateral physics |
---|
| 144 | IF( ln_traldf_hor .AND. ln_sco ) nzdf = 1 ! horizontal lateral physics in s-coordinate |
---|
| 145 | |
---|
[583] | 146 | IF( ln_zdfexp .AND. nzdf == 1 ) THEN |
---|
| 147 | CALL ctl_stop( 'tra_zdf : If using the rotation of lateral mixing operator or TKE ', & |
---|
| 148 | & ' or KPP scheme, the implicit scheme is required, set ln_zdfexp = .false.' ) |
---|
| 149 | ENDIF |
---|
| 150 | |
---|
[458] | 151 | ! Test: esopa |
---|
| 152 | IF( lk_esopa ) nzdf = -1 ! All schemes used |
---|
| 153 | |
---|
| 154 | IF(lwp) THEN |
---|
| 155 | WRITE(numout,*) |
---|
| 156 | WRITE(numout,*) 'tra:zdf_ctl : vertical tracer physics scheme' |
---|
| 157 | WRITE(numout,*) '~~~~~~~~~~~' |
---|
| 158 | IF( nzdf == -1 ) WRITE(numout,*) ' ESOPA test All scheme used' |
---|
| 159 | IF( nzdf == 0 ) WRITE(numout,*) ' Explicit time-splitting scheme' |
---|
| 160 | IF( nzdf == 1 ) WRITE(numout,*) ' Implicit (euler backward) scheme' |
---|
| 161 | ENDIF |
---|
| 162 | |
---|
| 163 | END SUBROUTINE zdf_ctl |
---|
| 164 | |
---|
| 165 | !!============================================================================== |
---|
| 166 | END MODULE trazdf |
---|