Changeset 7123 for branches/UKMO/r5518_bdy_sponge_temp/NEMOGCM
- Timestamp:
- 2016-10-26T19:32:29+02:00 (8 years ago)
- Location:
- branches/UKMO/r5518_bdy_sponge_temp/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/r5518_bdy_sponge_temp/NEMOGCM/NEMO/OPA_SRC/BDY/bdy_oce.F90
r7122 r7123 83 83 LOGICAL :: ln_mask_file !: =T read bdymask from file 84 84 LOGICAL :: ln_vol !: =T volume correction 85 LOGICAL, DIMENSION(jp_bdy) :: ln_sponge !: =T use sponge layer 85 86 ! 86 87 INTEGER :: nb_bdy !: number of open boundary sets … … 88 89 INTEGER :: nn_volctl !: = 0 the total volume will have the variability of the surface Flux E-P 89 90 ! ! = 1 the volume will be constant during all the integration. 91 REAL(wp) :: rn_sponge !: multiplier of diffusion for sponge layer 90 92 CHARACTER(len=20), DIMENSION(jp_bdy) :: cn_dyn2d ! Choice of boundary condition for barotropic variables (U,V,SSH) 91 93 INTEGER, DIMENSION(jp_bdy) :: nn_dyn2d_dta !: = 0 use the initial state as bdy dta ; … … 118 120 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET :: bdyumask !: Mask defining computational domain at U-points 119 121 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET :: bdyvmask !: Mask defining computational domain at V-points 122 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET :: sponge_factor !: Multiplier for diffusion for sponge layer 120 123 121 124 REAL(wp) :: bdysurftot !: Lateral surface of unstructured open boundary … … 148 151 ! 149 152 ALLOCATE( bdytmask(jpi,jpj) , bdyumask(jpi,jpj), bdyvmask(jpi,jpj), & 150 & STAT=bdy_oce_alloc )153 & sponge_factor(jpi,jpj), STAT=bdy_oce_alloc ) 151 154 ! 152 155 ! Initialize masks -
branches/UKMO/r5518_bdy_sponge_temp/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
r7122 r7123 102 102 & cn_ice_lim, nn_ice_lim_dta, & 103 103 & rn_ice_tem, rn_ice_sal, rn_ice_age, & 104 & ln_vol, nn_volctl, nn_rimwidth 104 & ln_vol, nn_volctl, nn_rimwidth, & 105 & ln_sponge, rn_sponge 105 106 !! 106 107 NAMELIST/nambdy_index/ ctypebdy, nbdyind, nbdybeg, nbdyend … … 365 366 IF(lwp) WRITE(numout,*) ' Width of relaxation zone = ', nn_rimwidth(ib_bdy) 366 367 IF(lwp) WRITE(numout,*) 368 IF( ln_sponge(ib_bdy) ) THEN ! check sponge layer choice 369 IF(lwp) WRITE(numout,*) 'Sponge layer applied at open boundaries' 370 IF(lwp) WRITE(numout,*) 'Multiplier for diffusion in sponge layer : ', rn_sponge 371 IF(lwp) WRITE(numout,*) 372 ELSE 373 IF(lwp) WRITE(numout,*) 'No volume correction applied at open boundaries' 374 IF(lwp) WRITE(numout,*) 375 ENDIF 367 376 368 377 ENDDO … … 383 392 ENDIF 384 393 ENDIF 394 395 sponge_factor(:,:) = 1.0 385 396 386 397 ! ------------------------------------------------- … … 1104 1115 END DO 1105 1116 END DO 1117 ! Compute multiplier for diffusion for sponge layer 1118 ! ------------------------------------------------- 1119 IF( ln_sponge(ib_bdy) ) THEN 1120 igrd=1 1121 DO ib = 1, idx_bdy(ib_bdy)%nblen(igrd) 1122 nbi => idx_bdy(ib_bdy)%nbi(ib,igrd) 1123 nbj => idx_bdy(ib_bdy)%nbj(ib,igrd) 1124 nbr => idx_bdy(ib_bdy)%nbr(ib,igrd) 1125 sponge_factor(nbi,nbj) = 1.0 + (rn_sponge-1.0) * ( 1.- TANH( FLOAT( nbr - 1 ) *0.5 ) ) 1126 ! 0.5 factor says how fast tanh goes to 1 - reduce this to have 1127 ! effect on more of the rimwidth 1128 END DO 1129 ENDIF 1106 1130 1107 1131 ENDDO -
branches/UKMO/r5518_bdy_sponge_temp/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_iso.F90
r7122 r7123 30 30 USE wrk_nemo ! Memory Allocation 31 31 USE timing ! Timing 32 #if defined key_bdy 33 USE bdy_oce ! needed for extra diffusion in rim 34 #endif 32 35 33 36 IMPLICIT NONE … … 112 115 REAL(wp) :: zcoef0, zcoef3, zcoef4, zmkt, zmkf ! - - 113 116 REAL(wp) :: zuav, zvav, zuwslpi, zuwslpj, zvwslpi, zvwslpj ! - - 117 REAL(wp), DIMENSION(jpi,jpj) :: zfactor ! multiplier for diffusion 114 118 ! 115 119 REAL(wp), POINTER, DIMENSION(:,:) :: ziut, zjuf, zjvt, zivf, zdku, zdk1u, zdkv, zdk1v … … 127 131 IF( dyn_ldf_iso_alloc() /= 0 ) CALL ctl_stop('STOP', 'dyn_ldf_iso: failed to allocate arrays') 128 132 ENDIF 133 #if defined key_bdy 134 zfactor(:,:) = sponge_factor(:,:) 135 #else 136 zfactor(:,:) = 1.0 137 #endif 138 #if defined key_bdy 139 zfactor(:,:) = sponge_factor(:,:) 140 #else 141 zfactor(:,:) = 1.0 142 #endif 129 143 130 144 !!gm bug is dyn_ldf_iso called before tra_ldf_iso .... <<<<<===== TO BE CHECKED … … 183 197 DO jj = 2, jpjm1 184 198 DO ji = fs_2, jpi ! vector opt. 185 zabe1 = ( ahmt(ji,jj,jk)+rn_ahm_b ) * e2t(ji,jj) * MIN( fse3u(ji,jj,jk), fse3u(ji-1,jj,jk) ) * r1_e1t(ji,jj)199 zabe1 = zfactor(ji,jj) * ( ahmt(ji,jj,jk)+rn_ahm_b ) * e2t(ji,jj) * MIN( fse3u(ji,jj,jk), fse3u(ji-1,jj,jk) ) * r1_e1t(ji,jj) 186 200 187 201 zmskt = 1._wp / MAX( umask(ji-1,jj,jk )+umask(ji,jj,jk+1) & 188 202 & + umask(ji-1,jj,jk+1)+umask(ji,jj,jk ) , 1._wp ) 189 203 190 zcof1 = - rn_aht_0 * e2t(ji,jj) * zmskt * 0.5 * ( uslp(ji-1,jj,jk) + uslp(ji,jj,jk) )204 zcof1 = - zfactor(ji,jj) * rn_aht_0 * e2t(ji,jj) * zmskt * 0.5 * ( uslp(ji-1,jj,jk) + uslp(ji,jj,jk) ) 191 205 192 206 ziut(ji,jj) = ( zabe1 * ( ub(ji,jj,jk) - ub(ji-1,jj,jk) ) & … … 198 212 DO jj = 2, jpjm1 199 213 DO ji = fs_2, jpi ! vector opt. 200 zabe1 = ( ahmt(ji,jj,jk)+rn_ahm_b ) * e2t(ji,jj) * fse3t(ji,jj,jk) * r1_e1t(ji,jj)214 zabe1 = zfactor(ji,jj) * ( ahmt(ji,jj,jk)+rn_ahm_b ) * e2t(ji,jj) * fse3t(ji,jj,jk) * r1_e1t(ji,jj) 201 215 202 216 zmskt = 1._wp / MAX( umask(ji-1,jj,jk ) + umask(ji,jj,jk+1) & 203 217 & + umask(ji-1,jj,jk+1) + umask(ji,jj,jk ) , 1._wp ) 204 218 205 zcof1 = - rn_aht_0 * e2t(ji,jj) * zmskt * 0.5 * ( uslp(ji-1,jj,jk) + uslp(ji,jj,jk) )219 zcof1 = - zfactor(ji,jj) * rn_aht_0 * e2t(ji,jj) * zmskt * 0.5 * ( uslp(ji-1,jj,jk) + uslp(ji,jj,jk) ) 206 220 207 221 ziut(ji,jj) = ( zabe1 * ( ub(ji,jj,jk) - ub(ji-1,jj,jk) ) & … … 215 229 DO jj = 1, jpjm1 216 230 DO ji = 1, fs_jpim1 ! vector opt. 217 zabe2 = ( ahmf(ji,jj,jk) + rn_ahm_b ) * e1f(ji,jj) * fse3f(ji,jj,jk) * r1_e2f(ji,jj)231 zabe2 = zfactor(ji,jj) * ( ahmf(ji,jj,jk) + rn_ahm_b ) * e1f(ji,jj) * fse3f(ji,jj,jk) * r1_e2f(ji,jj) 218 232 219 233 zmskf = 1._wp / MAX( umask(ji,jj+1,jk )+umask(ji,jj,jk+1) & 220 234 & + umask(ji,jj+1,jk+1)+umask(ji,jj,jk ) , 1._wp ) 221 235 222 zcof2 = - rn_aht_0 * e1f(ji,jj) * zmskf * 0.5 * ( vslp(ji+1,jj,jk) + vslp(ji,jj,jk) )236 zcof2 = - zfactor(ji,jj) * rn_aht_0 * e1f(ji,jj) * zmskf * 0.5 * ( vslp(ji+1,jj,jk) + vslp(ji,jj,jk) ) 223 237 224 238 zjuf(ji,jj) = ( zabe2 * ( ub(ji,jj+1,jk) - ub(ji,jj,jk) ) & … … 236 250 DO jj = 2, jpjm1 237 251 DO ji = 1, fs_jpim1 ! vector opt. 238 zabe1 = ( ahmf(ji,jj,jk) + rn_ahm_b ) * e2f(ji,jj) * fse3f(ji,jj,jk) * r1_e1f(ji,jj)252 zabe1 = zfactor(ji,jj) * ( ahmf(ji,jj,jk) + rn_ahm_b ) * e2f(ji,jj) * fse3f(ji,jj,jk) * r1_e1f(ji,jj) 239 253 240 254 zmskf = 1._wp / MAX( vmask(ji+1,jj,jk )+vmask(ji,jj,jk+1) & 241 255 & + vmask(ji+1,jj,jk+1)+vmask(ji,jj,jk ) , 1._wp ) 242 256 243 zcof1 = - rn_aht_0 * e2f(ji,jj) * zmskf * 0.5 * ( uslp(ji,jj+1,jk) + uslp(ji,jj,jk) )257 zcof1 = - zfactor(ji,jj) * rn_aht_0 * e2f(ji,jj) * zmskf * 0.5 * ( uslp(ji,jj+1,jk) + uslp(ji,jj,jk) ) 244 258 245 259 zivf(ji,jj) = ( zabe1 * ( vb(ji+1,jj,jk) - vb(ji,jj,jk) ) & … … 253 267 DO jj = 2, jpj 254 268 DO ji = 1, fs_jpim1 ! vector opt. 255 zabe2 = ( ahmt(ji,jj,jk)+rn_ahm_b ) * e1t(ji,jj) * MIN( fse3v(ji,jj,jk), fse3v(ji,jj-1,jk) ) * r1_e2t(ji,jj)269 zabe2 = zfactor(ji,jj) * ( ahmt(ji,jj,jk)+rn_ahm_b ) * e1t(ji,jj) * MIN( fse3v(ji,jj,jk), fse3v(ji,jj-1,jk) ) * r1_e2t(ji,jj) 256 270 257 271 zmskt = 1._wp / MAX( vmask(ji,jj-1,jk )+vmask(ji,jj,jk+1) & 258 272 & + vmask(ji,jj-1,jk+1)+vmask(ji,jj,jk ) , 1._wp ) 259 273 260 zcof2 = - rn_aht_0 * e1t(ji,jj) * zmskt * 0.5 * ( vslp(ji,jj-1,jk) + vslp(ji,jj,jk) )274 zcof2 = - zfactor(ji,jj) * rn_aht_0 * e1t(ji,jj) * zmskt * 0.5 * ( vslp(ji,jj-1,jk) + vslp(ji,jj,jk) ) 261 275 262 276 zjvt(ji,jj) = ( zabe2 * ( vb(ji,jj,jk) - vb(ji,jj-1,jk) ) & … … 268 282 DO jj = 2, jpj 269 283 DO ji = 1, fs_jpim1 ! vector opt. 270 zabe2 = ( ahmt(ji,jj,jk)+rn_ahm_b ) * e1t(ji,jj) * fse3t(ji,jj,jk) * r1_e2t(ji,jj)284 zabe2 = zfactor(ji,jj) * ( ahmt(ji,jj,jk)+rn_ahm_b ) * e1t(ji,jj) * fse3t(ji,jj,jk) * r1_e2t(ji,jj) 271 285 272 286 zmskt = 1./MAX( vmask(ji,jj-1,jk )+vmask(ji,jj,jk+1) & 273 287 & + vmask(ji,jj-1,jk+1)+vmask(ji,jj,jk ), 1. ) 274 288 275 zcof2 = - rn_aht_0 * e1t(ji,jj) * zmskt * 0.5 * ( vslp(ji,jj-1,jk) + vslp(ji,jj,jk) )289 zcof2 = - zfactor(ji,jj) * rn_aht_0 * e1t(ji,jj) * zmskt * 0.5 * ( vslp(ji,jj-1,jk) + vslp(ji,jj,jk) ) 276 290 277 291 zjvt(ji,jj) = ( zabe2 * ( vb(ji,jj,jk) - vb(ji,jj-1,jk) ) & -
branches/UKMO/r5518_bdy_sponge_temp/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90
r7122 r7123 31 31 USE wrk_nemo ! Memory Allocation 32 32 USE timing ! Timing 33 #if defined key_bdy 34 USE bdy_oce 35 #endif 33 36 34 37 IMPLICIT NONE … … 112 115 REAL(wp), POINTER, DIMENSION(:,:) :: zdkt, zdk1t, z2d 113 116 REAL(wp), POINTER, DIMENSION(:,:,:) :: zdit, zdjt, zftu, zftv, ztfw 117 REAL(wp), DIMENSION(jpi,jpj) :: zfactor ! multiplier for diffusion 114 118 !!---------------------------------------------------------------------- 115 119 ! … … 204 208 ENDIF 205 209 ! 210 #if defined key_bdy 211 zfactor(:,:) = sponge_factor(:,:) 212 #else 213 zfactor(:,:) = 1.0 214 #endif 206 215 ! ! =========== 207 216 DO jn = 1, kjpt ! tracer loop … … 269 278 DO jj = 1 , jpjm1 !== Horizontal fluxes 270 279 DO ji = 1, fs_jpim1 ! vector opt. 271 zabe1 = pahu(ji,jj,jk) * e2_e1u(ji,jj) * fse3u_n(ji,jj,jk)272 zabe2 = pahv(ji,jj,jk) * e1_e2v(ji,jj) * fse3v_n(ji,jj,jk)280 zabe1 = zfactor(ji,jj) * pahu(ji,jj,jk) * e2_e1u(ji,jj) * fse3u_n(ji,jj,jk) 281 zabe2 = zfactor(ji,jj) * pahv(ji,jj,jk) * e1_e2v(ji,jj) * fse3v_n(ji,jj,jk) 273 282 ! 274 283 zmsku = 1. / MAX( tmask(ji+1,jj,jk ) + tmask(ji,jj,jk+1) & -
branches/UKMO/r5518_bdy_sponge_temp/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_lap.F90
r7122 r7123 30 30 USE lib_mpp ! distribued memory computing library 31 31 USE timing ! Timing 32 #if defined key_bdy 33 USE bdy_oce 34 #endif 32 35 USE wrk_nemo ! Memory allocation 33 36 … … 81 84 REAL(wp) :: zsign ! local scalars 82 85 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztu, ztv, zaheeu, zaheev 86 REAL(wp), DIMENSION(jpi,jpj) :: zfactor ! multiplier for diffusion 83 87 !!---------------------------------------------------------------------- 84 88 ! … … 90 94 WRITE(numout,*) '~~~~~~~~~~~ ' 91 95 ENDIF 96 #if defined key_bdy 97 zfactor(:,:) = sponge_factor(:,:) 98 #else 99 zfactor(:,:) = 1.0 100 #endif 92 101 ! 93 102 CALL wrk_alloc( jpi,jpj,jpk, ztu, ztv, zaheeu, zaheev ) … … 100 109 DO jj = 1, jpjm1 101 110 DO ji = 1, fs_jpim1 ! vector opt. 102 zaheeu(ji,jj,jk) = z sign * pahu(ji,jj,jk) * e2_e1u(ji,jj) * fse3u_n(ji,jj,jk) !!gm * umask(ji,jj,jk) pah masked!103 zaheev(ji,jj,jk) = z sign * pahv(ji,jj,jk) * e1_e2v(ji,jj) * fse3v_n(ji,jj,jk) !!gm * vmask(ji,jj,jk)111 zaheeu(ji,jj,jk) = zfactor(ji,jj) * zsign * pahu(ji,jj,jk) * e2_e1u(ji,jj) * fse3u_n(ji,jj,jk) !!gm * umask(ji,jj,jk) pah masked! 112 zaheev(ji,jj,jk) = zfactor(ji,jj) * zsign * pahv(ji,jj,jk) * e1_e2v(ji,jj) * fse3v_n(ji,jj,jk) !!gm * vmask(ji,jj,jk) 104 113 END DO 105 114 END DO
Note: See TracChangeset
for help on using the changeset viewer.