- Timestamp:
- 2016-01-08T10:35:19+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
r4359 r6225 18 18 USE oce_trc ! ocean dynamics and tracers variables 19 19 USE trc ! ocean passive tracers variables 20 USE trcnam_trp ! passive tracers transport namelist variables21 20 USE trcdta 22 21 USE tradmp 23 22 USE prtctl_trc ! Print control for debbuging 24 23 USE trdtra 25 USE trdmod_oce 24 USE trd_oce 25 USE iom 26 26 27 27 IMPLICIT NONE 28 28 PRIVATE 29 29 30 PUBLIC trc_dmp ! routine called by step.F90 31 PUBLIC trc_dmp_clo ! routine called by step.F90 32 PUBLIC trc_dmp_alloc ! routine called by nemogcm.F90 30 PUBLIC trc_dmp 31 PUBLIC trc_dmp_clo 32 PUBLIC trc_dmp_alloc 33 PUBLIC trc_dmp_ini 34 35 INTEGER , PUBLIC :: nn_zdmp_tr ! = 0/1/2 flag for damping in the mixed layer 36 CHARACTER(LEN=200) , PUBLIC :: cn_resto_tr !File containing restoration coefficient 33 37 34 38 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: restotr ! restoring coeff. on tracers (s-1) … … 39 43 40 44 !! * Substitutions 41 # include " top_substitute.h90"45 # include "vectopt_loop_substitute.h90" 42 46 !!---------------------------------------------------------------------- 43 47 !! NEMO/TOP 3.3 , NEMO Consortium (2010) 44 !! $ Header: /home/opalod/NEMOCVSROOT/NEMO/TOP_SRC/TRP/trcdmp.F90,v 1.11 2006/09/01 14:03:49 opalod Exp$48 !! $Id$ 45 49 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 46 50 !!---------------------------------------------------------------------- … … 75 79 !! ** Action : - update the tracer trends tra with the newtonian 76 80 !! damping trends. 77 !! - save the trends ('key_trdmld_trc') 78 !!---------------------------------------------------------------------- 79 !! 80 INTEGER, INTENT( in ) :: kt ! ocean time-step index 81 !! 82 INTEGER :: ji, jj, jk, jn, jl ! dummy loop indices 83 REAL(wp) :: ztra ! temporary scalars 84 CHARACTER (len=22) :: charout 81 !! - save the trends ('key_trdmxl_trc') 82 !!---------------------------------------------------------------------- 83 INTEGER, INTENT(in) :: kt ! ocean time-step index 84 ! 85 INTEGER :: ji, jj, jk, jn, jl ! dummy loop indices 86 CHARACTER (len=22) :: charout 85 87 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd 86 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrcdta ! 3D workspace88 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrcdta ! 3D workspace 87 89 !!---------------------------------------------------------------------- 88 90 ! 89 91 IF( nn_timing == 1 ) CALL timing_start('trc_dmp') 90 92 ! 91 ! 0. Initialization (first time-step only)92 ! --------------93 IF( kt == nittrc000 ) CALL trc_dmp_init94 95 93 IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrtrd ) ! temporary save of trends 96 94 ! … … 104 102 ! 105 103 IF( ln_trc_ini(jn) ) THEN ! update passive tracers arrays with input data read from file 106 104 ! 107 105 jl = n_trc_index(jn) 108 106 CALL trc_dta( kt, sf_trcdta(jl),rf_trfac(jl) ) ! read tracer data at nit000 109 107 ztrcdta(:,:,:) = sf_trcdta(jl)%fnow(:,:,:) 110 108 ! 111 109 SELECT CASE ( nn_zdmp_tr ) 112 110 ! … … 115 113 DO jj = 2, jpjm1 116 114 DO ji = fs_2, fs_jpim1 ! vector opt. 117 ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 118 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 115 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 119 116 END DO 120 117 END DO 121 118 END DO 122 !119 ! 123 120 CASE ( 1 ) !== no damping in the turbocline (avt > 5 cm2/s) ==! 124 121 DO jk = 1, jpkm1 125 122 DO jj = 2, jpjm1 126 123 DO ji = fs_2, fs_jpim1 ! vector opt. 127 IF( avt(ji,jj,jk) <= 5.e-4 ) THEN 128 ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 129 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 124 IF( avt(ji,jj,jk) <= 5.e-4_wp ) THEN 125 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 130 126 ENDIF 131 127 END DO 132 128 END DO 133 129 END DO 134 !130 ! 135 131 CASE ( 2 ) !== no damping in the mixed layer ==! 136 132 DO jk = 1, jpkm1 137 133 DO jj = 2, jpjm1 138 134 DO ji = fs_2, fs_jpim1 ! vector opt. 139 IF( fsdept(ji,jj,jk) >= hmlp (ji,jj) ) THEN 140 ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 141 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 135 IF( gdept_n(ji,jj,jk) >= hmlp (ji,jj) ) THEN 136 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 142 137 END IF 143 138 END DO 144 139 END DO 145 140 END DO 146 !141 ! 147 142 END SELECT 148 143 ! … … 151 146 IF( l_trdtrc ) THEN 152 147 ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) 153 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_dmp, ztrtrd )148 CALL trd_tra( kt, 'TRC', jn, jptra_dmp, ztrtrd ) 154 149 END IF 155 150 ! ! =========== … … 161 156 IF( l_trdtrc ) CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd ) 162 157 ! ! print mean trends (used for debugging) 163 IF( ln_ctl ) THEN 164 WRITE(charout, FMT="('dmp ')") ; CALL prt_ctl_trc_info(charout) 165 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 158 IF( ln_ctl ) THEN 159 WRITE(charout, FMT="('dmp ')") 160 CALL prt_ctl_trc_info(charout) 161 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 166 162 ENDIF 167 163 ! … … 169 165 ! 170 166 END SUBROUTINE trc_dmp 167 168 169 SUBROUTINE trc_dmp_ini 170 !!---------------------------------------------------------------------- 171 !! *** ROUTINE trc_dmp_ini *** 172 !! 173 !! ** Purpose : Initialization for the newtonian damping 174 !! 175 !! ** Method : read the nammbf namelist and check the parameters 176 !! called by trc_dmp at the first timestep (nittrc000) 177 !!---------------------------------------------------------------------- 178 INTEGER :: ios, imask ! local integers 179 !! 180 NAMELIST/namtrc_dmp/ nn_zdmp_tr , cn_resto_tr 181 !!---------------------------------------------------------------------- 182 ! 183 IF( nn_timing == 1 ) CALL timing_start('trc_dmp_init') 184 ! 185 REWIND( numnat_ref ) ! Namelist namtrc_dmp in reference namelist : Passive tracers newtonian damping 186 READ ( numnat_ref, namtrc_dmp, IOSTAT = ios, ERR = 909) 187 909 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dmp in reference namelist', lwp ) 188 189 REWIND( numnat_cfg ) ! Namelist namtrc_dmp in configuration namelist : Passive tracers newtonian damping 190 READ ( numnat_cfg, namtrc_dmp, IOSTAT = ios, ERR = 910) 191 910 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dmp in configuration namelist', lwp ) 192 IF(lwm) WRITE ( numont, namtrc_dmp ) 193 194 IF(lwp) THEN ! Namelist print 195 WRITE(numout,*) 196 WRITE(numout,*) 'trc_dmp : Passive tracers newtonian damping' 197 WRITE(numout,*) '~~~~~~~' 198 WRITE(numout,*) ' Namelist namtrc_dmp : set damping parameter' 199 WRITE(numout,*) ' mixed layer damping option nn_zdmp_tr = ', nn_zdmp_tr, '(zoom: forced to 0)' 200 WRITE(numout,*) ' Restoration coeff file cn_resto_tr = ', cn_resto_tr 201 ENDIF 202 ! 203 IF( lzoom .AND. .NOT.lk_c1d ) nn_zdmp_tr = 0 ! restoring to climatology at closed north or south boundaries 204 SELECT CASE ( nn_zdmp_tr ) 205 CASE ( 0 ) ; IF(lwp) WRITE(numout,*) ' tracer damping throughout the water column' 206 CASE ( 1 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the turbocline (avt > 5 cm2/s)' 207 CASE ( 2 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the mixed layer' 208 CASE DEFAULT 209 WRITE(ctmp1,*) 'bad flag value for nn_zdmp_tr = ', nn_zdmp_tr 210 CALL ctl_stop(ctmp1) 211 END SELECT 212 213 IF( .NOT.lk_c1d ) THEN 214 IF( .NOT. ln_tradmp ) & 215 & CALL ctl_stop( 'passive trace damping need ln_tradmp to compute damping coef.' ) 216 ! 217 ! ! Read damping coefficients from file 218 !Read in mask from file 219 CALL iom_open ( cn_resto_tr, imask) 220 CALL iom_get ( imask, jpdom_autoglo, 'resto', restotr) 221 CALL iom_close( imask ) 222 ! 223 ENDIF 224 IF( nn_timing == 1 ) CALL timing_stop('trc_dmp_init') 225 ! 226 END SUBROUTINE trc_dmp_ini 227 171 228 172 229 SUBROUTINE trc_dmp_clo( kt ) … … 182 239 !! nctsi2(), nctsj2() : north-east Closed sea limits (i,j) 183 240 !!---------------------------------------------------------------------- 184 INTEGER, INTENT( in ) :: kt 185 ! 186 INTEGER :: ji, jj, jk, jn, jl, jc! dummy loop indicesa187 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrcdta ! 3D workspace188 189 !!---------------------------------------------------------------------- 190 241 INTEGER, INTENT( in ) :: kt ! ocean time-step index 242 ! 243 INTEGER :: ji , jj, jk, jn, jl, jc ! dummy loop indicesa 244 INTEGER :: isrow ! local index 245 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrcdta ! 3D workspace 246 !!---------------------------------------------------------------------- 247 ! 191 248 IF( kt == nit000 ) THEN 192 249 ! initial values … … 200 257 ! 201 258 SELECT CASE ( jp_cfg ) 259 ! ! ======================= 260 CASE ( 1 ) ! eORCA_R1 configuration 261 ! ! ======================= 262 isrow = 332 - jpjglo 263 ! 264 ! Caspian Sea 265 nctsi1(1) = 332 ; nctsj1(1) = 243 - isrow 266 nctsi2(1) = 344 ; nctsj2(1) = 275 - isrow 267 ! 202 268 ! ! ======================= 203 269 CASE ( 2 ) ! ORCA_R2 configuration … … 291 357 END SUBROUTINE trc_dmp_clo 292 358 293 294 SUBROUTINE trc_dmp_init295 !!----------------------------------------------------------------------296 !! *** ROUTINE trc_dmp_init ***297 !!298 !! ** Purpose : Initialization for the newtonian damping299 !!300 !! ** Method : read the nammbf namelist and check the parameters301 !! called by trc_dmp at the first timestep (nittrc000)302 !!----------------------------------------------------------------------303 !304 IF( nn_timing == 1 ) CALL timing_start('trc_dmp_init')305 !306 SELECT CASE ( nn_hdmp_tr )307 CASE ( -1 ) ; IF(lwp) WRITE(numout,*) ' tracer damping in the Med & Red seas only'308 CASE ( 1:90 ) ; IF(lwp) WRITE(numout,*) ' tracer damping poleward of', nn_hdmp_tr, ' degrees'309 CASE DEFAULT310 WRITE(ctmp1,*) ' bad flag value for nn_hdmp_tr = ', nn_hdmp_tr311 CALL ctl_stop(ctmp1)312 END SELECT313 314 IF( lzoom ) nn_zdmp_tr = 0 ! restoring to climatology at closed north or south boundaries315 SELECT CASE ( nn_zdmp_tr )316 CASE ( 0 ) ; IF(lwp) WRITE(numout,*) ' tracer damping throughout the water column'317 CASE ( 1 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the turbocline (avt > 5 cm2/s)'318 CASE ( 2 ) ; IF(lwp) WRITE(numout,*) ' no tracer damping in the mixed layer'319 CASE DEFAULT320 WRITE(ctmp1,*) 'bad flag value for nn_zdmp_tr = ', nn_zdmp_tr321 CALL ctl_stop(ctmp1)322 END SELECT323 324 IF( .NOT. ln_tradmp ) &325 & CALL ctl_stop( 'passive trace damping need key_tradmp to compute damping coef.' )326 !327 ! ! Damping coefficients initialization328 IF( lzoom ) THEN ; CALL dtacof_zoom( restotr )329 ELSE ; CALL dtacof( nn_hdmp_tr, rn_surf_tr, rn_bot_tr, rn_dep_tr, &330 & nn_file_tr, 'TRC' , restotr )331 ENDIF332 !333 IF( nn_timing == 1 ) CALL timing_stop('trc_dmp_init')334 !335 END SUBROUTINE trc_dmp_init336 337 359 #else 338 360 !!---------------------------------------------------------------------- … … 346 368 #endif 347 369 348 349 370 !!====================================================================== 350 371 END MODULE trcdmp
Note: See TracChangeset
for help on using the changeset viewer.