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 9012 for branches/2017/dev_CNRS_2017/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2017-12-13T14:57:33+01:00 (6 years ago)
Author:
acc
Message:

Branch dev_CNRS_2017. Merge in no_ghost changes from dev_r8126_ROBUST08_no_ghost. These changes include lib_mpp refresh and rationalisation of mppini from dev_r8126_ROBUST10_MPPINI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_CNRS_2017/NEMOGCM/NEMO/SAO_SRC/nemogcm.F90

    r8882 r9012  
    9393      INTEGER ::   ji                 ! dummy loop indices 
    9494      INTEGER ::   ios, ilocal_comm   ! local integer 
     95      INTEGER  ::   iiarea, ijarea     ! local integers 
     96      INTEGER  ::   iirest, ijrest     ! local integers 
    9597      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
    9698      ! 
     
    209211#endif 
    210212      ENDIF 
     213      ! 
     214#if defined key_agrif 
     215      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90) 
     216         jpiglo  = nbcellsx + 2 + 2*nbghostcells 
     217         jpjglo  = nbcellsy + 2 + 2*nbghostcells 
     218         jpi     = ( jpiglo-2*nn_hls + (jpni-1+0) ) / jpni + 2*nn_hls 
     219         jpj     = ( jpjglo-2*nn_hls + (jpnj-1+0) ) / jpnj + 2*nn_hls 
     220         jpimax  = jpi 
     221         jpjmax  = jpj 
     222         nperio  = 0 
     223         jperio  = 0 
     224         ln_use_jattr = .false. 
     225      ENDIF 
     226#endif 
    211227 
    212228      IF( Agrif_Root() ) THEN       ! AGRIF mother: specific setting from jpni and jpnj 
     229         iiarea = 1 + MOD( narea - 1 , jpni ) 
     230         ijarea = 1 + ( narea - 1 ) / jpni 
     231         iirest = 1 + MOD( jpiglo - 2*nn_hls - 1 , jpni ) 
     232         ijrest = 1 + MOD( jpjglo - 2*nn_hls - 1 , jpnj ) 
    213233#if defined key_nemocice_decomp 
    214          jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
    215          jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim.  
     234         jpi = ( nx_global+2-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim. 
     235         jpj = ( ny_global+2-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim.  
     236         jpimax  = jpi 
     237         jpjmax  = jpj 
     238         IF( iiarea == jpni ) jpi = jpiglo - (jpni - 1) * (jpi - 2*nn_hls) 
     239         IF( ijarea == jpnj ) jpj = jpjglo - (jpnj - 1) * (jpj - 2*nn_hls) 
    216240#else 
    217          jpi = ( jpiglo     -2*jpreci + (jpni-1) ) / jpni + 2*jpreci    ! first  dim. 
    218          jpj = ( jpjglo     -2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj    ! second dim. 
    219 #endif 
    220       ENDIF 
    221  
    222 !!gm ???    why here  it has already been done in line 301 ! 
     241         jpi = ( jpiglo     -2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls    ! first  dim. 
     242         jpj = ( jpjglo     -2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls    ! second dim. 
     243         jpimax  = jpi 
     244         jpjmax  = jpj 
     245         IF( iiarea > iirest ) jpi = jpi - 1 
     246         IF( ijarea > ijrest ) jpj = jpj - 1 
     247#endif 
     248      ENDIF 
     249 
    223250      jpk = jpkglo                                             ! third dim 
    224 !!gm end 
     251 
     252#if defined key_agrif 
     253      ! simple trick to use same vertical grid as parent but different number of levels:  
     254      ! Save maximum number of levels in jpkglo, then define all vertical grids with this number. 
     255      ! Suppress once vertical online interpolation is ok 
     256      IF(.NOT.Agrif_Root())   jpkglo = Agrif_Parent( jpkglo ) 
     257#endif 
    225258      jpim1 = jpi-1                                            ! inner domain indices 
    226259      jpjm1 = jpj-1                                            !   "           " 
    227       jpkm1 = jpk-1                                            !   "           " 
     260      jpkm1 = MAX( 1, jpk-1 )                                  !   "           " 
    228261      jpij  = jpi*jpj                                          !  jpi x j 
    229262 
     
    261294      CALL nemo_ctl                             ! Control prints & Benchmark 
    262295 
    263       !                                         ! Domain decomposition 
    264       IF( jpni*jpnj == jpnij ) THEN   ;   CALL mpp_init      ! standard cutting out 
    265       ELSE                            ;   CALL mpp_init2     ! eliminate land processors 
    266       ENDIF 
     296      !                                      ! Domain decomposition 
     297      CALL mpp_init 
    267298      ! 
    268299      IF( ln_timing    )   CALL timing_init     ! timing by routine 
     
    384415      ! 
    385416      IF( numstp          /= -1 )   CLOSE( numstp          )   ! time-step file 
    386       IF( numsol          /= -1 )   CLOSE( numsol          )   ! solver file 
     417      IF( numrun          /= -1 )   CLOSE( numrun          )   ! run statistics file 
    387418      IF( numnam_ref      /= -1 )   CLOSE( numnam_ref      )   ! oce reference namelist 
    388419      IF( numnam_cfg      /= -1 )   CLOSE( numnam_cfg      )   ! oce configuration namelist 
Note: See TracChangeset for help on using the changeset viewer.