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 9817 for branches/UKMO/dev_r5518_nemo2cice_prints/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2018-06-21T11:58:42+02:00 (6 years ago)
Author:
dancopsey
Message:

Merged in GO6 package branch up to revision 8356.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_nemo2cice_prints/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r9816 r9817  
    6868   USE icbini          ! handle bergs, initialisation 
    6969   USE icbstp          ! handle bergs, calving, themodynamics and transport 
     70   USE sbccpl  
    7071   USE cpl_oasis3      ! OASIS3 coupling 
    7172   USE c1d             ! 1D configuration 
     
    7475#if defined key_top 
    7576   USE trcini          ! passive tracer initialisation 
     77   USE trc, ONLY: numstr  ! tracer stats unit number 
    7678#endif 
    7779   USE lib_mpp         ! distributed memory computing 
     
    161163          ENDIF 
    162164 
     165#if defined key_agrif 
     166          CALL Agrif_Regrid() 
     167#endif 
     168 
    163169         DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    164170#if defined key_agrif 
    165             CALL Agrif_Step( stp )           ! AGRIF: time stepping 
     171            CALL stp                         ! AGRIF: time stepping 
    166172#else 
    167             CALL stp( istp )                 ! standard time stepping 
     173            IF (lk_oasis) CALL sbc_cpl_snd( istp )  ! Coupling to atmos 
     174       CALL stp( istp ) 
     175            ! We don't couple on the final timestep because 
     176            ! our restart file has already been written 
     177            ! and contains all the necessary data for a 
     178            ! restart. sbc_cpl_snd could be called here 
     179            ! but it would require 
     180            ! a) A test to ensure it was not performed 
     181            !    on the very last time-step 
     182            ! b) the presence of another call to 
     183            !    sbc_cpl_snd call prior to the main DO loop 
     184            ! This solution produces identical results 
     185            ! with fewer lines of code.  
    168186#endif 
    169187            istp = istp + 1 
     
    187205      ! 
    188206#if defined key_agrif 
    189       CALL Agrif_ParentGrid_To_ChildGrid() 
    190       IF( lk_diaobs ) CALL dia_obs_wri 
    191       IF( nn_timing == 1 )   CALL timing_finalize 
    192       CALL Agrif_ChildGrid_To_ParentGrid() 
     207      IF( .NOT. Agrif_Root() ) THEN 
     208         CALL Agrif_ParentGrid_To_ChildGrid() 
     209         IF( lk_diaobs ) CALL dia_obs_wri 
     210         IF( nn_timing == 1 )   CALL timing_finalize 
     211         CALL Agrif_ChildGrid_To_ParentGrid() 
     212      ENDIF 
    193213#endif 
    194214      IF( nn_timing == 1 )   CALL timing_finalize 
     
    277297      IF( Agrif_Root() ) THEN 
    278298         IF( lk_oasis ) THEN 
    279             CALL cpl_init( "oceanx", ilocal_comm )                     ! nemo local communicator given by oasis 
     299            CALL cpl_init( "toyoce", ilocal_comm )                     ! nemo local communicator given by oasis 
    280300            CALL xios_initialize( "not used",local_comm=ilocal_comm )    ! send nemo communicator to xios 
    281301         ELSE 
     
    288308      IF( lk_oasis ) THEN 
    289309         IF( Agrif_Root() ) THEN 
    290             CALL cpl_init( "oceanx", ilocal_comm )                      ! nemo local communicator given by oasis 
     310            CALL cpl_init( "toyoce", ilocal_comm )                      ! nemo local communicator given by oasis 
    291311         ENDIF 
    292312         ! Nodes selection (control print return in cltxt) 
     
    334354         jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim. 
    335355#endif 
    336       ENDIF 
     356      ENDIF          
    337357         jpk = jpkdta                                             ! third dim 
     358#if defined key_agrif 
     359         ! simple trick to use same vertical grid as parent 
     360         ! but different number of levels:  
     361         ! Save maximum number of levels in jpkdta, then define all vertical grids 
     362         ! with this number. 
     363         ! Suppress once vertical online interpolation is ok 
     364         IF(.NOT.Agrif_Root()) jpkdta = Agrif_Parent(jpkdta) 
     365#endif 
    338366         jpim1 = jpi-1                                            ! inner domain indices 
    339367         jpjm1 = jpj-1                                            !   "           " 
     
    448476      !                                     ! Diagnostics 
    449477      IF( lk_floats     )   CALL     flo_init   ! drifting Floats 
    450       IF( lk_diaar5     )   CALL dia_ar5_init   ! ar5 diag 
    451478                            CALL dia_ptr_init   ! Poleward TRansports initialization 
    452479      IF( lk_diadct     )   CALL dia_dct_init   ! Sections tranports 
     
    461488      IF( lk_asminc     )   CALL asm_inc_init   ! Initialize assimilation increments 
    462489      IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
     490       
     491      IF (nstop > 0) THEN 
     492        CALL CTL_STOP('STOP','Critical errors in NEMO initialisation') 
     493      END IF 
     494 
    463495      ! 
    464496   END SUBROUTINE nemo_init 
     
    596628      IF( numdct_heat     /= -1 )   CLOSE( numdct_heat     )   ! heat transports 
    597629      IF( numdct_salt     /= -1 )   CLOSE( numdct_salt     )   ! salt transports 
    598  
     630#if defined key_top 
     631      IF( numstr          /= -1 )   CLOSE( numstr          )   ! tracer statistics  
     632#endif 
    599633      ! 
    600634      numout = 6                                     ! redefine numout in case it is used after this point... 
     
    710744      INTEGER :: ifac, jl, inu 
    711745      INTEGER, PARAMETER :: ntest = 14 
    712       INTEGER :: ilfax(ntest) 
    713       ! 
    714       ! lfax contains the set of allowed factors. 
    715       data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  & 
    716          &                            128,   64,   32,   16,    8,   4,   2  / 
    717       !!---------------------------------------------------------------------- 
     746      INTEGER, DIMENSION(ntest) :: ilfax 
     747      ! 
     748      ! ilfax contains the set of allowed factors. 
     749      ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 
     750      !!---------------------------------------------------------------------- 
     751      ! ilfax contains the set of allowed factors. 
     752      ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 
    718753 
    719754      ! Clear the error flag and initialise output vars 
Note: See TracChangeset for help on using the changeset viewer.