[458] | 1 | MODULE traldf |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE traldf *** |
---|
| 4 | !! Ocean Active tracers : lateral diffusive trends |
---|
| 5 | !!===================================================================== |
---|
[2528] | 6 | !! History : 9.0 ! 2005-11 (G. Madec) Original code |
---|
| 7 | !! NEMO 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA |
---|
[458] | 8 | !!---------------------------------------------------------------------- |
---|
[503] | 9 | |
---|
| 10 | !!---------------------------------------------------------------------- |
---|
[2528] | 11 | !! tra_ldf : update the tracer trend with the lateral diffusion |
---|
| 12 | !! tra_ldf_init : initialization, namelist read, and parameters control |
---|
| 13 | !! ldf_ano : compute lateral diffusion for constant T-S profiles |
---|
[458] | 14 | !!---------------------------------------------------------------------- |
---|
| 15 | USE oce ! ocean dynamics and tracers |
---|
| 16 | USE dom_oce ! ocean space and time domain |
---|
| 17 | USE phycst ! physical constants |
---|
| 18 | USE ldftra_oce ! ocean tracer lateral physics |
---|
| 19 | USE ldfslp ! ??? |
---|
| 20 | USE traldf_bilapg ! lateral mixing (tra_ldf_bilapg routine) |
---|
| 21 | USE traldf_bilap ! lateral mixing (tra_ldf_bilap routine) |
---|
| 22 | USE traldf_iso ! lateral mixing (tra_ldf_iso routine) |
---|
[2528] | 23 | USE traldf_iso_grif ! lateral mixing (tra_ldf_iso_grif routine) |
---|
[458] | 24 | USE traldf_lap ! lateral mixing (tra_ldf_lap routine) |
---|
[4990] | 25 | USE trd_oce ! trends: ocean variables |
---|
| 26 | USE trdtra ! trends manager: tracers |
---|
| 27 | ! |
---|
[458] | 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) |
---|
[3294] | 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 |
---|
| 39 | PUBLIC tra_ldf_init ! called by opa.F90 |
---|
[2528] | 40 | ! |
---|
| 41 | INTEGER :: nldf = 0 ! type of lateral diffusion used defined from ln_traldf_... namlist logicals) |
---|
[458] | 42 | |
---|
[2715] | 43 | REAL, SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: t0_ldf, s0_ldf !: lateral diffusion trends of T & S for a cst profile |
---|
| 44 | ! ! (key_traldf_ano only) |
---|
| 45 | |
---|
[458] | 46 | !! * Substitutions |
---|
| 47 | # include "domzgr_substitute.h90" |
---|
| 48 | # include "vectopt_loop_substitute.h90" |
---|
[503] | 49 | !!---------------------------------------------------------------------- |
---|
[2528] | 50 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
[1152] | 51 | !! $Id$ |
---|
[2528] | 52 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[503] | 53 | !!---------------------------------------------------------------------- |
---|
[458] | 54 | CONTAINS |
---|
| 55 | |
---|
| 56 | SUBROUTINE tra_ldf( kt ) |
---|
| 57 | !!---------------------------------------------------------------------- |
---|
| 58 | !! *** ROUTINE tra_ldf *** |
---|
| 59 | !! |
---|
| 60 | !! ** Purpose : compute the lateral ocean tracer physics. |
---|
| 61 | !!---------------------------------------------------------------------- |
---|
[503] | 62 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
| 63 | !! |
---|
[3294] | 64 | REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrdt, ztrds |
---|
[458] | 65 | !!---------------------------------------------------------------------- |
---|
[3294] | 66 | ! |
---|
| 67 | IF( nn_timing == 1 ) CALL timing_start('tra_ldf') |
---|
| 68 | ! |
---|
| 69 | rldf = 1 ! For active tracers the |
---|
[458] | 70 | |
---|
[2528] | 71 | IF( l_trdtra ) THEN !* Save ta and sa trends |
---|
[3294] | 72 | CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds ) |
---|
| 73 | ztrdt(:,:,:) = tsa(:,:,:,jp_tem) |
---|
| 74 | ztrds(:,:,:) = tsa(:,:,:,jp_sal) |
---|
[458] | 75 | ENDIF |
---|
| 76 | |
---|
| 77 | SELECT CASE ( nldf ) ! compute lateral mixing trend and add it to the general trend |
---|
[4990] | 78 | CASE ( 0 ) ; CALL tra_ldf_lap ( kt, nit000, 'TRA', gtsu, gtsv, gtui, gtvi, & |
---|
| 79 | & tsb, tsa, jpts ) ! iso-level laplacian |
---|
[2528] | 80 | CASE ( 1 ) ! rotated laplacian |
---|
| 81 | IF( ln_traldf_grif ) THEN |
---|
[3294] | 82 | CALL tra_ldf_iso_grif( kt, nit000,'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 ) ! Griffies operator |
---|
[2528] | 83 | ELSE |
---|
[4990] | 84 | CALL tra_ldf_iso ( kt, nit000, 'TRA', gtsu, gtsv, gtui, gtvi, & |
---|
| 85 | & tsb, tsa, jpts, ahtb0 ) ! Madec operator |
---|
[2528] | 86 | ENDIF |
---|
[4990] | 87 | CASE ( 2 ) ; CALL tra_ldf_bilap ( kt, nit000, 'TRA', gtsu, gtsv, gtui, gtvi, & |
---|
| 88 | & tsb, tsa, jpts ) ! iso-level bilaplacian |
---|
[3294] | 89 | CASE ( 3 ) ; CALL tra_ldf_bilapg ( kt, nit000, 'TRA', tsb, tsa, jpts ) ! s-coord. geopot. bilap. |
---|
[503] | 90 | ! |
---|
[2528] | 91 | CASE ( -1 ) ! esopa: test all possibility with control print |
---|
[4990] | 92 | CALL tra_ldf_lap ( kt, nit000, 'TRA', gtsu, gtsv, gtui, gtvi, & |
---|
| 93 | & tsb, tsa, jpts ) |
---|
[2528] | 94 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf0 - Ta: ', mask1=tmask, & |
---|
| 95 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
| 96 | IF( ln_traldf_grif ) THEN |
---|
[3294] | 97 | CALL tra_ldf_iso_grif( kt, nit000, 'TRA', gtsu, gtsv, tsb, tsa, jpts, ahtb0 ) |
---|
[2528] | 98 | ELSE |
---|
[4990] | 99 | CALL tra_ldf_iso ( kt, nit000, 'TRA', gtsu, gtsv, gtui, gtvi, & |
---|
| 100 | & tsb, tsa, jpts, ahtb0 ) |
---|
[2528] | 101 | ENDIF |
---|
| 102 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf1 - Ta: ', mask1=tmask, & |
---|
| 103 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
[4990] | 104 | CALL tra_ldf_bilap ( kt, nit000, 'TRA', gtsu, gtsv, gtui, gtvi, & |
---|
| 105 | & tsb, tsa, jpts ) |
---|
[2528] | 106 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf2 - Ta: ', mask1=tmask, & |
---|
| 107 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
[3294] | 108 | CALL tra_ldf_bilapg( kt, nit000, 'TRA', tsb, tsa, jpts ) |
---|
[2528] | 109 | CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf3 - Ta: ', mask1=tmask, & |
---|
| 110 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
[458] | 111 | END SELECT |
---|
| 112 | |
---|
| 113 | #if defined key_traldf_ano |
---|
[2528] | 114 | tsa(:,:,:,jp_tem) = tsa(:,:,:,jp_tem) - t0_ldf(:,:,:) ! anomaly: substract the reference diffusivity |
---|
| 115 | tsa(:,:,:,jp_sal) = tsa(:,:,:,jp_sal) - s0_ldf(:,:,:) |
---|
[458] | 116 | #endif |
---|
[2528] | 117 | |
---|
[503] | 118 | IF( l_trdtra ) THEN ! save the horizontal diffusive trends for further diagnostics |
---|
[2528] | 119 | ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) |
---|
| 120 | ztrds(:,:,:) = tsa(:,:,:,jp_sal) - ztrds(:,:,:) |
---|
[4990] | 121 | CALL trd_tra( kt, 'TRA', jp_tem, jptra_ldf, ztrdt ) |
---|
| 122 | CALL trd_tra( kt, 'TRA', jp_sal, jptra_ldf, ztrds ) |
---|
[3294] | 123 | CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) |
---|
[458] | 124 | ENDIF |
---|
| 125 | ! ! print mean trends (used for debugging) |
---|
[2528] | 126 | IF(ln_ctl) CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' ldf - Ta: ', mask1=tmask, & |
---|
| 127 | & tab3d_2=tsa(:,:,:,jp_sal), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
[503] | 128 | ! |
---|
[3294] | 129 | IF( nn_timing == 1 ) CALL timing_stop('tra_ldf') |
---|
| 130 | ! |
---|
[458] | 131 | END SUBROUTINE tra_ldf |
---|
| 132 | |
---|
| 133 | |
---|
[2528] | 134 | SUBROUTINE tra_ldf_init |
---|
[458] | 135 | !!---------------------------------------------------------------------- |
---|
[2528] | 136 | !! *** ROUTINE tra_ldf_init *** |
---|
[458] | 137 | !! |
---|
| 138 | !! ** Purpose : Choice of the operator for the lateral tracer diffusion |
---|
| 139 | !! |
---|
[1601] | 140 | !! ** Method : set nldf from the namtra_ldf logicals |
---|
[458] | 141 | !! nldf == -1 ESOPA test: ALL operators are used |
---|
| 142 | !! nldf == 0 laplacian operator |
---|
| 143 | !! nldf == 1 Rotated laplacian operator |
---|
| 144 | !! nldf == 2 bilaplacian operator |
---|
| 145 | !! nldf == 3 Rotated bilaplacian |
---|
| 146 | !!---------------------------------------------------------------------- |
---|
| 147 | INTEGER :: ioptio, ierr ! temporary integers |
---|
| 148 | !!---------------------------------------------------------------------- |
---|
| 149 | |
---|
| 150 | ! Define the lateral mixing oparator for tracers |
---|
| 151 | ! =============================================== |
---|
| 152 | |
---|
[503] | 153 | IF(lwp) THEN ! Namelist print |
---|
[458] | 154 | WRITE(numout,*) |
---|
[2528] | 155 | WRITE(numout,*) 'tra_ldf_init : lateral tracer diffusive operator' |
---|
[458] | 156 | WRITE(numout,*) '~~~~~~~~~~~' |
---|
[2528] | 157 | WRITE(numout,*) ' Namelist namtra_ldf already read in ldftra module' |
---|
| 158 | WRITE(numout,*) ' see ldf_tra_init report for lateral mixing parameters' |
---|
| 159 | WRITE(numout,*) |
---|
[458] | 160 | ENDIF |
---|
| 161 | |
---|
[503] | 162 | ! ! control the input |
---|
[458] | 163 | ioptio = 0 |
---|
| 164 | IF( ln_traldf_lap ) ioptio = ioptio + 1 |
---|
| 165 | IF( ln_traldf_bilap ) ioptio = ioptio + 1 |
---|
[620] | 166 | IF( ioptio > 1 ) CALL ctl_stop( ' use ONE or NONE of the 2 lap/bilap operator type on tracer' ) |
---|
| 167 | IF( ioptio == 0 ) nldf = -2 ! No lateral diffusion |
---|
[458] | 168 | ioptio = 0 |
---|
| 169 | IF( ln_traldf_level ) ioptio = ioptio + 1 |
---|
| 170 | IF( ln_traldf_hor ) ioptio = ioptio + 1 |
---|
| 171 | IF( ln_traldf_iso ) ioptio = ioptio + 1 |
---|
[3294] | 172 | IF( ioptio > 1 ) CALL ctl_stop( ' use only ONE direction (level/hor/iso)' ) |
---|
[458] | 173 | |
---|
| 174 | ! defined the type of lateral diffusion from ln_traldf_... logicals |
---|
[902] | 175 | ! CAUTION : nldf = 1 is used in trazdf_imp, change it carefully |
---|
[458] | 176 | ierr = 0 |
---|
[620] | 177 | IF( ln_traldf_lap ) THEN ! laplacian operator |
---|
[458] | 178 | IF ( ln_zco ) THEN ! z-coordinate |
---|
| 179 | IF ( ln_traldf_level ) nldf = 0 ! iso-level (no rotation) |
---|
| 180 | IF ( ln_traldf_hor ) nldf = 0 ! horizontal (no rotation) |
---|
| 181 | IF ( ln_traldf_iso ) nldf = 1 ! isoneutral ( rotation) |
---|
| 182 | ENDIF |
---|
[4990] | 183 | IF ( ln_zps ) THEN ! zps-coordinate |
---|
[458] | 184 | IF ( ln_traldf_level ) ierr = 1 ! iso-level not allowed |
---|
| 185 | IF ( ln_traldf_hor ) nldf = 0 ! horizontal (no rotation) |
---|
| 186 | IF ( ln_traldf_iso ) nldf = 1 ! isoneutral ( rotation) |
---|
| 187 | ENDIF |
---|
[4990] | 188 | IF ( ln_sco ) THEN ! s-coordinate |
---|
[458] | 189 | IF ( ln_traldf_level ) nldf = 0 ! iso-level (no rotation) |
---|
| 190 | IF ( ln_traldf_hor ) nldf = 1 ! horizontal ( rotation) |
---|
| 191 | IF ( ln_traldf_iso ) nldf = 1 ! isoneutral ( rotation) |
---|
| 192 | ENDIF |
---|
| 193 | ENDIF |
---|
| 194 | |
---|
| 195 | IF( ln_traldf_bilap ) THEN ! bilaplacian operator |
---|
| 196 | IF ( ln_zco ) THEN ! z-coordinate |
---|
| 197 | IF ( ln_traldf_level ) nldf = 2 ! iso-level (no rotation) |
---|
| 198 | IF ( ln_traldf_hor ) nldf = 2 ! horizontal (no rotation) |
---|
| 199 | IF ( ln_traldf_iso ) ierr = 2 ! isoneutral ( rotation) |
---|
| 200 | ENDIF |
---|
[4990] | 201 | IF ( ln_zps ) THEN ! zps-coordinate |
---|
[458] | 202 | IF ( ln_traldf_level ) ierr = 1 ! iso-level not allowed |
---|
| 203 | IF ( ln_traldf_hor ) nldf = 2 ! horizontal (no rotation) |
---|
| 204 | IF ( ln_traldf_iso ) ierr = 2 ! isoneutral ( rotation) |
---|
| 205 | ENDIF |
---|
[4990] | 206 | IF ( ln_sco ) THEN ! s-coordinate |
---|
[458] | 207 | IF ( ln_traldf_level ) nldf = 2 ! iso-level (no rotation) |
---|
| 208 | IF ( ln_traldf_hor ) nldf = 3 ! horizontal ( rotation) |
---|
| 209 | IF ( ln_traldf_iso ) ierr = 2 ! isoneutral ( rotation) |
---|
| 210 | ENDIF |
---|
| 211 | ENDIF |
---|
| 212 | |
---|
[4488] | 213 | IF( nldf == 3 ) CALL ctl_warn( 'geopotential bilaplacian tracer diffusion in s-coords not thoroughly tested' ) |
---|
[503] | 214 | IF( ierr == 1 ) CALL ctl_stop( ' iso-level in z-coordinate - partial step, not allowed' ) |
---|
| 215 | IF( ierr == 2 ) CALL ctl_stop( ' isoneutral bilaplacian operator does not exist' ) |
---|
| 216 | IF( lk_traldf_eiv .AND. .NOT.ln_traldf_iso ) & |
---|
| 217 | CALL ctl_stop( ' eddy induced velocity on tracers', & |
---|
| 218 | & ' the eddy induced velocity on tracers requires isopycnal laplacian diffusion' ) |
---|
[458] | 219 | IF( nldf == 1 .OR. nldf == 3 ) THEN ! rotation |
---|
[503] | 220 | IF( .NOT.lk_ldfslp ) CALL ctl_stop( ' the rotation of the diffusive tensor require key_ldfslp' ) |
---|
[915] | 221 | l_traldf_rot = .TRUE. ! needed for trazdf_imp |
---|
[458] | 222 | ENDIF |
---|
| 223 | |
---|
| 224 | IF( lk_esopa ) THEN |
---|
| 225 | IF(lwp) WRITE(numout,*) ' esopa control: use all lateral physics options' |
---|
| 226 | nldf = -1 |
---|
| 227 | ENDIF |
---|
| 228 | |
---|
| 229 | IF(lwp) THEN |
---|
| 230 | WRITE(numout,*) |
---|
[620] | 231 | IF( nldf == -2 ) WRITE(numout,*) ' NO lateral diffusion' |
---|
| 232 | IF( nldf == -1 ) WRITE(numout,*) ' ESOPA test All scheme used' |
---|
| 233 | IF( nldf == 0 ) WRITE(numout,*) ' laplacian operator' |
---|
| 234 | IF( nldf == 1 ) WRITE(numout,*) ' Rotated laplacian operator' |
---|
| 235 | IF( nldf == 2 ) WRITE(numout,*) ' bilaplacian operator' |
---|
| 236 | IF( nldf == 3 ) WRITE(numout,*) ' Rotated bilaplacian' |
---|
[458] | 237 | ENDIF |
---|
| 238 | |
---|
| 239 | ! Reference T & S diffusivity (if necessary) |
---|
| 240 | ! =========================== |
---|
| 241 | CALL ldf_ano |
---|
[503] | 242 | ! |
---|
[2528] | 243 | END SUBROUTINE tra_ldf_init |
---|
[458] | 244 | |
---|
| 245 | #if defined key_traldf_ano |
---|
| 246 | !!---------------------------------------------------------------------- |
---|
| 247 | !! 'key_traldf_ano' T & S lateral diffusion on anomalies |
---|
| 248 | !!---------------------------------------------------------------------- |
---|
| 249 | |
---|
| 250 | SUBROUTINE ldf_ano |
---|
| 251 | !!---------------------------------------------------------------------- |
---|
| 252 | !! *** ROUTINE ldf_ano *** |
---|
| 253 | !! |
---|
| 254 | !! ** Purpose : initializations of |
---|
| 255 | !!---------------------------------------------------------------------- |
---|
[2715] | 256 | ! |
---|
[458] | 257 | USE zdf_oce ! vertical mixing |
---|
| 258 | USE trazdf ! vertical mixing: double diffusion |
---|
| 259 | USE zdfddm ! vertical mixing: double diffusion |
---|
[2715] | 260 | ! |
---|
[503] | 261 | INTEGER :: jk ! Dummy loop indice |
---|
[2715] | 262 | INTEGER :: ierr ! local integer |
---|
| 263 | LOGICAL :: llsave ! local logical |
---|
| 264 | REAL(wp) :: zt0, zs0, z12 ! local scalar |
---|
[3294] | 265 | REAL(wp), POINTER, DIMENSION(:,:,:) :: zt_ref, zs_ref, ztb, zsb, zavt |
---|
[458] | 266 | !!---------------------------------------------------------------------- |
---|
[3294] | 267 | ! |
---|
| 268 | IF( nn_timing == 1 ) CALL timing_start('ldf_ano') |
---|
| 269 | ! |
---|
| 270 | CALL wrk_alloc( jpi, jpj, jpk, zt_ref, zs_ref, ztb, zsb, zavt ) |
---|
| 271 | ! |
---|
[458] | 272 | |
---|
| 273 | IF(lwp) THEN |
---|
| 274 | WRITE(numout,*) |
---|
| 275 | WRITE(numout,*) 'tra:ldf_ano : lateral diffusion acting on anomalies' |
---|
| 276 | WRITE(numout,*) '~~~~~~~~~~~' |
---|
| 277 | ENDIF |
---|
| 278 | |
---|
[2715] | 279 | ! ! allocate trabbl arrays |
---|
| 280 | ALLOCATE( t0_ldf(jpi,jpj,jpk) , s0_ldf(jpi,jpj,jpk) , STAT=ierr ) |
---|
| 281 | IF( lk_mpp ) CALL mpp_sum( ierr ) |
---|
| 282 | IF( ierr /= 0 ) CALL ctl_stop( 'STOP', 'ldf_ano: unable to allocate arrays' ) |
---|
| 283 | |
---|
[458] | 284 | ! defined the T & S reference profiles |
---|
| 285 | ! ------------------------------------ |
---|
| 286 | zt0 =10.e0 ! homogeneous ocean |
---|
| 287 | zs0 =35.e0 |
---|
| 288 | zt_ref(:,:,:) = 10.0 * tmask(:,:,:) |
---|
| 289 | zs_ref(:,:,:) = 35.0 * tmask(:,:,:) |
---|
| 290 | IF(lwp) WRITE(numout,*) ' homogeneous ocean T = ', zt0, ' S = ',zs0 |
---|
| 291 | |
---|
| 292 | ! ! T & S profile (to be coded +namelist parameter |
---|
| 293 | |
---|
| 294 | ! prepare the ldf computation |
---|
| 295 | ! --------------------------- |
---|
| 296 | llsave = l_trdtra |
---|
| 297 | l_trdtra = .false. ! desactivate trend computation |
---|
| 298 | t0_ldf(:,:,:) = 0.e0 |
---|
| 299 | s0_ldf(:,:,:) = 0.e0 |
---|
[2528] | 300 | ztb (:,:,:) = tsb (:,:,:,jp_tem) |
---|
| 301 | zsb (:,:,:) = tsb (:,:,:,jp_sal) |
---|
| 302 | ua (:,:,:) = tsa (:,:,:,jp_tem) |
---|
| 303 | va (:,:,:) = tsa (:,:,:,jp_sal) |
---|
[458] | 304 | zavt (:,:,:) = avt(:,:,:) |
---|
[474] | 305 | IF( lk_zdfddm ) THEN CALL ctl_stop( ' key_traldf_ano with key_zdfddm not implemented' ) |
---|
[458] | 306 | ! set tb, sb to reference values and avr to zero |
---|
[2528] | 307 | tsb (:,:,:,jp_tem) = zt_ref(:,:,:) |
---|
| 308 | tsb (:,:,:,jp_sal) = zs_ref(:,:,:) |
---|
| 309 | tsa (:,:,:,jp_tem) = 0.e0 |
---|
| 310 | tsa (:,:,:,jp_sal) = 0.e0 |
---|
| 311 | avt(:,:,:) = 0.e0 |
---|
[458] | 312 | |
---|
| 313 | ! Compute the ldf trends |
---|
| 314 | ! ---------------------- |
---|
[3294] | 315 | CALL tra_ldf( nit000 + 1 ) ! horizontal components (+1: no more init) |
---|
| 316 | CALL tra_zdf( nit000 ) ! vertical component (if necessary nit000 to performed the init) |
---|
[458] | 317 | |
---|
| 318 | ! finalise the computation and recover all arrays |
---|
| 319 | ! ----------------------------------------------- |
---|
| 320 | l_trdtra = llsave |
---|
| 321 | z12 = 2.e0 |
---|
| 322 | IF( neuler == 1) z12 = 1.e0 |
---|
| 323 | IF( ln_zdfexp ) THEN ! ta,sa are the trends |
---|
[2528] | 324 | t0_ldf(:,:,:) = tsa(:,:,:,jp_tem) |
---|
| 325 | s0_ldf(:,:,:) = tsa(:,:,:,jp_sal) |
---|
[458] | 326 | ELSE |
---|
| 327 | DO jk = 1, jpkm1 |
---|
[2528] | 328 | t0_ldf(:,:,jk) = ( tsa(:,:,jk,jp_tem) - tsb(:,:,jk,jp_tem) ) / ( z12 *rdttra(jk) ) |
---|
| 329 | s0_ldf(:,:,jk) = ( tsa(:,:,jk,jp_sal) - tsb(:,:,jk,jp_sal) ) / ( z12 *rdttra(jk) ) |
---|
[458] | 330 | END DO |
---|
| 331 | ENDIF |
---|
[2528] | 332 | tsb(:,:,:,jp_tem) = ztb (:,:,:) |
---|
| 333 | tsb(:,:,:,jp_sal) = zsb (:,:,:) |
---|
| 334 | tsa(:,:,:,jp_tem) = ua (:,:,:) |
---|
| 335 | tsa(:,:,:,jp_sal) = va (:,:,:) |
---|
| 336 | avt(:,:,:) = zavt(:,:,:) |
---|
[503] | 337 | ! |
---|
[3294] | 338 | CALL wrk_dealloc( jpi, jpj, jpk, zt_ref, zs_ref, ztb, zsb, zavt ) |
---|
[2715] | 339 | ! |
---|
[3294] | 340 | IF( nn_timing == 1 ) CALL timing_stop('ldf_ano') |
---|
| 341 | ! |
---|
[458] | 342 | END SUBROUTINE ldf_ano |
---|
| 343 | |
---|
| 344 | #else |
---|
| 345 | !!---------------------------------------------------------------------- |
---|
| 346 | !! default option : Dummy code NO T & S background profiles |
---|
| 347 | !!---------------------------------------------------------------------- |
---|
| 348 | SUBROUTINE ldf_ano |
---|
| 349 | IF(lwp) THEN |
---|
| 350 | WRITE(numout,*) |
---|
| 351 | WRITE(numout,*) 'tra:ldf_ano : lateral diffusion acting on the full fields' |
---|
| 352 | WRITE(numout,*) '~~~~~~~~~~~' |
---|
| 353 | ENDIF |
---|
| 354 | END SUBROUTINE ldf_ano |
---|
| 355 | #endif |
---|
| 356 | |
---|
| 357 | !!====================================================================== |
---|
[620] | 358 | END MODULE traldf |
---|