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

Ignore:
Timestamp:
2015-07-10T13:28:53+02:00 (9 years ago)
Author:
timgraham
Message:

Merged head of trunk into branch

File:
1 edited

Legend:

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

    r4982 r5581  
    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 
     
    8782   USE crsini          ! initialise grid coarsening utility 
    8883   USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges  
     84   USE sbc_oce, ONLY: lk_oasis 
     85   USE stopar 
     86   USE stopts 
    8987 
    9088   IMPLICIT NONE 
     
    121119      !!---------------------------------------------------------------------- 
    122120      ! 
    123  
    124121#if defined key_agrif 
    125122      CALL Agrif_Init_Grids()      ! AGRIF: set the meshes 
     
    139136# endif 
    140137#endif 
    141  
    142138      ! check that all process are still there... If some process have an error, 
    143139      ! they will never enter in step and other processes will wait until the end of the cpu time! 
     
    170166 
    171167         DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    172  
    173168#if defined key_agrif 
    174169            CALL stp                         ! AGRIF: time stepping 
     
    176171            CALL stp( istp )                 ! standard time stepping 
    177172#endif 
    178  
    179173            istp = istp + 1 
    180174            IF( lk_mpp )   CALL mpp_max( nstop ) 
     
    207201      ! 
    208202      CALL nemo_closefile 
     203      ! 
    209204#if defined key_iomput 
    210205      CALL xios_finalize                ! end mpp communications with xios 
    211 # if defined key_oasis3 || defined key_oasis4 
    212       CALL cpl_prism_finalize           ! end coupling and mpp communications with OASIS 
    213 # endif 
     206      IF( lk_oasis ) CALL cpl_finalize    ! end coupling and mpp communications with OASIS 
    214207#else 
    215 # if defined key_oasis3 || defined key_oasis4 
    216       CALL cpl_prism_finalize           ! end coupling and mpp communications with OASIS 
    217 # else 
    218       IF( lk_mpp )   CALL mppstop       ! end mpp communications 
    219 # endif 
     208      IF( lk_oasis ) THEN  
     209         CALL cpl_finalize              ! end coupling and mpp communications with OASIS 
     210      ELSE 
     211         IF( lk_mpp )   CALL mppstop    ! end mpp communications 
     212      ENDIF 
    220213#endif 
    221214      ! 
     
    233226      INTEGER ::   ios 
    234227      CHARACTER(len=80), DIMENSION(16) ::   cltxt 
    235       !! 
    236       NAMELIST/namctl/ ln_ctl, nn_print, nn_ictls, nn_ictle,   & 
     228      ! 
     229      NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    237230         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    238231         &             nn_bench, nn_timing 
    239232      NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    240          &             jpizoom, jpjzoom, jperio 
     233         &             jpizoom, jpjzoom, jperio, ln_use_jattr 
    241234      !!---------------------------------------------------------------------- 
    242235      ! 
    243236      cltxt = '' 
     237      cxios_context = 'nemo' 
    244238      ! 
    245239      !                             ! Open reference namelist and configuration namelist files 
     
    277271      nperio  = 0 
    278272      jperio  = 0 
     273      ln_use_jattr = .false. 
    279274   ENDIF 
    280275#endif 
     
    287282#if defined key_iomput 
    288283      IF( Agrif_Root() ) THEN 
    289 # if defined key_oasis3 || defined key_oasis4 
    290          CALL cpl_prism_init( ilocal_comm )      ! nemo local communicator given by oasis 
    291          CALL xios_initialize( "oceanx",local_comm=ilocal_comm ) 
    292 # else 
    293          CALL  xios_initialize( "nemo",return_comm=ilocal_comm ) 
    294 # endif 
    295       ENDIF 
    296       narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection 
     284         IF( lk_oasis ) THEN 
     285            CALL cpl_init( "oceanx", ilocal_comm )                     ! nemo local communicator given by oasis 
     286            CALL xios_initialize( "not used",local_comm=ilocal_comm )    ! send nemo communicator to xios 
     287         ELSE 
     288            CALL  xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm )    ! nemo local communicator given by xios 
     289         ENDIF 
     290      ENDIF 
     291      ! Nodes selection (control print return in cltxt) 
     292      narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) 
    297293#else 
    298 # if defined key_oasis3 || defined key_oasis4 
    299       IF( Agrif_Root() ) THEN 
    300          CALL cpl_prism_init( ilocal_comm )                 ! nemo local communicator given by oasis 
    301       ENDIF 
    302       narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt) 
    303 # else 
    304       ilocal_comm = 0 
    305       narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop )                 ! Nodes selection (control print return in cltxt) 
    306 # endif 
     294      IF( lk_oasis ) THEN 
     295         IF( Agrif_Root() ) THEN 
     296            CALL cpl_init( "oceanx", ilocal_comm )                      ! nemo local communicator given by oasis 
     297         ENDIF 
     298         ! Nodes selection (control print return in cltxt) 
     299         narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm ) 
     300      ELSE 
     301         ilocal_comm = 0 
     302         ! Nodes selection (control print return in cltxt) 
     303         narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop ) 
     304      ENDIF 
    307305#endif 
    308306      narea = narea + 1                                     ! mynode return the rank of proc (0 --> jpnij -1 ) 
     
    365363         WRITE(numout,*) '                       NEMO team' 
    366364         WRITE(numout,*) '            Ocean General Circulation Model' 
    367          WRITE(numout,*) '                  version 3.4  (2011) ' 
     365         WRITE(numout,*) '                  version 3.6  (2015) ' 
    368366         WRITE(numout,*) 
    369367         WRITE(numout,*) 
     
    407405      IF( lk_tide       )   CALL    tide_init( nit000 )    ! Initialisation of the tidal harmonics 
    408406 
    409       IF( lk_bdy        )   CALL      bdy_init  ! Open boundaries initialisation 
    410       IF( lk_bdy        )   CALL  bdy_dta_init  ! Open boundaries initialisation of external data arrays 
     407                            CALL     sbc_init   ! Forcings : surface module (clem: moved here for bdy purpose) 
     408 
     409      IF( lk_bdy        )   CALL     bdy_init   ! Open boundaries initialisation 
     410      IF( lk_bdy        )   CALL bdy_dta_init   ! Open boundaries initialisation of external data arrays 
    411411      IF( lk_bdy .AND. lk_tide )   & 
    412          &                  CALL  bdytide_init  ! Open boundaries initialisation of tidal harmonic forcing 
     412         &                  CALL bdytide_init   ! Open boundaries initialisation of tidal harmonic forcing 
    413413 
    414414                            CALL dyn_nept_init  ! simplified form of Neptune effect 
    415  
    416415      !      
    417416      IF( ln_crs        )   CALL     crs_init   ! Domain initialization of coarsened grid 
    418417      ! 
    419418                                ! Ocean physics 
    420                             CALL     sbc_init   ! Forcings : surface module 
    421419      !                                         ! Vertical physics 
    422  
    423420                            CALL     zdf_init      ! namelist read 
    424  
    425421                            CALL zdf_bfr_init      ! bottom friction 
    426  
    427422      IF( lk_zdfric     )   CALL zdf_ric_init      ! Richardson number dependent Kz 
    428423      IF( lk_zdftke     )   CALL zdf_tke_init      ! TKE closure scheme 
     
    458453      IF( nn_cla == 1 .AND. cp_cfg == 'orca' .AND. jp_cfg == 2 )   CALL cla_init       ! Cross Land Advection 
    459454                            CALL icb_init( rdt, nit000)   ! initialise icebergs instance 
     455                            CALL sto_par_init   ! Stochastic parametrization 
     456      IF( ln_sto_eos     )  CALL sto_pts_init   ! RRandom T/S fluctuations 
    460457      
    461458#if defined key_top 
     
    463460                            CALL     trc_init 
    464461#endif 
    465       ! 
    466   
    467                                             ! Diagnostics 
     462      !                                     ! Diagnostics 
    468463      IF( lk_floats     )   CALL     flo_init   ! drifting Floats 
    469464      IF( lk_diaar5     )   CALL dia_ar5_init   ! ar5 diag 
     
    471466      IF( lk_diadct     )   CALL dia_dct_init   ! Sections tranports 
    472467                            CALL dia_hsb_init   ! heat content, salt content and volume budgets 
    473                             CALL trd_mod_init   ! Mixed-layer/Vorticity/Integral constraints trends 
     468                            CALL     trd_init   ! Mixed-layer/Vorticity/Integral constraints trends 
    474469      IF( lk_diaobs     ) THEN                  ! Observation & model comparison 
    475470                            CALL dia_obs_init            ! Initialize observational data 
    476471                            CALL dia_obs( nit000 - 1 )   ! Observation operator for restart 
    477472      ENDIF 
     473 
    478474      !                                     ! Assimilation increments 
    479475      IF( lk_asminc     )   CALL asm_inc_init   ! Initialize assimilation increments 
     
    534530         WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 
    535531         WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
     532         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
    536533      ENDIF 
    537534      !                             ! Parameter control 
     
    673670      !! ** Method  : 
    674671      !!---------------------------------------------------------------------- 
    675       INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 
     672      INTEGER, INTENT(in) ::   num_pes  ! The number of MPI processes we have 
    676673      ! 
    677674      INTEGER, PARAMETER :: nfactmax = 20 
     
    682679      INTEGER, DIMENSION(nfactmax) :: ifact ! Array of factors 
    683680      !!---------------------------------------------------------------------- 
    684  
     681      ! 
    685682      ierr = 0 
    686  
     683      ! 
    687684      CALL factorise( ifact, nfactmax, nfact, num_pes, ierr ) 
    688  
     685      ! 
    689686      IF( nfact <= 1 ) THEN 
    690687         WRITE (numout, *) 'WARNING: factorisation of number of PEs failed' 
     
    777774 
    778775#if defined key_mpp_mpi 
     776 
    779777   SUBROUTINE nemo_northcomms 
    780778      !!====================================================================== 
     
    851849   END SUBROUTINE nemo_northcomms 
    852850#endif 
     851 
    853852   !!====================================================================== 
    854853END MODULE nemogcm 
Note: See TracChangeset for help on using the changeset viewer.