New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 7378 for branches/2016 – NEMO

Changeset 7378 for branches/2016


Ignore:
Timestamp:
2016-11-30T11:15:30+01:00 (7 years ago)
Author:
clem
Message:

debug agrif

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/NST_SRC/agrif_user.F90

    r7277 r7378  
    3939      jpkm1   = jpk-1                                          
    4040      jpij    = jpi*jpj  
    41  !SF      jpidta  = jpiglo 
    42  !SF     jpjdta  = jpjglo 
    4341      nperio  = 0 
    4442      jperio  = 0 
     
    239237         WRITE(cl_check2,*)  NINT(rdt) 
    240238         WRITE(cl_check3,*)  NINT(Agrif_Parent(rdt)/Agrif_Rhot()) 
    241          CALL ctl_warn( 'incompatible time step between grids',   & 
     239         CALL ctl_stop( 'incompatible time step between ocean grids',   & 
    242240               &               'parent grid value : '//cl_check1    ,   &  
    243241               &               'child  grid value : '//cl_check2    ,   &  
    244                &               'value on child grid will be changed to : '//cl_check3 ) 
    245          rdt=Agrif_Parent(rdt)/Agrif_Rhot() 
     242               &               'value on child grid should be changed to : '//cl_check3 ) 
    246243      ENDIF 
    247244 
     
    566563#  endif 
    567564 
     565#if defined key_lim3 
     566SUBROUTINE Agrif_InitValues_cont_lim3 
     567   !!---------------------------------------------------------------------- 
     568   !!                 *** ROUTINE Agrif_InitValues_cont_lim3 *** 
     569   !! 
     570   !! ** Purpose :: Initialisation of variables to be interpolated for LIM3 
     571   !!---------------------------------------------------------------------- 
     572   USE Agrif_Util 
     573   USE sbc_oce, ONLY : nn_fsbc  ! clem: necessary otherwise Agrif_Parent(nn_fsbc) = nn_fsbc 
     574   USE ice 
     575   USE agrif_ice 
     576   USE in_out_manager 
     577   USE agrif_lim3_update 
     578   USE agrif_lim3_interp 
     579   USE lib_mpp 
     580   ! 
     581   IMPLICIT NONE 
     582   !!---------------------------------------------------------------------- 
     583   ! 
     584   ! Declaration of the type of variable which have to be interpolated (parent=>child) 
     585   !---------------------------------------------------------------------------------- 
     586   CALL agrif_declare_var_lim3 
     587 
     588   ! Controls (clem) 
     589   ! stop if rhot * nn_fsbc(parent) /= N * nn_fsbc(child) with N being integer 
     590   IF( MOD( Agrif_irhot() * Agrif_Parent(nn_fsbc), nn_fsbc ) /= 0 )  THEN 
     591      CALL ctl_stop('rhot * nn_fsbc(parent) /= N * nn_fsbc(child), therefore nn_fsbc(child) should be set to 1 or nn_fsbc(parent)') 
     592   ENDIF 
     593 
     594   ! stop if update frequency is different from nn_fsbc 
     595   IF( nbclineupdate > nn_fsbc )  CALL ctl_stop('With ice model on child grid, nn_cln_update should be set to 1 or nn_fsbc') 
     596 
     597 
     598   ! First Interpolations (using "after" ice subtime step => lim_nbstep=1) 
     599   !---------------------------------------------------------------------- 
     600   lim_nbstep = 1 
     601   CALL agrif_interp_lim3('U') ! interpolation of ice velocities 
     602   CALL agrif_interp_lim3('V') ! interpolation of ice velocities 
     603   CALL agrif_interp_lim3('T') ! interpolation of ice tracers 
     604   lim_nbstep = 0 
     605    
     606   ! Update in case 2 ways 
     607   !---------------------- 
     608   CALL agrif_update_lim3(0) 
     609 
     610   ! 
     611END SUBROUTINE Agrif_InitValues_cont_lim3 
     612 
     613SUBROUTINE agrif_declare_var_lim3 
     614   !!---------------------------------------------------------------------- 
     615   !!                 *** ROUTINE agrif_declare_var_lim3 *** 
     616   !! 
     617   !! ** Purpose :: Declaration of variables to be interpolated for LIM3 
     618   !!---------------------------------------------------------------------- 
     619   USE Agrif_Util 
     620   USE ice 
     621 
     622   IMPLICIT NONE 
     623   !!---------------------------------------------------------------------- 
     624   ! 
     625   ! 1. Declaration of the type of variable which have to be interpolated (parent=>child) 
     626   !       agrif_declare_variable(position,1st point index,--,--,dimensions,name) 
     627   !------------------------------------------------------------------------------------- 
     628   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 ) 
     629   CALL agrif_declare_variable((/1,2/)    ,(/2,3/),(/'x','y'/)    ,(/1,1/)  ,(/nlci,nlcj/)                      ,u_ice_id   ) 
     630   CALL agrif_declare_variable((/2,1/)    ,(/3,2/),(/'x','y'/)    ,(/1,1/)  ,(/nlci,nlcj/)                      ,v_ice_id   ) 
     631 
     632   ! 2. Set interpolations (normal & tangent to the grid cell for velocities) 
     633   !----------------------------------- 
     634   CALL Agrif_Set_bcinterp(tra_ice_id,  interp = AGRIF_linear) 
     635   CALL Agrif_Set_bcinterp(u_ice_id  , interp1 = Agrif_linear,interp2 = AGRIF_ppm   ) 
     636   CALL Agrif_Set_bcinterp(v_ice_id  , interp1 = AGRIF_ppm   ,interp2 = Agrif_linear) 
     637 
     638   ! 3. Set location of interpolations 
     639   !---------------------------------- 
     640   CALL Agrif_Set_bc(tra_ice_id,(/0,1/)) 
     641   CALL Agrif_Set_bc(u_ice_id  ,(/0,1/)) 
     642   CALL Agrif_Set_bc(v_ice_id  ,(/0,1/)) 
     643 
     644   ! 4. Set update type in case 2 ways (child=>parent) (normal & tangent to the grid cell for velocities) 
     645   !-------------------------------------------------- 
     646   CALL Agrif_Set_Updatetype(tra_ice_id, update = AGRIF_Update_Average) ! clem je comprends pas average/copy 
     647   CALL Agrif_Set_Updatetype(u_ice_id  ,update1 = Agrif_Update_Copy   , update2 = Agrif_Update_Average) 
     648   CALL Agrif_Set_Updatetype(v_ice_id  ,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy   ) 
     649 
     650END SUBROUTINE agrif_declare_var_lim3 
     651#endif 
     652 
    568653 
    569654# if defined key_top 
     
    622707         WRITE(cl_check2,*)  rdt 
    623708         WRITE(cl_check3,*)  rdt*Agrif_Rhot() 
    624          CALL ctl_warn( 'incompatible time step between grids',   & 
     709         CALL ctl_stop( 'incompatible time step between grids',   & 
    625710               &               'parent grid value : '//cl_check1    ,   &  
    626711               &               'child  grid value : '//cl_check2    ,   &  
    627                &               'value on child grid will be changed to  & 
     712               &               'value on child grid should be changed to  & 
    628713               &               :'//cl_check3  ) 
    629          rdt=rdt*Agrif_Rhot() 
    630714      ENDIF 
    631715 
     
    779863   IF( agrif_oce_alloc()  > 0 )   CALL ctl_warn('agrif agrif_oce_alloc: allocation of arrays failed') 
    780864# if defined key_lim2 
    781    IF( agrif_ice_alloc()  > 0 )   CALL ctl_stop('agrif agrif_ice_alloc: allocation of arrays failed') 
     865   IF( agrif_ice_alloc()  > 0 )   CALL ctl_stop('agrif agrif_ice_alloc: allocation of arrays failed') ! only for LIM2 (not LIM3) 
    782866# endif 
    783867   ! 
Note: See TracChangeset for help on using the changeset viewer.