[941] | 1 | MODULE trcnxt |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE trcnxt *** |
---|
| 4 | !! Ocean passive tracers: time stepping on passives tracers |
---|
| 5 | !!====================================================================== |
---|
[2528] | 6 | !! History : 7.0 ! 1991-11 (G. Madec) Original code |
---|
| 7 | !! ! 1993-03 (M. Guyon) symetrical conditions |
---|
| 8 | !! ! 1995-02 (M. Levy) passive tracers |
---|
| 9 | !! ! 1996-02 (G. Madec & M. Imbard) opa release 8.0 |
---|
| 10 | !! 8.0 ! 1996-04 (A. Weaver) Euler forward step |
---|
| 11 | !! 8.2 ! 1999-02 (G. Madec, N. Grima) semi-implicit pressure grad. |
---|
| 12 | !! NEMO 1.0 ! 2002-08 (G. Madec) F90: Free form and module |
---|
| 13 | !! ! 2002-08 (G. Madec) F90: Free form and module |
---|
| 14 | !! ! 2002-11 (C. Talandier, A-M Treguier) Open boundaries |
---|
| 15 | !! ! 2004-03 (C. Ethe) passive tracers |
---|
| 16 | !! ! 2007-02 (C. Deltel) Diagnose ML trends for passive tracers |
---|
| 17 | !! 2.0 ! 2006-02 (L. Debreu, C. Mazauric) Agrif implementation |
---|
| 18 | !! 3.0 ! 2008-06 (G. Madec) time stepping always done in trazdf |
---|
| 19 | !! 3.1 ! 2009-02 (G. Madec, R. Benshila) re-introduce the vvl option |
---|
| 20 | !! 3.3 ! 2010-06 (C. Ethe, G. Madec) Merge TRA-TRC |
---|
[1175] | 21 | !!---------------------------------------------------------------------- |
---|
[941] | 22 | #if defined key_top |
---|
| 23 | !!---------------------------------------------------------------------- |
---|
| 24 | !! 'key_top' TOP models |
---|
| 25 | !!---------------------------------------------------------------------- |
---|
| 26 | !! trc_nxt : time stepping on passive tracers |
---|
| 27 | !!---------------------------------------------------------------------- |
---|
| 28 | USE oce_trc ! ocean dynamics and tracers variables |
---|
[2528] | 29 | USE trc ! ocean passive tracers variables |
---|
[941] | 30 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 31 | USE prtctl_trc ! Print control for debbuging |
---|
[4990] | 32 | USE trd_oce |
---|
[2528] | 33 | USE trdtra |
---|
| 34 | USE tranxt |
---|
[6140] | 35 | USE trcbdy ! BDY open boundaries |
---|
| 36 | USE bdy_par, only: lk_bdy |
---|
[2528] | 37 | # if defined key_agrif |
---|
[941] | 38 | USE agrif_top_interp |
---|
[2528] | 39 | # endif |
---|
[941] | 40 | |
---|
| 41 | IMPLICIT NONE |
---|
| 42 | PRIVATE |
---|
| 43 | |
---|
[2715] | 44 | PUBLIC trc_nxt ! routine called by step.F90 |
---|
[2528] | 45 | |
---|
[6140] | 46 | REAL(wp) :: r2dttrc |
---|
[2715] | 47 | |
---|
[941] | 48 | !!---------------------------------------------------------------------- |
---|
[2528] | 49 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
[1152] | 50 | !! $Id$ |
---|
[2715] | 51 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[941] | 52 | !!---------------------------------------------------------------------- |
---|
| 53 | CONTAINS |
---|
| 54 | |
---|
| 55 | SUBROUTINE trc_nxt( kt ) |
---|
| 56 | !!---------------------------------------------------------------------- |
---|
| 57 | !! *** ROUTINE trcnxt *** |
---|
| 58 | !! |
---|
| 59 | !! ** Purpose : Compute the passive tracers fields at the |
---|
| 60 | !! next time-step from their temporal trends and swap the fields. |
---|
| 61 | !! |
---|
| 62 | !! ** Method : Apply lateral boundary conditions on (ua,va) through |
---|
| 63 | !! call to lbc_lnk routine |
---|
| 64 | !! default: |
---|
| 65 | !! arrays swap |
---|
| 66 | !! (trn) = (tra) ; (tra) = (0,0) |
---|
| 67 | !! (trb) = (trn) |
---|
| 68 | !! |
---|
| 69 | !! For Arakawa or TVD Scheme : |
---|
| 70 | !! A Asselin time filter applied on now tracers (trn) to avoid |
---|
| 71 | !! the divergence of two consecutive time-steps and tr arrays |
---|
| 72 | !! to prepare the next time_step: |
---|
| 73 | !! (trb) = (trn) + atfp [ (trb) + (tra) - 2 (trn) ] |
---|
| 74 | !! (trn) = (tra) ; (tra) = (0,0) |
---|
| 75 | !! |
---|
| 76 | !! |
---|
| 77 | !! ** Action : - update trb, trn |
---|
| 78 | !!---------------------------------------------------------------------- |
---|
[1271] | 79 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
[2715] | 80 | ! |
---|
[2528] | 81 | INTEGER :: jk, jn ! dummy loop indices |
---|
[941] | 82 | REAL(wp) :: zfact ! temporary scalar |
---|
| 83 | CHARACTER (len=22) :: charout |
---|
[3294] | 84 | REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrdt |
---|
[941] | 85 | !!---------------------------------------------------------------------- |
---|
[3294] | 86 | ! |
---|
| 87 | IF( nn_timing == 1 ) CALL timing_start('trc_nxt') |
---|
| 88 | ! |
---|
| 89 | IF( kt == nittrc000 .AND. lwp ) THEN |
---|
[941] | 90 | WRITE(numout,*) |
---|
| 91 | WRITE(numout,*) 'trc_nxt : time stepping on passive tracers' |
---|
| 92 | ENDIF |
---|
[6140] | 93 | ! |
---|
[5656] | 94 | #if defined key_agrif |
---|
| 95 | CALL Agrif_trc ! AGRIF zoom boundaries |
---|
| 96 | #endif |
---|
[6140] | 97 | DO jn = 1, jptra ! Update after tracer on domain lateral boundaries |
---|
[941] | 98 | CALL lbc_lnk( tra(:,:,:,jn), 'T', 1. ) |
---|
[2528] | 99 | END DO |
---|
[941] | 100 | |
---|
[6140] | 101 | IF( lk_bdy ) CALL trc_bdy( kt ) |
---|
[941] | 102 | |
---|
[6140] | 103 | ! ! set time step size (Euler/Leapfrog) |
---|
| 104 | IF( neuler == 0 .AND. kt == nittrc000 ) THEN ; r2dttrc = rdttrc ! at nittrc000 (Euler) |
---|
| 105 | ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN ; r2dttrc = 2.* rdttrc ! at nit000 or nit000+1 (Leapfrog) |
---|
[2528] | 106 | ENDIF |
---|
[941] | 107 | |
---|
[6140] | 108 | IF( l_trdtrc ) THEN ! trends: store now fields before the Asselin filter application |
---|
| 109 | CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrdt ) |
---|
[2528] | 110 | ztrdt(:,:,:,:) = trn(:,:,:,:) |
---|
| 111 | ENDIF |
---|
[6140] | 112 | ! ! Leap-Frog + Asselin filter time stepping |
---|
| 113 | IF( neuler == 0 .AND. kt == nittrc000 ) THEN ! Euler time-stepping at first time-step (only swap) |
---|
[2528] | 114 | DO jn = 1, jptra |
---|
| 115 | DO jk = 1, jpkm1 |
---|
| 116 | trn(:,:,jk,jn) = tra(:,:,jk,jn) |
---|
| 117 | END DO |
---|
| 118 | END DO |
---|
[6140] | 119 | ELSE ! Asselin filter + swap |
---|
| 120 | IF( ln_linssh ) THEN ; CALL tra_nxt_fix( kt, nittrc000, 'TRC', trb, trn, tra, jptra ) ! linear ssh |
---|
| 121 | ELSE ; CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra, & |
---|
| 122 | & sbc_trc, sbc_trc_b, jptra ) ! non-linear ssh |
---|
[2528] | 123 | ENDIF |
---|
[6140] | 124 | ! |
---|
| 125 | DO jn = 1, jptra |
---|
| 126 | CALL lbc_lnk( trb(:,:,:,jn), 'T', 1._wp ) |
---|
| 127 | CALL lbc_lnk( trn(:,:,:,jn), 'T', 1._wp ) |
---|
| 128 | CALL lbc_lnk( tra(:,:,:,jn), 'T', 1._wp ) |
---|
| 129 | END DO |
---|
[2528] | 130 | ENDIF |
---|
[6140] | 131 | ! |
---|
| 132 | IF( l_trdtrc ) THEN ! trends: send Asselin filter trends to trdtra manager for further diagnostics |
---|
[2528] | 133 | DO jn = 1, jptra |
---|
| 134 | DO jk = 1, jpkm1 |
---|
[6140] | 135 | zfact = 1._wp / r2dttrc |
---|
[2528] | 136 | ztrdt(:,:,jk,jn) = ( trb(:,:,jk,jn) - ztrdt(:,:,jk,jn) ) * zfact |
---|
[4990] | 137 | CALL trd_tra( kt, 'TRC', jn, jptra_atf, ztrdt ) |
---|
[1175] | 138 | END DO |
---|
[2528] | 139 | END DO |
---|
[3294] | 140 | CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrdt ) |
---|
[2528] | 141 | END IF |
---|
| 142 | ! |
---|
[941] | 143 | IF(ln_ctl) THEN ! print mean trends (used for debugging) |
---|
| 144 | WRITE(charout, FMT="('nxt')") |
---|
| 145 | CALL prt_ctl_trc_info(charout) |
---|
| 146 | CALL prt_ctl_trc(tab4d=trn, mask=tmask, clinfo=ctrcnm) |
---|
| 147 | ENDIF |
---|
[2528] | 148 | ! |
---|
[3294] | 149 | IF( nn_timing == 1 ) CALL timing_stop('trc_nxt') |
---|
| 150 | ! |
---|
[941] | 151 | END SUBROUTINE trc_nxt |
---|
| 152 | |
---|
| 153 | #else |
---|
| 154 | !!---------------------------------------------------------------------- |
---|
| 155 | !! Default option Empty module |
---|
| 156 | !!---------------------------------------------------------------------- |
---|
| 157 | CONTAINS |
---|
| 158 | SUBROUTINE trc_nxt( kt ) |
---|
| 159 | INTEGER, INTENT(in) :: kt |
---|
| 160 | WRITE(*,*) 'trc_nxt: You should not have seen this print! error?', kt |
---|
| 161 | END SUBROUTINE trc_nxt |
---|
| 162 | #endif |
---|
| 163 | !!====================================================================== |
---|
| 164 | END MODULE trcnxt |
---|