[941] | 1 | MODULE trcdmp |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE trcdmp *** |
---|
| 4 | !! Ocean physics: internal restoring trend on passive tracers |
---|
| 5 | !!====================================================================== |
---|
[2030] | 6 | !! History : OPA ! 1991-03 (O. Marti, G. Madec) Original code |
---|
| 7 | !! ! 1996-01 (G. Madec) statement function for e3 |
---|
| 8 | !! ! 1997-05 (H. Loukos) adapted for passive tracers |
---|
| 9 | !! NEMO 9.0 ! 2004-03 (C. Ethe) free form + modules |
---|
| 10 | !! 3.2 ! 2007-02 (C. Deltel) Diagnose ML trends for passive tracers |
---|
| 11 | !! 3.3 ! 2010-06 (C. Ethe, G. Madec) merge TRA-TRC |
---|
[941] | 12 | !!---------------------------------------------------------------------- |
---|
[1175] | 13 | #if defined key_top && defined key_trcdmp |
---|
[941] | 14 | !!---------------------------------------------------------------------- |
---|
[1175] | 15 | !! key_trcdmp internal damping |
---|
| 16 | !!---------------------------------------------------------------------- |
---|
[941] | 17 | !! trc_dmp : update the tracer trend with the internal damping |
---|
| 18 | !! trc_dmp_init : initialization, namlist read, parameters control |
---|
| 19 | !!---------------------------------------------------------------------- |
---|
| 20 | USE oce_trc ! ocean dynamics and tracers variables |
---|
[1175] | 21 | USE trc ! ocean passive tracers variables |
---|
[2030] | 22 | USE trcnam_trp ! passive tracers transport namelist variables |
---|
[941] | 23 | USE trcdta |
---|
[2030] | 24 | USE tradmp |
---|
[941] | 25 | USE prtctl_trc ! Print control for debbuging |
---|
[2030] | 26 | USE trdtra |
---|
[941] | 27 | |
---|
| 28 | IMPLICIT NONE |
---|
| 29 | PRIVATE |
---|
| 30 | |
---|
[1175] | 31 | PUBLIC trc_dmp ! routine called by step.F90 |
---|
[941] | 32 | |
---|
[1175] | 33 | LOGICAL , PUBLIC, PARAMETER :: lk_trcdmp = .TRUE. !: internal damping flag |
---|
[2030] | 34 | ! !!* Namelist namtrc_dmp : passive tracer newtonian damping * |
---|
| 35 | INTEGER :: nn_hdmp_tr = -1 ! = 0/-1/'latitude' for damping over passive tracer |
---|
| 36 | INTEGER :: nn_zdmp_tr = 0 ! = 0/1/2 flag for damping in the mixed layer |
---|
| 37 | REAL(wp) :: rn_surf_tr = 50. ! surface time scale for internal damping [days] |
---|
| 38 | REAL(wp) :: rn_bot_tr = 360. ! bottom time scale for internal damping [days] |
---|
| 39 | REAL(wp) :: rn_dep_tr = 800. ! depth of transition between rn_surf and rn_bot [meters] |
---|
| 40 | INTEGER :: nn_file_tr = 2 ! = 1 create a damping.coeff NetCDF file |
---|
[941] | 41 | |
---|
[2030] | 42 | REAL(wp), DIMENSION(jpi,jpj,jpk) :: restotr ! restoring coeff. on tracers (s-1) |
---|
| 43 | |
---|
[941] | 44 | !! * Substitutions |
---|
| 45 | # include "top_substitute.h90" |
---|
| 46 | !!---------------------------------------------------------------------- |
---|
[2287] | 47 | !! NEMO/TOP 3.3 , NEMO Consortium (2010) |
---|
[1175] | 48 | !! $Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/TRP/trcdmp.F90,v 1.11 2006/09/01 14:03:49 opalod Exp $ |
---|
[2287] | 49 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[941] | 50 | !!---------------------------------------------------------------------- |
---|
| 51 | |
---|
| 52 | CONTAINS |
---|
| 53 | |
---|
| 54 | SUBROUTINE trc_dmp( kt ) |
---|
| 55 | !!---------------------------------------------------------------------- |
---|
| 56 | !! *** ROUTINE trc_dmp *** |
---|
| 57 | !! |
---|
| 58 | !! ** Purpose : Compute the passive tracer trend due to a newtonian damping |
---|
| 59 | !! of the tracer field towards given data field and add it to the |
---|
| 60 | !! general tracer trends. |
---|
| 61 | !! |
---|
| 62 | !! ** Method : Newtonian damping towards trdta computed |
---|
| 63 | !! and add to the general tracer trends: |
---|
| 64 | !! trn = tra + restotr * (trdta - trb) |
---|
| 65 | !! The trend is computed either throughout the water column |
---|
| 66 | !! (nlmdmptr=0) or in area of weak vertical mixing (nlmdmptr=1) or |
---|
| 67 | !! below the well mixed layer (nlmdmptr=2) |
---|
| 68 | !! |
---|
| 69 | !! ** Action : - update the tracer trends tra with the newtonian |
---|
| 70 | !! damping trends. |
---|
[1175] | 71 | !! - save the trends ('key_trdmld_trc') |
---|
| 72 | !!---------------------------------------------------------------------- |
---|
[941] | 73 | !! |
---|
| 74 | INTEGER, INTENT( in ) :: kt ! ocean time-step index |
---|
[2030] | 75 | !! |
---|
[1175] | 76 | INTEGER :: ji, jj, jk, jn ! dummy loop indices |
---|
[2030] | 77 | REAL(wp) :: ztra ! temporary scalars |
---|
[941] | 78 | CHARACTER (len=22) :: charout |
---|
[2030] | 79 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ztrtrd |
---|
[941] | 80 | !!---------------------------------------------------------------------- |
---|
| 81 | |
---|
| 82 | ! 0. Initialization (first time-step only) |
---|
| 83 | ! -------------- |
---|
[2148] | 84 | IF( kt == nit000 ) CALL trc_dmp_init |
---|
[941] | 85 | |
---|
[2030] | 86 | IF( l_trdtrc ) ALLOCATE( ztrtrd(jpi,jpj,jpk) ) ! temporary save of trends |
---|
[1175] | 87 | |
---|
[941] | 88 | ! 1. Newtonian damping trends on tracer fields |
---|
| 89 | ! -------------------------------------------- |
---|
| 90 | ! Initialize the input fields for newtonian damping |
---|
[2030] | 91 | CALL trc_dta( kt ) |
---|
[1175] | 92 | ! ! =========== |
---|
| 93 | DO jn = 1, jptra ! tracer loop |
---|
| 94 | ! ! =========== |
---|
| 95 | IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn) ! save trends |
---|
[941] | 96 | |
---|
| 97 | IF( lutini(jn) ) THEN |
---|
[2030] | 98 | ! |
---|
| 99 | SELECT CASE ( nn_zdmp_trc ) |
---|
| 100 | ! |
---|
| 101 | CASE( 0 ) !== newtonian damping throughout the water column ==! |
---|
[941] | 102 | DO jk = 1, jpkm1 |
---|
| 103 | DO jj = 2, jpjm1 |
---|
| 104 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[2030] | 105 | ztra = restotr(ji,jj,jk) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) |
---|
[941] | 106 | tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra |
---|
| 107 | END DO |
---|
| 108 | END DO |
---|
| 109 | END DO |
---|
[2030] | 110 | ! |
---|
| 111 | CASE ( 1 ) !== no damping in the turbocline (avt > 5 cm2/s) ==! |
---|
[941] | 112 | DO jk = 1, jpkm1 |
---|
| 113 | DO jj = 2, jpjm1 |
---|
| 114 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
[2030] | 115 | IF( avt(ji,jj,jk) <= 5.e-4 ) THEN |
---|
| 116 | ztra = restotr(ji,jj,jk) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) |
---|
| 117 | tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra |
---|
[941] | 118 | ENDIF |
---|
| 119 | END DO |
---|
| 120 | END DO |
---|
| 121 | END DO |
---|
[2030] | 122 | ! |
---|
| 123 | CASE ( 2 ) !== no damping in the mixed layer ==! |
---|
[941] | 124 | DO jk = 1, jpkm1 |
---|
| 125 | DO jj = 2, jpjm1 |
---|
| 126 | DO ji = fs_2, fs_jpim1 ! vector opt. |
---|
| 127 | IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN |
---|
| 128 | ztra = restotr(ji,jj,jk,jn) * ( trdta(ji,jj,jk,jn) - trb(ji,jj,jk,jn) ) |
---|
[2030] | 129 | tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra |
---|
| 130 | END IF |
---|
[941] | 131 | END DO |
---|
| 132 | END DO |
---|
| 133 | END DO |
---|
[2030] | 134 | ! |
---|
[941] | 135 | END SELECT |
---|
[2030] | 136 | ! |
---|
[941] | 137 | ENDIF |
---|
[2030] | 138 | ! |
---|
[1175] | 139 | IF( l_trdtrc ) THEN |
---|
| 140 | ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) |
---|
[2030] | 141 | CALL trd_tra( kt, 'TRC', jn, jptra_trd_dmp, ztrtrd ) |
---|
[1175] | 142 | END IF |
---|
| 143 | ! ! =========== |
---|
| 144 | END DO ! tracer loop |
---|
| 145 | ! ! =========== |
---|
[2030] | 146 | IF( l_trdtrc ) DEALLOCATE( ztrtrd ) |
---|
| 147 | ! ! print mean trends (used for debugging) |
---|
| 148 | IF( ln_ctl ) THEN |
---|
| 149 | WRITE(charout, FMT="('dmp ')") ; CALL prt_ctl_trc_info(charout) |
---|
| 150 | CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) |
---|
[941] | 151 | ENDIF |
---|
[2030] | 152 | ! |
---|
[941] | 153 | END SUBROUTINE trc_dmp |
---|
| 154 | |
---|
| 155 | |
---|
| 156 | SUBROUTINE trc_dmp_init |
---|
| 157 | !!---------------------------------------------------------------------- |
---|
| 158 | !! *** ROUTINE trc_dmp_init *** |
---|
| 159 | !! |
---|
| 160 | !! ** Purpose : Initialization for the newtonian damping |
---|
| 161 | !! |
---|
| 162 | !! ** Method : read the nammbf namelist and check the parameters |
---|
| 163 | !! called by trc_dmp at the first timestep (nit000) |
---|
| 164 | !!---------------------------------------------------------------------- |
---|
| 165 | |
---|
[2030] | 166 | SELECT CASE ( nn_hdmp_tr ) |
---|
| 167 | CASE ( -1 ) ; IF(lwp) WRITE(numout,*) ' tracer damping in the Med & Red seas only' |
---|
| 168 | CASE ( 1:90 ) ; IF(lwp) WRITE(numout,*) ' tracer damping poleward of', nn_hdmp_tr, ' degrees' |
---|
[941] | 169 | CASE DEFAULT |
---|
[2030] | 170 | WRITE(ctmp1,*) ' bad flag value for nn_hdmp_tr = ', nn_hdmp_tr |
---|
[941] | 171 | CALL ctl_stop(ctmp1) |
---|
| 172 | END SELECT |
---|
| 173 | |
---|
[2030] | 174 | SELECT CASE ( nn_zdmp_tr ) |
---|
| 175 | CASE ( 0 ) ; IF(lwp) WRITE(numout,*) ' tracer damping throughout the water column' |
---|
| 176 | CASE ( 1 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the turbocline (avt > 5 cm2/s)' |
---|
| 177 | CASE ( 2 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the mixed layer' |
---|
[941] | 178 | CASE DEFAULT |
---|
[2030] | 179 | WRITE(ctmp1,*) 'bad flag value for nn_zdmp_tr = ', nn_zdmp_tr |
---|
[941] | 180 | CALL ctl_stop(ctmp1) |
---|
| 181 | END SELECT |
---|
| 182 | |
---|
[2030] | 183 | IF( .NOT. lk_dtatrc ) & |
---|
| 184 | & CALL ctl_stop( 'no passive tracer data define key_dtatrc' ) |
---|
| 185 | |
---|
| 186 | IF( .NOT. lk_tradmp ) & |
---|
| 187 | & CALL ctl_stop( 'passive trace damping need key_tradmp to compute damping coef.' ) |
---|
| 188 | ! |
---|
| 189 | ! ! Damping coefficients initialization |
---|
| 190 | IF( lzoom ) THEN ; CALL dtacof_zoom( restotr ) |
---|
| 191 | ELSE ; CALL dtacof( nn_hdmp_tr, rn_surf_tr, rn_bot_tr, rn_dep_tr, & |
---|
| 192 | & nn_file_tr, 'TRC' , restotr ) |
---|
[1175] | 193 | ENDIF |
---|
[2030] | 194 | ! |
---|
[941] | 195 | END SUBROUTINE trc_dmp_init |
---|
| 196 | #else |
---|
| 197 | !!---------------------------------------------------------------------- |
---|
| 198 | !! Default key NO internal damping |
---|
| 199 | !!---------------------------------------------------------------------- |
---|
| 200 | LOGICAL , PUBLIC, PARAMETER :: lk_trcdmp = .FALSE. !: internal damping flag |
---|
| 201 | CONTAINS |
---|
| 202 | SUBROUTINE trc_dmp( kt ) ! Empty routine |
---|
| 203 | INTEGER, INTENT(in) :: kt |
---|
| 204 | WRITE(*,*) 'trc_dmp: You should not have seen this print! error?', kt |
---|
| 205 | END SUBROUTINE trc_dmp |
---|
| 206 | #endif |
---|
| 207 | !!====================================================================== |
---|
| 208 | END MODULE trcdmp |
---|