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 8010 for branches/2017/dev_r7963_nemo_v3_6_AGRIF-3_AGRIFVVL/NEMOGCM/NEMO/NST_SRC/agrif_user.F90 – NEMO

Ignore:
Timestamp:
2017-05-09T17:36:25+02:00 (7 years ago)
Author:
jchanut
Message:

AGRIF vvl add on

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r7963_nemo_v3_6_AGRIF-3_AGRIFVVL/NEMOGCM/NEMO/NST_SRC/agrif_user.F90

    r7988 r8010  
     1#undef UPD_HIGH   /* MIX HIGH UPDATE */ 
    12#if defined key_agrif 
    23!!---------------------------------------------------------------------- 
     
    9091# if defined key_top 
    9192   CALL Agrif_InitValues_cont_top 
    92 # endif       
     93# endif  
     94 
     95   nbcline     = 0 
     96#if defined key_top 
     97   nbcline_trc = 0 
     98#endif 
     99 
     100   IF ( Agrif_Level().EQ.Agrif_MaxLevel() ) CALL agrif_Update_ini() 
     101 
     102   Agrif_UseSpecialValueInUpdate = .FALSE. 
     103      
    93104END SUBROUTINE Agrif_initvalues 
    94105 
     
    150161   ! 5. Update type 
    151162   !---------------  
     163# if defined UPD_HIGH 
     164   CALL Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Average, update2=Agrif_Update_Full_Weighting) 
     165   CALL Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Full_Weighting, update2=Agrif_Update_Average) 
     166#else 
    152167   CALL Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Copy, update2=Agrif_Update_Average) 
    153168   CALL Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Average, update2=Agrif_Update_Copy) 
    154  
    155 ! High order updates 
    156 !   CALL Agrif_Set_Updatetype(e1u_id,update1 = Agrif_Update_Average,            update2=Agrif_Update_Full_Weighting) 
    157 !   CALL Agrif_Set_Updatetype(e2v_id,update1 = Agrif_Update_Full_Weighting,     update2=Agrif_Update_Average) 
     169#endif 
    158170    ! 
    159171END SUBROUTINE agrif_declare_var_dom 
     
    302314      ! 
    303315   ENDIF 
    304    !  
    305    ! Do update at initialisation because not done before writing restarts 
    306    ! This would indeed change boundary conditions values at initial time 
    307    ! hence produce restartability issues. 
    308    ! Note that update below is recursive (with lk_agrif_doupd=T): 
    309    !  
    310 ! JC: I am not sure if Agrif_MaxLevel() is the "relative" 
    311 !     or the absolute maximum nesting level...TBC   
    312    nbcline = 0                  
    313    IF ( Agrif_Level().EQ.Agrif_MaxLevel() ) THEN        
    314       ! NB: Order matters below:  
    315       IF ( lk_vvl ) CALL Agrif_Update_vvl()  
    316       CALL Agrif_Update_tra() 
    317       CALL Agrif_Update_dyn() 
    318    ENDIF 
    319    ! 
     316 
     317END SUBROUTINE Agrif_InitValues_cont 
     318 
     319RECURSIVE SUBROUTINE Agrif_Update_ini( ) 
     320   ! 
     321   USE dom_oce 
     322   USE agrif_opa_update 
     323#if defined key_top 
     324   USE agrif_top_update 
     325#endif 
     326   ! 
     327   IMPLICIT NONE 
     328   ! 
     329   IF (Agrif_Root()) RETURN 
     330   ! 
     331   IF ( lk_vvl ) CALL Agrif_Update_vvl() 
     332   CALL Agrif_Update_tra() 
     333#if defined key_top 
     334   CALL Agrif_Update_Trc() 
     335#endif 
     336   CALL Agrif_Update_dyn() 
    320337# if defined key_zdftke 
    321338!   CALL Agrif_Update_tke(0) 
    322339# endif 
    323    ! 
    324    Agrif_UseSpecialValueInUpdate = .FALSE. 
    325    lk_agrif_doupd = .FALSE. 
    326    ! 
    327 END SUBROUTINE Agrif_InitValues_cont 
    328  
     340 
     341   CALL Agrif_ChildGrid_To_ParentGrid() 
     342   CALL Agrif_Update_ini() 
     343   CALL Agrif_ParentGrid_To_ChildGrid() 
     344 
     345END SUBROUTINE agrif_update_ini 
    329346 
    330347SUBROUTINE agrif_declare_var 
     
    431448   ! 5. Update type 
    432449   !---------------  
     450   CALL Agrif_Set_Updatetype(scales_t_id, update = AGRIF_Update_Average) 
     451 
     452# if defined UPD_HIGH 
     453   CALL Agrif_Set_Updatetype(tsn_id, update = Agrif_Update_Full_Weighting) 
     454   CALL Agrif_Set_Updatetype(un_update_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Full_Weighting) 
     455   CALL Agrif_Set_Updatetype(vn_update_id,update1 = Agrif_Update_Full_Weighting, update2 = Agrif_Update_Average) 
     456 
     457   CALL Agrif_Set_Updatetype(ub2b_update_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Full_Weighting) 
     458   CALL Agrif_Set_Updatetype(vb2b_update_id,update1 = Agrif_Update_Full_Weighting, update2 = Agrif_Update_Average) 
     459   CALL Agrif_Set_Updatetype(sshn_id, update = Agrif_Update_Full_Weighting) 
     460   CALL Agrif_Set_Updatetype(e3t_id, update = Agrif_Update_Full_Weighting) 
     461 
     462# if defined key_zdftke || defined key_zdfgls 
     463   CALL Agrif_Set_Updatetype( en_id, update = AGRIF_Update_Full_Weighting) 
     464   CALL Agrif_Set_Updatetype(avt_id, update = AGRIF_Update_Full_Weighting) 
     465   CALL Agrif_Set_Updatetype(avm_id, update = AGRIF_Update_Full_Weighting) 
     466# endif 
     467 
     468#else 
    433469   CALL Agrif_Set_Updatetype(tsn_id, update = AGRIF_Update_Average) 
    434  
    435    CALL Agrif_Set_Updatetype(scales_t_id, update = AGRIF_Update_Average) 
    436  
    437470   CALL Agrif_Set_Updatetype(un_update_id,update1 = Agrif_Update_Copy, update2 = Agrif_Update_Average) 
    438471   CALL Agrif_Set_Updatetype(vn_update_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy) 
    439472 
    440    CALL Agrif_Set_Updatetype(sshn_id, update = AGRIF_Update_Average) 
    441  
    442473   CALL Agrif_Set_Updatetype(ub2b_update_id,update1 = Agrif_Update_Copy, update2 = Agrif_Update_Average) 
    443474   CALL Agrif_Set_Updatetype(vb2b_update_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Copy) 
     475   CALL Agrif_Set_Updatetype(sshn_id, update = AGRIF_Update_Average) 
     476   CALL Agrif_Set_Updatetype(e3t_id, update = AGRIF_Update_Average) 
    444477 
    445478# if defined key_zdftke || defined key_zdfgls 
     
    449482# endif 
    450483 
    451    CALL Agrif_Set_Updatetype(e3t_id, update = AGRIF_Update_Average) 
    452  
    453 ! High order updates 
    454 !   CALL Agrif_Set_Updatetype(tsn_id, update = Agrif_Update_Full_Weighting) 
    455 !   CALL Agrif_Set_Updatetype(un_update_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Full_Weighting) 
    456 !   CALL Agrif_Set_Updatetype(vn_update_id,update1 = Agrif_Update_Full_Weighting, update2 = Agrif_Update_Average) 
    457 ! 
    458 !   CALL Agrif_Set_Updatetype(ub2b_update_id,update1 = Agrif_Update_Average, update2 = Agrif_Update_Full_Weighting) 
    459 !   CALL Agrif_Set_Updatetype(vb2b_update_id,update1 = Agrif_Update_Full_Weighting, update2 = Agrif_Update_Average) 
    460 !   CALL Agrif_Set_Updatetype(sshn_id, update = Agrif_Update_Full_Weighting) 
    461  
    462 !   CALL Agrif_Set_Updatetype(e3t_id, update = Agrif_Update_Full_Weighting) 
     484#endif 
    463485   ! 
    464486END SUBROUTINE agrif_declare_var 
     
    660682      ENDIF 
    661683   ENDIF 
    662    nbcline_trc = 0 
    663    CALL Agrif_Update_trc(0) 
    664    ! 
    665    Agrif_UseSpecialValueInUpdate = .FALSE. 
    666684   ! 
    667685END SUBROUTINE Agrif_InitValues_cont_top 
     
    699717   ! 5. Update type 
    700718   !---------------  
     719# if defined UPD_HIGH 
     720   CALL Agrif_Set_Updatetype(trn_id, update = Agrif_Update_Full_Weighting) 
     721#else 
    701722   CALL Agrif_Set_Updatetype(trn_id, update = AGRIF_Update_Average) 
    702  
    703 !   Higher order update 
    704 !   CALL Agrif_Set_Updatetype(tsn_id, update = Agrif_Update_Full_Weighting) 
    705  
     723#endif 
    706724   ! 
    707725END SUBROUTINE agrif_declare_var_top 
Note: See TracChangeset for help on using the changeset viewer.