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 13540 for NEMO/branches/2020/r12377_ticket2386/src/OFF/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2020-09-29T12:41:06+02:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2386: update to latest trunk

Location:
NEMO/branches/2020/r12377_ticket2386
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/r12377_ticket2386

    • 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@13507        sette 
  • NEMO/branches/2020/r12377_ticket2386/src/OFF/nemogcm.F90

    r12377 r13540  
    2828   USE usrdef_nam     ! user defined configuration 
    2929   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) 
    3034   !              ! ocean physics 
    3135   USE ldftra         ! lateral diffusivity setting    (ldf_tra_init routine) 
     
    5963   USE timing         ! Timing 
    6064   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    61    USE lbcnfd  , ONLY : isendto, nsndto, nfsloop, nfeloop   ! Setup of north fold exchanges 
     65   USE lbcnfd  , ONLY : isendto, nsndto   ! Setup of north fold exchanges 
    6266   USE step, ONLY : Nbb, Nnn, Naa, Nrhs   ! time level indices 
     67   USE halo_mng 
    6368 
    6469   IMPLICIT NONE 
     
    9095      !!              Madec, 2008, internal report, IPSL. 
    9196      !!---------------------------------------------------------------------- 
    92       INTEGER :: istp, indic       ! time step index 
     97      INTEGER :: istp       ! time step index 
    9398      !!---------------------------------------------------------------------- 
    9499 
     
    117122                                CALL dta_dyn    ( istp, Nbb, Nnn, Naa )       ! Interpolation of the dynamical fields 
    118123#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 
    119131                                CALL trc_stp    ( istp, Nbb, Nnn, Nrhs, Naa ) ! time-stepping 
    120 #if ! defined key_sed_off 
    121          IF( .NOT.ln_linssh )   CALL dta_dyn_atf( istp, Nbb, Nnn, Naa )       ! time filter of sea  surface height and vertical scale factors 
     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 
    122137#endif 
    123138         ! Swap time levels 
     
    127142         Naa = Nrhs 
    128143         ! 
     144#if ! defined key_qco 
    129145#if ! defined key_sed_off 
    130146         IF( .NOT.ln_linssh )   CALL dta_dyn_sf_interp( istp, Nnn )  ! calculate now grid parameters 
    131147#endif 
    132                                 CALL stp_ctl    ( istp, indic )  ! Time loop: control and print 
     148#endif          
     149                                CALL stp_ctl    ( istp )             ! Time loop: control and print 
    133150         istp = istp + 1 
    134151      END DO 
     
    145162      IF( nstop /= 0 .AND. lwp ) THEN                 ! error print 
    146163         WRITE(ctmp1,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found' 
    147          CALL ctl_stop( ctmp1 ) 
     164         WRITE(ctmp2,*) '           Look for "E R R O R" messages in all existing ocean_output* files' 
     165         CALL ctl_stop( ' ', ctmp1, ' ', ctmp2 ) 
    148166      ENDIF 
    149167      ! 
     
    175193      INTEGER ::   ios, ilocal_comm   ! local integers 
    176194      !! 
    177       NAMELIST/namctl/ sn_cfctl, nn_print, nn_ictls, nn_ictle,              & 
    178          &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,             & 
    179          &             ln_timing, ln_diacfl 
     195      NAMELIST/namctl/ sn_cfctl, ln_timing, ln_diacfl,                                & 
     196         &             nn_isplt,  nn_jsplt,  nn_ictls, nn_ictle, nn_jctls, nn_jctle 
    180197      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    181198      !!---------------------------------------------------------------------- 
    182199      ! 
    183200      cxios_context = 'nemo' 
     201      nn_hls = 1 
    184202      ! 
    185203      !                             !-------------------------------------------------! 
     
    209227      IF( lwm )   CALL ctl_opn(     numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
    210228      ! open /dev/null file to be able to supress output write easily 
     229      IF( Agrif_Root() ) THEN 
    211230                  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 
    212236      ! 
    213237      !                             !--------------------! 
     
    221245      ! 
    222246      ! finalize the definition of namctl variables 
    223       IF( sn_cfctl%l_allon ) THEN 
    224          ! Turn on all options. 
    225          CALL nemo_set_cfctl( sn_cfctl, .TRUE., .TRUE. ) 
    226          ! Ensure all processors are active 
    227          sn_cfctl%procmin = 0 ; sn_cfctl%procmax = 1000000 ; sn_cfctl%procincr = 1 
    228       ELSEIF( sn_cfctl%l_config ) THEN 
    229          ! Activate finer control of report outputs 
    230          ! optionally switch off output from selected areas (note this only 
    231          ! applies to output which does not involve global communications) 
    232          IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax  ) .OR. & 
    233            & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) )    & 
    234            &   CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. ) 
    235       ELSE 
    236          ! turn off all options. 
    237          CALL nemo_set_cfctl( sn_cfctl, .FALSE., .TRUE. ) 
    238       ENDIF 
     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. ) 
    239249      ! 
    240250      lwp = (narea == 1) .OR. sn_cfctl%l_oceout    ! control of all listing output print 
     
    282292      ! 
    283293      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
    284          CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     294         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    285295      ELSE                                ! user-defined namelist 
    286          CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     296         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    287297      ENDIF 
    288298      ! 
     
    296306      CALL mpp_init 
    297307 
     308      CALL halo_mng_init() 
    298309      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
    299310      CALL nemo_alloc() 
     
    301312      ! Initialise time level indices 
    302313      Nbb = 1; Nnn = 2; Naa = 3; Nrhs = Naa 
    303     
    304314 
    305315      !                             !-------------------------------! 
     
    323333 
    324334                           CALL     sbc_init( Nbb, Nnn, Naa )    ! Forcings : surface module 
     335                           CALL     bdy_init    ! Open boundaries initialisation     
    325336 
    326337      !                                      ! Tracer physics 
     
    365376         WRITE(numout,*) '~~~~~~~~' 
    366377         WRITE(numout,*) '   Namelist namctl' 
    367          WRITE(numout,*) '                              sn_cfctl%l_glochk  = ', sn_cfctl%l_glochk 
    368          WRITE(numout,*) '                              sn_cfctl%l_allon   = ', sn_cfctl%l_allon 
    369          WRITE(numout,*) '       finer control over o/p sn_cfctl%l_config  = ', sn_cfctl%l_config 
    370378         WRITE(numout,*) '                              sn_cfctl%l_runstat = ', sn_cfctl%l_runstat 
    371379         WRITE(numout,*) '                              sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat 
     
    379387         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr  
    380388         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr  
    381          WRITE(numout,*) '      level of print                  nn_print   = ', nn_print 
    382          WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls 
    383          WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle 
    384          WRITE(numout,*) '      Start j indice for SUM control  nn_jctls   = ', nn_jctls 
    385          WRITE(numout,*) '      End j indice for SUM control    nn_jctle   = ', nn_jctle 
    386          WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    387          WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    388389         WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing 
    389390         WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl 
    390391      ENDIF 
    391       ! 
    392       nprint    = nn_print          ! convert DOCTOR namelist names into OLD names 
    393       nictls    = nn_ictls 
    394       nictle    = nn_ictle 
    395       njctls    = nn_jctls 
    396       njctle    = nn_jctle 
    397       isplt     = nn_isplt 
    398       jsplt     = nn_jsplt 
    399  
     392 
     393      IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
    400394      IF(lwp) THEN                  ! control print 
    401395         WRITE(numout,*) 
     
    408402         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr     = ', ln_use_jattr 
    409403      ENDIF 
    410       IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
    411       ! 
    412       !                             ! Parameter control 
    413       ! 
    414       IF( sn_cfctl%l_prtctl .OR. sn_cfctl%l_prttrc ) THEN              ! sub-domain area indices for the control prints 
    415          IF( lk_mpp .AND. jpnij > 1 ) THEN 
    416             isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real split domain 
    417          ELSE 
    418             IF( isplt == 1 .AND. jsplt == 1  ) THEN 
    419                CALL ctl_warn( ' - isplt & jsplt are equal to 1',   & 
    420                   &           ' - the print control will be done over the whole domain' ) 
    421             ENDIF 
    422             ijsplt = isplt * jsplt            ! total number of processors ijsplt 
    423          ENDIF 
    424          IF(lwp) WRITE(numout,*)'          - The total number of processors over which the' 
    425          IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt 
    426          ! 
    427          !                              ! indices used for the SUM control 
    428          IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area 
    429             lsp_area = .FALSE. 
    430          ELSE                                             ! print control done over a specific  area 
    431             lsp_area = .TRUE. 
    432             IF( nictls < 1 .OR. nictls > jpiglo )   THEN 
    433                CALL ctl_warn( '          - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) 
    434                nictls = 1 
    435             ENDIF 
    436             IF( nictle < 1 .OR. nictle > jpiglo )   THEN 
    437                CALL ctl_warn( '          - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) 
    438                nictle = jpiglo 
    439             ENDIF 
    440             IF( njctls < 1 .OR. njctls > jpjglo )   THEN 
    441                CALL ctl_warn( '          - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) 
    442                njctls = 1 
    443             ENDIF 
    444             IF( njctle < 1 .OR. njctle > jpjglo )   THEN 
    445                CALL ctl_warn( '          - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) 
    446                njctle = jpjglo 
    447             ENDIF 
    448          ENDIF 
    449       ENDIF 
    450404      ! 
    451405      IF( 1._wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.',  & 
     
    486440      USE zdf_oce,   ONLY : zdf_oce_alloc 
    487441      USE trc_oce,   ONLY : trc_oce_alloc 
     442      USE bdy_oce,   ONLY : bdy_oce_alloc 
    488443      ! 
    489444      INTEGER :: ierr 
     
    495450      ierr = ierr + zdf_oce_alloc()          ! ocean vertical physics 
    496451      ierr = ierr + trc_oce_alloc()          ! shared TRC / TRA arrays 
     452      ierr = ierr + bdy_oce_alloc()    ! bdy masks (incl. initialization)       
    497453      ! 
    498454      CALL mpp_sum( 'nemogcm', ierr ) 
     
    501457   END SUBROUTINE nemo_alloc 
    502458 
    503    SUBROUTINE nemo_set_cfctl(sn_cfctl, setto, for_all ) 
     459   SUBROUTINE nemo_set_cfctl(sn_cfctl, setto ) 
    504460      !!---------------------------------------------------------------------- 
    505461      !!                     ***  ROUTINE nemo_set_cfctl  *** 
    506462      !! 
    507463      !! ** Purpose :   Set elements of the output control structure to setto. 
    508       !!                for_all should be .false. unless all areas are to be 
    509       !!                treated identically. 
    510       !! 
     464     !! 
    511465      !! ** Method  :   Note this routine can be used to switch on/off some 
    512       !!                types of output for selected areas but any output types 
    513       !!                that involve global communications (e.g. mpp_max, glob_sum) 
    514       !!                should be protected from selective switching by the 
    515       !!                for_all argument 
    516       !!---------------------------------------------------------------------- 
    517       LOGICAL :: setto, for_all 
    518       TYPE(sn_ctl) :: sn_cfctl 
    519       !!---------------------------------------------------------------------- 
    520       IF( for_all ) THEN 
    521          sn_cfctl%l_runstat = setto 
    522          sn_cfctl%l_trcstat = setto 
    523       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 
    524473      sn_cfctl%l_oceout  = setto 
    525474      sn_cfctl%l_layout  = setto 
     
    551500 
    552501 
    553    SUBROUTINE stp_ctl( kt, kindic ) 
     502   SUBROUTINE stp_ctl( kt ) 
    554503      !!---------------------------------------------------------------------- 
    555504      !!                    ***  ROUTINE stp_ctl  *** 
     
    562511      !!---------------------------------------------------------------------- 
    563512      INTEGER, INTENT(in   ) ::   kt      ! ocean time-step index 
    564       INTEGER, INTENT(inout) ::   kindic  ! indicator of solver convergence 
    565513      !!---------------------------------------------------------------------- 
    566514      ! 
Note: See TracChangeset for help on using the changeset viewer.