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.
agrifcontrol.patch on Ticket #1892 – Attachment – NEMO

Ticket #1892: agrifcontrol.patch

File agrifcontrol.patch, 4.8 KB (added by mdunphy, 7 years ago)

Patch for Fix #1, moving the control from agrif_user.F90 to domain.F90

  • NEMOGCM/CONFIG/SalishSea/MY_SRC/agrif_user.F90

    # HG changeset patch
    # User Michael Dunphy
    # Date 1494273926 25200
    #      Mon May 08 13:05:26 2017 -0700
    # Node ID 2912b6b92669b16a971cf52bf8a660ad72141b18
    # Parent  aef169d93cf2e2817b72db1bb56e7c32c2b19576
    Move AGRIF time step and run length control from agrif_user.F90 to domain.F90
    
    diff -r aef169d93cf2 -r 2912b6b92669 NEMOGCM/CONFIG/SalishSea/MY_SRC/agrif_user.F90
    a b  
    221221   check_namelist = .TRUE. 
    222222 
    223223   IF( check_namelist ) THEN  
    224  
    225       ! Check time steps            
    226       IF( NINT(Agrif_Rhot()) * NINT(rdt) .NE. Agrif_Parent(rdt) ) THEN 
    227          WRITE(cl_check1,*)  NINT(Agrif_Parent(rdt)) 
    228          WRITE(cl_check2,*)  NINT(rdt) 
    229          WRITE(cl_check3,*)  NINT(Agrif_Parent(rdt)/Agrif_Rhot()) 
    230          CALL ctl_warn( 'incompatible time step between grids',   & 
    231                &               'parent grid value : '//cl_check1    ,   &  
    232                &               'child  grid value : '//cl_check2    ,   &  
    233                &               'value on child grid will be changed to : '//cl_check3 ) 
    234          rdt=Agrif_Parent(rdt)/Agrif_Rhot() 
    235       ENDIF 
    236  
    237       ! Check run length 
    238       IF( Agrif_IRhot() * (Agrif_Parent(nitend)- & 
    239             Agrif_Parent(nit000)+1) .NE. (nitend-nit000+1) ) THEN 
    240          WRITE(cl_check1,*)  (Agrif_Parent(nit000)-1)*Agrif_IRhot() + 1 
    241          WRITE(cl_check2,*)   Agrif_Parent(nitend)   *Agrif_IRhot() 
    242          CALL ctl_warn( 'incompatible run length between grids'               ,   & 
    243                &              ' nit000 on fine grid will be change to : '//cl_check1,   & 
    244                &              ' nitend on fine grid will be change to : '//cl_check2    ) 
    245          nit000 = (Agrif_Parent(nit000)-1)*Agrif_IRhot() + 1 
    246          nitend =  Agrif_Parent(nitend)   *Agrif_IRhot() 
    247       ENDIF 
    248  
    249224      ! Check coordinates 
    250225      IF( ln_zps ) THEN 
    251226         ! check parameters for partial steps  
  • NEMOGCM/CONFIG/SalishSea/MY_SRC/domain.F90

    diff -r aef169d93cf2 -r 2912b6b92669 NEMOGCM/CONFIG/SalishSea/MY_SRC/domain.F90
    a b  
    150150      NAMELIST/namnc4/ nn_nchunks_i, nn_nchunks_j, nn_nchunks_k, ln_nc4zip 
    151151#endif 
    152152      INTEGER  ::   ios                 ! Local integer output status for namelist read 
     153      CHARACTER(len=15) :: cl_check1, cl_check2, cl_check3 
    153154      !!---------------------------------------------------------------------- 
    154155 
    155156      REWIND( numnam_ref )              ! Namelist namrun in reference namelist : Parameters of the run 
     
    241242      ENDIF 
    242243#endif 
    243244 
     245#if defined key_agrif 
     246      IF( .NOT. Agrif_Root() ) THEN 
     247        ! Check run length 
     248        IF( Agrif_IRhot() * (Agrif_Parent(nitend)- & 
     249              Agrif_Parent(nit000)+1) .NE. (nitend-nit000+1) ) THEN 
     250           WRITE(cl_check1,*)  (Agrif_Parent(nit000)-1)*Agrif_IRhot() + 1 
     251           WRITE(cl_check2,*)   Agrif_Parent(nitend)   *Agrif_IRhot() 
     252           CALL ctl_warn( 'incompatible run length between grids'               ,   & 
     253                 &              ' nit000 on fine grid will be changed to : '//cl_check1,   & 
     254                 &              ' nitend on fine grid will be changed to : '//cl_check2    ) 
     255           nit000 = (Agrif_Parent(nit000)-1)*Agrif_IRhot() + 1 
     256           nitend =  Agrif_Parent(nitend)   *Agrif_IRhot() 
     257        ENDIF 
     258      ENDIF 
     259#endif 
     260 
    244261      REWIND( numnam_ref )              ! Namelist namdom in reference namelist : space & time domain (bathymetry, mesh, timestep) 
    245262      READ  ( numnam_ref, namdom, IOSTAT = ios, ERR = 903) 
    246263903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdom in reference namelist', lwp ) 
     
    304321      rdtmax    = rn_rdtmin 
    305322      rdth      = rn_rdth 
    306323 
     324#if defined key_agrif 
     325      IF( .NOT. Agrif_Root() ) THEN 
     326        ! Check time steps 
     327        IF( NINT(Agrif_Rhot()) * NINT(rdt) .NE. Agrif_Parent(rdt) ) THEN 
     328           WRITE(cl_check1,*)  NINT(Agrif_Parent(rdt)) 
     329           WRITE(cl_check2,*)  NINT(rdt) 
     330           WRITE(cl_check3,*)  NINT(Agrif_Parent(rdt)/Agrif_Rhot()) 
     331           CALL ctl_warn( 'incompatible time step between grids',   & 
     332                 &               'parent grid value : '//cl_check1    ,   & 
     333                 &               'child  grid value : '//cl_check2    ,   & 
     334                 &               'value on child grid will be changed to : '//cl_check3 ) 
     335           rdt=Agrif_Parent(rdt)/Agrif_Rhot() 
     336        ENDIF 
     337      ENDIF 
     338#endif 
     339 
    307340      REWIND( numnam_ref )              ! Namelist namcla in reference namelist : Cross land advection 
    308341      READ  ( numnam_ref, namcla, IOSTAT = ios, ERR = 905) 
    309342905   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcla in reference namelist', lwp )