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 5208 for branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2015-04-13T15:08:59+02:00 (9 years ago)
Author:
davestorkey
Message:

Merge in changes from trunk up to 5021.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO11_restart_functionality/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r4723 r5208  
    4242   !!---------------------------------------------------------------------- 
    4343   USE step_oce        ! module used in the ocean time stepping module 
    44    USE sbc_oce         ! surface boundary condition: ocean 
    4544   USE cla             ! cross land advection               (tra_cla routine) 
    4645   USE domcfg          ! domain configuration               (dom_cfg routine) 
     
    5150#endif 
    5251   USE tideini         ! tidal components initialization   (tide_ini routine) 
    53    USE bdyini          ! open boundary cond. initialization (bdy_init routine) 
    54    USE bdydta          ! open boundary cond. initialization (bdy_dta_init routine) 
    55    USE bdytides        ! open boundary cond. initialization (bdytide_init routine) 
     52   USE bdyini          ! open boundary cond. setting      (bdy_init routine) 
     53   USE bdydta          ! open boundary cond. setting  (bdy_dta_init routine) 
     54   USE bdytides        ! open boundary cond. setting  (bdytide_init routine) 
    5655   USE istate          ! initial state setting          (istate_init routine) 
    5756   USE ldfdyn          ! lateral viscosity setting      (ldfdyn_init routine) 
     
    5958   USE zdfini          ! vertical physics setting          (zdf_init routine) 
    6059   USE phycst          ! physical constant                  (par_cst routine) 
    61    USE trdmod          ! momentum/tracers trends       (trd_mod_init routine) 
     60   USE trdini          ! dyn/tra trends initialization     (trd_init routine) 
    6261   USE asminc          ! assimilation increments      
    6362   USE asmbkg          ! writing out state trajectory 
     
    6968   USE icbini          ! handle bergs, initialisation 
    7069   USE icbstp          ! handle bergs, calving, themodynamics and transport 
    71 #if defined key_oasis3 
    7270   USE cpl_oasis3      ! OASIS3 coupling 
    73 #elif defined key_oasis4 
    74    USE cpl_oasis4      ! OASIS4 coupling (not working) 
    75 #endif 
    7671   USE c1d             ! 1D configuration 
    7772   USE step_c1d        ! Time stepping loop for the 1D configuration 
     
    121116      !!---------------------------------------------------------------------- 
    122117      ! 
    123  
    124118#if defined key_agrif 
    125119      CALL Agrif_Init_Grids()      ! AGRIF: set the meshes 
     
    139133# endif 
    140134#endif 
    141  
    142135      ! check that all process are still there... If some process have an error, 
    143136      ! they will never enter in step and other processes will wait until the end of the cpu time! 
     
    166159 
    167160         DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    168  
    169161#if defined key_agrif 
    170162            CALL Agrif_Step( stp )           ! AGRIF: time stepping 
     
    172164            CALL stp( istp )                 ! standard time stepping 
    173165#endif 
    174  
    175166            istp = istp + 1 
    176167            IF( lk_mpp )   CALL mpp_max( nstop ) 
     
    201192      ! 
    202193      CALL nemo_closefile 
     194      ! 
    203195#if defined key_iomput 
    204196      CALL xios_finalize                ! end mpp communications with xios 
    205 # if defined key_oasis3 || defined key_oasis4 
    206       CALL cpl_prism_finalize           ! end coupling and mpp communications with OASIS 
    207 # endif 
     197      IF( lk_cpl ) CALL cpl_finalize    ! end coupling and mpp communications with OASIS 
    208198#else 
    209 # if defined key_oasis3 || defined key_oasis4 
    210       CALL cpl_prism_finalize           ! end coupling and mpp communications with OASIS 
    211 # else 
    212       IF( lk_mpp )   CALL mppstop       ! end mpp communications 
    213 # endif 
     199      IF( lk_cpl ) THEN  
     200         CALL cpl_finalize              ! end coupling and mpp communications with OASIS 
     201      ELSE 
     202         IF( lk_mpp )   CALL mppstop    ! end mpp communications 
     203      ENDIF 
    214204#endif 
    215205      ! 
     
    227217      INTEGER ::   ios 
    228218      CHARACTER(len=80), DIMENSION(16) ::   cltxt 
    229       !! 
    230       NAMELIST/namctl/ ln_ctl, nn_print, nn_ictls, nn_ictle,   & 
     219      ! 
     220      NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    231221         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    232222         &             nn_bench, nn_timing 
     
    281271#if defined key_iomput 
    282272      IF( Agrif_Root() ) THEN 
    283 # if defined key_oasis3 || defined key_oasis4 
    284          CALL cpl_prism_init( ilocal_comm )      ! nemo local communicator given by oasis 
    285          CALL xios_initialize( "oceanx",local_comm=ilocal_comm ) 
    286 # else 
    287          CALL  xios_initialize( "nemo",return_comm=ilocal_comm ) 
    288 # endif 
     273         IF( lk_cpl ) THEN 
     274            CALL cpl_init( ilocal_comm )                               ! nemo local communicator given by oasis 
     275            CALL xios_initialize( "oceanx",local_comm=ilocal_comm )    ! send nemo communicator to xios 
     276         ELSE 
     277            CALL  xios_initialize( "nemo",return_comm=ilocal_comm )    ! nemo local communicator given by xios 
     278         ENDIF 
    289279      ENDIF 
    290280      narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection 
    291281#else 
    292 # if defined key_oasis3 || defined key_oasis4 
    293       IF( Agrif_Root() ) THEN 
    294          CALL cpl_prism_init( ilocal_comm )                 ! nemo local communicator given by oasis 
    295       ENDIF 
    296       narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt) 
    297 # else 
    298       ilocal_comm = 0 
    299       narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop )                 ! Nodes selection (control print return in cltxt) 
    300 # endif 
     282      IF( lk_cpl ) THEN 
     283         IF( Agrif_Root() ) THEN 
     284            CALL cpl_init( ilocal_comm )                       ! nemo local communicator given by oasis 
     285         ENDIF 
     286         narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt) 
     287      ELSE 
     288         ilocal_comm = 0 
     289         narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop )                ! Nodes selection (control print return in cltxt) 
     290      ENDIF 
    301291#endif 
    302292      narea = narea + 1                                     ! mynode return the rank of proc (0 --> jpnij -1 ) 
     
    393383      IF( lk_tide       )   CALL    tide_init( nit000 )    ! Initialisation of the tidal harmonics 
    394384 
    395       IF( lk_bdy        )   CALL      bdy_init  ! Open boundaries initialisation 
    396       IF( lk_bdy        )   CALL  bdy_dta_init  ! Open boundaries initialisation of external data arrays 
     385      IF( lk_bdy        )   CALL     bdy_init   ! Open boundaries initialisation 
     386      IF( lk_bdy        )   CALL bdy_dta_init   ! Open boundaries initialisation of external data arrays 
    397387      IF( lk_bdy .AND. lk_tide )   & 
    398          &                  CALL  bdytide_init  ! Open boundaries initialisation of tidal harmonic forcing 
     388         &                  CALL bdytide_init   ! Open boundaries initialisation of tidal harmonic forcing 
    399389 
    400390                            CALL dyn_nept_init  ! simplified form of Neptune effect 
     
    406396                            CALL     sbc_init   ! Forcings : surface module 
    407397      !                                         ! Vertical physics 
    408  
    409398                            CALL     zdf_init      ! namelist read 
    410  
    411399                            CALL zdf_bfr_init      ! bottom friction 
    412  
    413400      IF( lk_zdfric     )   CALL zdf_ric_init      ! Richardson number dependent Kz 
    414401      IF( lk_zdftke     )   CALL zdf_tke_init      ! TKE closure scheme 
     
    449436                            CALL     trc_init 
    450437#endif 
    451       ! 
    452   
    453                                             ! Diagnostics 
     438      !                                     ! Diagnostics 
    454439      IF( lk_floats     )   CALL     flo_init   ! drifting Floats 
    455440      IF( lk_diaar5     )   CALL dia_ar5_init   ! ar5 diag 
     
    457442      IF( lk_diadct     )   CALL dia_dct_init   ! Sections tranports 
    458443                            CALL dia_hsb_init   ! heat content, salt content and volume budgets 
    459                             CALL trd_mod_init   ! Mixed-layer/Vorticity/Integral constraints trends 
     444                            CALL     trd_init   ! Mixed-layer/Vorticity/Integral constraints trends 
    460445      IF( lk_diaobs     ) THEN                  ! Observation & model comparison 
    461446                            CALL dia_obs_init            ! Initialize observational data 
    462447                            CALL dia_obs( nit000 - 1 )   ! Observation operator for restart 
    463448      ENDIF 
     449 
    464450      !                                     ! Assimilation increments 
    465451      IF( lk_asminc     )   CALL asm_inc_init   ! Initialize assimilation increments 
     
    659645      !! ** Method  : 
    660646      !!---------------------------------------------------------------------- 
    661       INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 
     647      INTEGER, INTENT(in) ::   num_pes  ! The number of MPI processes we have 
    662648      ! 
    663649      INTEGER, PARAMETER :: nfactmax = 20 
     
    668654      INTEGER, DIMENSION(nfactmax) :: ifact ! Array of factors 
    669655      !!---------------------------------------------------------------------- 
    670  
     656      ! 
    671657      ierr = 0 
    672  
     658      ! 
    673659      CALL factorise( ifact, nfactmax, nfact, num_pes, ierr ) 
    674  
     660      ! 
    675661      IF( nfact <= 1 ) THEN 
    676662         WRITE (numout, *) 'WARNING: factorisation of number of PEs failed' 
     
    714700      INTEGER, PARAMETER :: ntest = 14 
    715701      INTEGER :: ilfax(ntest) 
    716  
     702      ! 
    717703      ! lfax contains the set of allowed factors. 
    718704      data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  & 
     
    765751 
    766752#if defined key_mpp_mpi 
     753 
    767754   SUBROUTINE nemo_northcomms 
    768755      !!====================================================================== 
     
    839826   END SUBROUTINE nemo_northcomms 
    840827#endif 
     828 
    841829   !!====================================================================== 
    842830END MODULE nemogcm 
Note: See TracChangeset for help on using the changeset viewer.