- Timestamp:
- 2017-11-17T15:40:12+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r8183_ICEMODEL_svn_removed/NEMOGCM/NEMO/NST_SRC/agrif_user.F90
r8733 r8738 127 127 !! 128 128 IMPLICIT NONE 129 ! 130 INTEGER :: ind1, ind2, ind3 129 131 !!---------------------------------------------------------------------- 130 132 131 133 ! 1. Declaration of the type of variable which have to be interpolated 132 134 !--------------------------------------------------------------------- 133 CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),e1u_id) 134 CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),e2v_id) 135 !!clem ghost 136 ind1 = nbghostcells 137 ind2 = 1 + nbghostcells 138 ind3 = 2 + nbghostcells 139 CALL agrif_declare_variable((/1,2/),(/ind2,ind3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),e1u_id) 140 CALL agrif_declare_variable((/2,1/),(/ind3,ind2/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),e2v_id) 141 !!clem ghost 135 142 136 143 ! 2. Type of interpolation … … 141 148 ! 3. Location of interpolation 142 149 !----------------------------- 143 CALL Agrif_Set_bc(e1u_id,(/0,0/)) 144 CALL Agrif_Set_bc(e2v_id,(/0,0/)) 150 !!clem ghost (previously set to /0,0/) 151 CALL Agrif_Set_bc(e1u_id,(/0,ind1-1/)) 152 CALL Agrif_Set_bc(e2v_id,(/0,ind1-1/)) 153 !!clem ghost 145 154 146 155 ! 5. Update type … … 337 346 !!---------------------------------------------------------------------- 338 347 USE agrif_util 339 USE par_oce ! ONLY : jpts 348 USE par_oce ! ONLY : jpts and ghostcells 340 349 USE oce 341 350 USE agrif_oce 342 351 !! 343 352 IMPLICIT NONE 353 ! 354 INTEGER :: ind1, ind2, ind3 344 355 !!---------------------------------------------------------------------- 345 356 346 357 ! 1. Declaration of the type of variable which have to be interpolated 347 358 !--------------------------------------------------------------------- 348 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,jpts/),tsn_id) 349 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,jpts/),tsn_sponge_id) 350 351 CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),un_interp_id) 352 CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),vn_interp_id) 353 CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),un_update_id) 354 CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),vn_update_id) 355 CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),un_sponge_id) 356 CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),vn_sponge_id) 357 358 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),e3t_id) 359 CALL agrif_declare_variable((/1,2,0/),(/2,3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),umsk_id) 360 CALL agrif_declare_variable((/2,1,0/),(/3,2,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),vmsk_id) 361 362 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,3/),scales_t_id) 363 364 CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),unb_id) 365 CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),vnb_id) 366 CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),ub2b_interp_id) 367 CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),vb2b_interp_id) 368 CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),ub2b_update_id) 369 CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),vb2b_update_id) 370 371 CALL agrif_declare_variable((/2,2/),(/3,3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),sshn_id) 359 !!clem ghost 360 ind1 = nbghostcells 361 ind2 = 1 + nbghostcells 362 ind3 = 2 + nbghostcells 363 CALL agrif_declare_variable((/2,2,0,0/),(/ind3,ind3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,jpts/),tsn_id) 364 CALL agrif_declare_variable((/2,2,0,0/),(/ind3,ind3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,jpts/),tsn_sponge_id) 365 366 CALL agrif_declare_variable((/1,2,0/),(/ind2,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),un_interp_id) 367 CALL agrif_declare_variable((/2,1,0/),(/ind3,ind2,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),vn_interp_id) 368 CALL agrif_declare_variable((/1,2,0/),(/ind2,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),un_update_id) 369 CALL agrif_declare_variable((/2,1,0/),(/ind3,ind2,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),vn_update_id) 370 CALL agrif_declare_variable((/1,2,0/),(/ind2,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),un_sponge_id) 371 CALL agrif_declare_variable((/2,1,0/),(/ind3,ind2,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),vn_sponge_id) 372 373 CALL agrif_declare_variable((/2,2,0/),(/ind3,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),e3t_id) 374 CALL agrif_declare_variable((/1,2,0/),(/ind2,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),umsk_id) 375 CALL agrif_declare_variable((/2,1,0/),(/ind3,ind2,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpk/),vmsk_id) 376 377 CALL agrif_declare_variable((/2,2,0,0/),(/ind3,ind3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,3/),scales_t_id) 378 379 CALL agrif_declare_variable((/1,2/),(/ind2,ind3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),unb_id) 380 CALL agrif_declare_variable((/2,1/),(/ind3,ind2/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),vnb_id) 381 CALL agrif_declare_variable((/1,2/),(/ind2,ind3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),ub2b_interp_id) 382 CALL agrif_declare_variable((/2,1/),(/ind3,ind2/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),vb2b_interp_id) 383 CALL agrif_declare_variable((/1,2/),(/ind2,ind3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),ub2b_update_id) 384 CALL agrif_declare_variable((/2,1/),(/ind3,ind2/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),vb2b_update_id) 385 386 CALL agrif_declare_variable((/2,2/),(/ind3,ind3/),(/'x','y'/),(/1,1/),(/nlci,nlcj/),sshn_id) 372 387 373 388 # if defined key_zdftke 374 CALL agrif_declare_variable((/2,2,0/),(/ 3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/), en_id)375 CALL agrif_declare_variable((/2,2,0/),(/ 3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),avt_id)376 CALL agrif_declare_variable((/2,2,0/),(/ 3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),avm_id)389 CALL agrif_declare_variable((/2,2,0/),(/ind3,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/), en_id) 390 CALL agrif_declare_variable((/2,2,0/),(/ind3,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),avt_id) 391 CALL agrif_declare_variable((/2,2,0/),(/ind3,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj,jpk/),avm_id) 377 392 # endif 393 !!clem ghost 378 394 379 395 ! 2. Type of interpolation … … 407 423 ! 3. Location of interpolation 408 424 !----------------------------- 409 CALL Agrif_Set_bc(tsn_id,(/0,1/)) 410 CALL Agrif_Set_bc(un_interp_id,(/0,1/)) 411 CALL Agrif_Set_bc(vn_interp_id,(/0,1/)) 412 413 ! CALL Agrif_Set_bc(tsn_sponge_id,(/-3*Agrif_irhox(),0/)) 414 ! CALL Agrif_Set_bc(un_sponge_id,(/-2*Agrif_irhox()-1,0/)) 415 ! CALL Agrif_Set_bc(vn_sponge_id,(/-2*Agrif_irhox()-1,0/)) 416 CALL Agrif_Set_bc(tsn_sponge_id,(/-nn_sponge_len*Agrif_irhox()-1,0/)) 425 !!clem ghost 426 CALL Agrif_Set_bc(tsn_id,(/0,ind1/)) 427 CALL Agrif_Set_bc(un_interp_id,(/0,ind1/)) 428 CALL Agrif_Set_bc(vn_interp_id,(/0,ind1/)) 429 430 ! clem: previously set to /-,0/ 431 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 9 417 432 CALL Agrif_Set_bc(un_sponge_id ,(/-nn_sponge_len*Agrif_irhox()-1,0/)) 418 433 CALL Agrif_Set_bc(vn_sponge_id ,(/-nn_sponge_len*Agrif_irhox()-1,0/)) 419 434 420 CALL Agrif_Set_bc(sshn_id,(/0,0/)) 421 CALL Agrif_Set_bc(unb_id ,(/0,0/)) 422 CALL Agrif_Set_bc(vnb_id ,(/0,0/)) 423 CALL Agrif_Set_bc(ub2b_interp_id,(/0,0/)) 424 CALL Agrif_Set_bc(vb2b_interp_id,(/0,0/)) 425 426 CALL Agrif_Set_bc(e3t_id,(/-2*Agrif_irhox()-1,0/)) ! if west and rhox=3: column 2 to 9 427 CALL Agrif_Set_bc(umsk_id,(/0,0/)) 428 CALL Agrif_Set_bc(vmsk_id,(/0,0/)) 429 435 CALL Agrif_Set_bc(sshn_id,(/0,ind1-1/)) 436 CALL Agrif_Set_bc(unb_id ,(/0,ind1-1/)) 437 CALL Agrif_Set_bc(vnb_id ,(/0,ind1-1/)) 438 CALL Agrif_Set_bc(ub2b_interp_id,(/0,ind1-1/)) 439 CALL Agrif_Set_bc(vb2b_interp_id,(/0,ind1-1/)) 440 441 CALL Agrif_Set_bc(e3t_id,(/-2*Agrif_irhox()-1,ind1-1/)) ! if west and rhox=3 and ghost=1: column 2 to 9 442 CALL Agrif_Set_bc(umsk_id,(/0,ind1-1/)) 443 CALL Agrif_Set_bc(vmsk_id,(/0,ind1-1/)) 444 445 ! clem: previously set to /0,1/ 430 446 # if defined key_zdftke 431 CALL Agrif_Set_bc(avm_id ,(/0, 1/))447 CALL Agrif_Set_bc(avm_id ,(/0,ind1/)) 432 448 # endif 449 !!clem ghost 433 450 434 451 ! 5. Update type … … 463 480 ! 464 481 END SUBROUTINE agrif_declare_var 465 466 # if defined key_lim2467 SUBROUTINE Agrif_InitValues_cont_lim2468 !!----------------------------------------------------------------------469 !! *** ROUTINE Agrif_InitValues_cont_lim2 ***470 !!471 !! ** Purpose :: Initialisation of variables to be interpolated for LIM2472 !!----------------------------------------------------------------------473 USE Agrif_Util474 USE ice_2475 USE agrif_ice476 USE in_out_manager477 USE agrif_lim2_update478 USE agrif_lim2_interp479 USE lib_mpp480 !!481 IMPLICIT NONE482 !!----------------------------------------------------------------------483 484 ! 1. Declaration of the type of variable which have to be interpolated485 !---------------------------------------------------------------------486 CALL agrif_declare_var_lim2487 488 ! 2. First interpolations of potentially non zero fields489 !-------------------------------------------------------490 Agrif_SpecialValue=-9999.491 Agrif_UseSpecialValue = .TRUE.492 ! Call Agrif_Bc_variable(zadv ,adv_ice_id ,calledweight=1.,procname=interp_adv_ice )493 ! Call Agrif_Bc_variable(zvel ,u_ice_id ,calledweight=1.,procname=interp_u_ice )494 ! Call Agrif_Bc_variable(zvel ,v_ice_id ,calledweight=1.,procname=interp_v_ice )495 Agrif_SpecialValue=0.496 Agrif_UseSpecialValue = .FALSE.497 498 ! 3. Some controls499 !-----------------500 501 # if ! defined key_lim2_vp502 lim_nbstep = 1.503 CALL agrif_rhg_lim2_load504 CALL agrif_trp_lim2_load505 lim_nbstep = 0.506 # endif507 !RB mandatory but why ???508 ! IF( nbclineupdate /= nn_fsbc .AND. nn_ice == 2 )THEN509 ! CALL ctl_warn ('With ice model on child grid, nbclineupdate is set to nn_fsbc')510 ! nbclineupdate = nn_fsbc511 ! ENDIF512 CALL Agrif_Update_lim2(0)513 !514 END SUBROUTINE Agrif_InitValues_cont_lim2515 516 517 SUBROUTINE agrif_declare_var_lim2518 !!----------------------------------------------------------------------519 !! *** ROUTINE agrif_declare_var_lim2 ***520 !!521 !! ** Purpose :: Declaration of variables to be interpolated for LIM2522 !!----------------------------------------------------------------------523 USE agrif_util524 USE ice_2525 !!526 IMPLICIT NONE527 !!----------------------------------------------------------------------528 529 ! 1. Declaration of the type of variable which have to be interpolated530 !---------------------------------------------------------------------531 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/jpi,jpj, 7/),adv_ice_id )532 # if defined key_lim2_vp533 CALL agrif_declare_variable((/1,1/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),u_ice_id)534 CALL agrif_declare_variable((/1,1/),(/3,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),v_ice_id)535 # else536 CALL agrif_declare_variable((/1,2/),(/2,3/),(/'x','y'/),(/1,1/),(/jpi,jpj/),u_ice_id)537 CALL agrif_declare_variable((/2,1/),(/3,2/),(/'x','y'/),(/1,1/),(/jpi,jpj/),v_ice_id)538 # endif539 540 ! 2. Type of interpolation541 !-------------------------542 CALL Agrif_Set_bcinterp(adv_ice_id ,interp=AGRIF_linear)543 CALL Agrif_Set_bcinterp(u_ice_id,interp1=Agrif_linear,interp2=AGRIF_ppm)544 CALL Agrif_Set_bcinterp(v_ice_id,interp1=AGRIF_ppm,interp2=Agrif_linear)545 546 ! 3. Location of interpolation547 !-----------------------------548 CALL Agrif_Set_bc(adv_ice_id ,(/0,1/))549 CALL Agrif_Set_bc(u_ice_id,(/0,1/))550 CALL Agrif_Set_bc(v_ice_id,(/0,1/))551 552 ! 5. Update type553 !---------------554 CALL Agrif_Set_Updatetype(adv_ice_id , update = AGRIF_Update_Average)555 CALL Agrif_Set_Updatetype(u_ice_id,update1 = Agrif_Update_Copy, update2 = Agrif_Update_Average)556 CALL Agrif_Set_Updatetype(v_ice_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy)557 !558 END SUBROUTINE agrif_declare_var_lim2559 # endif560 482 561 483 #if defined key_lim3 … … 623 545 USE Agrif_Util 624 546 USE ice 625 626 IMPLICIT NONE 547 USE par_oce, ONLY : nbghostcells 548 ! 549 IMPLICIT NONE 550 ! 551 INTEGER :: ind1, ind2, ind3 627 552 !!---------------------------------------------------------------------- 628 553 ! … … 634 559 ! 2,2 = two ghost lines 635 560 !------------------------------------------------------------------------------------- 636 CALL agrif_declare_variable((/2,2,0/),(/3,3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpl*(5+nlay_s+nlay_i)/),tra_ice_id ) 637 CALL agrif_declare_variable((/1,2/) ,(/2,3/),(/'x','y'/) ,(/1,1/) ,(/nlci,nlcj/) ,u_ice_id ) 638 CALL agrif_declare_variable((/2,1/) ,(/3,2/),(/'x','y'/) ,(/1,1/) ,(/nlci,nlcj/) ,v_ice_id ) 561 !!clem ghost 562 ind1 = nbghostcells 563 ind2 = 1 + nbghostcells 564 ind3 = 2 + nbghostcells 565 CALL agrif_declare_variable((/2,2,0/),(/ind3,ind3,0/),(/'x','y','N'/),(/1,1,1/),(/nlci,nlcj,jpl*(5+nlay_s+nlay_i)/),tra_ice_id ) 566 CALL agrif_declare_variable((/1,2/) ,(/ind2,ind3/) ,(/'x','y'/) ,(/1,1/) ,(/nlci,nlcj/) ,u_ice_id ) 567 CALL agrif_declare_variable((/2,1/) ,(/ind3,ind2/) ,(/'x','y'/) ,(/1,1/) ,(/nlci,nlcj/) ,v_ice_id ) 568 !!clem ghost 639 569 640 570 ! 2. Set interpolations (normal & tangent to the grid cell for velocities) … … 646 576 ! 3. Set location of interpolations 647 577 !---------------------------------- 648 CALL Agrif_Set_bc(tra_ice_id,(/0,1/)) 649 CALL Agrif_Set_bc(u_ice_id ,(/0,1/)) 650 CALL Agrif_Set_bc(v_ice_id ,(/0,1/)) 578 !!clem ghost 579 CALL Agrif_Set_bc(tra_ice_id,(/0,ind1/)) 580 CALL Agrif_Set_bc(u_ice_id ,(/0,ind1/)) 581 CALL Agrif_Set_bc(v_ice_id ,(/0,ind1/)) 582 !!clem ghost 651 583 652 584 ! 4. Set update type in case 2 ways (child=>parent) (normal & tangent to the grid cell for velocities) … … 777 709 !! 778 710 IMPLICIT NONE 711 ! 712 INTEGER :: ind1, ind2, ind3 779 713 !!---------------------------------------------------------------------- 780 714 781 715 ! 1. Declaration of the type of variable which have to be interpolated 782 716 !--------------------------------------------------------------------- 783 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,jptra/),trn_id) 784 CALL agrif_declare_variable((/2,2,0,0/),(/3,3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,jptra/),trn_sponge_id) 717 !!clem ghost 718 ind1 = nbghostcells 719 ind2 = 1 + nbghostcells 720 ind3 = 2 + nbghostcells 721 CALL agrif_declare_variable((/2,2,0,0/),(/ind3,ind3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,jptra/),trn_id) 722 CALL agrif_declare_variable((/2,2,0,0/),(/ind3,ind3,0,0/),(/'x','y','N','N'/),(/1,1,1,1/),(/nlci,nlcj,jpk,jptra/),trn_sponge_id) 785 723 786 724 ! 2. Type of interpolation … … 791 729 ! 3. Location of interpolation 792 730 !----------------------------- 793 CALL Agrif_Set_bc(trn_id,(/0,1/)) 794 ! CALL Agrif_Set_bc(trn_sponge_id,(/-3*Agrif_irhox(),0/)) 731 !!clem ghost 732 CALL Agrif_Set_bc(trn_id,(/0,ind1/)) 733 !clem: previously set to /-,0/ 795 734 CALL Agrif_Set_bc(trn_sponge_id,(/-nn_sponge_len*Agrif_irhox()-1,0/)) 796 735 … … 868 807 ! 869 808 IF( agrif_oce_alloc() > 0 ) CALL ctl_warn('agrif agrif_oce_alloc: allocation of arrays failed') 870 # if defined key_lim2871 IF( agrif_ice_alloc() > 0 ) CALL ctl_stop('agrif agrif_ice_alloc: allocation of arrays failed') ! only for LIM2 (not LIM3)872 # endif873 809 ! 874 810 END SUBROUTINE agrif_nemo_init
Note: See TracChangeset
for help on using the changeset viewer.