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 13727 for NEMO/branches/2020/dev_12905_xios_restart/src/OFF – NEMO

Ignore:
Timestamp:
2020-11-05T15:18:53+01:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2462: Upate to trunk rev 13688

Location:
NEMO/branches/2020/dev_12905_xios_restart
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_12905_xios_restart

    • 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 
        88 
        99# SETTE 
        10 ^/utils/CI/sette@HEAD         sette 
         10^/utils/CI/sette@13559        sette 
  • NEMO/branches/2020/dev_12905_xios_restart/src/OFF/dtadyn.F90

    r12489 r13727  
    2323   USE c1d             ! 1D configuration: lk_c1d 
    2424   USE dom_oce         ! ocean domain: variables 
     25#if ! defined key_qco  
    2526   USE domvvl          ! variable volume 
     27#else 
     28   USE domqco 
     29#endif 
    2630   USE zdf_oce         ! ocean vertical physics: variables 
    2731   USE sbc_oce         ! surface module: variables 
     
    5256   PUBLIC   dta_dyn_sed        ! called by nemo_gcm 
    5357   PUBLIC   dta_dyn_atf        ! called by nemo_gcm 
     58#if ! defined key_qco 
    5459   PUBLIC   dta_dyn_sf_interp  ! called by nemo_gcm 
     60#endif 
    5561 
    5662   CHARACTER(len=100) ::   cn_dir          !: Root directory for location of ssr files 
     
    6571   INTEGER  , SAVE      ::   jf_uwd         ! index of u-transport 
    6672   INTEGER  , SAVE      ::   jf_vwd         ! index of v-transport 
    67    INTEGER  , SAVE      ::   jf_wwd         ! index of v-transport 
     73   INTEGER  , SAVE      ::   jf_wwd         ! index of w-transport 
    6874   INTEGER  , SAVE      ::   jf_avt         ! index of Kz 
    6975   INTEGER  , SAVE      ::   jf_mld         ! index of mixed layer deptht 
     
    122128      ! 
    123129      IF( kt == nit000 ) THEN    ;    nprevrec = 0 
    124       ELSE                       ;    nprevrec = sf_dyn(jf_tem)%nrec_a(2) 
     130      ELSE                       ;    nprevrec = sf_dyn(jf_tem)%nrec(2,sf_dyn(jf_tem)%naa) 
    125131      ENDIF 
    126132      CALL fld_read( kt, 1, sf_dyn )      !=  read data at kt time step   ==! 
     
    149155         emp_b  (:,:)   = sf_dyn(jf_empb)%fnow(:,:,1) * tmask(:,:,1)    ! E-P 
    150156         zemp   (:,:)   = ( 0.5_wp * ( emp(:,:) + emp_b(:,:) ) + rnf(:,:) + fwbcorr ) * tmask(:,:,1) 
    151          CALL dta_dyn_ssh( kt, zhdivtr, ssh(:,:,Kbb), zemp, ssh(:,:,Kaa), e3t(:,:,:,Kaa) )  !=  ssh, vertical scale factor & vertical transport 
     157#if defined key_qco 
     158         CALL dta_dyn_ssh( kt, zhdivtr, ssh(:,:,Kbb), zemp, ssh(:,:,Kaa) ) 
     159         CALL dom_qco_r3c( ssh(:,:,Kaa), r3t(:,:,Kaa), r3u(:,:,Kaa), r3v(:,:,Kaa) ) 
     160#else 
     161         CALL dta_dyn_ssh( kt, zhdivtr, ssh(:,:,Kbb), zemp, ssh(:,:,Kaa), e3t(:,:,:,Kaa) )  !=  ssh, vertical scale factor 
     162#endif 
    152163         DEALLOCATE( zemp , zhdivtr ) 
    153164         !                                           Write in the tracer restart file 
     
    283294      !                                         ! fill sf with slf_i and control print 
    284295      CALL fld_fill( sf_dyn, slf_d, cn_dir, 'dta_dyn_init', 'Data in file', 'namdta_dyn' ) 
     296      sf_dyn(jf_uwd)%cltype = 'U'   ;   sf_dyn(jf_uwd)%zsgn = -1._wp   
     297      sf_dyn(jf_vwd)%cltype = 'V'   ;   sf_dyn(jf_vwd)%zsgn = -1._wp   
     298      ! 
     299      IF( ln_trabbl ) THEN 
     300         sf_dyn(jf_ubl)%cltype = 'U'   ;   sf_dyn(jf_ubl)%zsgn =  1._wp   
     301         sf_dyn(jf_vbl)%cltype = 'V'   ;   sf_dyn(jf_vbl)%zsgn =  1._wp   
     302      END IF 
    285303      ! 
    286304      ! Open file for each variable to get his number of dimension 
     
    319337           iom_varid( numrtr, 'sshn', ldstop = .FALSE. ) > 0 ) THEN 
    320338           IF(lwp) WRITE(numout,*) ' ssh(:,:,Kmm) forcing fields read in the restart file for initialisation' 
    321            CALL iom_get( numrtr, jpdom_autoglo, 'sshn', ssh(:,:,Kmm)   ) 
    322            CALL iom_get( numrtr, jpdom_autoglo, 'sshb', ssh(:,:,Kbb)   ) 
     339           CALL iom_get( numrtr, jpdom_auto, 'sshn', ssh(:,:,Kmm)   ) 
     340           CALL iom_get( numrtr, jpdom_auto, 'sshb', ssh(:,:,Kbb)   ) 
    323341        ELSE 
    324342           IF(lwp) WRITE(numout,*) ' ssh(:,:,Kmm) forcing fields read in the restart file for initialisation' 
    325343           CALL iom_open( 'restart', inum ) 
    326            CALL iom_get( inum, jpdom_autoglo, 'sshn', ssh(:,:,Kmm)   ) 
    327            CALL iom_get( inum, jpdom_autoglo, 'sshb', ssh(:,:,Kbb)   ) 
     344           CALL iom_get( inum, jpdom_auto, 'sshn', ssh(:,:,Kmm)   ) 
     345           CALL iom_get( inum, jpdom_auto, 'sshb', ssh(:,:,Kbb)   ) 
    328346           CALL iom_close( inum )                                        ! close file 
    329347        ENDIF 
    330348        ! 
     349#if defined key_qco 
     350        CALL dom_qco_r3c( ssh(:,:,Kbb), r3t(:,:,Kbb), r3u(:,:,Kbb), r3v(:,:,Kbb) ) 
     351        CALL dom_qco_r3c( ssh(:,:,Kmm), r3t(:,:,Kmm), r3u(:,:,Kmm), r3v(:,:,Kmm) ) 
     352#else 
    331353        DO jk = 1, jpkm1 
    332            e3t(:,:,jk,Kmm) = e3t_0(:,:,jk) * ( 1._wp + ssh(:,:,Kmm) * tmask(:,:,1) / ( ht_0(:,:) + 1.0 - tmask(:,:,1) ) ) 
     354           e3t(:,:,jk,Kmm) = e3t_0(:,:,jk) * ( 1._wp + ssh(:,:,Kmm) * r1_ht_0(:,:) * tmask(:,:,jk) ) 
    333355        ENDDO 
    334356        e3t(:,:,jpk,Kaa) = e3t_0(:,:,jpk) 
     
    342364        ! ------------------------------------ 
    343365        CALL dom_vvl_interpol( e3t(:,:,:,Kmm), e3w(:,:,:,Kmm), 'W' ) 
    344    
     366!!gm this should be computed from ssh(Kbb)   
    345367        e3t(:,:,:,Kbb)  = e3t(:,:,:,Kmm) 
    346368        e3u(:,:,:,Kbb)  = e3u(:,:,:,Kmm) 
     
    352374        gdepw(:,:,1,Kmm) = 0.0_wp 
    353375 
    354         DO_3D_11_11( 2, jpk ) 
     376        DO_3D( 1, 1, 1, 1, 2, jpk ) 
    355377          !    zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))   ! 0 everywhere 
    356378          !    tmask = wmask, ie everywhere expect at jk = mikt 
     
    367389        ! 
    368390      ENDIF 
     391#endif 
    369392      ! 
    370393      IF( ln_dynrnf .AND. ln_dynrnf_depth ) THEN       ! read depht over which runoffs are distributed 
     
    372395         IF(lwp) WRITE(numout,*) ' read in the file depht over which runoffs are distributed' 
    373396         CALL iom_open ( "runoffs", inum )                           ! open file 
    374          CALL iom_get  ( inum, jpdom_data, 'rodepth', h_rnf )   ! read the river mouth array 
     397         CALL iom_get  ( inum, jpdom_global, 'rodepth', h_rnf )   ! read the river mouth array 
    375398         CALL iom_close( inum )                                        ! close file 
    376399         ! 
    377400         nk_rnf(:,:) = 0                               ! set the number of level over which river runoffs are applied 
    378          DO_2D_11_11 
     401         DO_2D( 1, 1, 1, 1 ) 
    379402            IF( h_rnf(ji,jj) > 0._wp ) THEN 
    380403               jk = 2 
     
    389412            ENDIF 
    390413         END_2D 
    391          DO_2D_11_11 
     414         DO_2D( 1, 1, 1, 1 )                           ! set the associated depth 
    392415            h_rnf(ji,jj) = 0._wp 
    393416            DO jk = 1, nk_rnf(ji,jj) 
     
    413436   END SUBROUTINE dta_dyn_init 
    414437 
     438    
    415439   SUBROUTINE dta_dyn_sed( kt, Kmm ) 
    416440      !!---------------------------------------------------------------------- 
     
    434458      ! 
    435459      IF( kt == nit000 ) THEN    ;    nprevrec = 0 
    436       ELSE                       ;    nprevrec = sf_dyn(jf_tem)%nrec_a(2) 
     460      ELSE                       ;    nprevrec = sf_dyn(jf_tem)%nrec(2,sf_dyn(jf_tem)%naa) 
    437461      ENDIF 
    438462      CALL fld_read( kt, 1, sf_dyn )      !=  read data at kt time step   ==! 
     
    529553   END SUBROUTINE dta_dyn_sed_init 
    530554 
     555    
    531556   SUBROUTINE dta_dyn_atf( kt, Kbb, Kmm, Kaa ) 
    532557     !!--------------------------------------------------------------------- 
     
    552577   END SUBROUTINE dta_dyn_atf 
    553578    
     579    
     580#if ! defined key_qco     
    554581   SUBROUTINE dta_dyn_sf_interp( kt, Kmm ) 
    555582      !!--------------------------------------------------------------------- 
     
    580607      gdepw(:,:,1,Kmm) = 0.0_wp 
    581608      ! 
    582       DO_3D_11_11( 2, jpk ) 
     609      DO_3D( 1, 1, 1, 1, 2, jpk ) 
    583610         zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
    584611         gdepw(ji,jj,jk,Kmm) = gdepw(ji,jj,jk-1,Kmm) + e3t(ji,jj,jk-1,Kmm) 
     
    588615      ! 
    589616   END SUBROUTINE dta_dyn_sf_interp 
     617#endif 
     618 
    590619 
    591620   SUBROUTINE dta_dyn_ssh( kt, phdivtr, psshb,  pemp, pssha, pe3ta ) 
     
    606635      !!          The boundary conditions are w=0 at the bottom (no flux) 
    607636      !! 
    608       !! ** action  :   ssh(:,:,Kaa) / e3t(:,:,:,Kaa) / ww 
     637      !! ** action  :   ssh(:,:,Kaa) / e3t(:,:,k,Kaa) / ww 
    609638      !! 
    610639      !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling. 
     
    630659      !                                                ! Sea surface  elevation time-stepping 
    631660      pssha(:,:) = ( psshb(:,:) - z2dt * ( r1_rho0 * pemp(:,:)  + zhdiv(:,:) ) ) * ssmask(:,:) 
    632       !                                                 !  
    633       !                                                 ! After acale factors at t-points ( z_star coordinate ) 
     661      ! 
     662      IF( PRESENT( pe3ta ) ) THEN                      ! After acale factors at t-points ( z_star coordinate ) 
    634663      DO jk = 1, jpkm1 
    635         pe3ta(:,:,jk) = e3t_0(:,:,jk) * ( 1._wp + pssha(:,:) * tmask(:,:,1) / ( ht_0(:,:) + 1.0 - tmask(:,:,1) ) ) 
     664            pe3ta(:,:,jk) = e3t_0(:,:,jk) * ( 1._wp + pssha(:,:) * r1_ht_0(:,:) * tmask(:,:,jk) ) 
    636665      END DO 
     666      ENDIF 
    637667      ! 
    638668   END SUBROUTINE dta_dyn_ssh 
     
    657687      !!---------------------------------------------------------------------- 
    658688      ! 
    659       DO_2D_11_11 
     689      DO_2D( 1, 1, 1, 1 )               ! update the depth over which runoffs are distributed 
    660690         h_rnf(ji,jj) = 0._wp 
    661691         DO jk = 1, nk_rnf(ji,jj)                           ! recalculates h_rnf to be the depth in metres 
     
    686716      !!--------------------------------------------------------------------- 
    687717      ! 
    688       IF( sf_dyn(jf_tem)%ln_tint ) THEN    ! Computes slopes (here avt is used as workspace)                        
     718      IF( sf_dyn(jf_tem)%ln_tint ) THEN    ! Computes slopes (here avt is used as workspace) 
     719         ! 
    689720         IF( kt == nit000 ) THEN 
    690721            IF(lwp) WRITE(numout,*) ' Compute new slopes at kt = ', kt 
    691             zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,1) * tmask(:,:,:)   ! temperature 
    692             zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,1) * tmask(:,:,:)   ! salinity  
    693             avt(:,:,:)        = sf_dyn(jf_avt)%fdta(:,:,:,1) * tmask(:,:,:)   ! vertical diffusive coef. 
     722            zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,sf_dyn(jf_tem)%nbb) * tmask(:,:,:)   ! temperature 
     723            zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,sf_dyn(jf_sal)%nbb) * tmask(:,:,:)   ! salinity  
     724            avt(:,:,:)        = sf_dyn(jf_avt)%fdta(:,:,:,sf_dyn(jf_avt)%nbb) * tmask(:,:,:)   ! vertical diffusive coef. 
    694725            CALL compute_slopes( kt, zts, zuslp, zvslp, zwslpi, zwslpj, Kbb, Kmm ) 
    695726            uslpdta (:,:,:,1) = zuslp (:,:,:)  
     
    698729            wslpjdta(:,:,:,1) = zwslpj(:,:,:)  
    699730            ! 
    700             zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,2) * tmask(:,:,:)   ! temperature 
    701             zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,2) * tmask(:,:,:)   ! salinity  
    702             avt(:,:,:)        = sf_dyn(jf_avt)%fdta(:,:,:,2) * tmask(:,:,:)   ! vertical diffusive coef. 
     731            zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,sf_dyn(jf_tem)%naa) * tmask(:,:,:)   ! temperature 
     732            zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,sf_dyn(jf_sal)%naa) * tmask(:,:,:)   ! salinity  
     733            avt(:,:,:)        = sf_dyn(jf_avt)%fdta(:,:,:,sf_dyn(jf_avt)%naa) * tmask(:,:,:)   ! vertical diffusive coef. 
    703734            CALL compute_slopes( kt, zts, zuslp, zvslp, zwslpi, zwslpj, Kbb, Kmm ) 
    704735            uslpdta (:,:,:,2) = zuslp (:,:,:)  
     
    709740           !  
    710741           iswap = 0 
    711            IF( sf_dyn(jf_tem)%nrec_a(2) - nprevrec /= 0 )  iswap = 1 
    712            IF( nsecdyn > sf_dyn(jf_tem)%nrec_b(2) .AND. iswap == 1 )  THEN    ! read/update the after data 
     742           IF( sf_dyn(jf_tem)%nrec(2,sf_dyn(jf_tem)%naa) - nprevrec /= 0 )  iswap = 1 
     743           IF( nsecdyn > sf_dyn(jf_tem)%nrec(2,sf_dyn(jf_tem)%nbb) .AND. iswap == 1 )  THEN    ! read/update the after data 
    713744              IF(lwp) WRITE(numout,*) ' Compute new slopes at kt = ', kt 
    714745              uslpdta (:,:,:,1) =  uslpdta (:,:,:,2)         ! swap the data 
     
    717748              wslpjdta(:,:,:,1) =  wslpjdta(:,:,:,2)  
    718749              ! 
    719               zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,2) * tmask(:,:,:)   ! temperature 
    720               zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,2) * tmask(:,:,:)   ! salinity  
    721               avt(:,:,:)        = sf_dyn(jf_avt)%fdta(:,:,:,2) * tmask(:,:,:)   ! vertical diffusive coef. 
     750              zts(:,:,:,jp_tem) = sf_dyn(jf_tem)%fdta(:,:,:,sf_dyn(jf_tem)%naa) * tmask(:,:,:)   ! temperature 
     751              zts(:,:,:,jp_sal) = sf_dyn(jf_sal)%fdta(:,:,:,sf_dyn(jf_sal)%naa) * tmask(:,:,:)   ! salinity  
     752              avt(:,:,:)        = sf_dyn(jf_avt)%fdta(:,:,:,sf_dyn(jf_avt)%naa) * tmask(:,:,:)   ! vertical diffusive coef. 
    722753              CALL compute_slopes( kt, zts, zuslp, zvslp, zwslpi, zwslpj, Kbb, Kmm ) 
    723754              ! 
     
    731762      ! 
    732763      IF( sf_dyn(jf_tem)%ln_tint )  THEN 
    733          ztinta =  REAL( nsecdyn - sf_dyn(jf_tem)%nrec_b(2), wp )  & 
    734             &    / REAL( sf_dyn(jf_tem)%nrec_a(2) - sf_dyn(jf_tem)%nrec_b(2), wp ) 
     764         ztinta =  REAL( nsecdyn - sf_dyn(jf_tem)%nrec(2,sf_dyn(jf_tem)%nbb), wp )  & 
     765            &    / REAL( sf_dyn(jf_tem)%nrec(2,sf_dyn(jf_tem)%naa) - sf_dyn(jf_tem)%nrec(2,sf_dyn(jf_tem)%nbb), wp ) 
    735766         ztintb =  1. - ztinta 
    736767         IF( l_ldfslp .AND. .NOT.lk_c1d ) THEN    ! Computes slopes (here avt is used as workspace) 
  • NEMO/branches/2020/dev_12905_xios_restart/src/OFF/nemogcm.F90

    r13000 r13727  
    2828   USE usrdef_nam     ! user defined configuration 
    2929   USE eosbn2         ! equation of state            (eos bn2 routine) 
    30    USE bdy_oce,  ONLY : ln_bdy 
    31    USE bdyini         ! open boundary cond. setting       (bdy_init 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) 
    3234   !              ! ocean physics 
    3335   USE ldftra         ! lateral diffusivity setting    (ldf_tra_init routine) 
     
    3840   USE sbcmod         ! surface boundary condition     (sbc_init     routine) 
    3941   USE phycst         ! physical constant                   (par_cst routine) 
     42   USE zdfphy         ! vertical physics manager       (zdf_phy_init routine) 
    4043   USE dtadyn         ! Lecture and Interpolation of the dynamical fields 
    4144   USE trcini         ! Initilization of the passive tracers 
     
    4750   USE trcnam         ! passive tracer : namelist 
    4851   USE trcrst         ! passive tracer restart 
    49    USE diaptr         ! Need to initialise this as some variables are used in if statements later 
    5052   USE sbc_oce , ONLY : ln_rnf 
    5153   USE sbcrnf         ! surface boundary condition : runoffs 
     
    6163   USE timing         ! Timing 
    6264   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    63    USE lbcnfd  , ONLY : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges 
     65   USE lbcnfd  , ONLY : isendto, nsndto   ! Setup of north fold exchanges 
    6466   USE step, ONLY : Nbb, Nnn, Naa, Nrhs   ! time level indices 
     67   USE halo_mng 
    6568 
    6669   IMPLICIT NONE 
     
    7073 
    7174   CHARACTER (len=64) ::   cform_aaa="( /, 'AAAAAAAA', / ) "   ! flag for output listing 
     75#if defined key_mpp_mpi 
     76   ! need MPI_Wtime 
     77   INCLUDE 'mpif.h' 
     78#endif 
    7279 
    7380   !!---------------------------------------------------------------------- 
     
    9299      !!              Madec, 2008, internal report, IPSL. 
    93100      !!---------------------------------------------------------------------- 
    94       INTEGER :: istp, indic       ! time step index 
     101      INTEGER :: istp       ! time step index 
     102      REAL(wp)::   zstptiming   ! elapsed time for 1 time step 
    95103      !!---------------------------------------------------------------------- 
    96104 
     
    111119      !  
    112120      DO WHILE ( istp <= nitend .AND. nstop == 0 )    !==  OFF time-stepping  ==! 
     121 
     122         IF( ln_timing ) THEN 
     123            zstptiming = MPI_Wtime() 
     124            IF ( istp == ( nit000 + 1 ) ) elapsed_time = zstptiming 
     125            IF ( istp ==         nitend ) elapsed_time = zstptiming - elapsed_time 
     126         ENDIF 
    113127         ! 
    114128      IF((istp == nitrst) .AND. lwxios) THEN 
     
    125139                                CALL dta_dyn    ( istp, Nbb, Nnn, Naa )       ! Interpolation of the dynamical fields 
    126140#endif 
     141#if ! defined key_sed_off 
     142         IF( .NOT.ln_linssh ) THEN 
     143                                CALL dta_dyn_atf( istp, Nbb, Nnn, Naa )       ! time filter of sea  surface height and vertical scale factors 
     144# if defined key_qco 
     145                                CALL dom_qco_r3c( ssh(:,:,Kmm), r3t_f, r3u_f, r3v_f ) 
     146# endif 
     147         ENDIF 
    127148                                CALL trc_stp    ( istp, Nbb, Nnn, Nrhs, Naa ) ! time-stepping 
    128 #if ! defined key_sed_off 
    129          IF( .NOT.ln_linssh )   CALL dta_dyn_atf( istp, Nbb, Nnn, Naa )       ! time filter of sea  surface height and vertical scale factors 
     149# if defined key_qco 
     150                                !r3t(:,:,Kmm) = r3t_f(:,:)                     ! update ssh to h0 ratio 
     151                                !r3u(:,:,Kmm) = r3u_f(:,:) 
     152                                !r3v(:,:,Kmm) = r3v_f(:,:) 
     153# endif 
    130154#endif 
    131155         ! Swap time levels 
     
    135159         Naa = Nrhs 
    136160         ! 
     161#if ! defined key_qco 
    137162#if ! defined key_sed_off 
    138163         IF( .NOT.ln_linssh )   CALL dta_dyn_sf_interp( istp, Nnn )  ! calculate now grid parameters 
    139164#endif 
    140                                 CALL stp_ctl    ( istp, indic )  ! Time loop: control and print 
     165#endif          
     166         CALL stp_ctl    ( istp )             ! Time loop: control and print 
    141167         istp = istp + 1 
     168 
     169         IF( lwp .AND. ln_timing )   WRITE(numtime,*) 'timing step ', istp-1, ' : ', MPI_Wtime() - zstptiming 
     170 
    142171      END DO 
    143172      ! 
     
    153182      IF( nstop /= 0 .AND. lwp ) THEN                 ! error print 
    154183         WRITE(ctmp1,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found' 
    155          CALL ctl_stop( ctmp1 ) 
     184         WRITE(ctmp2,*) '           Look for "E R R O R" messages in all existing ocean_output* files' 
     185         CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 ) 
    156186      ENDIF 
    157187      ! 
     
    183213      INTEGER ::   ios, ilocal_comm   ! local integers 
    184214      !! 
    185       NAMELIST/namctl/ sn_cfctl, nn_print, nn_ictls, nn_ictle,              & 
    186          &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,             & 
    187          &             ln_timing, ln_diacfl 
     215      NAMELIST/namctl/ sn_cfctl, ln_timing, ln_diacfl,                                & 
     216         &             nn_isplt,  nn_jsplt,  nn_ictls, nn_ictle, nn_jctls, nn_jctle 
    188217      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    189218      !!---------------------------------------------------------------------- 
    190219      ! 
    191220      cxios_context = 'nemo' 
     221      nn_hls = 1 
    192222      ! 
    193223      !                             !-------------------------------------------------! 
     
    235265      ! 
    236266      ! finalize the definition of namctl variables 
    237       IF( sn_cfctl%l_allon ) THEN 
    238          ! Turn on all options. 
    239          CALL nemo_set_cfctl( sn_cfctl, .TRUE., .TRUE. ) 
    240          ! Ensure all processors are active 
    241          sn_cfctl%procmin = 0 ; sn_cfctl%procmax = 1000000 ; sn_cfctl%procincr = 1 
    242       ELSEIF( sn_cfctl%l_config ) THEN 
    243          ! Activate finer control of report outputs 
    244          ! optionally switch off output from selected areas (note this only 
    245          ! applies to output which does not involve global communications) 
    246          IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax  ) .OR. & 
    247            & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) )    & 
    248            &   CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. ) 
    249       ELSE 
    250          ! turn off all options. 
    251          CALL nemo_set_cfctl( sn_cfctl, .FALSE., .TRUE. ) 
    252       ENDIF 
     267      IF( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax .OR. MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 )   & 
     268         &   CALL nemo_set_cfctl( sn_cfctl, .FALSE. ) 
    253269      ! 
    254270      lwp = (narea == 1) .OR. sn_cfctl%l_oceout    ! control of all listing output print 
     
    296312      ! 
    297313      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
    298          CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     314         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    299315      ELSE                                ! user-defined namelist 
    300          CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     316         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    301317      ENDIF 
    302318      ! 
     
    310326      CALL mpp_init 
    311327 
     328      CALL halo_mng_init() 
    312329      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
    313330      CALL nemo_alloc() 
     
    336353 
    337354                           CALL     sbc_init( Nbb, Nnn, Naa )    ! Forcings : surface module 
    338                            CALL     bdy_init    ! Open boundaries initialisation     
     355                           CALL     bdy_init    ! Open boundaries initialisation 
     356                            
     357                           CALL zdf_phy_init( Nnn )    ! Vertical physics 
    339358 
    340359      !                                      ! Tracer physics 
    341360                           CALL ldf_tra_init    ! Lateral ocean tracer physics 
    342                            CALL ldf_eiv_init    ! Eddy induced velocity param 
     361                           CALL ldf_eiv_init    ! Eddy induced velocity param. must be done after ldf_tra_init 
    343362                           CALL tra_ldf_init    ! lateral mixing 
    344363      IF( l_ldfslp     )   CALL ldf_slp_init    ! slope of lateral mixing 
     
    354373                           CALL dta_dyn_init( Nbb, Nnn, Naa )        ! Initialization for the dynamics 
    355374#endif 
    356  
    357375                           CALL     trc_init( Nbb, Nnn, Naa )        ! Passive tracers initialization 
    358                            CALL dia_ptr_init   ! Poleward TRansports initialization 
    359376                            
    360377      IF(lwp) WRITE(numout,cform_aaa)           ! Flag AAAAAAA 
     
    379396         WRITE(numout,*) '~~~~~~~~' 
    380397         WRITE(numout,*) '   Namelist namctl' 
    381          WRITE(numout,*) '                              sn_cfctl%l_glochk  = ', sn_cfctl%l_glochk 
    382          WRITE(numout,*) '                              sn_cfctl%l_allon   = ', sn_cfctl%l_allon 
    383          WRITE(numout,*) '       finer control over o/p sn_cfctl%l_config  = ', sn_cfctl%l_config 
    384398         WRITE(numout,*) '                              sn_cfctl%l_runstat = ', sn_cfctl%l_runstat 
    385399         WRITE(numout,*) '                              sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat 
     
    393407         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr  
    394408         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr  
    395          WRITE(numout,*) '      level of print                  nn_print   = ', nn_print 
    396          WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls 
    397          WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle 
    398          WRITE(numout,*) '      Start j indice for SUM control  nn_jctls   = ', nn_jctls 
    399          WRITE(numout,*) '      End j indice for SUM control    nn_jctle   = ', nn_jctle 
    400          WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    401          WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    402409         WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing 
    403410         WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl 
    404411      ENDIF 
    405       ! 
    406       nprint    = nn_print          ! convert DOCTOR namelist names into OLD names 
    407       nictls    = nn_ictls 
    408       nictle    = nn_ictle 
    409       njctls    = nn_jctls 
    410       njctle    = nn_jctle 
    411       isplt     = nn_isplt 
    412       jsplt     = nn_jsplt 
    413  
     412 
     413      IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
    414414      IF(lwp) THEN                  ! control print 
    415415         WRITE(numout,*) 
     
    422422         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr     = ', ln_use_jattr 
    423423      ENDIF 
    424       IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
    425       ! 
    426       !                             ! Parameter control 
    427       ! 
    428       IF( sn_cfctl%l_prtctl .OR. sn_cfctl%l_prttrc ) THEN              ! sub-domain area indices for the control prints 
    429          IF( lk_mpp .AND. jpnij > 1 ) THEN 
    430             isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real split domain 
    431          ELSE 
    432             IF( isplt == 1 .AND. jsplt == 1  ) THEN 
    433                CALL ctl_warn( ' - isplt & jsplt are equal to 1',   & 
    434                   &           ' - the print control will be done over the whole domain' ) 
    435             ENDIF 
    436             ijsplt = isplt * jsplt            ! total number of processors ijsplt 
    437          ENDIF 
    438          IF(lwp) WRITE(numout,*)'          - The total number of processors over which the' 
    439          IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt 
    440          ! 
    441          !                              ! indices used for the SUM control 
    442          IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area 
    443             lsp_area = .FALSE. 
    444          ELSE                                             ! print control done over a specific  area 
    445             lsp_area = .TRUE. 
    446             IF( nictls < 1 .OR. nictls > jpiglo )   THEN 
    447                CALL ctl_warn( '          - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) 
    448                nictls = 1 
    449             ENDIF 
    450             IF( nictle < 1 .OR. nictle > jpiglo )   THEN 
    451                CALL ctl_warn( '          - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) 
    452                nictle = jpiglo 
    453             ENDIF 
    454             IF( njctls < 1 .OR. njctls > jpjglo )   THEN 
    455                CALL ctl_warn( '          - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) 
    456                njctls = 1 
    457             ENDIF 
    458             IF( njctle < 1 .OR. njctle > jpjglo )   THEN 
    459                CALL ctl_warn( '          - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) 
    460                njctle = jpjglo 
    461             ENDIF 
    462          ENDIF 
    463       ENDIF 
    464424      ! 
    465425      IF( 1._wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.',  & 
     
    517477   END SUBROUTINE nemo_alloc 
    518478 
    519    SUBROUTINE nemo_set_cfctl(sn_cfctl, setto, for_all ) 
     479   SUBROUTINE nemo_set_cfctl(sn_cfctl, setto ) 
    520480      !!---------------------------------------------------------------------- 
    521481      !!                     ***  ROUTINE nemo_set_cfctl  *** 
    522482      !! 
    523483      !! ** Purpose :   Set elements of the output control structure to setto. 
    524       !!                for_all should be .false. unless all areas are to be 
    525       !!                treated identically. 
    526       !! 
     484     !! 
    527485      !! ** Method  :   Note this routine can be used to switch on/off some 
    528       !!                types of output for selected areas but any output types 
    529       !!                that involve global communications (e.g. mpp_max, glob_sum) 
    530       !!                should be protected from selective switching by the 
    531       !!                for_all argument 
    532       !!---------------------------------------------------------------------- 
    533       LOGICAL :: setto, for_all 
    534       TYPE(sn_ctl) :: sn_cfctl 
    535       !!---------------------------------------------------------------------- 
    536       IF( for_all ) THEN 
    537          sn_cfctl%l_runstat = setto 
    538          sn_cfctl%l_trcstat = setto 
    539       ENDIF 
     486      !!                types of output for selected areas. 
     487      !!---------------------------------------------------------------------- 
     488      TYPE(sn_ctl), INTENT(inout) :: sn_cfctl 
     489      LOGICAL     , INTENT(in   ) :: setto 
     490      !!---------------------------------------------------------------------- 
     491      sn_cfctl%l_runstat = setto 
     492      sn_cfctl%l_trcstat = setto 
    540493      sn_cfctl%l_oceout  = setto 
    541494      sn_cfctl%l_layout  = setto 
     
    567520 
    568521 
    569    SUBROUTINE stp_ctl( kt, kindic ) 
     522   SUBROUTINE stp_ctl( kt ) 
    570523      !!---------------------------------------------------------------------- 
    571524      !!                    ***  ROUTINE stp_ctl  *** 
     
    578531      !!---------------------------------------------------------------------- 
    579532      INTEGER, INTENT(in   ) ::   kt      ! ocean time-step index 
    580       INTEGER, INTENT(inout) ::   kindic  ! indicator of solver convergence 
    581533      !!---------------------------------------------------------------------- 
    582534      ! 
Note: See TracChangeset for help on using the changeset viewer.