[2030] | 1 | MODULE trczdf |
---|
| 2 | !!============================================================================== |
---|
| 3 | !! *** MODULE trczdf *** |
---|
| 4 | !! Ocean Passive tracers : vertical diffusive trends |
---|
| 5 | !!===================================================================== |
---|
[9019] | 6 | !! History : 9.0 ! 2005-11 (G. Madec) Original code |
---|
[2030] | 7 | !! NEMO 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA |
---|
[9019] | 8 | !! 4.0 ! 2017-04 (G. Madec) remove the explicit case |
---|
[2030] | 9 | !!---------------------------------------------------------------------- |
---|
| 10 | #if defined key_top |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
| 12 | !! 'key_top' TOP models |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
[9019] | 14 | !! trc_zdf : update the tracer trend with the vertical diffusion |
---|
[2030] | 15 | !!---------------------------------------------------------------------- |
---|
[5836] | 16 | USE trc ! ocean passive tracers variables |
---|
| 17 | USE oce_trc ! ocean dynamics and active tracers |
---|
| 18 | USE trd_oce ! trends: ocean variables |
---|
[9019] | 19 | USE trazdf ! tracer: vertical diffusion |
---|
| 20 | !!gm do we really need this ? |
---|
[5836] | 21 | USE trcldf ! passive tracers: lateral diffusion |
---|
[9019] | 22 | !!gm |
---|
[5836] | 23 | USE trdtra ! trends manager: tracers |
---|
| 24 | USE prtctl_trc ! Print control |
---|
[2030] | 25 | |
---|
| 26 | IMPLICIT NONE |
---|
| 27 | PRIVATE |
---|
| 28 | |
---|
[5836] | 29 | PUBLIC trc_zdf ! called by step.F90 |
---|
| 30 | |
---|
[2030] | 31 | !!---------------------------------------------------------------------- |
---|
[10067] | 32 | !! NEMO/TOP 4.0 , NEMO Consortium (2018) |
---|
[7753] | 33 | !! $Id$ |
---|
[10068] | 34 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[2030] | 35 | !!---------------------------------------------------------------------- |
---|
| 36 | CONTAINS |
---|
[2715] | 37 | |
---|
[12377] | 38 | SUBROUTINE trc_zdf( kt, Kbb, Kmm, Krhs, ptr, Kaa ) |
---|
[2030] | 39 | !!---------------------------------------------------------------------- |
---|
| 40 | !! *** ROUTINE trc_zdf *** |
---|
| 41 | !! |
---|
[9019] | 42 | !! ** Purpose : compute the vertical ocean tracer physics using |
---|
| 43 | !! an implicit time-stepping scheme. |
---|
[2030] | 44 | !!--------------------------------------------------------------------- |
---|
[12377] | 45 | INTEGER , INTENT(in ) :: kt ! ocean time-step index |
---|
| 46 | INTEGER , INTENT(in ) :: Kbb, Kmm, Krhs, Kaa ! ocean time level indices |
---|
| 47 | REAL(wp), DIMENSION(jpi,jpj,jpk,jptra,jpt), INTENT(inout) :: ptr ! passive tracers and RHS of tracer equation |
---|
[2030] | 48 | ! |
---|
[7753] | 49 | INTEGER :: jk, jn |
---|
[2030] | 50 | CHARACTER (len=22) :: charout |
---|
[9019] | 51 | REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: ztrtrd ! 4D workspace |
---|
[2030] | 52 | !!--------------------------------------------------------------------- |
---|
[3294] | 53 | ! |
---|
[9124] | 54 | IF( ln_timing ) CALL timing_start('trc_zdf') |
---|
[3294] | 55 | ! |
---|
[12377] | 56 | IF( l_trdtrc ) ztrtrd(:,:,:,:) = ptr(:,:,:,:,Krhs) |
---|
[9019] | 57 | ! |
---|
[12489] | 58 | CALL tra_zdf_imp( kt, nittrc000, 'TRC', rDt_trc, Kbb, Kmm, Krhs, ptr, Kaa, jptra ) ! implicit scheme |
---|
[9019] | 59 | ! |
---|
[3632] | 60 | IF( l_trdtrc ) THEN ! save the vertical diffusive trends for further diagnostics |
---|
[2030] | 61 | DO jn = 1, jptra |
---|
| 62 | DO jk = 1, jpkm1 |
---|
[12489] | 63 | ztrtrd(:,:,jk,jn) = ( ( ptr(:,:,jk,jn,Kaa) - ptr(:,:,jk,jn,Kbb) ) / rDt_trc ) - ztrtrd(:,:,jk,jn) |
---|
[2030] | 64 | END DO |
---|
[12377] | 65 | CALL trd_tra( kt, Kmm, Krhs, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) ) |
---|
[2030] | 66 | END DO |
---|
| 67 | ENDIF |
---|
| 68 | ! ! print mean trends (used for debugging) |
---|
[12377] | 69 | IF( sn_cfctl%l_prttrc ) THEN |
---|
[9019] | 70 | WRITE(charout, FMT="('zdf ')") |
---|
| 71 | CALL prt_ctl_trc_info(charout) |
---|
[12377] | 72 | CALL prt_ctl_trc( tab4d=tr(:,:,:,:,Kaa), mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) |
---|
[2030] | 73 | END IF |
---|
| 74 | ! |
---|
[9124] | 75 | IF( ln_timing ) CALL timing_stop('trc_zdf') |
---|
[3294] | 76 | ! |
---|
[2030] | 77 | END SUBROUTINE trc_zdf |
---|
[5836] | 78 | |
---|
[2030] | 79 | #else |
---|
| 80 | !!---------------------------------------------------------------------- |
---|
| 81 | !! Default option Empty module |
---|
| 82 | !!---------------------------------------------------------------------- |
---|
| 83 | CONTAINS |
---|
| 84 | SUBROUTINE trc_zdf( kt ) |
---|
| 85 | INTEGER, INTENT(in) :: kt |
---|
| 86 | WRITE(*,*) 'trc_zdf: You should not have seen this print! error?', kt |
---|
| 87 | END SUBROUTINE trc_zdf |
---|
| 88 | #endif |
---|
| 89 | !!============================================================================== |
---|
| 90 | END MODULE trczdf |
---|