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 13899 for NEMO/branches/2020/tickets_icb_1900/src/SAS/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2020-11-27T17:26:33+01:00 (4 years ago)
Author:
mathiot
Message:

ticket #1900: update branch to trunk and add ICB test case

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

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/tickets_icb_1900

    • Property svn:externals
      •  

        old new  
        22^/utils/build/makenemo@HEAD   makenemo 
        33^/utils/build/mk@HEAD         mk 
        4 ^/utils/tools/@HEAD           tools 
         4^/utils/tools@HEAD            tools 
        55^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
         
        88 
        99# SETTE 
        10 ^/utils/CI/sette@12931        sette 
         10^/utils/CI/sette@13559        sette 
  • NEMO/branches/2020/tickets_icb_1900/src/SAS/nemogcm.F90

    r13365 r13899  
    22   !!====================================================================== 
    33   !!                       ***  MODULE nemogcm   *** 
    4    !! StandAlone Surface module : surface fluxes + sea-ice + iceberg floats 
     4   !! StandAlone Surface module : surface fluxes + sea-ice + iceberg floats + ABL 
    55   !!====================================================================== 
    66   !! History :  3.6  ! 2011-11  (S. Alderson, G. Madec) original code 
     
    3636   USE icb_oce        ! icebergs 
    3737   ! 
     38   USE prtctl         ! Print control 
    3839   USE in_out_manager ! I/O manager 
    3940   USE lib_mpp        ! distributed memory computing 
    4041   USE mppini         ! shared/distributed memory setting (mpp_init routine) 
    41    USE lbcnfd  , ONLY : isendto, nsndto, nfsloop, nfeloop  ! Setup of north fold exchanges 
     42   USE lbcnfd  , ONLY : isendto, nsndto ! Setup of north fold exchanges 
    4243   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 
    4344#if defined key_iomput 
     
    4748   USE agrif_ice_update ! ice update 
    4849#endif 
     50   USE halo_mng 
    4951 
    5052   IMPLICIT NONE 
     
    5759 
    5860#if defined key_mpp_mpi 
     61   ! need MPI_Wtime 
    5962   INCLUDE 'mpif.h' 
    6063#endif 
     
    8285      !!---------------------------------------------------------------------- 
    8386      INTEGER ::   istp   ! time step index 
     87      REAL(wp)::   zstptiming   ! elapsed time for 1 time step 
    8488      !!---------------------------------------------------------------------- 
    8589      ! 
     
    9296#if defined key_agrif 
    9397      Kbb_a = Nbb; Kmm_a = Nnn; Krhs_a = Nrhs   ! agrif_oce module copies of time level indices 
    94       CALL Agrif_Declare_Var       !  "      "   "   "      "  DYN/TRA  
     98      CALL Agrif_Declare_Var       !  "      "   "   "      "  DYN/TRA 
    9599# if defined key_top 
    96100      CALL Agrif_Declare_Var_top   !  "      "   "   "      "  TOP 
     
    106110      !                            !==   time stepping   ==! 
    107111      !                            !-----------------------! 
     112      ! 
     113      !                                               !== set the model time-step  ==! 
     114      ! 
    108115      istp = nit000 
    109116      ! 
     
    123130      END DO 
    124131      ! 
    125 #else 
     132# else 
    126133      ! 
    127134      IF( .NOT.ln_diurnal_only ) THEN                 !==  Standard time-stepping  ==! 
    128135         ! 
    129136         DO WHILE( istp <= nitend .AND. nstop == 0 ) 
    130 #if defined key_mpp_mpi 
     137 
    131138            ncom_stp = istp 
    132             IF ( istp == ( nit000 + 1 ) ) elapsed_time = MPI_Wtime() 
    133             IF ( istp ==         nitend ) elapsed_time = MPI_Wtime() - elapsed_time 
    134 #endif 
     139            IF( ln_timing ) THEN 
     140               zstptiming = MPI_Wtime() 
     141               IF ( istp == ( nit000 + 1 ) ) elapsed_time = zstptiming 
     142               IF ( istp ==         nitend ) elapsed_time = zstptiming - elapsed_time 
     143            ENDIF 
     144             
    135145            CALL stp        ( istp )  
    136146            istp = istp + 1 
     147 
     148            IF( lwp .AND. ln_timing )   WRITE(numtime,*) 'timing step ', istp-1, ' : ', MPI_Wtime() - zstptiming 
     149 
    137150         END DO 
    138151         ! 
     
    198211      INTEGER ::   ios, ilocal_comm   ! local integers 
    199212      !! 
    200       NAMELIST/namctl/ sn_cfctl, nn_print, nn_ictls, nn_ictle,              & 
    201          &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,             & 
    202          &             ln_timing, ln_diacfl 
     213      NAMELIST/namctl/ sn_cfctl, ln_timing, ln_diacfl,                                & 
     214         &             nn_isplt,  nn_jsplt,  nn_ictls, nn_ictle, nn_jctls, nn_jctle             
    203215      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
    204216      !!---------------------------------------------------------------------- 
     
    207219      ELSE                  ;   cxios_context = 'nemo' 
    208220      ENDIF 
     221      nn_hls = 1 
    209222      ! 
    210223      !                             !-------------------------------------------------! 
     
    304317         WRITE(numout,*) "       )  )       \) |`\ \)  '.   \      (   (   " 
    305318         WRITE(numout,*) "      (  (           \_/       '-._\      )   )  " 
    306          WRITE(numout,*) "       )  ) jgs                    `     (   (   " 
     319         WRITE(numout,*) "       )  ) jgs                     `    (   (   " 
    307320         WRITE(numout,*) "     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " 
    308321         WRITE(numout,*) 
     
    325338      ! 
    326339      IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file 
    327          CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     340         CALL domain_cfg ( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    328341      ELSE                              ! user-defined namelist 
    329          CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     342         CALL usr_def_nam( cn_cfg, nn_cfg, Ni0glo, Nj0glo, jpkglo, jperio ) 
    330343      ENDIF 
    331344      ! 
     
    337350      CALL mpp_init 
    338351 
     352      CALL halo_mng_init() 
    339353      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
    340354      CALL nemo_alloc() 
     
    353367      ! 
    354368      !                                      ! General initialization 
    355       IF( ln_timing    )   CALL timing_init     ! timing 
     369      IF( ln_timing    )   CALL timing_init ( 'timing_sas.output' ) 
    356370      IF( ln_timing    )   CALL timing_start( 'nemo_init') 
    357371 
     
    365379         &                 CALL prt_ctl_init        ! Print control 
    366380       
     381      IF( ln_rstart )      CALL rst_read_open 
    367382                           CALL day_init        ! model calendar (using both namelist and restart infos) 
    368       IF( ln_rstart )      CALL rst_read_open 
    369  
     383 
     384#if defined key_agrif 
     385      uu(:,:,:,:) = 0.0_wp   ;   vv(:,:,:,:) = 0.0_wp   ;   ts(:,:,:,:,:) = 0.0_wp   ! needed for interp done at initialization phase 
     386#endif  
    370387      !                                      ! external forcing  
    371388                           CALL sbc_init( Nbb, Nnn, Naa )  ! Forcings : surface module  
     
    416433         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr  
    417434         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr  
    418          WRITE(numout,*) '      level of print                  nn_print   = ', nn_print 
    419          WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls 
    420          WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle 
    421          WRITE(numout,*) '      Start j indice for SUM control  nn_jctls   = ', nn_jctls 
    422          WRITE(numout,*) '      End j indice for SUM control    nn_jctle   = ', nn_jctle 
    423          WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    424          WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    425435         WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing 
    426436         WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl 
    427437      ENDIF 
    428438      ! 
    429       nprint    = nn_print          ! convert DOCTOR namelist names into OLD names 
    430       nictls    = nn_ictls 
    431       nictle    = nn_ictle 
    432       njctls    = nn_jctls 
    433       njctle    = nn_jctle 
    434       isplt     = nn_isplt 
    435       jsplt     = nn_jsplt 
    436  
     439      IF( .NOT.ln_read_cfg )   ln_closea = .FALSE.   ! dealing possible only with a domcfg file 
    437440      IF(lwp) THEN                  ! control print 
    438441         WRITE(numout,*) 
     
    445448         WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr 
    446449      ENDIF 
    447       IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file 
    448       ! 
    449       !                             ! Parameter control 
    450       ! 
    451       IF( sn_cfctl%l_prtctl .OR. sn_cfctl%l_prttrc ) THEN              ! sub-domain area indices for the control prints 
    452          IF( lk_mpp .AND. jpnij > 1 ) THEN 
    453             isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real split domain 
    454          ELSE 
    455             IF( isplt == 1 .AND. jsplt == 1  ) THEN 
    456                CALL ctl_warn( ' - isplt & jsplt are equal to 1',   & 
    457                   &           ' - the print control will be done over the whole domain' ) 
    458             ENDIF 
    459             ijsplt = isplt * jsplt            ! total number of processors ijsplt 
    460          ENDIF 
    461          IF(lwp) WRITE(numout,*)'          - The total number of processors over which the' 
    462          IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt 
    463          ! 
    464          !                              ! indices used for the SUM control 
    465          IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area 
    466             lsp_area = .FALSE. 
    467          ELSE                                             ! print control done over a specific  area 
    468             lsp_area = .TRUE. 
    469             IF( nictls < 1 .OR. nictls > jpiglo )   THEN 
    470                CALL ctl_warn( '          - nictls must be 1<=nictls>=jpiglo, it is forced to 1' ) 
    471                nictls = 1 
    472             ENDIF 
    473             IF( nictle < 1 .OR. nictle > jpiglo )   THEN 
    474                CALL ctl_warn( '          - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' ) 
    475                nictle = jpiglo 
    476             ENDIF 
    477             IF( njctls < 1 .OR. njctls > jpjglo )   THEN 
    478                CALL ctl_warn( '          - njctls must be 1<=njctls>=jpjglo, it is forced to 1' ) 
    479                njctls = 1 
    480             ENDIF 
    481             IF( njctle < 1 .OR. njctle > jpjglo )   THEN 
    482                CALL ctl_warn( '          - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' ) 
    483                njctle = jpjglo 
    484             ENDIF 
    485          ENDIF 
    486       ENDIF 
    487450      ! 
    488451      IF( 1._wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.',  & 
     
    538501      ierr =        dia_wri_alloc() 
    539502      ierr = ierr + dom_oce_alloc()          ! ocean domain 
    540       ierr = ierr + oce_alloc    ()          ! (tsn...) needed for agrif and/or SI3 and bdy 
     503      ierr = ierr + oce_alloc    ()          ! (ts...) needed for agrif and/or SI3 and bdy 
    541504      ierr = ierr + bdy_oce_alloc()          ! bdy masks (incl. initialization) 
    542505      ! 
Note: See TracChangeset for help on using the changeset viewer.