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

Ignore:
Timestamp:
2015-05-12T12:37:15+02:00 (9 years ago)
Author:
deazer
Message:

Merged branch with Trunk at revision 5253.
Checked with SETTE, passes modified iodef.xml for AMM12 experiment

File:
1 edited

Legend:

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

    r4756 r5260  
    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   USE diatmb          ! Top,middle,bottom output 
    9085   USE dia25h          ! 25h mean output 
     
    123118      !!---------------------------------------------------------------------- 
    124119      ! 
    125  
    126120#if defined key_agrif 
    127121      CALL Agrif_Init_Grids()      ! AGRIF: set the meshes 
     
    141135# endif 
    142136#endif 
    143  
    144137      ! check that all process are still there... If some process have an error, 
    145138      ! they will never enter in step and other processes will wait until the end of the cpu time! 
     
    168161 
    169162         DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    170  
    171163#if defined key_agrif 
    172164            CALL Agrif_Step( stp )           ! AGRIF: time stepping 
     
    174166            CALL stp( istp )                 ! standard time stepping 
    175167#endif 
    176  
    177168            istp = istp + 1 
    178169            IF( lk_mpp )   CALL mpp_max( nstop ) 
     
    203194      ! 
    204195      CALL nemo_closefile 
     196      ! 
    205197#if defined key_iomput 
    206198      CALL xios_finalize                ! end mpp communications with xios 
    207 # if defined key_oasis3 || defined key_oasis4 
    208       CALL cpl_prism_finalize           ! end coupling and mpp communications with OASIS 
    209 # endif 
     199      IF( lk_cpl ) CALL cpl_finalize    ! end coupling and mpp communications with OASIS 
    210200#else 
    211 # if defined key_oasis3 || defined key_oasis4 
    212       CALL cpl_prism_finalize           ! end coupling and mpp communications with OASIS 
    213 # else 
    214       IF( lk_mpp )   CALL mppstop       ! end mpp communications 
    215 # endif 
     201      IF( lk_cpl ) THEN  
     202         CALL cpl_finalize              ! end coupling and mpp communications with OASIS 
     203      ELSE 
     204         IF( lk_mpp )   CALL mppstop    ! end mpp communications 
     205      ENDIF 
    216206#endif 
    217207      ! 
     
    229219      INTEGER ::   ios 
    230220      CHARACTER(len=80), DIMENSION(16) ::   cltxt 
    231       !! 
    232       NAMELIST/namctl/ ln_ctl, nn_print, nn_ictls, nn_ictle,   & 
     221      ! 
     222      NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    233223         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    234224         &             nn_bench, nn_timing 
    235225      NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    236          &             jpizoom, jpjzoom, jperio 
     226         &             jpizoom, jpjzoom, jperio, ln_use_jattr 
    237227      !!---------------------------------------------------------------------- 
    238228      ! 
     
    273263      nperio  = 0 
    274264      jperio  = 0 
     265      ln_use_jattr = .false. 
    275266   ENDIF 
    276267#endif 
     
    283274#if defined key_iomput 
    284275      IF( Agrif_Root() ) THEN 
    285 # if defined key_oasis3 || defined key_oasis4 
    286          CALL cpl_prism_init( ilocal_comm )      ! nemo local communicator given by oasis 
    287          CALL xios_initialize( "oceanx",local_comm=ilocal_comm ) 
    288 # else 
    289          CALL  xios_initialize( "nemo",return_comm=ilocal_comm ) 
    290 # endif 
     276         IF( lk_cpl ) THEN 
     277            CALL cpl_init( ilocal_comm )                               ! nemo local communicator given by oasis 
     278            CALL xios_initialize( "oceanx",local_comm=ilocal_comm )    ! send nemo communicator to xios 
     279         ELSE 
     280            CALL  xios_initialize( "nemo",return_comm=ilocal_comm )    ! nemo local communicator given by xios 
     281         ENDIF 
    291282      ENDIF 
    292283      narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection 
    293284#else 
    294 # if defined key_oasis3 || defined key_oasis4 
    295       IF( Agrif_Root() ) THEN 
    296          CALL cpl_prism_init( ilocal_comm )                 ! nemo local communicator given by oasis 
    297       ENDIF 
    298       narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt) 
    299 # else 
    300       ilocal_comm = 0 
    301       narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop )                 ! Nodes selection (control print return in cltxt) 
    302 # endif 
     285      IF( lk_cpl ) THEN 
     286         IF( Agrif_Root() ) THEN 
     287            CALL cpl_init( ilocal_comm )                       ! nemo local communicator given by oasis 
     288         ENDIF 
     289         narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection (control print return in cltxt) 
     290      ELSE 
     291         ilocal_comm = 0 
     292         narea = mynode( cltxt, numnam_ref, numnam_cfg, numond , nstop )                ! Nodes selection (control print return in cltxt) 
     293      ENDIF 
    303294#endif 
    304295      narea = narea + 1                                     ! mynode return the rank of proc (0 --> jpnij -1 ) 
     
    353344         WRITE(numout,*) '                       NEMO team' 
    354345         WRITE(numout,*) '            Ocean General Circulation Model' 
    355          WRITE(numout,*) '                  version 3.4  (2011) ' 
     346         WRITE(numout,*) '                  version 3.6  (2015) ' 
    356347         WRITE(numout,*) 
    357348         WRITE(numout,*) 
     
    395386      IF( lk_tide       )   CALL    tide_init( nit000 )    ! Initialisation of the tidal harmonics 
    396387 
    397       IF( lk_bdy        )   CALL      bdy_init  ! Open boundaries initialisation 
    398       IF( lk_bdy        )   CALL  bdy_dta_init  ! Open boundaries initialisation of external data arrays 
     388                            CALL     sbc_init   ! Forcings : surface module (clem: moved here for bdy purpose) 
     389 
     390      IF( lk_bdy        )   CALL     bdy_init   ! Open boundaries initialisation 
     391      IF( lk_bdy        )   CALL bdy_dta_init   ! Open boundaries initialisation of external data arrays 
    399392      IF( lk_bdy .AND. lk_tide )   & 
    400          &                  CALL  bdytide_init  ! Open boundaries initialisation of tidal harmonic forcing 
     393         &                  CALL bdytide_init   ! Open boundaries initialisation of tidal harmonic forcing 
    401394 
    402395                            CALL dyn_nept_init  ! simplified form of Neptune effect 
    403  
    404396      !      
    405397      IF( ln_crs        )   CALL     crs_init   ! Domain initialization of coarsened grid 
    406398      ! 
    407399                                ! Ocean physics 
    408                             CALL     sbc_init   ! Forcings : surface module 
    409400      !                                         ! Vertical physics 
    410  
    411401                            CALL     zdf_init      ! namelist read 
    412  
    413402                            CALL zdf_bfr_init      ! bottom friction 
    414  
    415403      IF( lk_zdfric     )   CALL zdf_ric_init      ! Richardson number dependent Kz 
    416404      IF( lk_zdftke     )   CALL zdf_tke_init      ! TKE closure scheme 
     
    451439                            CALL     trc_init 
    452440#endif 
    453       ! 
    454   
    455                                             ! Diagnostics 
     441      !                                     ! Diagnostics 
    456442      IF( lk_floats     )   CALL     flo_init   ! drifting Floats 
    457443      IF( lk_diaar5     )   CALL dia_ar5_init   ! ar5 diag 
     
    459445      IF( lk_diadct     )   CALL dia_dct_init   ! Sections tranports 
    460446                            CALL dia_hsb_init   ! heat content, salt content and volume budgets 
    461                             CALL trd_mod_init   ! Mixed-layer/Vorticity/Integral constraints trends 
     447                            CALL     trd_init   ! Mixed-layer/Vorticity/Integral constraints trends 
    462448      IF( lk_diaobs     ) THEN                  ! Observation & model comparison 
    463449                            CALL dia_obs_init            ! Initialize observational data 
    464450                            CALL dia_obs( nit000 - 1 )   ! Observation operator for restart 
    465451      ENDIF 
     452 
    466453      !                                     ! Assimilation increments 
    467454      IF( lk_asminc     )   CALL asm_inc_init   ! Initialize assimilation increments 
     
    525512         WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 
    526513         WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
     514         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
    527515      ENDIF 
    528516      !                             ! Parameter control 
     
    573561      ENDIF 
    574562      ! 
    575       IF( lk_c1d .AND. .NOT.lk_iomput )   CALL ctl_stop( 'nemo_ctl: The 1D configuration must be used ',   & 
    576          &                                               'with the IOM Input/Output manager. '         ,   & 
    577          &                                               'Compile with key_iomput enabled' ) 
    578       ! 
    579563      IF( 1_wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ',  & 
    580564         &                                               'f2003 standard. '                              ,  & 
     
    628612      USE ldftra_oce, ONLY: ldftra_oce_alloc 
    629613      USE trc_oce   , ONLY: trc_oce_alloc 
    630       USE insitu_tem, ONLY: insitu_tem_alloc 
     614      USE diainsitutem, ONLY: insitu_tem_alloc 
    631615#if defined key_diadct  
    632616      USE diadct    , ONLY: diadct_alloc  
     
    670654      !! ** Method  : 
    671655      !!---------------------------------------------------------------------- 
    672       INTEGER, INTENT(in) :: num_pes ! The number of MPI processes we have 
     656      INTEGER, INTENT(in) ::   num_pes  ! The number of MPI processes we have 
    673657      ! 
    674658      INTEGER, PARAMETER :: nfactmax = 20 
     
    679663      INTEGER, DIMENSION(nfactmax) :: ifact ! Array of factors 
    680664      !!---------------------------------------------------------------------- 
    681  
     665      ! 
    682666      ierr = 0 
    683  
     667      ! 
    684668      CALL factorise( ifact, nfactmax, nfact, num_pes, ierr ) 
    685  
     669      ! 
    686670      IF( nfact <= 1 ) THEN 
    687671         WRITE (numout, *) 'WARNING: factorisation of number of PEs failed' 
     
    725709      INTEGER, PARAMETER :: ntest = 14 
    726710      INTEGER :: ilfax(ntest) 
    727  
     711      ! 
    728712      ! lfax contains the set of allowed factors. 
    729713      data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256,  & 
     
    776760 
    777761#if defined key_mpp_mpi 
     762 
    778763   SUBROUTINE nemo_northcomms 
    779764      !!====================================================================== 
     
    810795          !loop over the other north-fold processes to find the processes 
    811796          !managing the points belonging to the sxT-dxT range 
    812           DO jn = jpnij - jpni +1, jpnij 
    813              IF ( njmppt(jn) == njmppmax ) THEN 
     797   
     798          DO jn = 1, jpni 
    814799                !sxT is the first point (in the global domain) of the jn 
    815800                !process 
    816                 sxT = nimppt(jn) 
     801                sxT = nfiimpp(jn, jpnj) 
    817802                !dxT is the last point (in the global domain) of the jn 
    818803                !process 
    819                 dxT = nimppt(jn) + nlcit(jn) - 1 
     804                dxT = nfiimpp(jn, jpnj) + nfilcit(jn, jpnj) - 1 
    820805                IF ((sxM .gt. sxT) .AND. (sxM .lt. dxT)) THEN 
    821806                   nsndto = nsndto + 1 
    822                    isendto(nsndto) = jn 
     807                     isendto(nsndto) = jn 
    823808                ELSEIF ((sxM .le. sxT) .AND. (dxM .ge. dxT)) THEN 
    824809                   nsndto = nsndto + 1 
    825                    isendto(nsndto) = jn 
     810                     isendto(nsndto) = jn 
    826811                ELSEIF ((dxM .lt. dxT) .AND. (sxT .lt. dxM)) THEN 
    827812                   nsndto = nsndto + 1 
    828                    isendto(nsndto) = jn 
     813                     isendto(nsndto) = jn 
    829814                END IF 
    830              END IF 
    831815          END DO 
     816          nfsloop = 1 
     817          nfeloop = nlci 
     818          DO jn = 2,jpni-1 
     819           IF(nfipproc(jn,jpnj) .eq. (narea - 1)) THEN 
     820              IF (nfipproc(jn - 1 ,jpnj) .eq. -1) THEN 
     821                 nfsloop = nldi 
     822              ENDIF 
     823              IF (nfipproc(jn + 1,jpnj) .eq. -1) THEN 
     824                 nfeloop = nlei 
     825              ENDIF 
     826           ENDIF 
     827        END DO 
     828 
    832829      ENDIF 
    833830      l_north_nogather = .TRUE. 
     
    838835   END SUBROUTINE nemo_northcomms 
    839836#endif 
     837 
    840838   !!====================================================================== 
    841839END MODULE nemogcm 
Note: See TracChangeset for help on using the changeset viewer.