Changeset 11868 for NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_user.F90
- Timestamp:
- 2019-11-06T16:43:51+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r11233_AGRIF-05_jchanut_vert_coord_interp/src/NST/agrif_user.F90
r11827 r11868 126 126 CALL Agrif_Bc_variable(mbkt_id,calledweight=1.,procname=interpmbkt) 127 127 ! 128 ! Assume step wise change of bathymetry near interface 129 ! TODO: Switch to linear interpolation of bathymetry in the s-coordinate case 130 ! and no refinement 128 131 DO jj = 1, jpjm1 129 132 DO ji = 1, jpim1 … … 140 143 mbku_parent(:,:) = MAX( NINT( zk(:,:) ), 1 ) 141 144 zk(:,:) = REAL( mbkv_parent(:,:), wp ) ; CALL lbc_lnk( 'Agrif_InitValues_cont', zk, 'V', 1. ) 142 mbkv_parent(:,:) = MAX( NINT( zk(:,:) ), 1 ) 145 mbkv_parent(:,:) = MAX( NINT( zk(:,:) ), 1 ) 143 146 #endif 144 147 … … 238 241 ENDIF 239 242 240 ! check if masks and bathymetries match 241 IF(ln_chk_bathy) THEN 242 ! 243 IF(lwp) WRITE(numout,*) 'AGRIF: Check Bathymetry and masks near bdys. Level: ', Agrif_Level() 244 ! 245 kindic_agr = 0 246 ! check if umask agree with parent along western and eastern boundaries: 247 CALL Agrif_Bc_variable(umsk_id,calledweight=1.,procname=interpumsk) 248 ! check if vmask agree with parent along northern and southern boundaries: 249 CALL Agrif_Bc_variable(vmsk_id,calledweight=1.,procname=interpvmsk) 250 ! check if tmask and vertical scale factors agree with parent over first two coarse grid points: 251 CALL Agrif_Bc_variable(e3t_id,calledweight=1.,procname=interpe3t) 252 ! 253 CALL mpp_sum( 'agrif_user', kindic_agr ) 254 IF( kindic_agr /= 0 ) THEN 255 CALL ctl_stop('Child Bathymetry is not correct near boundaries.') 256 ELSE 257 IF(lwp) WRITE(numout,*) 'Child Bathymetry is ok near boundaries.' 258 END IF 259 ENDIF 260 261 #if defined key_vertical 262 IF ( Agrif_Parent(jpk).GT.jpk ) THEN 263 CALL ctl_stop( ' With key_vertical, child grids must have jpk greater or equal to the parent value' ) 264 ENDIF 265 #endif 243 ENDIF 244 245 ! check if masks and bathymetries match 246 IF(ln_chk_bathy) THEN 266 247 ! 267 ENDIF 248 IF(lwp) WRITE(numout,*) ' ' 249 IF(lwp) WRITE(numout,*) 'AGRIF: Check Bathymetry and masks near bdys. Level: ', Agrif_Level() 250 ! 251 kindic_agr = 0 252 # if ! defined key_vertical 253 ! 254 ! check if umask agree with parent along western and eastern boundaries: 255 CALL Agrif_Bc_variable(umsk_id,calledweight=1.,procname=interpumsk) 256 ! check if vmask agree with parent along northern and southern boundaries: 257 CALL Agrif_Bc_variable(vmsk_id,calledweight=1.,procname=interpvmsk) 258 ! check if tmask and vertical scale factors agree with parent over first two coarse grid points: 259 CALL Agrif_Bc_variable(e3t_id,calledweight=1.,procname=interpe3t) 260 ! 261 # else 262 ! 263 ! In case of vertical interpolation, check only that total depths agree between child and parent: 264 DO ji = 1, jpi 265 DO jj = 1, jpj 266 IF ((mbkt_parent(ji,jj)/=0).AND.(ht0_parent(ji,jj)/=ht_0(ji,jj))) kindic_agr = kindic_agr + 1 267 IF ((mbku_parent(ji,jj)/=0).AND.(hu0_parent(ji,jj)/=hu_0(ji,jj))) kindic_agr = kindic_agr + 1 268 IF ((mbkv_parent(ji,jj)/=0).AND.(hv0_parent(ji,jj)/=hv_0(ji,jj))) kindic_agr = kindic_agr + 1 269 END DO 270 END DO 271 # endif 272 CALL mpp_sum( 'agrif_user', kindic_agr ) 273 IF( kindic_agr /= 0 ) THEN 274 CALL ctl_stop('==> Child Bathymetry is NOT correct near boundaries.') 275 ELSE 276 IF(lwp) WRITE(numout,*) '==> Child Bathymetry is ok near boundaries.' 277 IF(lwp) WRITE(numout,*) ' ' 278 END IF 279 ! 280 ENDIF 281 282 # if defined key_vertical 283 ! Additional constrain that should be removed someday: 284 IF ( Agrif_Parent(jpk).GT.jpk ) THEN 285 CALL ctl_stop( ' With key_vertical, child grids must have jpk greater or equal to the parent value' ) 286 ENDIF 287 # endif 268 288 ! 269 289 END SUBROUTINE Agrif_InitValues_cont … … 379 399 ! 3. Location of interpolation 380 400 !----------------------------- 381 CALL Agrif_Set_bc( tsn_id, (/0,ind1-1/) ) 382 CALL Agrif_Set_bc( un_interp_id, (/0,ind1-1/) ) 401 CALL Agrif_Set_bc( tsn_id, (/0,ind1-1/) ) ! if west, rhox=3 and nbghost=3: columns 2 to 4 402 CALL Agrif_Set_bc( un_interp_id, (/0,ind1-1/) ) 383 403 CALL Agrif_Set_bc( vn_interp_id, (/0,ind1-1/) ) 384 404 385 CALL Agrif_Set_bc( tsn_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) ) ! if west and rhox=3 and sponge=2 and ghost=1: columns 2 to 9386 CALL Agrif_Set_bc( un_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) ) 387 CALL Agrif_Set_bc( vn_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) ) 405 CALL Agrif_Set_bc( tsn_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) ) ! if west, rhox=3, nn_sponge_len=2 406 CALL Agrif_Set_bc( un_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) ) ! and nbghost=3: 407 CALL Agrif_Set_bc( vn_sponge_id, (/-nn_sponge_len*Agrif_irhox()-1,0/) ) ! columns 4 to 11 388 408 389 409 CALL Agrif_Set_bc( sshn_id, (/0,ind1-1/) ) … … 393 413 CALL Agrif_Set_bc( vb2b_interp_id, (/0,ind1-1/) ) 394 414 395 CALL Agrif_Set_bc( e3t_id, (/-nn_sponge_len*Agrif_irhox(),ind1-1/) ) ! if west and rhox=3 and ghost=1: column 2 to 6396 CALL Agrif_Set_bc( umsk_id, (/0,0/) ) 397 CALL Agrif_Set_bc( vmsk_id, (/0,0/) ) 398 # if defined key_vertical 415 CALL Agrif_Set_bc( e3t_id, (/-nn_sponge_len*Agrif_irhox(),ind1-1/) ) ! if west, rhox=3, nn_sponge_len=2 416 CALL Agrif_Set_bc( umsk_id, (/0,0/) ) ! and nbghost=3: 417 CALL Agrif_Set_bc( vmsk_id, (/0,0/) ) ! columns 2 to 10 418 # if defined key_vertical 399 419 ! extend the interpolation zone by 1 more point than necessary: 400 420 CALL Agrif_Set_bc( mbkt_id, (/-nn_sponge_len*Agrif_irhox()-2,ind1/) )
Note: See TracChangeset
for help on using the changeset viewer.