Changeset 7646 for trunk/NEMOGCM/NEMO/NST_SRC/agrif_user.F90
- Timestamp:
- 2017-02-06T10:25:03+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/NST_SRC/agrif_user.F90
r6140 r7646 1 1 #if defined key_agrif 2 2 !!---------------------------------------------------------------------- 3 !! NEMO/NST 3.7 , NEMO Consortium (201 5)3 !! NEMO/NST 3.7 , NEMO Consortium (2016) 4 4 !! $Id$ 5 5 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 18 18 USE dom_oce 19 19 USE nemogcm 20 ! 20 !! 21 21 IMPLICIT NONE 22 22 !!---------------------------------------------------------------------- … … 32 32 ! JC: change to allow for different vertical levels 33 33 ! jpk is already set 34 ! keep it jpk possibly different from jpk dtawhich34 ! keep it jpk possibly different from jpkglo which 35 35 ! hold parent grid vertical levels number (set earlier) 36 ! jpk = jpk dta36 ! jpk = jpkglo 37 37 jpim1 = jpi-1 38 38 jpjm1 = jpj-1 39 39 jpkm1 = jpk-1 40 40 jpij = jpi*jpj 41 jpidta = jpiglo42 jpjdta = jpjglo43 jpizoom = 144 jpjzoom = 145 41 nperio = 0 46 42 jperio = 0 … … 61 57 USE nemogcm 62 58 USE tradmp 63 USE bdy_ par64 65 IMPLICIT NONE 66 !!---------------------------------------------------------------------- 67 ! 0. Initializations68 !------------------- 69 IF( cp_cfg == 'orca' ) THEN 70 IF ( jp_cfg == 2 .OR. jp_cfg == 025 .OR. jp_cfg == 05 &71 & .OR. jp_cfg == 4 ) THEN72 jp_cfg = -1 ! set special value for jp_cfg on fine grids73 c p_cfg = "default"59 USE bdy_oce , ONLY: ln_bdy 60 !! 61 IMPLICIT NONE 62 !!---------------------------------------------------------------------- 63 ! 64 !!gm I think this is now useless ... nn_cfg & cn_cfg are set to -999999 and "UNKNOWN" 65 !!gm when reading the AGRIF domain configuration file 66 IF( cn_cfg == 'orca' ) THEN 67 IF ( nn_cfg == 2 .OR. nn_cfg == 025 .OR. nn_cfg == 05 .OR. nn_cfg == 4 ) THEN 68 nn_cfg = -1 ! set special value for nn_cfg on fine grids 69 cn_cfg = "default" 74 70 ENDIF 75 71 ENDIF 76 ! Specific fine grid Initializations 77 ! no tracer damping on fine grids 78 ln_tradmp = .FALSE. 79 ! no open boundary on fine grids 80 lk_bdy = .FALSE. 81 82 83 CALL nemo_init ! Initializations of each fine grid 84 72 ! !* Specific fine grid Initializations 73 ln_tradmp = .FALSE. ! no tracer damping on fine grids 74 ! 75 ln_bdy = .FALSE. ! no open boundary on fine grids 76 77 CALL nemo_init !* Initializations of each fine grid 78 79 ! !* Agrif initialization 85 80 CALL agrif_nemo_init 86 81 CALL Agrif_InitValues_cont_dom 87 # if ! defined key_offline88 82 CALL Agrif_InitValues_cont 89 # endif90 83 # if defined key_top 91 84 CALL Agrif_InitValues_cont_top 92 # endif 85 # endif 86 ! 93 87 END SUBROUTINE Agrif_initvalues 94 88 … … 108 102 USE agrif_opa_interp 109 103 USE agrif_opa_sponge 110 ! 111 IMPLICIT NONE 112 ! 113 !!---------------------------------------------------------------------- 114 104 !! 105 IMPLICIT NONE 106 !!---------------------------------------------------------------------- 107 ! 115 108 ! Declaration of the type of variable which have to be interpolated 116 ! ---------------------------------------------------------------------109 ! 117 110 CALL agrif_declare_var_dom 118 111 ! … … 129 122 USE par_oce 130 123 USE oce 124 !! 131 125 IMPLICIT NONE 132 126 !!---------------------------------------------------------------------- … … 158 152 END SUBROUTINE agrif_declare_var_dom 159 153 160 161 # if ! defined key_offline162 154 163 155 SUBROUTINE Agrif_InitValues_cont … … 176 168 USE agrif_opa_interp 177 169 USE agrif_opa_sponge 178 ! 170 !! 179 171 IMPLICIT NONE 180 172 ! … … 239 231 WRITE(cl_check2,*) NINT(rdt) 240 232 WRITE(cl_check3,*) NINT(Agrif_Parent(rdt)/Agrif_Rhot()) 241 CALL ctl_ warn( 'incompatible time step between grids', &233 CALL ctl_stop( 'incompatible time step between ocean grids', & 242 234 & 'parent grid value : '//cl_check1 , & 243 235 & 'child grid value : '//cl_check2 , & 244 & 'value on child grid will be changed to : '//cl_check3 ) 245 rdt=Agrif_Parent(rdt)/Agrif_Rhot() 236 & 'value on child grid should be changed to : '//cl_check3 ) 246 237 ENDIF 247 238 … … 259 250 260 251 ! Check coordinates 261 IF( ln_zps ) THEN262 ! check parameters for partial steps263 IF( Agrif_Parent(e3zps_min) .NE. e3zps_min ) THEN264 WRITE(*,*) 'incompatible e3zps_min between grids'265 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min)266 WRITE(*,*) 'child grid :',e3zps_min267 WRITE(*,*) 'those values should be identical'268 STOP269 ENDIF270 IF( Agrif_Parent(e3zps_rat) /= e3zps_rat ) THEN271 WRITE(*,*) 'incompatible e3zps_rat between grids'272 WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat)273 WRITE(*,*) 'child grid :',e3zps_rat274 WRITE(*,*) 'those values should be identical'275 STOP276 ENDIF277 ENDIF252 !SF IF( ln_zps ) THEN 253 !SF ! check parameters for partial steps 254 !SF IF( Agrif_Parent(e3zps_min) .NE. e3zps_min ) THEN 255 !SF WRITE(*,*) 'incompatible e3zps_min between grids' 256 !SF WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_min) 257 !SF WRITE(*,*) 'child grid :',e3zps_min 258 !SF WRITE(*,*) 'those values should be identical' 259 !SF STOP 260 !SF ENDIF 261 !SF IF( Agrif_Parent(e3zps_rat) /= e3zps_rat ) THEN 262 !SF WRITE(*,*) 'incompatible e3zps_rat between grids' 263 !SF WRITE(*,*) 'parent grid :',Agrif_Parent(e3zps_rat) 264 !SF WRITE(*,*) 'child grid :',e3zps_rat 265 !SF WRITE(*,*) 'those values should be identical' 266 !SF STOP 267 !SF ENDIF 268 !SF ENDIF 278 269 279 270 ! Check free surface scheme … … 346 337 USE oce 347 338 USE agrif_oce 339 !! 348 340 IMPLICIT NONE 349 341 !!---------------------------------------------------------------------- … … 468 460 ! 469 461 END SUBROUTINE agrif_declare_var 470 # endif471 462 472 463 # if defined key_lim2 … … 484 475 USE agrif_lim2_interp 485 476 USE lib_mpp 486 ! 487 IMPLICIT NONE 488 ! 477 !! 478 IMPLICIT NONE 489 479 !!---------------------------------------------------------------------- 490 480 … … 521 511 END SUBROUTINE Agrif_InitValues_cont_lim2 522 512 513 523 514 SUBROUTINE agrif_declare_var_lim2 524 515 !!---------------------------------------------------------------------- … … 529 520 USE agrif_util 530 521 USE ice_2 531 522 !! 532 523 IMPLICIT NONE 533 524 !!---------------------------------------------------------------------- … … 564 555 END SUBROUTINE agrif_declare_var_lim2 565 556 # endif 557 558 #if defined key_lim3 559 SUBROUTINE Agrif_InitValues_cont_lim3 560 !!---------------------------------------------------------------------- 561 !! *** ROUTINE Agrif_InitValues_cont_lim3 *** 562 !! 563 !! ** Purpose :: Initialisation of variables to be interpolated for LIM3 564 !!---------------------------------------------------------------------- 565 USE Agrif_Util 566 USE sbc_oce, ONLY : nn_fsbc ! clem: necessary otherwise Agrif_Parent(nn_fsbc) = nn_fsbc 567 USE ice 568 USE agrif_ice 569 USE in_out_manager 570 USE agrif_lim3_update 571 USE agrif_lim3_interp 572 USE lib_mpp 573 ! 574 IMPLICIT NONE 575 !!---------------------------------------------------------------------- 576 ! 577 ! Declaration of the type of variable which have to be interpolated (parent=>child) 578 !---------------------------------------------------------------------------------- 579 CALL agrif_declare_var_lim3 580 581 ! Controls (clem) 582 ! stop if rhot * nn_fsbc(parent) /= N * nn_fsbc(child) with N being integer 583 IF( MOD( Agrif_irhot() * Agrif_Parent(nn_fsbc), nn_fsbc ) /= 0 ) THEN 584 CALL ctl_stop('rhot * nn_fsbc(parent) /= N * nn_fsbc(child), therefore nn_fsbc(child) should be set to 1 or nn_fsbc(parent)') 585 ENDIF 586 587 ! stop if update frequency is different from nn_fsbc 588 IF( nbclineupdate > nn_fsbc ) CALL ctl_stop('With ice model on child grid, nn_cln_update should be set to 1 or nn_fsbc') 589 590 591 ! First Interpolations (using "after" ice subtime step => lim_nbstep=1) 592 !---------------------------------------------------------------------- 593 lim_nbstep = 1 594 CALL agrif_interp_lim3('U') ! interpolation of ice velocities 595 CALL agrif_interp_lim3('V') ! interpolation of ice velocities 596 CALL agrif_interp_lim3('T') ! interpolation of ice tracers 597 lim_nbstep = 0 598 599 ! Update in case 2 ways 600 !---------------------- 601 CALL agrif_update_lim3(0) 602 603 ! 604 END SUBROUTINE Agrif_InitValues_cont_lim3 605 606 SUBROUTINE agrif_declare_var_lim3 607 !!---------------------------------------------------------------------- 608 !! *** ROUTINE agrif_declare_var_lim3 *** 609 !! 610 !! ** Purpose :: Declaration of variables to be interpolated for LIM3 611 !!---------------------------------------------------------------------- 612 USE Agrif_Util 613 USE ice 614 615 IMPLICIT NONE 616 !!---------------------------------------------------------------------- 617 ! 618 ! 1. Declaration of the type of variable which have to be interpolated (parent=>child) 619 ! agrif_declare_variable(position,1st point index,--,--,dimensions,name) 620 !------------------------------------------------------------------------------------- 621 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 ) 622 CALL agrif_declare_variable((/1,2/) ,(/2,3/),(/'x','y'/) ,(/1,1/) ,(/nlci,nlcj/) ,u_ice_id ) 623 CALL agrif_declare_variable((/2,1/) ,(/3,2/),(/'x','y'/) ,(/1,1/) ,(/nlci,nlcj/) ,v_ice_id ) 624 625 ! 2. Set interpolations (normal & tangent to the grid cell for velocities) 626 !----------------------------------- 627 CALL Agrif_Set_bcinterp(tra_ice_id, interp = AGRIF_linear) 628 CALL Agrif_Set_bcinterp(u_ice_id , interp1 = Agrif_linear,interp2 = AGRIF_ppm ) 629 CALL Agrif_Set_bcinterp(v_ice_id , interp1 = AGRIF_ppm ,interp2 = Agrif_linear) 630 631 ! 3. Set location of interpolations 632 !---------------------------------- 633 CALL Agrif_Set_bc(tra_ice_id,(/0,1/)) 634 CALL Agrif_Set_bc(u_ice_id ,(/0,1/)) 635 CALL Agrif_Set_bc(v_ice_id ,(/0,1/)) 636 637 ! 4. Set update type in case 2 ways (child=>parent) (normal & tangent to the grid cell for velocities) 638 !-------------------------------------------------- 639 CALL Agrif_Set_Updatetype(tra_ice_id, update = AGRIF_Update_Average) ! clem je comprends pas average/copy 640 CALL Agrif_Set_Updatetype(u_ice_id ,update1 = Agrif_Update_Copy , update2 = Agrif_Update_Average) 641 CALL Agrif_Set_Updatetype(v_ice_id ,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy ) 642 643 END SUBROUTINE agrif_declare_var_lim3 644 #endif 566 645 567 646 … … 585 664 USE agrif_top_interp 586 665 USE agrif_top_sponge 587 ! 666 !! 588 667 IMPLICIT NONE 589 668 ! … … 615 694 616 695 IF( check_namelist ) THEN 617 # if defined key_offline618 696 ! Check time steps 619 697 IF( NINT(Agrif_Rhot()) * NINT(rdt) .NE. Agrif_Parent(rdt) ) THEN … … 621 699 WRITE(cl_check2,*) rdt 622 700 WRITE(cl_check3,*) rdt*Agrif_Rhot() 623 CALL ctl_ warn( 'incompatible time step between grids', &701 CALL ctl_stop( 'incompatible time step between grids', & 624 702 & 'parent grid value : '//cl_check1 , & 625 703 & 'child grid value : '//cl_check2 , & 626 & 'value on child grid willbe changed to &704 & 'value on child grid should be changed to & 627 705 & :'//cl_check3 ) 628 rdt=rdt*Agrif_Rhot()629 706 ENDIF 630 707 … … 659 736 ENDIF 660 737 ENDIF 661 # endif662 738 ! Check passive tracer cell 663 739 IF( nn_dttrc .NE. 1 ) THEN … … 684 760 USE dom_oce 685 761 USE trc 686 687 IMPLICIT NONE 762 !! 763 IMPLICIT NONE 764 !!---------------------------------------------------------------------- 688 765 689 766 ! 1. Declaration of the type of variable which have to be interpolated … … 716 793 SUBROUTINE Agrif_detect( kg, ksizex ) 717 794 !!---------------------------------------------------------------------- 718 !! *** ROUTINE Agrif_detect *** 719 !!---------------------------------------------------------------------- 720 ! 795 !! *** ROUTINE Agrif_detect *** 796 !!---------------------------------------------------------------------- 721 797 INTEGER, DIMENSION(2) :: ksizex 722 798 INTEGER, DIMENSION(ksizex(1),ksizex(2)) :: kg … … 736 812 USE in_out_manager 737 813 USE lib_mpp 814 !! 738 815 IMPLICIT NONE 739 816 ! … … 777 854 IF( agrif_oce_alloc() > 0 ) CALL ctl_warn('agrif agrif_oce_alloc: allocation of arrays failed') 778 855 # if defined key_lim2 779 IF( agrif_ice_alloc() > 0 ) CALL ctl_stop('agrif agrif_ice_alloc: allocation of arrays failed') 856 IF( agrif_ice_alloc() > 0 ) CALL ctl_stop('agrif agrif_ice_alloc: allocation of arrays failed') ! only for LIM2 (not LIM3) 780 857 # endif 781 858 ! … … 789 866 !!---------------------------------------------------------------------- 790 867 USE dom_oce 868 !! 791 869 IMPLICIT NONE 792 870 ! … … 803 881 END SUBROUTINE Agrif_InvLoc 804 882 883 805 884 SUBROUTINE Agrif_get_proc_info( imin, imax, jmin, jmax ) 806 885 !!---------------------------------------------------------------------- … … 808 887 !!---------------------------------------------------------------------- 809 888 USE par_oce 889 !! 810 890 IMPLICIT NONE 811 891 ! … … 821 901 END SUBROUTINE Agrif_get_proc_info 822 902 903 823 904 SUBROUTINE Agrif_estimate_parallel_cost(imin, imax,jmin, jmax, nbprocs, grid_cost) 824 905 !!---------------------------------------------------------------------- … … 826 907 !!---------------------------------------------------------------------- 827 908 USE par_oce 909 !! 828 910 IMPLICIT NONE 829 911 !
Note: See TracChangeset
for help on using the changeset viewer.