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