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 13375 for branches – NEMO

Changeset 13375 for branches


Ignore:
Timestamp:
2020-08-03T18:26:21+02:00 (4 years ago)
Author:
jwhile
Message:

Updates for 1d running

Location:
branches/UKMO/dev_1d_bugfixes_BoB/NEMOGCM/NEMO/OPA_SRC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_1d_bugfixes_BoB/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90

    r10302 r13375  
    1010   !!---------------------------------------------------------------------- 
    1111   !!   'key_c1d'                                       1D Configuration 
    12    !!----------------------------------------------------------------------   
     12   !!---------------------------------------------------------------------- 
    1313   !!   stp_c1d        : NEMO system time-stepping in c1d case 
    1414   !!---------------------------------------------------------------------- 
    15    USE step_oce        ! time stepping definition modules  
     15   USE step_oce        ! time stepping definition modules 
    1616#if defined key_top 
    1717   USE trcstp          ! passive tracer time-stepping      (trc_stp routine) 
     
    2020   USE dynnxt_c1d      ! time-stepping                    (dyn_nxt routine) 
    2121   USE dyndmp          ! U & V momentum damping           (dyn_dmp routine) 
    22    USE restart         ! restart  
     22   USE restart         ! restart 
    2323 
    2424   IMPLICIT NONE 
     
    4040      !!---------------------------------------------------------------------- 
    4141      !!                     ***  ROUTINE stp_c1d  *** 
    42       !!                       
     42      !! 
    4343      !! ** Purpose :  - Time stepping of SBC including LIM (dynamic and thermodynamic eqs.) 
    4444      !!               - Time stepping of OPA (momentum and active tracer eqs.) 
    4545      !!               - Time stepping of TOP (passive tracer eqs.) 
    46       !!  
    47       !! ** Method  : -1- Update forcings and data   
    48       !!              -2- Update vertical ocean physics  
    49       !!              -3- Compute the t and s trends  
    50       !!              -4- Update t and s  
     46      !! 
     47      !! ** Method  : -1- Update forcings and data 
     48      !!              -2- Update vertical ocean physics 
     49      !!              -3- Compute the t and s trends 
     50      !!              -4- Update t and s 
    5151      !!              -5- Compute the momentum trends 
    5252      !!              -6- Update the horizontal velocity 
     
    7676                         CALL bn2( tsb, rab_b, rn2b ) ! before Brunt-Vaisala frequency 
    7777                         CALL bn2( tsn, rab_n, rn2  ) ! now    Brunt-Vaisala frequency 
    78       !  VERTICAL PHYSICS    
     78      !  VERTICAL PHYSICS 
    7979                         CALL zdf_bfr( kstp )         ! bottom friction 
    8080      !                                               ! Vertical eddy viscosity and diffusivity coefficients 
     
    9898      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   & 
    9999         &               CALL zdf_ddm( kstp )         ! double diffusive mixing 
    100           
     100 
    101101                         CALL zdf_mxl( kstp )         ! mixed layer depth 
    102102 
     
    125125                        tsa(:,:,:,:) = 0._wp       ! set tracer trends to zero 
    126126 
     127      IF( lk_asminc .AND. ln_asmiau .AND.  ln_trainc )   & 
     128                        CALL tra_asm_inc( kstp )   ! apply tracer assimilation increment 
    127129                        CALL tra_sbc( kstp )       ! surface boundary condition 
    128130      IF( ln_traqsr )   CALL tra_qsr( kstp )       ! penetrative solar radiation qsr 
     
    141143                        ua(:,:,:) = 0._wp          ! set dynamics trends to zero 
    142144                        va(:,:,:) = 0._wp 
     145 
     146      IF( ln_bkgwri )   CALL asm_bkg_wri( kstp )     ! output background fields 
    143147 
    144148      IF( ln_dyndmp )   CALL dyn_dmp    ( kstp )   ! internal damping trends- momentum 
  • branches/UKMO/dev_1d_bugfixes_BoB/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r11442 r13375  
    2929   !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
    3030   !!            3.4  ! 2011-11  (C. Harris) decomposition changes for running with CICE 
    31    !!                 ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening  
     31   !!                 ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening 
    3232   !!---------------------------------------------------------------------- 
    3333 
     
    5959   USE phycst          ! physical constant                  (par_cst routine) 
    6060   USE trdini          ! dyn/tra trends initialization     (trd_init routine) 
    61    USE asminc          ! assimilation increments      
     61   USE asminc          ! assimilation increments 
    6262   USE asmbkg          ! writing out state trajectory 
    6363   USE asmbgc          ! biogeochemical assimilation increments 
     
    6969   USE icbini          ! handle bergs, initialisation 
    7070   USE icbstp          ! handle bergs, calving, themodynamics and transport 
    71    USE sbccpl  
     71   USE sbccpl 
    7272   USE cpl_oasis3      ! OASIS3 coupling 
    7373   USE c1d             ! 1D configuration 
     
    8484   USE sbctide, ONLY: lk_tide 
    8585   USE crsini          ! initialise grid coarsening utility 
    86    USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges  
     86   USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 
    8787   USE sbc_oce, ONLY: lk_oasis 
    8888   USE stopack 
     
    132132#if defined key_agrif 
    133133      CALL Agrif_Declare_Var_dom   ! AGRIF: set the meshes for DOM 
    134       CALL Agrif_Declare_Var       !  "      "   "   "      "  DYN/TRA  
     134      CALL Agrif_Declare_Var       !  "      "   "   "      "  DYN/TRA 
    135135# if defined key_top 
    136136      CALL Agrif_Declare_Var_top   !  "      "   "   "      "  TOP 
     
    150150      !                            !-----------------------! 
    151151      istp = nit000 
     152 
     153      IF( lk_asminc ) THEN 
     154         IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 )    ! Output background fields 
     155         IF( ln_asmdin ) THEN                        ! Direct initialization 
     156            IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 )    ! Tracers 
     157            IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 )    ! Dynamics 
     158            IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 )    ! SSH 
     159            IF( lk_bgcinc ) CALL bgc_asm_inc( nit000 - 1 )    ! BGC 
     160         ENDIF 
     161      ENDIF 
     162 
    152163#if defined key_c1d 
    153          DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    154             CALL stp_c1d( istp ) 
    155             istp = istp + 1 
    156          END DO 
     164      DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
     165         CALL stp_c1d( istp ) 
     166         istp = istp + 1 
     167      END DO 
    157168#else 
    158           IF( lk_asminc ) THEN 
    159              IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 )    ! Output background fields 
    160              IF( ln_asmdin ) THEN                        ! Direct initialization 
    161                 IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 )    ! Tracers 
    162                 IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 )    ! Dynamics 
    163                 IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 )    ! SSH 
    164                 IF( lk_bgcinc ) CALL bgc_asm_inc( nit000 - 1 )    ! BGC 
    165              ENDIF 
    166           ENDIF 
    167169 
    168170#if defined key_agrif 
    169           CALL Agrif_Regrid() 
    170 #endif 
    171  
    172          DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
     171      CALL Agrif_Regrid() 
     172#endif 
     173 
     174      DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    173175#if defined key_agrif 
    174             CALL stp                         ! AGRIF: time stepping 
     176         CALL stp                         ! AGRIF: time stepping 
    175177#else 
    176             IF (lk_oasis) CALL sbc_cpl_snd( istp )  ! Coupling to atmos 
    177        CALL stp( istp ) 
     178         IF (lk_oasis) CALL sbc_cpl_snd( istp )  ! Coupling to atmos 
     179         CALL stp( istp ) 
    178180            ! We don't couple on the final timestep because 
    179181            ! our restart file has already been written 
     
    186188            !    sbc_cpl_snd call prior to the main DO loop 
    187189            ! This solution produces identical results 
    188             ! with fewer lines of code.  
    189 #endif 
    190             istp = istp + 1 
    191             IF( lk_mpp )   CALL mpp_max( nstop ) 
    192          END DO 
     190            ! with fewer lines of code. 
     191#endif 
     192         istp = istp + 1 
     193         IF( lk_mpp )   CALL mpp_max( nstop ) 
     194      END DO 
    193195#endif 
    194196 
     
    225227      IF( lk_oasis ) CALL cpl_finalize    ! end coupling and mpp communications with OASIS 
    226228#else 
    227       IF( lk_oasis ) THEN  
     229      IF( lk_oasis ) THEN 
    228230         CALL cpl_finalize              ! end coupling and mpp communications with OASIS 
    229231      ELSE 
     
    233235      ! 
    234236      ! Met Office addition: if failed, return non-zero exit code 
    235       IF( nstop /= 0 )  CALL exit( 9 )  
     237      IF( nstop /= 0 )  CALL exit( 9 ) 
    236238      ! 
    237239   END SUBROUTINE nemo_gcm 
     
    278280      REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist : Control prints & Benchmark 
    279281      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
    280 904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
     282904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. ) 
    281283 
    282284! Force values for AGRIF zoom (cf. agrif_user.F90) 
     
    357359#if defined key_nemocice_decomp 
    358360         jpi = ( nx_global+2-2*jpreci + (jpni-1) ) / jpni + 2*jpreci ! first  dim. 
    359          jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim.  
     361         jpj = ( ny_global+2-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj ! second dim. 
    360362#else 
    361363         jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim. 
    362364         jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim. 
    363365#endif 
    364       ENDIF          
     366      ENDIF 
    365367         jpk = jpkdta                                             ! third dim 
    366368#if defined key_agrif 
    367369         ! simple trick to use same vertical grid as parent 
    368          ! but different number of levels:  
     370         ! but different number of levels: 
    369371         ! Save maximum number of levels in jpkdta, then define all vertical grids 
    370372         ! with this number. 
     
    435437 
    436438                            CALL dyn_nept_init  ! simplified form of Neptune effect 
    437       !      
     439      ! 
    438440      IF( ln_crs        )   CALL     crs_init   ! Domain initialization of coarsened grid 
    439441      ! 
     
    477479                            CALL sto_par_init   ! Stochastic parametrization 
    478480      IF( ln_sto_eos     )  CALL sto_pts_init   ! RRandom T/S fluctuations 
    479       
     481 
    480482#if defined key_top 
    481483      !                                     ! Passive tracers 
     
    498500                            CALL    bias_init   ! Pressure correction bias 
    499501      IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler 
    500        
     502 
    501503      IF (nstop > 0) THEN 
    502504        CALL CTL_STOP('STOP','Critical errors in NEMO initialisation') 
     
    557559         WRITE(numout,*) '      left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 
    558560         WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 
    559          WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
     561         WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio 
    560562         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
    561563      ENDIF 
     
    639641      IF( numdct_salt     /= -1 )   CLOSE( numdct_salt     )   ! salt transports 
    640642#if defined key_top 
    641       IF( numstr          /= -1 )   CLOSE( numstr          )   ! tracer statistics  
     643      IF( numstr          /= -1 )   CLOSE( numstr          )   ! tracer statistics 
    642644#endif 
    643645      ! 
     
    661663      USE ldftra_oce, ONLY: ldftra_oce_alloc 
    662664      USE trc_oce   , ONLY: trc_oce_alloc 
    663 #if defined key_diadct  
    664       USE diadct    , ONLY: diadct_alloc  
    665 #endif  
     665#if defined key_diadct 
     666      USE diadct    , ONLY: diadct_alloc 
     667#endif 
    666668#if defined key_bdy 
    667669      USE bdy_oce   , ONLY: bdy_oce_alloc 
     
    681683      ierr = ierr + trc_oce_alloc   ()          ! shared TRC / TRA arrays 
    682684      ! 
    683 #if defined key_diadct  
    684       ierr = ierr + diadct_alloc    ()          !  
    685 #endif  
     685#if defined key_diadct 
     686      ierr = ierr + diadct_alloc    ()          ! 
     687#endif 
    686688#if defined key_bdy 
    687689      ierr = ierr + bdy_oce_alloc   ()          ! bdy masks (incl. initialization) 
     
    813815      !!====================================================================== 
    814816      !!                     ***  ROUTINE  nemo_northcomms  *** 
    815       !! nemo_northcomms    :  Setup for north fold exchanges with explicit  
     817      !! nemo_northcomms    :  Setup for north fold exchanges with explicit 
    816818      !!                       point-to-point messaging 
    817819      !!===================================================================== 
     
    821823      !!---------------------------------------------------------------------- 
    822824      !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) 
    823       !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC)  
     825      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC) 
    824826      !!---------------------------------------------------------------------- 
    825827 
     
    828830 
    829831      njmppmax = MAXVAL( njmppt ) 
    830      
     832 
    831833      !initializes the north-fold communication variables 
    832834      isendto(:) = 0 
     
    844846          !loop over the other north-fold processes to find the processes 
    845847          !managing the points belonging to the sxT-dxT range 
    846    
     848 
    847849          DO jn = 1, jpni 
    848850                !sxT is the first point (in the global domain) of the jn 
     
    887889   !!====================================================================== 
    888890END MODULE nemogcm 
    889  
    890  
Note: See TracChangeset for help on using the changeset viewer.