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