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 4147 for branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2013-11-04T12:51:55+01:00 (10 years ago)
Author:
cetlod
Message:

merge in dev_LOCEAN_2013, the 1st development branch dev_r3853_CNRS9_Confsetting, from its starting point ( r3853 ) on the trunk: see ticket #1169

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_LOCEAN_2013/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r3769 r4147  
    118118      !!---------------------------------------------------------------------- 
    119119      ! 
     120 
    120121#if defined key_agrif 
    121122      CALL Agrif_Init_Grids()      ! AGRIF: set the meshes 
     
    135136# endif 
    136137#endif 
     138 
    137139      ! check that all process are still there... If some process have an error, 
    138140      ! they will never enter in step and other processes will wait until the end of the cpu time! 
     
    161163 
    162164         DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
     165 
    163166#if defined key_agrif 
    164167            CALL Agrif_Step( stp )           ! AGRIF: time stepping 
     
    166169            CALL stp( istp )                 ! standard time stepping 
    167170#endif 
     171 
    168172            istp = istp + 1 
    169173            IF( lk_mpp )   CALL mpp_max( nstop ) 
     
    218222      INTEGER ::   ji            ! dummy loop indices 
    219223      INTEGER ::   ilocal_comm   ! local integer 
     224      INTEGER ::   ios 
    220225      CHARACTER(len=80), DIMENSION(16) ::   cltxt 
    221226      !! 
    222       NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
     227      NAMELIST/namctl/ ln_ctl, nn_print, nn_ictls, nn_ictle,   & 
    223228         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    224229         &             nn_bench, nn_timing 
     230      NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
     231         &             jpizoom, jpjzoom, jperio 
    225232      !!---------------------------------------------------------------------- 
    226233      ! 
    227234      cltxt = '' 
    228235      ! 
    229       !                             ! open Namelist file 
    230       CALL ctl_opn( numnam, 'namelist', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    231       ! 
    232       READ( numnam, namctl )        ! Namelist namctl : Control prints & Benchmark 
     236      !                             ! Open reference namelist and configuration namelist files 
     237      CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
     238      CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
     239      CALL ctl_opn( numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
     240      ! 
     241      REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints & Benchmark 
     242      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
     243901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in reference namelist', lwp ) 
     244 
     245      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist : Control prints & Benchmark 
     246      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
     247902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', lwp ) 
     248      WRITE( numond, namctl ) 
     249 
     250      ! 
     251      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist : Control prints & Benchmark 
     252      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
     253903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in reference namelist', lwp ) 
     254 
     255      REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist : Control prints & Benchmark 
     256      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
     257904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', lwp )    
     258      WRITE( numond, namcfg ) 
     259! Force values for AGRIF zoom (cf. agrif_user.F90) 
     260#if defined key_agrif 
     261   IF( .NOT. Agrif_Root() ) THEN 
     262      jpiglo  = nbcellsx + 2 + 2*nbghostcells 
     263      jpjglo  = nbcellsy + 2 + 2*nbghostcells 
     264      jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 
     265      jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 
     266      jpidta  = jpiglo 
     267      jpjdta  = jpjglo 
     268      jpizoom = 1 
     269      jpjzoom = 1 
     270      nperio  = 0 
     271      jperio  = 0 
     272   ENDIF 
     273#endif 
    233274      ! 
    234275      !                             !--------------------------------------------! 
     
    244285# endif 
    245286      ENDIF 
    246       narea = mynode( cltxt, numnam, nstop, ilocal_comm )   ! Nodes selection 
     287      narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection 
    247288#else 
    248289# if defined key_oasis3 || defined key_oasis4 
     
    250291         CALL cpl_prism_init( ilocal_comm )                 ! nemo local communicator given by oasis 
    251292      ENDIF 
    252       narea = mynode( cltxt, numnam, nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt) 
     293      narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt) 
    253294# else 
    254295      ilocal_comm = 0 
    255       narea = mynode( cltxt, numnam, nstop )                 ! Nodes selection (control print return in cltxt) 
     296      narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop )                 ! Nodes selection (control print return in cltxt) 
    256297# endif 
    257298#endif 
     
    283324         jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim. 
    284325#endif 
     326      ENDIF 
    285327         jpk = jpkdta                                             ! third dim 
    286328         jpim1 = jpi-1                                            ! inner domain indices 
     
    288330         jpkm1 = jpk-1                                            !   "           " 
    289331         jpij  = jpi*jpj                                          !  jpi x j 
    290       ENDIF 
    291332 
    292333      IF(lwp) THEN                            ! open listing units 
     
    350391                            CALL     sbc_init   ! Forcings : surface module 
    351392      !                                         ! Vertical physics 
     393 
    352394                            CALL     zdf_init      ! namelist read 
     395 
    353396                            CALL zdf_bfr_init      ! bottom friction 
     397 
    354398      IF( lk_zdfric     )   CALL zdf_ric_init      ! Richardson number dependent Kz 
    355399      IF( lk_zdftke     )   CALL zdf_tke_init      ! TKE closure scheme 
     
    382426 
    383427      !                                     ! Misc. options 
    384       IF( nn_cla == 1   )   CALL cla_init       ! Cross Land Advection 
     428      IF( nn_cla == 1 .AND. cp_cfg == 'orca' .AND. jp_cfg == 2 )   CALL cla_init       ! Cross Land Advection 
    385429                            CALL icb_init( rdt, nit000)   ! initialise icebergs instance 
    386        
     430      
    387431#if defined key_top 
    388432      !                                     ! Passive tracers 
    389433                            CALL     trc_init 
    390434#endif 
    391       !                                     ! Diagnostics 
     435      ! 
     436  
     437                                            ! Diagnostics 
    392438      IF( lk_floats     )   CALL     flo_init   ! drifting Floats 
    393439      IF( lk_diaar5     )   CALL dia_ar5_init   ! ar5 diag 
     
    441487      jsplt     = nn_jsplt 
    442488      nbench    = nn_bench 
     489 
     490      IF(lwp) THEN                  ! control print 
     491         WRITE(numout,*) 
     492         WRITE(numout,*) 'namcfg  : configuration initialization through namelist read' 
     493         WRITE(numout,*) '~~~~~~~ ' 
     494         WRITE(numout,*) '   Namelist namcfg' 
     495         WRITE(numout,*) '      configuration name              cp_cfg      = ', TRIM(cp_cfg) 
     496         WRITE(numout,*) '      configuration zoom name         cp_cfz      = ', TRIM(cp_cfz) 
     497         WRITE(numout,*) '      configuration resolution        jp_cfg      = ', jp_cfg 
     498         WRITE(numout,*) '      1st lateral dimension ( >= jpi ) jpidta     = ', jpidta 
     499         WRITE(numout,*) '      2nd    "         "    ( >= jpj ) jpjdta     = ', jpjdta 
     500         WRITE(numout,*) '      3nd    "         "               jpkdta     = ', jpkdta 
     501         WRITE(numout,*) '      1st dimension of global domain in i jpiglo  = ', jpiglo 
     502         WRITE(numout,*) '      2nd    -                  -    in j jpjglo  = ', jpjglo 
     503         WRITE(numout,*) '      left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 
     504         WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 
     505         WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
     506      ENDIF 
    443507      !                             ! Parameter control 
    444508      ! 
     
    484548         CASE ( 'gyre' )   ;   CALL ctl_warn( ' The Benchmark is activated ' ) 
    485549         CASE DEFAULT      ;   CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:',   & 
    486             &                                 ' key_gyre must be used or set nbench = 0' ) 
     550            &                                 ' cp_cfg = "gyre" in namelist &namcfg or set nbench = 0' ) 
    487551         END SELECT 
    488552      ENDIF 
     
    510574      CALL iom_close                                 ! close all input/output files managed by iom_* 
    511575      ! 
    512       IF( numstp      /= -1 )   CLOSE( numstp      )   ! time-step file 
    513       IF( numsol      /= -1 )   CLOSE( numsol      )   ! solver file 
    514       IF( numnam      /= -1 )   CLOSE( numnam      )   ! oce namelist 
    515       IF( numnam_ice  /= -1 )   CLOSE( numnam_ice  )   ! ice namelist 
    516       IF( numevo_ice  /= -1 )   CLOSE( numevo_ice  )   ! ice variables (temp. evolution) 
    517       IF( numout      /=  6 )   CLOSE( numout      )   ! standard model output file 
    518       IF( numdct_vol  /= -1 )   CLOSE( numdct_vol  )   ! volume transports 
    519       IF( numdct_heat /= -1 )   CLOSE( numdct_heat )   ! heat transports 
    520       IF( numdct_salt /= -1 )   CLOSE( numdct_salt )   ! salt transports 
     576      IF( numstp          /= -1 )   CLOSE( numstp          )   ! time-step file 
     577      IF( numsol          /= -1 )   CLOSE( numsol          )   ! solver file 
     578      IF( numnam_ref      /= -1 )   CLOSE( numnam_ref      )   ! oce reference namelist 
     579      IF( numnam_cfg      /= -1 )   CLOSE( numnam_cfg      )   ! oce configuration namelist 
     580      IF( numond          /= -1 )   CLOSE( numond          )   ! oce output namelist 
     581      IF( numnam_ice_ref  /= -1 )   CLOSE( numnam_ice_ref  )   ! ice reference namelist 
     582      IF( numnam_ice_cfg  /= -1 )   CLOSE( numnam_ice_cfg  )   ! ice configuration namelist 
     583      IF( numoni          /= -1 )   CLOSE( numoni          )   ! ice output namelist 
     584      IF( numevo_ice      /= -1 )   CLOSE( numevo_ice      )   ! ice variables (temp. evolution) 
     585      IF( numout          /=  6 )   CLOSE( numout          )   ! standard model output file 
     586      IF( numdct_vol      /= -1 )   CLOSE( numdct_vol      )   ! volume transports 
     587      IF( numdct_heat     /= -1 )   CLOSE( numdct_heat     )   ! heat transports 
     588      IF( numdct_salt     /= -1 )   CLOSE( numdct_salt     )   ! salt transports 
    521589 
    522590      ! 
Note: See TracChangeset for help on using the changeset viewer.