[458] | 1 | MODULE traldf |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE traldf *** |
---|
| 4 | !! Ocean Active tracers : lateral diffusive trends |
---|
| 5 | !!===================================================================== |
---|
[5836] | 6 | !! History : 9.0 ! 2005-11 (G. Madec) Original code |
---|
| 7 | !! NEMO 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA |
---|
| 8 | !! 3.7 ! 2013-12 (G. Madec) remove the optional computation from T & S anomaly profiles and traldf_bilapg |
---|
| 9 | !! - ! 2013-12 (F. Lemarie, G. Madec) triad operator (Griffies) + Method of Stabilizing Correction |
---|
| 10 | !! - ! 2014-01 (G. Madec, S. Masson) restructuration/simplification of lateral diffusive operators |
---|
[458] | 11 | !!---------------------------------------------------------------------- |
---|
[503] | 12 | |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
[6060] | 14 | !! tra_ldf : update the tracer trend with the lateral diffusion trend |
---|
| 15 | !! tra_ldf_init : initialization, namelist read, and parameters control |
---|
[458] | 16 | !!---------------------------------------------------------------------- |
---|
[6060] | 17 | USE oce ! ocean dynamics and tracers |
---|
| 18 | USE dom_oce ! ocean space and time domain |
---|
| 19 | USE phycst ! physical constants |
---|
| 20 | USE ldftra ! lateral diffusion: eddy diffusivity & EIV coeff. |
---|
| 21 | USE ldfslp ! lateral diffusion: iso-neutral slope |
---|
| 22 | USE traldf_lap_blp ! lateral diffusion: laplacian iso-level operator (tra_ldf_lap/_blp routines) |
---|
| 23 | USE traldf_iso ! lateral diffusion: laplacian iso-neutral standard operator (tra_ldf_iso routine ) |
---|
| 24 | USE traldf_triad ! lateral diffusion: laplacian iso-neutral triad operator (tra_ldf_triad routine ) |
---|
| 25 | USE trd_oce ! trends: ocean variables |
---|
| 26 | USE trdtra ! ocean active tracers trends |
---|
[4990] | 27 | ! |
---|
[5836] | 28 | USE prtctl ! Print control |
---|
| 29 | USE in_out_manager ! I/O manager |
---|
| 30 | USE lib_mpp ! distribued memory computing library |
---|
| 31 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 32 | USE wrk_nemo ! Memory allocation |
---|
| 33 | USE timing ! Timing |
---|
[458] | 34 | |
---|
| 35 | IMPLICIT NONE |
---|
| 36 | PRIVATE |
---|
| 37 | |
---|
[4990] | 38 | PUBLIC tra_ldf ! called by step.F90 |
---|
[5836] | 39 | PUBLIC tra_ldf_init ! called by nemogcm.F90 |
---|
[2528] | 40 | ! |
---|
[5836] | 41 | INTEGER :: nldf = 0 ! type of lateral diffusion used defined from ln_traldf_... (namlist logicals) |
---|
| 42 | |
---|
[458] | 43 | !! * Substitutions |
---|
| 44 | # include "vectopt_loop_substitute.h90" |
---|
[503] | 45 | !!---------------------------------------------------------------------- |
---|
[5836] | 46 | !! NEMO/OPA 3.7 , NEMO Consortium (2015) |
---|
[1152] | 47 | !! $Id$ |
---|
[2528] | 48 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[503] | 49 | !!---------------------------------------------------------------------- |
---|
[458] | 50 | CONTAINS |
---|
| 51 | |
---|
| 52 | SUBROUTINE tra_ldf( kt ) |
---|
| 53 | !!---------------------------------------------------------------------- |
---|
| 54 | !! *** ROUTINE tra_ldf *** |
---|
| 55 | !! |
---|
| 56 | !! ** Purpose : compute the lateral ocean tracer physics. |
---|
| 57 | !!---------------------------------------------------------------------- |
---|
[503] | 58 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
| 59 | !! |
---|
[3294] | 60 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdt, ztrds |
---|
[458] | 61 | !!---------------------------------------------------------------------- |
---|
[3294] | 62 | ! |
---|
[5836] | 63 | IF( nn_timing == 1 ) CALL timing_start('tra_ldf') |
---|
[3294] | 64 | ! |
---|
[2528] | 65 | IF( l_trdtra ) THEN !* Save ta and sa trends |
---|
[5836] | 66 | CALL wrk_alloc( jpi,jpj,jpk, ztrdt, ztrds ) |
---|
[3294] | 67 | ztrdt(:,:,:) = tsa(:,:,:,jp_tem) |
---|
| 68 | ztrds(:,:,:) = tsa(:,:,:,jp_sal) |
---|
[458] | 69 | ENDIF |
---|
[5836] | 70 | ! |
---|
| 71 | SELECT CASE ( nldf ) !* compute lateral mixing trend and add it to the general trend |
---|
| 72 | CASE ( np_lap ) ! laplacian: iso-level operator |
---|
| 73 | CALL tra_ldf_lap ( kt, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, tsb, tsa, jpts, 1 ) |
---|
| 74 | CASE ( np_lap_i ) ! laplacian: standard iso-neutral operator (Madec) |
---|
| 75 | CALL tra_ldf_iso ( kt, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, tsb, tsb, tsa, jpts, 1 ) |
---|
| 76 | CASE ( np_lap_it ) ! laplacian: triad iso-neutral operator (griffies) |
---|
| 77 | CALL tra_ldf_triad( kt, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, tsb, tsb, tsa, jpts, 1 ) |
---|
| 78 | CASE ( np_blp , np_blp_i , np_blp_it ) ! bilaplacian: iso-level & iso-neutral operators |
---|
| 79 | CALL tra_ldf_blp ( kt, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, tsb , tsa, jpts, nldf ) |
---|
[458] | 80 | END SELECT |
---|
[6060] | 81 | ! |
---|
[5836] | 82 | IF( l_trdtra ) THEN !* save the horizontal diffusive trends for further diagnostics |
---|
[2528] | 83 | ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) |
---|
| 84 | ztrds(:,:,:) = tsa(:,:,:,jp_sal) - ztrds(:,:,:) |
---|
[4990] | 85 | CALL trd_tra( kt, 'TRA', jp_tem, jptra_ldf, ztrdt ) |
---|
| 86 | CALL trd_tra( kt, 'TRA', jp_sal, jptra_ldf, ztrds ) |
---|
[5836] | 87 | CALL wrk_dealloc( jpi,jpj,jpk, ztrdt, ztrds ) |
---|
[458] | 88 | ENDIF |
---|
[5836] | 89 | ! !* print mean trends (used for debugging) |
---|
[2528] | 90 | IF(ln_ctl) CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf - Ta: ', mask1=tmask, & |
---|
| 91 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
[503] | 92 | ! |
---|
[5836] | 93 | IF( nn_timing == 1 ) CALL timing_stop('tra_ldf') |
---|
[3294] | 94 | ! |
---|
[458] | 95 | END SUBROUTINE tra_ldf |
---|
| 96 | |
---|
| 97 | |
---|
[2528] | 98 | SUBROUTINE tra_ldf_init |
---|
[458] | 99 | !!---------------------------------------------------------------------- |
---|
[2528] | 100 | !! *** ROUTINE tra_ldf_init *** |
---|
[458] | 101 | !! |
---|
| 102 | !! ** Purpose : Choice of the operator for the lateral tracer diffusion |
---|
| 103 | !! |
---|
[1601] | 104 | !! ** Method : set nldf from the namtra_ldf logicals |
---|
[458] | 105 | !!---------------------------------------------------------------------- |
---|
[5836] | 106 | INTEGER :: ioptio, ierr ! temporary integers |
---|
[458] | 107 | !!---------------------------------------------------------------------- |
---|
[5836] | 108 | ! |
---|
| 109 | IF(lwp) THEN ! Namelist print |
---|
[458] | 110 | WRITE(numout,*) |
---|
[2528] | 111 | WRITE(numout,*) 'tra_ldf_init : lateral tracer diffusive operator' |
---|
[458] | 112 | WRITE(numout,*) '~~~~~~~~~~~' |
---|
[6060] | 113 | WRITE(numout,*) ' Namelist namtra_ldf: already read in ldftra module' |
---|
| 114 | WRITE(numout,*) ' see ldf_tra_init report for lateral mixing parameters' |
---|
[2528] | 115 | WRITE(numout,*) |
---|
[458] | 116 | ENDIF |
---|
[5836] | 117 | ! ! use of lateral operator or not |
---|
| 118 | nldf = np_ERROR |
---|
[458] | 119 | ioptio = 0 |
---|
[5836] | 120 | IF( ln_traldf_lap ) ioptio = ioptio + 1 |
---|
| 121 | IF( ln_traldf_blp ) ioptio = ioptio + 1 |
---|
| 122 | IF( ioptio > 1 ) CALL ctl_stop( 'tra_ldf_init: use ONE or NONE of the 2 lap/bilap operator type on tracer' ) |
---|
| 123 | IF( ioptio == 0 ) nldf = np_no_ldf ! No lateral diffusion |
---|
| 124 | ! |
---|
| 125 | IF( nldf /= np_no_ldf ) THEN ! direction ==>> type of operator |
---|
| 126 | ioptio = 0 |
---|
| 127 | IF( ln_traldf_lev ) ioptio = ioptio + 1 |
---|
| 128 | IF( ln_traldf_hor ) ioptio = ioptio + 1 |
---|
| 129 | IF( ln_traldf_iso ) ioptio = ioptio + 1 |
---|
| 130 | IF( ioptio > 1 ) CALL ctl_stop( 'tra_ldf_init: use only ONE direction (level/hor/iso)' ) |
---|
| 131 | ! |
---|
| 132 | ! ! defined the type of lateral diffusion from ln_traldf_... logicals |
---|
| 133 | ierr = 0 |
---|
| 134 | IF( ln_traldf_lap ) THEN ! laplacian operator |
---|
| 135 | IF ( ln_zco ) THEN ! z-coordinate |
---|
| 136 | IF ( ln_traldf_lev ) nldf = np_lap ! iso-level = horizontal (no rotation) |
---|
| 137 | IF ( ln_traldf_hor ) nldf = np_lap ! iso-level = horizontal (no rotation) |
---|
| 138 | IF ( ln_traldf_iso ) nldf = np_lap_i ! iso-neutral: standard ( rotation) |
---|
| 139 | IF ( ln_traldf_triad ) nldf = np_lap_it ! iso-neutral: triad ( rotation) |
---|
| 140 | ENDIF |
---|
| 141 | IF ( ln_zps ) THEN ! z-coordinate with partial step |
---|
| 142 | IF ( ln_traldf_lev ) ierr = 1 ! iso-level not allowed |
---|
| 143 | IF ( ln_traldf_hor ) nldf = np_lap ! horizontal (no rotation) |
---|
| 144 | IF ( ln_traldf_iso ) nldf = np_lap_i ! iso-neutral: standard (rotation) |
---|
| 145 | IF ( ln_traldf_triad ) nldf = np_lap_it ! iso-neutral: triad (rotation) |
---|
| 146 | ENDIF |
---|
| 147 | IF ( ln_sco ) THEN ! s-coordinate |
---|
| 148 | IF ( ln_traldf_lev ) nldf = np_lap ! iso-level (no rotation) |
---|
| 149 | IF ( ln_traldf_hor ) nldf = np_lap_i ! horizontal ( rotation) |
---|
| 150 | IF ( ln_traldf_iso ) nldf = np_lap_i ! iso-neutral: standard ( rotation) |
---|
| 151 | IF ( ln_traldf_triad ) nldf = np_lap_it ! iso-neutral: triad ( rotation) |
---|
| 152 | ENDIF |
---|
[458] | 153 | ENDIF |
---|
[5836] | 154 | ! |
---|
| 155 | IF( ln_traldf_blp ) THEN ! bilaplacian operator |
---|
| 156 | IF ( ln_zco ) THEN ! z-coordinate |
---|
| 157 | IF ( ln_traldf_lev ) nldf = np_blp ! iso-level = horizontal (no rotation) |
---|
| 158 | IF ( ln_traldf_hor ) nldf = np_blp ! iso-level = horizontal (no rotation) |
---|
| 159 | IF ( ln_traldf_iso ) nldf = np_blp_i ! iso-neutral: standard ( rotation) |
---|
| 160 | IF ( ln_traldf_triad ) nldf = np_blp_it ! iso-neutral: triad ( rotation) |
---|
| 161 | ENDIF |
---|
| 162 | IF ( ln_zps ) THEN ! z-coordinate with partial step |
---|
| 163 | IF ( ln_traldf_lev ) ierr = 1 ! iso-level not allowed |
---|
| 164 | IF ( ln_traldf_hor ) nldf = np_blp ! horizontal (no rotation) |
---|
| 165 | IF ( ln_traldf_iso ) nldf = np_blp_i ! iso-neutral: standard ( rotation) |
---|
| 166 | IF ( ln_traldf_triad ) nldf = np_blp_it ! iso-neutral: triad ( rotation) |
---|
| 167 | ENDIF |
---|
| 168 | IF ( ln_sco ) THEN ! s-coordinate |
---|
| 169 | IF ( ln_traldf_lev ) nldf = np_blp ! iso-level (no rotation) |
---|
| 170 | IF ( ln_traldf_hor ) nldf = np_blp_it ! horizontal ( rotation) |
---|
| 171 | IF ( ln_traldf_iso ) nldf = np_blp_i ! iso-neutral: standard ( rotation) |
---|
| 172 | IF ( ln_traldf_triad ) nldf = np_blp_it ! iso-neutral: triad ( rotation) |
---|
| 173 | ENDIF |
---|
[458] | 174 | ENDIF |
---|
| 175 | ENDIF |
---|
[5836] | 176 | ! |
---|
[6060] | 177 | IF( ierr == 1 ) CALL ctl_stop( 'iso-level in z-partial step, not allowed' ) |
---|
[5836] | 178 | IF( ln_ldfeiv .AND. .NOT.( ln_traldf_iso .OR. ln_traldf_triad ) ) & |
---|
[6060] | 179 | & CALL ctl_stop( 'eddy induced velocity on tracers requires iso-neutral laplacian diffusion' ) |
---|
| 180 | ! |
---|
[5836] | 181 | IF( nldf == np_lap_i .OR. nldf == np_lap_it .OR. & |
---|
| 182 | & nldf == np_blp_i .OR. nldf == np_blp_it ) l_ldfslp = .TRUE. ! slope of neutral surfaces required |
---|
| 183 | ! |
---|
[458] | 184 | IF(lwp) THEN |
---|
| 185 | WRITE(numout,*) |
---|
[6060] | 186 | SELECT CASE( nldf ) |
---|
| 187 | CASE( np_no_ldf ) ; WRITE(numout,*) ' NO lateral diffusion' |
---|
| 188 | CASE( np_lap ) ; WRITE(numout,*) ' laplacian iso-level operator' |
---|
| 189 | CASE( np_lap_i ) ; WRITE(numout,*) ' Rotated laplacian operator (standard)' |
---|
| 190 | CASE( np_lap_it ) ; WRITE(numout,*) ' Rotated laplacian operator (triad)' |
---|
| 191 | CASE( np_blp ) ; WRITE(numout,*) ' bilaplacian iso-level operator' |
---|
| 192 | CASE( np_blp_i ) ; WRITE(numout,*) ' Rotated bilaplacian operator (standard)' |
---|
| 193 | CASE( np_blp_it ) ; WRITE(numout,*) ' Rotated bilaplacian operator (triad)' |
---|
| 194 | END SELECT |
---|
[458] | 195 | ENDIF |
---|
[503] | 196 | ! |
---|
[2528] | 197 | END SUBROUTINE tra_ldf_init |
---|
[458] | 198 | |
---|
| 199 | !!====================================================================== |
---|
[620] | 200 | END MODULE traldf |
---|