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 9482 for branches/2017/dev_merge_2017/NEMOGCM/NEMO/NST_SRC – NEMO

Ignore:
Timestamp:
2018-04-13T19:03:31+02:00 (6 years ago)
Author:
clem
Message:

The configuration Agrif_Nordic is now restartable for any nn_fsbc(Parent) and nn_fsbc(Child). However we do not authorized nn_fsbc(Child) to be larger than 1 because otherwise it breaks the CFL too easily. The simulation would still run but the results would not be satisfactory. I still have to verify this point with the last version of the code

Location:
branches/2017/dev_merge_2017/NEMOGCM/NEMO/NST_SRC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/NST_SRC/agrif_lim3_interp.F90

    r9454 r9482  
    5353      !!----------------------------------------------------------------------- 
    5454      ! 
    55       IF( Agrif_Root() .OR. nn_ice==0 )  RETURN   ! do not interpolate if inside Parent domain or if child domain does not have ice 
     55      IF( Agrif_Root() .OR. nn_ice==0 )  RETURN   ! do not interpolate if inside Parent Grid or if child domain does not have ice 
    5656      ! 
    5757      SELECT CASE( cd_type ) 
    5858      CASE('U','V') 
    59          IF( PRESENT( kiter ) ) THEN  ! interpolation at the child sub-time step (only for ice rheology) 
     59         IF( PRESENT( kiter ) ) THEN  ! interpolation at the child ice sub-time step (only for ice rheology) 
    6060            zbeta = ( REAL(lim_nbstep) - REAL(kitermax - kiter) / REAL(kitermax) ) /  & 
    6161               &    ( Agrif_Rhot() * REAL(Agrif_Parent(nn_fsbc)) / REAL(nn_fsbc) ) 
    62          ELSE                         ! interpolation at the child time step 
     62         ELSE                         ! interpolation at the child ice time step 
    6363            zbeta = REAL(lim_nbstep) / ( Agrif_Rhot() * REAL(Agrif_Parent(nn_fsbc)) / REAL(nn_fsbc) ) 
    6464         ENDIF 
     
    204204               ! 
    205205               DO jk = 1, nlay_s 
    206                   e_s(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) 
     206                  e_s(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
    207207                  jm = jm + 1 
    208208               END DO 
    209209               ! 
    210210               DO jk = 1, nlay_i 
    211                   e_i(i1:i2,j1:j2,jk,jl) = ptab(:,:,jm) * tmask(i1:i2,j1:j2,1) 
     211                  e_i(i1:i2,j1:j2,jk,jl) = ptab(i1:i2,j1:j2,jm) * tmask(i1:i2,j1:j2,1) 
    212212                  jm = jm + 1 
    213213               END DO 
     
    216216            ! 
    217217!!==> clem: this interpolation does not work because it creates negative values, due 
    218 !           to negative coefficients when mixing points (for ex. z7) 
     218!!          to negative coefficients when mixing points (for ex. z7) 
    219219!! 
    220220!         ELSE                          ! ==> complex interpolation (only one ghost cell available) 
    221221!            !! Use a more complex interpolation since we mix solutions over a couple of grid points 
    222222!            !! it is advised to use it for fields modified by high order schemes (e.g. advection UM5...) 
    223 !            !! clem: for some reason (I don't know why), the following lines do not work  
    224 !            !        I think there is an issue with Agrif_SpecialValue here (not taken into account properly) 
    225223!            ! record ztab 
    226224!            jm = 1 
     
    358356!         ENDIF  ! nbghostcells=1 
    359357          
    360          ! integrated values 
    361          vt_i (i1:i2,j1:j2) = SUM(      v_i(i1:i2,j1:j2,:),            dim=3 ) 
    362          vt_s (i1:i2,j1:j2) = SUM(      v_s(i1:i2,j1:j2,:),            dim=3 ) 
    363          at_i (i1:i2,j1:j2) = SUM(      a_i(i1:i2,j1:j2,:),            dim=3 ) 
    364          et_s(i1:i2,j1:j2)  = SUM( SUM( e_s(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 
    365          et_i(i1:i2,j1:j2)  = SUM( SUM( e_i(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 
    366  
    367          at_ip(i1:i2,j1:j2) = SUM( a_ip(i1:i2,j1:j2,:), dim=3 ) ! melt ponds 
    368          vt_ip(i1:i2,j1:j2) = SUM( v_ip(i1:i2,j1:j2,:), dim=3 ) 
    369          ! 
    370          ato_i(i1:i2,j1:j2) = 1._wp - at_i(i1:i2,j1:j2)         ! open water fraction   
    371  
    372358         DO jl = 1, jpl 
    373359            WHERE( tmask(i1:i2,j1:j2,1) == 0._wp )   t_su(i1:i2,j1:j2,jl) = rt0   ! to avoid a division by 0 in sbcblk.F90 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/NST_SRC/agrif_lim3_update.F90

    r9454 r9482  
    11#define TWO_WAY 
     2!!#undef TWO_WAY 
    23 
    34MODULE agrif_lim3_update 
     
    3233   PRIVATE 
    3334 
    34    PUBLIC   agrif_update_lim3   ! called by agrif_user.F90 
     35   PUBLIC   agrif_update_lim3   ! called by agrif_user.F90 and icestp.F90 
    3536 
    3637   !!---------------------------------------------------------------------- 
     
    5152      !!---------------------------------------------------------------------- 
    5253      ! 
    53       !! clem: I think the update should take place each time the ocean sees the surface forcings 
    54       !!       (but maybe I am wrong and we should update every rhot time steps)  
    55       IF( ( MOD( (kt-nit000)/nn_fsbc + 1, Agrif_irhot() * Agrif_Parent(nn_fsbc) / nn_fsbc ) /=0 ) .AND. (kt /= 0) ) RETURN ! do not update if nb of child time steps differ from time refinement 
    56                                                                                                                            ! i.e. update only at the parent time step 
    57       IF( nn_ice == 0 ) RETURN   ! do not update if child domain does not have ice 
     54      IF( Agrif_Root() .OR. nn_ice == 0 ) RETURN   ! do not update if inside Parent Grid or if child domain does not have ice 
     55      ! 
     56      IF( ( MOD( (kt-nit000)/nn_fsbc + 1, Agrif_irhot() * Agrif_Parent(nn_fsbc)/nn_fsbc ) /=0 ) .AND. (kt /= 0) ) RETURN   ! update only at the parent ice time step 
    5857      ! 
    5958      Agrif_SpecialValueFineGrid    = -9999. 
     
    148147         END DO 
    149148         ! 
    150          ! integrated values 
    151          vt_i(i1:i2,j1:j2) = SUM(      v_i(i1:i2,j1:j2,:)           , dim=3 ) 
    152          vt_s(i1:i2,j1:j2) = SUM(      v_s(i1:i2,j1:j2,:)           , dim=3 ) 
    153          at_i(i1:i2,j1:j2) = SUM(      a_i(i1:i2,j1:j2,:)           , dim=3 ) 
    154          et_s(i1:i2,j1:j2) = SUM( SUM( e_s(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 
    155          et_i(i1:i2,j1:j2) = SUM( SUM( e_i(i1:i2,j1:j2,:,:), dim=4 ), dim=3 ) 
    156  
    157          at_ip(i1:i2,j1:j2) = SUM( a_ip(i1:i2,j1:j2,:), dim=3 ) ! melt ponds 
    158          vt_ip(i1:i2,j1:j2) = SUM( v_ip(i1:i2,j1:j2,:), dim=3 ) 
    159          ! 
    160          ato_i(i1:i2,j1:j2) = 1._wp - at_i(i1:i2,j1:j2)         ! open water fraction   
    161  
    162149         DO jl = 1, jpl 
    163150            WHERE( tmask(i1:i2,j1:j2,1) == 0._wp )   t_su(i1:i2,j1:j2,jl) = rt0   ! to avoid a division by 0 in sbcblk.F90 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/NST_SRC/agrif_user.F90

    r9449 r9482  
    307307   USE agrif_top_update 
    308308#endif 
     309#if defined key_lim3 
     310   USE agrif_lim3_update 
     311#endif 
    309312   ! 
    310313   IMPLICIT NONE 
     
    323326!!   CALL Agrif_Update_tke(0) 
    324327 
     328#if defined key_lim3 
     329   CALL agrif_update_lim3(0) 
     330#endif 
     331    
    325332   CALL Agrif_ChildGrid_To_ParentGrid() 
    326333   CALL Agrif_Update_ini() 
     
    497504   USE agrif_ice 
    498505   USE in_out_manager 
    499    USE agrif_lim3_update 
    500506   USE agrif_lim3_interp 
    501507   USE lib_mpp 
     
    510516   ! Controls 
    511517 
    512    ! clem: For some reason, nn_fsbc(child)/=1 does not work properly (signal is largely degraded by the agrif zoom) 
     518   ! clem: For some reason, nn_fsbc(child)/=1 does not work properly (signal can be largely degraded by the agrif zoom) 
    513519   !          the run must satisfy CFL=Uice/(dx/dt) < 0.6/nn_fsbc(child) 
    514520   !          therefore, if nn_fsbc(child)>1 one must reduce the time-step in proportion to nn_fsbc(child), which is not acceptable 
    515    !       If a solution is found, the following stop could be removed 
    516    IF( nn_fsbc > 1 )  CALL ctl_stop('nn_fsbc(child) must be set to 1 otherwise agrif and lim3 do not work properly') 
     521   !       If a solution is found, the following stop could be removed because the rest of the code take nn_fsbc(child) into account 
     522   IF( nn_fsbc > 1 )  CALL ctl_stop('nn_fsbc(child) must be set to 1 otherwise agrif and sea-ice may not work properly') 
    517523 
    518524   ! stop if rhot * nn_fsbc(parent) /= N * nn_fsbc(child) with N being integer 
     
    528534   lim_nbstep = 0 
    529535    
    530    ! Update in case 2 ways 
    531    !---------------------- 
    532    CALL agrif_update_lim3(0) 
    533  
    534536   ! 
    535537END SUBROUTINE Agrif_InitValues_cont_lim3 
Note: See TracChangeset for help on using the changeset viewer.