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

Ignore:
Timestamp:
2015-02-17T10:06:39+01:00 (9 years ago)
Author:
timgraham
Message:

Merged head of trunk into branch in preparation for putting code back onto the trunk
In working copy ran the command:
svn merge svn+sshtimgraham@…/ipsl/forge/projets/nemo/svn/trunk

Also recompiled NEMO_book.pdf with merged input files

File:
1 edited

Legend:

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

    r4645 r5086  
    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 
     
    8681   USE sbctide, ONLY: lk_tide 
    8782   USE crsini          ! initialise grid coarsening utility 
    88    USE lbcnfd, ONLY: isendto, nsndto ! Setup of north fold exchanges  
     83   USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges  
    8984 
    9085   IMPLICIT NONE 
     
    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 
     
    568554      ENDIF 
    569555      ! 
    570       IF( lk_c1d .AND. .NOT.lk_iomput )   CALL ctl_stop( 'nemo_ctl: The 1D configuration must be used ',   & 
    571          &                                               'with the IOM Input/Output manager. '         ,   & 
    572          &                                               'Compile with key_iomput enabled' ) 
    573       ! 
    574556      IF( 1_wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ',  & 
    575557         &                                               'f2003 standard. '                              ,  & 
     
    663645      !! ** Method  : 
    664646      !!---------------------------------------------------------------------- 
    665       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 
    666648      ! 
    667649      INTEGER, PARAMETER :: nfactmax = 20 
     
    672654      INTEGER, DIMENSION(nfactmax) :: ifact ! Array of factors 
    673655      !!---------------------------------------------------------------------- 
    674  
     656      ! 
    675657      ierr = 0 
    676  
     658      ! 
    677659      CALL factorise( ifact, nfactmax, nfact, num_pes, ierr ) 
    678  
     660      ! 
    679661      IF( nfact <= 1 ) THEN 
    680662         WRITE (numout, *) 'WARNING: factorisation of number of PEs failed' 
     
    718700      INTEGER, PARAMETER :: ntest = 14 
    719701      INTEGER :: ilfax(ntest) 
    720  
     702      ! 
    721703      ! lfax contains the set of allowed factors. 
    722704      data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  & 
     
    769751 
    770752#if defined key_mpp_mpi 
     753 
    771754   SUBROUTINE nemo_northcomms 
    772755      !!====================================================================== 
     
    803786          !loop over the other north-fold processes to find the processes 
    804787          !managing the points belonging to the sxT-dxT range 
    805           DO jn = jpnij - jpni +1, jpnij 
    806              IF ( njmppt(jn) == njmppmax ) THEN 
     788   
     789          DO jn = 1, jpni 
    807790                !sxT is the first point (in the global domain) of the jn 
    808791                !process 
    809                 sxT = nimppt(jn) 
     792                sxT = nfiimpp(jn, jpnj) 
    810793                !dxT is the last point (in the global domain) of the jn 
    811794                !process 
    812                 dxT = nimppt(jn) + nlcit(jn) - 1 
     795                dxT = nfiimpp(jn, jpnj) + nfilcit(jn, jpnj) - 1 
    813796                IF ((sxM .gt. sxT) .AND. (sxM .lt. dxT)) THEN 
    814797                   nsndto = nsndto + 1 
    815                    isendto(nsndto) = jn 
     798                     isendto(nsndto) = jn 
    816799                ELSEIF ((sxM .le. sxT) .AND. (dxM .ge. dxT)) THEN 
    817800                   nsndto = nsndto + 1 
    818                    isendto(nsndto) = jn 
     801                     isendto(nsndto) = jn 
    819802                ELSEIF ((dxM .lt. dxT) .AND. (sxT .lt. dxM)) THEN 
    820803                   nsndto = nsndto + 1 
    821                    isendto(nsndto) = jn 
     804                     isendto(nsndto) = jn 
    822805                END IF 
    823              END IF 
    824806          END DO 
     807          nfsloop = 1 
     808          nfeloop = nlci 
     809          DO jn = 2,jpni-1 
     810           IF(nfipproc(jn,jpnj) .eq. (narea - 1)) THEN 
     811              IF (nfipproc(jn - 1 ,jpnj) .eq. -1) THEN 
     812                 nfsloop = nldi 
     813              ENDIF 
     814              IF (nfipproc(jn + 1,jpnj) .eq. -1) THEN 
     815                 nfeloop = nlei 
     816              ENDIF 
     817           ENDIF 
     818        END DO 
     819 
    825820      ENDIF 
    826821      l_north_nogather = .TRUE. 
     
    831826   END SUBROUTINE nemo_northcomms 
    832827#endif 
     828 
    833829   !!====================================================================== 
    834830END MODULE nemogcm 
Note: See TracChangeset for help on using the changeset viewer.