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

Ignore:
Timestamp:
2017-12-13T15:58:53+01:00 (6 years ago)
Author:
timgraham
Message:

Merge of dev_CNRS_2017 into branch

File:
1 edited

Legend:

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

    r8528 r9019  
    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      ! 
    9799      NAMELIST/namctl/ ln_ctl   , nn_print, nn_ictls, nn_ictle,   & 
    98100         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,   & 
    99          &             nn_timing, nn_diacfl 
     101         &             ln_timing, ln_diacfl 
    100102      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    101103      !!---------------------------------------------------------------------- 
     
    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 
     
    259292      !                             !-------------------------------! 
    260293 
    261       CALL nemo_ctl                          ! Control prints & Benchmark 
     294      CALL nemo_ctl                             ! Control prints & Benchmark 
    262295 
    263296      !                                      ! Domain decomposition 
    264       IF( jpni*jpnj == jpnij ) THEN   ;   CALL mpp_init      ! standard cutting out 
    265       ELSE                            ;   CALL mpp_init2     ! eliminate land processors 
    266       ENDIF 
    267       ! 
    268       IF( nn_timing == 1 )  CALL timing_init 
    269       ! 
    270       !                                      ! General initialization 
    271                             CALL     phy_cst    ! Physical constants 
    272                             CALL     eos_init   ! Equation of state 
    273                             CALL     dom_init   ! Domain 
    274  
    275       IF( ln_nnogather )    CALL nemo_northcomms   ! Initialise the northfold neighbour lists (must be done after the masks are defined) 
    276  
    277       IF( ln_ctl        )   CALL prt_ctl_init   ! Print control 
    278  
    279                             CALL  istate_init   ! ocean initial state (Dynamics and tracers) 
     297      CALL mpp_init 
     298      ! 
     299      IF( ln_timing    )   CALL timing_init     ! timing by routine 
     300      ! 
     301      !                                         ! General initialization 
     302                           CALL phy_cst            ! Physical constants 
     303                           CALL eos_init           ! Equation of state 
     304                           CALL dom_init           ! Domain 
     305 
     306      IF( ln_nnogather )   CALL nemo_northcomms ! Initialise the northfold neighbour lists (must be done after the masks are defined) 
     307 
     308      IF( ln_ctl       )   CALL prt_ctl_init    ! Print control 
     309 
     310                           CALL istate_init     ! ocean initial state (Dynamics and tracers) 
    280311   END SUBROUTINE nemo_init 
    281312 
     
    303334         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    304335         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    305          WRITE(numout,*) '      timing activated    (0/1)       nn_timing  = ', nn_timing 
     336         WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing 
     337         WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl 
    306338      ENDIF 
    307339      ! 
     
    383415      ! 
    384416      IF( numstp          /= -1 )   CLOSE( numstp          )   ! time-step file 
    385       IF( numsol          /= -1 )   CLOSE( numsol          )   ! solver file 
     417      IF( numrun          /= -1 )   CLOSE( numrun          )   ! run statistics file 
    386418      IF( numnam_ref      /= -1 )   CLOSE( numnam_ref      )   ! oce reference namelist 
    387419      IF( numnam_cfg      /= -1 )   CLOSE( numnam_cfg      )   ! oce configuration namelist 
Note: See TracChangeset for help on using the changeset viewer.