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 13463 for NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/OFF/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2020-09-14T17:40:34+02:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2195:update to trunk 13461

Location:
NEMO/branches/2019/dev_r11351_fldread_with_XIOS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
         8 
         9# SETTE 
         10^/utils/CI/sette@13382        sette 
  • NEMO/branches/2019/dev_r11351_fldread_with_XIOS/src/OFF/nemogcm.F90

    r10601 r13463  
    77   !!            3.4  ! 2011-01  (C. Ethe, A. R. Porter, STFC Daresbury) dynamical allocation 
    88   !!            4.0  ! 2016-10  (C. Ethe, G. Madec, S. Flavoni)  domain configuration / user defined interface 
     9   !!            4.1  ! 2019-08  (A. Coward, D. Storkey) rewrite in preparation for new timestepping scheme 
    910   !!---------------------------------------------------------------------- 
    1011 
     
    2728   USE usrdef_nam     ! user defined configuration 
    2829   USE eosbn2         ! equation of state            (eos bn2 routine) 
     30#if defined key_qco 
     31   USE domqco         ! tools for scale factor         (dom_qco_r3c  routine) 
     32#endif 
     33   USE bdyini         ! open boundary cond. setting        (bdy_init routine) 
    2934   !              ! ocean physics 
    3035   USE ldftra         ! lateral diffusivity setting    (ldf_tra_init routine) 
     
    5863   USE timing         ! Timing 
    5964   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    60    USE lbcnfd  , ONLY : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges 
     65   USE lbcnfd  , ONLY : isendto, nsndto   ! Setup of north fold exchanges 
     66   USE step, ONLY : Nbb, Nnn, Naa, Nrhs   ! time level indices 
     67   USE halo_mng 
    6168 
    6269   IMPLICIT NONE 
     
    8895      !!              Madec, 2008, internal report, IPSL. 
    8996      !!---------------------------------------------------------------------- 
    90       INTEGER :: istp, indic       ! time step index 
     97      INTEGER :: istp       ! time step index 
    9198      !!---------------------------------------------------------------------- 
    9299 
     
    111118                                CALL iom_setkt  ( istp - nit000 + 1, cxios_context )   ! say to iom that we are at time step kstp 
    112119#if defined key_sed_off 
    113                                 CALL dta_dyn_sed( istp )         ! Interpolation of the dynamical fields 
     120                                CALL dta_dyn_sed( istp,      Nnn      )       ! Interpolation of the dynamical fields 
    114121#else 
    115                                 CALL dta_dyn    ( istp )         ! Interpolation of the dynamical fields 
    116          IF( .NOT.ln_linssh )   CALL dta_dyn_swp( istp )         ! swap of sea  surface height and vertical scale factors 
    117 #endif 
    118                                 CALL trc_stp    ( istp )         ! time-stepping 
    119                                 CALL stp_ctl    ( istp, indic )  ! Time loop: control and print 
     122                                CALL dta_dyn    ( istp, Nbb, Nnn, Naa )       ! Interpolation of the dynamical fields 
     123#endif 
     124#if ! defined key_sed_off 
     125         IF( .NOT.ln_linssh ) THEN 
     126                                CALL dta_dyn_atf( istp, Nbb, Nnn, Naa )       ! time filter of sea  surface height and vertical scale factors 
     127# if defined key_qco 
     128                                CALL dom_qco_r3c( ssh(:,:,Kmm), r3t_f, r3u_f, r3v_f ) 
     129# endif 
     130         ENDIF 
     131                                CALL trc_stp    ( istp, Nbb, Nnn, Nrhs, Naa ) ! time-stepping 
     132# if defined key_qco 
     133                                !r3t(:,:,Kmm) = r3t_f(:,:)                     ! update ssh to h0 ratio 
     134                                !r3u(:,:,Kmm) = r3u_f(:,:) 
     135                                !r3v(:,:,Kmm) = r3v_f(:,:) 
     136# endif 
     137#endif 
     138         ! Swap time levels 
     139         Nrhs = Nbb 
     140         Nbb = Nnn 
     141         Nnn = Naa 
     142         Naa = Nrhs 
     143         ! 
     144#if ! defined key_qco 
     145#if ! defined key_sed_off 
     146         IF( .NOT.ln_linssh )   CALL dta_dyn_sf_interp( istp, Nnn )  ! calculate now grid parameters 
     147#endif 
     148#endif          
     149                                CALL stp_ctl    ( istp )             ! Time loop: control and print 
    120150         istp = istp + 1 
    121151      END DO 
     
    131161 
    132162      IF( nstop /= 0 .AND. lwp ) THEN                 ! error print 
    133          WRITE(numout,cform_err) 
    134          WRITE(numout,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found' 
    135          WRITE(numout,*) 
     163         WRITE(ctmp1,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found' 
     164         WRITE(ctmp2,*) '           Look for "E R R O R" messages in all existing ocean_output* files' 
     165         CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 ) 
    136166      ENDIF 
    137167      ! 
     
    146176#endif 
    147177      ! 
     178      IF(lwm) THEN 
     179         IF( nstop == 0 ) THEN   ;   STOP 0 
     180         ELSE                    ;   STOP 123 
     181         ENDIF 
     182      ENDIF 
     183      ! 
    148184   END SUBROUTINE nemo_gcm 
    149185 
     
    155191      !! ** Purpose :   initialization of the nemo model in off-line mode 
    156192      !!---------------------------------------------------------------------- 
    157       INTEGER  ::   ji                 ! dummy loop indices 
    158       INTEGER  ::   ios, ilocal_comm   ! local integers 
    159       CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
    160       !! 
    161       NAMELIST/namctl/ ln_ctl   , sn_cfctl, nn_print, nn_ictls, nn_ictle,   & 
    162          &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,             & 
    163          &             ln_timing, ln_diacfl 
     193      INTEGER ::   ios, ilocal_comm   ! local integers 
     194      !! 
     195      NAMELIST/namctl/ sn_cfctl, ln_timing, ln_diacfl,                                & 
     196         &             nn_isplt,  nn_jsplt,  nn_ictls, nn_ictle, nn_jctls, nn_jctle 
    164197      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    165198      !!---------------------------------------------------------------------- 
    166199      ! 
    167       cltxt  = '' 
    168       cltxt2 = '' 
    169       clnam  = ''   
    170200      cxios_context = 'nemo' 
    171       ! 
    172       !                             ! Open reference namelist and configuration namelist files 
    173       CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    174       CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    175       ! 
    176       REWIND( numnam_ref )              ! Namelist namctl in reference namelist 
     201      nn_hls = 1 
     202      ! 
     203      !                             !-------------------------------------------------! 
     204      !                             !     set communicator & select the local rank    ! 
     205      !                             !  must be done as soon as possible to get narea  ! 
     206      !                             !-------------------------------------------------! 
     207      ! 
     208#if defined key_iomput 
     209      CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm )   ! nemo local communicator given by xios 
     210      CALL mpp_start( ilocal_comm ) 
     211#else 
     212      CALL mpp_start( ) 
     213#endif 
     214      ! 
     215      narea = mpprank + 1               ! mpprank: the rank of proc (0 --> mppsize -1 ) 
     216      lwm = (narea == 1)                ! control of output namelists 
     217      ! 
     218      !                             !---------------------------------------------------------------! 
     219      !                             ! Open output files, reference and configuration namelist files ! 
     220      !                             !---------------------------------------------------------------! 
     221      ! 
     222      ! open ocean.output as soon as possible to get all output prints (including errors messages) 
     223      IF( lwm )   CALL ctl_opn(     numout,        'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     224      ! open reference and configuration namelist files 
     225                  CALL load_nml( numnam_ref,        'namelist_ref',                                           -1, lwm ) 
     226                  CALL load_nml( numnam_cfg,        'namelist_cfg',                                           -1, lwm ) 
     227      IF( lwm )   CALL ctl_opn(     numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     228      ! open /dev/null file to be able to supress output write easily 
     229      IF( Agrif_Root() ) THEN 
     230                  CALL ctl_opn(     numnul,           '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     231#ifdef key_agrif 
     232      ELSE 
     233                  numnul = Agrif_Parent(numnul)    
     234#endif 
     235      ENDIF 
     236      ! 
     237      !                             !--------------------! 
     238      !                             ! Open listing units !  -> need sn_cfctl from namctl to define lwp 
     239      !                             !--------------------! 
     240      ! 
    177241      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
    178 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 
    179       REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist 
     242901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namctl in reference namelist' ) 
    180243      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    181 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    182       ! 
    183       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist 
    184       READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    185 903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 
    186       REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist 
    187       READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
    188 904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    189  
    190       !                             !--------------------------! 
    191       !                             !  Set global domain size  !   (control print return in cltxt2) 
    192       !                             !--------------------------! 
    193       IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
    194          CALL domain_cfg ( cltxt2,        cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
    195          ! 
    196       ELSE                                ! user-defined namelist 
    197          CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
    198       ENDIF 
    199       ! 
    200       l_offline = .true.                  ! passive tracers are run offline 
    201       ! 
    202       !                             !--------------------------------------------! 
    203       !                             !  set communicator & select the local node  ! 
    204       !                             !  NB: mynode also opens output.namelist.dyn ! 
    205       !                             !      on unit number numond on first proc   ! 
    206       !                             !--------------------------------------------! 
    207 #if defined key_iomput 
    208       CALL  xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) 
    209       narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection 
    210 #else 
    211       ilocal_comm = 0 
    212       narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop )                ! Nodes selection (control print return in cltxt) 
    213 #endif 
    214  
    215       narea = narea + 1                       ! mynode return the rank of proc (0 --> jpnij -1 ) 
    216  
    217       IF( sn_cfctl%l_config ) THEN 
    218          ! Activate finer control of report outputs 
    219          ! optionally switch off output from selected areas (note this only 
    220          ! applies to output which does not involve global communications) 
    221          IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax  ) .OR. & 
    222            & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) )    & 
    223            &   CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. ) 
    224       ELSE 
    225          ! Use ln_ctl to turn on or off all options. 
    226          CALL nemo_set_cfctl( sn_cfctl, ln_ctl, .TRUE. ) 
    227       ENDIF 
    228  
    229       lwm = (narea == 1)                      ! control of output namelists 
    230       lwp = (narea == 1) .OR. ln_ctl          ! control of all listing output print 
    231  
    232       IF(lwm) THEN               ! write merged namelists from earlier to output namelist  
    233          !                       ! now that the file has been opened in call to mynode.  
    234          !                       ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 
    235          WRITE( numond, namctl ) 
    236          WRITE( numond, namcfg ) 
    237          IF( .NOT.ln_read_cfg ) THEN 
    238             DO ji = 1, SIZE(clnam) 
    239                IF( TRIM(clnam(ji)) /= '' )   WRITE(numond, * ) clnam(ji)     ! namusr_def print 
    240             END DO 
    241          ENDIF 
    242       ENDIF 
    243  
     244902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namctl in configuration namelist' ) 
     245      ! 
     246      ! finalize the definition of namctl variables 
     247      IF( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax .OR. MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 )   & 
     248         &   CALL nemo_set_cfctl( sn_cfctl, .FALSE. ) 
     249      ! 
     250      lwp = (narea == 1) .OR. sn_cfctl%l_oceout    ! control of all listing output print 
     251      ! 
    244252      IF(lwp) THEN                            ! open listing units 
    245253         ! 
    246          CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
     254         IF( .NOT. lwm )   &           ! alreay opened for narea == 1 
     255            &     CALL ctl_opn(     numout,        'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea ) 
    247256         ! 
    248257         WRITE(numout,*) 
    249          WRITE(numout,*) '   CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' 
     258         WRITE(numout,*) '   CNRS - NERC - Met OFFICE - MERCATOR-ocean - CMCC' 
    250259         WRITE(numout,*) '                       NEMO team' 
    251260         WRITE(numout,*) '                   Off-line TOP Model' 
     
    266275         WRITE(numout,*) "     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " 
    267276         WRITE(numout,*) 
    268          DO ji = 1, SIZE(cltxt) 
    269             IF( TRIM(cltxt (ji)) /= '' )   WRITE(numout,*) TRIM(cltxt(ji))    ! control print of mynode 
    270          END DO 
    271          WRITE(numout,*) 
    272          WRITE(numout,*) 
    273          DO ji = 1, SIZE(cltxt2) 
    274             IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) TRIM(cltxt2(ji))   ! control print of domain size 
    275          END DO 
    276277         ! 
    277278         WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA 
    278279         ! 
    279280      ENDIF 
    280       ! open /dev/null file to be able to supress output write easily 
    281       CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    282       ! 
    283       !                                      ! Domain decomposition 
    284       CALL mpp_init                          ! MPP 
    285  
     281      ! 
     282      IF(lwm) WRITE( numond, namctl ) 
     283      ! 
     284      !                             !------------------------------------! 
     285      !                             !  Set global domain size parameters ! 
     286      !                             !------------------------------------! 
     287      !      
     288      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
     289903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist' ) 
     290      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
     291904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )    
     292      ! 
     293      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
     294         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
     295      ELSE                                ! user-defined namelist 
     296         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
     297      ENDIF 
     298      ! 
     299      IF(lwm)   WRITE( numond, namcfg ) 
     300      l_offline = .true.                  ! passive tracers are run offline 
     301      ! 
     302      !                             !-----------------------------------------! 
     303      !                             ! mpp parameters and domain decomposition ! 
     304      !                             !-----------------------------------------! 
     305      ! 
     306      CALL mpp_init 
     307 
     308      CALL halo_mng_init() 
    286309      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
    287310      CALL nemo_alloc() 
     311 
     312      ! Initialise time level indices 
     313      Nbb = 1; Nnn = 2; Naa = 3; Nrhs = Naa 
    288314 
    289315      !                             !-------------------------------! 
     
    300326                           CALL     eos_init        ! Equation of state 
    301327      IF( lk_c1d       )   CALL     c1d_init        ! 1D column configuration 
    302                            CALL     dom_init("OPA") ! Domain 
    303       IF( ln_ctl       )   CALL prt_ctl_init        ! Print control 
    304  
    305                            CALL  istate_init    ! ocean initial state (Dynamics and tracers) 
    306  
    307                            CALL     sbc_init    ! Forcings : surface module 
     328                           CALL     dom_init( Nbb, Nnn, Naa, "OPA") ! Domain 
     329      IF( sn_cfctl%l_prtctl )   & 
     330         &                 CALL prt_ctl_init        ! Print control 
     331 
     332                           CALL  istate_init( Nnn, Naa )    ! ocean initial state (Dynamics and tracers) 
     333 
     334                           CALL     sbc_init( Nbb, Nnn, Naa )    ! Forcings : surface module 
     335                           CALL     bdy_init    ! Open boundaries initialisation     
    308336 
    309337      !                                      ! Tracer physics 
     
    319347                           CALL trc_rst_cal( nit000, 'READ' )   ! calendar 
    320348#if defined key_sed_off 
    321                            CALL dta_dyn_sed_init ! Initialization for the dynamics 
     349                           CALL dta_dyn_sed_init(  Nnn      )        ! Initialization for the dynamics 
    322350#else 
    323                            CALL dta_dyn_init   ! Initialization for the dynamics 
    324 #endif 
    325  
    326                            CALL     trc_init   ! Passive tracers initialization 
     351                           CALL dta_dyn_init( Nbb, Nnn, Naa )        ! Initialization for the dynamics 
     352#endif 
     353 
     354                           CALL     trc_init( Nbb, Nnn, Naa )        ! Passive tracers initialization 
    327355                           CALL dia_ptr_init   ! Poleward TRansports initialization 
    328356                            
     
    340368      !! ** Purpose :   control print setting 
    341369      !! 
    342       !! ** Method  : - print namctl information and check some consistencies 
     370      !! ** Method  : - print namctl and namcfg information and check some consistencies 
    343371      !!---------------------------------------------------------------------- 
    344372      ! 
     
    348376         WRITE(numout,*) '~~~~~~~~' 
    349377         WRITE(numout,*) '   Namelist namctl' 
    350          WRITE(numout,*) '      run control (for debugging)     ln_ctl     = ', ln_ctl 
    351          WRITE(numout,*) '       finer control over o/p sn_cfctl%l_config  = ', sn_cfctl%l_config 
    352378         WRITE(numout,*) '                              sn_cfctl%l_runstat = ', sn_cfctl%l_runstat 
    353379         WRITE(numout,*) '                              sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat 
    354380         WRITE(numout,*) '                              sn_cfctl%l_oceout  = ', sn_cfctl%l_oceout 
    355381         WRITE(numout,*) '                              sn_cfctl%l_layout  = ', sn_cfctl%l_layout 
    356          WRITE(numout,*) '                              sn_cfctl%l_mppout  = ', sn_cfctl%l_mppout 
    357          WRITE(numout,*) '                              sn_cfctl%l_mpptop  = ', sn_cfctl%l_mpptop 
     382         WRITE(numout,*) '                              sn_cfctl%l_prtctl  = ', sn_cfctl%l_prtctl 
     383         WRITE(numout,*) '                              sn_cfctl%l_prttrc  = ', sn_cfctl%l_prttrc 
     384         WRITE(numout,*) '                              sn_cfctl%l_oasout  = ', sn_cfctl%l_oasout 
    358385         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin   
    359386         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax   
    360387         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr  
    361388         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr  
    362          WRITE(numout,*) '      level of print                  nn_print   = ', nn_print 
    363          WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls 
    364          WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle 
    365          WRITE(numout,*) '      Start j indice for SUM control  nn_jctls   = ', nn_jctls 
    366          WRITE(numout,*) '      End j indice for SUM control    nn_jctle   = ', nn_jctle 
    367          WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    368          WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    369389         WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing 
    370390         WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl 
    371391      ENDIF 
    372       ! 
    373       nprint    = nn_print          ! convert DOCTOR namelist names into OLD names 
    374       nictls    = nn_ictls 
    375       nictle    = nn_ictle 
    376       njctls    = nn_jctls 
    377       njctle    = nn_jctle 
    378       isplt     = nn_isplt 
    379       jsplt     = nn_jsplt 
    380  
     392 
     393      IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
    381394      IF(lwp) THEN                  ! control print 
    382395         WRITE(numout,*) 
     
    389402         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr     = ', ln_use_jattr 
    390403      ENDIF 
    391       IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
    392       ! 
    393       !                             ! Parameter control 
    394       ! 
    395       IF( ln_ctl ) THEN                 ! sub-domain area indices for the control prints 
    396          IF( lk_mpp .AND. jpnij > 1 ) THEN 
    397             isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real split domain 
    398          ELSE 
    399             IF( isplt == 1 .AND. jsplt == 1  ) THEN 
    400                CALL ctl_warn( ' - isplt & jsplt are equal to 1',   & 
    401                   &           ' - the print control will be done over the whole domain' ) 
    402             ENDIF 
    403             ijsplt = isplt * jsplt            ! total number of processors ijsplt 
    404          ENDIF 
    405          IF(lwp) WRITE(numout,*)'          - The total number of processors over which the' 
    406          IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt 
    407          ! 
    408          !                              ! indices used for the SUM control 
    409          IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area 
    410             lsp_area = .FALSE. 
    411          ELSE                                             ! print control done over a specific  area 
    412             lsp_area = .TRUE. 
    413             IF( nictls < 1 .OR. nictls > jpiglo )   THEN 
    414                CALL ctl_warn( '          - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) 
    415                nictls = 1 
    416             ENDIF 
    417             IF( nictle < 1 .OR. nictle > jpiglo )   THEN 
    418                CALL ctl_warn( '          - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) 
    419                nictle = jpiglo 
    420             ENDIF 
    421             IF( njctls < 1 .OR. njctls > jpjglo )   THEN 
    422                CALL ctl_warn( '          - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) 
    423                njctls = 1 
    424             ENDIF 
    425             IF( njctle < 1 .OR. njctle > jpjglo )   THEN 
    426                CALL ctl_warn( '          - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) 
    427                njctle = jpjglo 
    428             ENDIF 
    429          ENDIF 
    430       ENDIF 
    431404      ! 
    432405      IF( 1._wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.',  & 
     
    448421      ! 
    449422      IF( numstp     /= -1 )   CLOSE( numstp     )   ! time-step file 
    450       IF( numnam_ref /= -1 )   CLOSE( numnam_ref )   ! oce reference namelist 
    451       IF( numnam_cfg /= -1 )   CLOSE( numnam_cfg )   ! oce configuration namelist 
    452       IF( numout     /=  6 )   CLOSE( numout     )   ! standard model output file 
    453423      IF( lwm.AND.numond  /= -1 )   CLOSE( numond          )   ! oce output namelist 
    454424      ! 
     
    470440      USE zdf_oce,   ONLY : zdf_oce_alloc 
    471441      USE trc_oce,   ONLY : trc_oce_alloc 
     442      USE bdy_oce,   ONLY : bdy_oce_alloc 
    472443      ! 
    473444      INTEGER :: ierr 
     
    479450      ierr = ierr + zdf_oce_alloc()          ! ocean vertical physics 
    480451      ierr = ierr + trc_oce_alloc()          ! shared TRC / TRA arrays 
     452      ierr = ierr + bdy_oce_alloc()    ! bdy masks (incl. initialization)       
    481453      ! 
    482454      CALL mpp_sum( 'nemogcm', ierr ) 
     
    485457   END SUBROUTINE nemo_alloc 
    486458 
    487    SUBROUTINE nemo_set_cfctl(sn_cfctl, setto, for_all ) 
     459   SUBROUTINE nemo_set_cfctl(sn_cfctl, setto ) 
    488460      !!---------------------------------------------------------------------- 
    489461      !!                     ***  ROUTINE nemo_set_cfctl  *** 
    490462      !! 
    491463      !! ** Purpose :   Set elements of the output control structure to setto. 
    492       !!                for_all should be .false. unless all areas are to be 
    493       !!                treated identically. 
    494       !! 
     464     !! 
    495465      !! ** Method  :   Note this routine can be used to switch on/off some 
    496       !!                types of output for selected areas but any output types 
    497       !!                that involve global communications (e.g. mpp_max, glob_sum) 
    498       !!                should be protected from selective switching by the 
    499       !!                for_all argument 
    500       !!---------------------------------------------------------------------- 
    501       LOGICAL :: setto, for_all 
    502       TYPE(sn_ctl) :: sn_cfctl 
    503       !!---------------------------------------------------------------------- 
    504       IF( for_all ) THEN 
    505          sn_cfctl%l_runstat = setto 
    506          sn_cfctl%l_trcstat = setto 
    507       ENDIF 
     466      !!                types of output for selected areas. 
     467      !!---------------------------------------------------------------------- 
     468      TYPE(sn_ctl), INTENT(inout) :: sn_cfctl 
     469      LOGICAL     , INTENT(in   ) :: setto 
     470      !!---------------------------------------------------------------------- 
     471      sn_cfctl%l_runstat = setto 
     472      sn_cfctl%l_trcstat = setto 
    508473      sn_cfctl%l_oceout  = setto 
    509474      sn_cfctl%l_layout  = setto 
    510       sn_cfctl%l_mppout  = setto 
    511       sn_cfctl%l_mpptop  = setto 
     475      sn_cfctl%l_prtctl  = setto 
     476      sn_cfctl%l_prttrc  = setto 
     477      sn_cfctl%l_oasout  = setto 
    512478   END SUBROUTINE nemo_set_cfctl 
    513479 
    514    SUBROUTINE istate_init 
     480   SUBROUTINE istate_init( Kmm, Kaa ) 
    515481      !!---------------------------------------------------------------------- 
    516482      !!                   ***  ROUTINE istate_init  *** 
     
    518484      !! ** Purpose :   Initialization to zero of the dynamics and tracers. 
    519485      !!---------------------------------------------------------------------- 
     486      INTEGER, INTENT(in) ::   Kmm, Kaa  ! ocean time level indices 
    520487      ! 
    521488      !     now fields         !     after fields      ! 
    522       un   (:,:,:)   = 0._wp   ;   ua(:,:,:) = 0._wp   ! 
    523       vn   (:,:,:)   = 0._wp   ;   va(:,:,:) = 0._wp   ! 
    524       wn   (:,:,:)   = 0._wp   !                       ! 
    525       hdivn(:,:,:)   = 0._wp   !                       ! 
    526       tsn  (:,:,:,:) = 0._wp   !                       ! 
     489      uu   (:,:,:,Kmm)   = 0._wp   ;   uu(:,:,:,Kaa) = 0._wp   ! 
     490      vv   (:,:,:,Kmm)   = 0._wp   ;   vv(:,:,:,Kaa) = 0._wp   ! 
     491      ww   (:,:,:)   = 0._wp   !                       ! 
     492      hdiv (:,:,:)   = 0._wp   !                       ! 
     493      ts  (:,:,:,:,Kmm) = 0._wp   !                       ! 
    527494      ! 
    528495      rhd  (:,:,:) = 0.e0 
     
    533500 
    534501 
    535    SUBROUTINE stp_ctl( kt, kindic ) 
     502   SUBROUTINE stp_ctl( kt ) 
    536503      !!---------------------------------------------------------------------- 
    537504      !!                    ***  ROUTINE stp_ctl  *** 
     
    544511      !!---------------------------------------------------------------------- 
    545512      INTEGER, INTENT(in   ) ::   kt      ! ocean time-step index 
    546       INTEGER, INTENT(inout) ::   kindic  ! indicator of solver convergence 
    547513      !!---------------------------------------------------------------------- 
    548514      ! 
Note: See TracChangeset for help on using the changeset viewer.