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 6982 for branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2016-10-04T15:01:17+02:00 (7 years ago)
Author:
flavoni
Message:

update SETTE, SAS, AMM12 and namelists to run simplif-2 branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90

    r6596 r6982  
    66   !! History :  OPA  ! 1990-10  (C. Levy, G. Madec)  Original code 
    77   !!            7.0  ! 1991-11  (M. Imbard, C. Levy, G. Madec) 
    8    !!            7.1  ! 1993-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar,  
    9    !!                             P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1  
     8   !!            7.1  ! 1993-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 
     9   !!                             P. Delecluse, C. Perigaud, G. Caniaux, B. Colot, C. Maes) release 7.1 
    1010   !!             -   ! 1992-06  (L.Terray)  coupling implementation 
    11    !!             -   ! 1993-11  (M.A. Filiberti) IGLOO sea-ice  
    12    !!            8.0  ! 1996-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar,  
     11   !!             -   ! 1993-11  (M.A. Filiberti) IGLOO sea-ice 
     12   !!            8.0  ! 1996-03  (M. Imbard, C. Levy, G. Madec, O. Marti, M. Guyon, A. Lazar, 
    1313   !!                             P. Delecluse, L.Terray, M.A. Filiberti, J. Vialar, A.M. Treguier, M. Levy) release 8.0 
    1414   !!            8.1  ! 1997-06  (M. Imbard, G. Madec) 
    15    !!            8.2  ! 1999-11  (M. Imbard, H. Goosse)  LIM sea-ice model  
    16    !!                 ! 1999-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP  
     15   !!            8.2  ! 1999-11  (M. Imbard, H. Goosse)  LIM sea-ice model 
     16   !!                 ! 1999-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP 
    1717   !!                 ! 2000-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER) 
    1818   !!   NEMO     1.0  ! 2002-08  (G. Madec)  F90: Free form and modules 
     
    2525   !!             -   ! 2007-07  (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) 
    2626   !!            3.2  ! 2009-08  (S. Masson)  open/write in the listing file in mpp 
    27    !!            3.3  ! 2010-05  (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface  
     27   !!            3.3  ! 2010-05  (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface 
    2828   !!             -   ! 2010-10  (C. Ethe, G. Madec) reorganisation of initialisation phase 
    2929   !!            3.3.1! 2011-01  (A. R. Porter, STFC Daresbury) dynamical allocation 
    30    !!            3.4  ! 2011-11  (C. Harris) decomposition changes for running with CICE 
     30   !!            3.4  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) add nemo_northcomms 
     31   !!             -   ! 2011-11  (C. Harris) decomposition changes for running with CICE 
     32   !!            3.6  ! 2012-05  (C. Calone, J. Simeon, G. Madec, C. Ethe) Add grid coarsening  
     33   !!             -   ! 2013-06  (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication  
     34   !!             -   ! 2014-12  (G. Madec) remove KPP scheme and cross-land advection (cla) 
    3135   !!---------------------------------------------------------------------- 
    3236 
     
    6468#endif 
    6569   USE bdy_par 
     70   USE usrdef_nam     ! user defined configuration 
    6671 
    6772   IMPLICIT NONE 
     
    7479 
    7580   !!---------------------------------------------------------------------- 
    76    !! NEMO/OPA 4.0 , NEMO Consortium (2011) 
     81   !! NEMO/OPA 4.0 , NEMO Consortium (2016) 
    7782   !! $Id$ 
    7883   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     
    8489      !!                     ***  ROUTINE nemo_gcm  *** 
    8590      !! 
    86       !! ** Purpose :   NEMO solves the primitive equations on an orthogonal  
     91      !! ** Purpose :   NEMO solves the primitive equations on an orthogonal 
    8792      !!              curvilinear mesh on the sphere. 
    8893      !! 
     
    124129      !                            !-----------------------! 
    125130      istp = nit000 
    126          
     131#if defined key_agrif 
     132      CALL Agrif_Regrid() 
     133#endif 
     134 
    127135      DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    128136#if defined key_agrif 
    129          CALL Agrif_Step( stp )           ! AGRIF: time stepping 
     137         CALL stp                         ! AGRIF: time stepping 
    130138#else 
    131          CALL stp( istp )                 ! standard time stepping 
     139         IF ( .NOT. ln_diurnal_only ) THEN 
     140            CALL stp( istp )                 ! standard time stepping 
     141         ELSE 
     142            CALL stp_diurnal( istp )        ! time step only the diurnal SST 
     143         ENDIF  
    132144#endif 
    133145         istp = istp + 1 
    134146         IF( lk_mpp )   CALL mpp_max( nstop ) 
    135       END DO 
     147         END DO 
    136148      ! 
    137149      IF( ln_icebergs )   CALL icb_end( nitend ) 
     
    157169      ! 
    158170#if defined key_iomput 
    159       CALL xios_finalize                ! end mpp communications with xios 
    160       IF( lk_oasis ) CALL cpl_finalize    ! end coupling and mpp communications with OASIS 
     171      CALL xios_finalize                  ! end mpp communications with xios 
     172      IF( lk_oasis )   CALL cpl_finalize  ! end coupling and mpp communications with OASIS 
    161173#else 
    162174      IF( lk_oasis ) THEN  
     
    176188      !! ** Purpose :   initialization of the NEMO GCM 
    177189      !!---------------------------------------------------------------------- 
    178       INTEGER ::   ji            ! dummy loop indices 
    179       INTEGER ::   ilocal_comm   ! local integer       
    180       INTEGER ::   ios 
    181       CHARACTER(len=80), DIMENSION(16) ::   cltxt 
    182       CHARACTER(len=80) ::   clname 
     190      INTEGER  ::   ji            ! dummy loop indices 
     191      INTEGER  ::   ilocal_comm   ! local integer 
     192      INTEGER  ::   ios, inum     !   -      - 
     193      REAL(wp) ::   ziglo, zjglo, zkglo, zperio   ! local scalars 
     194      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam, clbug 
     195      CHARACTER(len=80)                 ::   clname 
    183196      ! 
    184197      NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    185198         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    186          &             nn_bench, nn_timing, nn_diacfl 
    187       NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg,   & 
    188          &             jperio, ln_use_jattr 
    189       !!---------------------------------------------------------------------- 
    190       ! 
    191       cltxt = '' 
     199         &             nn_timing, nn_diacfl 
     200      NAMELIST/namcfg/ ln_read_cfg, ln_write_cfg, cp_cfg, jp_cfg, ln_use_jattr 
     201      !!---------------------------------------------------------------------- 
     202      ! 
     203      cltxt  = '' 
     204      cltxt2 = '' 
     205      clnam  = ''   
     206      clbug  = '' 
     207      cxios_context = 'nemo' 
    192208      ! 
    193209      !                             ! Open reference namelist and configuration namelist files 
     
    221237904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    222238 
    223 ! Force values for AGRIF zoom (cf. agrif_user.F90) 
     239!!gm      WRITE(clbug(3),*) ' after namelist namcfg read    nstop', nstop 
     240 
     241      !                             !--------------------------! 
     242      !                             !  Set global domain size  !   (control print return in cltxt2) 
     243      !                             !--------------------------! 
     244      IF( ln_read_cfg ) THEN              ! Read sizes in configuration "mesh_mask" file 
     245         CALL iom_open( 'domain_cfg', inum ) 
     246         CALL iom_get( inum, 'jpiglo', ziglo  )   ;   jpiglo = INT( ziglo ) 
     247         CALL iom_get( inum, 'jpjglo', zjglo  )   ;   jpjglo = INT( zjglo ) 
     248         CALL iom_get( inum, 'jpkglo', zkglo  )   ;   jpkglo = INT( zkglo ) 
     249         CALL iom_get( inum, 'jperio', zperio )   ;   jperio = INT( zperio ) 
     250         CALL iom_close( inum ) 
     251         WRITE(cltxt2(1),*)        
     252         WRITE(cltxt2(2),*) 'domain_cfg : domain size read in "domain_cfg" file : jp(i,j,k)glo = ', jpiglo, jpjglo, jpkglo         
     253         WRITE(cltxt2(3),*) '~~~~~~~~~~   lateral boudary type of the global domain      jperio= ', jperio 
     254         !         
     255      ELSE                                ! user-defined namelist 
     256         CALL usr_def_nam( cltxt2, clnam, jpiglo, jpjglo, jpkglo, jperio ) 
     257      ENDIF 
     258      jpk    = jpkglo 
     259      ! 
    224260#if defined key_agrif 
    225    IF( .NOT. Agrif_Root() ) THEN 
    226       jpiglo  = nbcellsx + 2 + 2*nbghostcells 
    227       jpjglo  = nbcellsy + 2 + 2*nbghostcells 
    228       jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 
    229       jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 
    230       jpidta  = jpiglo 
    231       jpjdta  = jpjglo 
    232       nperio  = 0 
    233       jperio  = 0 
    234       ln_use_jattr = .false. 
    235    ENDIF 
     261      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90) 
     262         jpiglo  = nbcellsx + 2 + 2*nbghostcells 
     263         jpjglo  = nbcellsy + 2 + 2*nbghostcells 
     264         jpi     = ( jpiglo-2*jpreci + (jpni-1+0) ) / jpni + 2*jpreci 
     265         jpj     = ( jpjglo-2*jprecj + (jpnj-1+0) ) / jpnj + 2*jprecj 
     266         nperio  = 0 
     267         jperio  = 0 
     268         ln_use_jattr = .false. 
     269      ENDIF 
    236270#endif 
    237271      ! 
     
    273307         WRITE( numond, namctl ) 
    274308         WRITE( numond, namcfg ) 
     309         IF( .NOT.ln_read_cfg ) THEN 
     310            DO ji = 1, SIZE(clnam) 
     311               IF( TRIM(clnam (ji)) /= '' )   WRITE(numond, * ) clnam(ji)    ! namusr_def print 
     312            END DO 
     313         ENDIF 
    275314      ENDIF 
    276315 
    277316      ! If dimensions of processor grid weren't specified in the namelist file  
    278317      ! then we calculate them here now that we have our communicator size 
    279       IF( (jpni < 1) .OR. (jpnj < 1) )THEN 
     318      IF( jpni < 1 .OR. jpnj < 1 ) THEN 
    280319#if   defined key_mpp_mpi 
    281          IF( Agrif_Root() ) CALL nemo_partition(mppsize) 
     320         IF( Agrif_Root() )   CALL nemo_partition( mppsize ) 
    282321#else 
    283322         jpni  = 1 
     
    285324         jpnij = jpni*jpnj 
    286325#endif 
    287       END IF 
     326      ENDIF 
    288327 
    289328      ! Calculate domain dimensions given calculated jpni and jpnj 
     
    299338#endif 
    300339      ENDIF 
    301          jpk = jpkdta                                             ! third dim 
    302          jpim1 = jpi-1                                            ! inner domain indices 
    303          jpjm1 = jpj-1                                            !   "           " 
    304          jpkm1 = jpk-1                                            !   "           " 
    305          jpij  = jpi*jpj                                          !  jpi x j 
     340 
     341!!gm ???    why here  it has already been done in line 301 ! 
     342      jpk = jpkglo                                             ! third dim 
     343!!gm end 
     344 
     345#if defined key_agrif 
     346      ! simple trick to use same vertical grid as parent but different number of levels:  
     347      ! Save maximum number of levels in jpkglo, then define all vertical grids with this number. 
     348      ! Suppress once vertical online interpolation is ok 
     349      IF(.NOT.Agrif_Root())   jpkglo = Agrif_Parent( jpkglo ) 
     350#endif 
     351      jpim1 = jpi-1                                            ! inner domain indices 
     352      jpjm1 = jpj-1                                            !   "           " 
     353      jpkm1 = jpk-1                                            !   "           " 
     354      jpij  = jpi*jpj                                          !  jpi x j 
    306355 
    307356      IF(lwp) THEN                            ! open listing units 
     
    317366         WRITE(numout,*) '                       NEMO team' 
    318367         WRITE(numout,*) '            Ocean General Circulation Model' 
    319          WRITE(numout,*) '                  version 3.6  (2015) ' 
     368         WRITE(numout,*) '                  version 3.7  (2015) ' 
    320369         WRITE(numout,*) '             StandAlone Surface version (SAS) ' 
    321370         WRITE(numout,*) 
     
    324373            IF( TRIM(cltxt(ji)) /= '' )   WRITE(numout,*) cltxt(ji)      ! control print of mynode 
    325374         END DO 
     375         WRITE(numout,*) 
     376         WRITE(numout,*) 
     377         DO ji = 1, SIZE(cltxt2) 
     378!            IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) cltxt2(ji)     ! control print of domain size 
     379            IF( cltxt2(ji) /= '' )   WRITE(numout,*) cltxt2(ji)     ! control print of domain size 
     380         END DO 
     381         ! 
    326382         WRITE(numout,cform_aaa)                                         ! Flag AAAAAAA 
    327383         ! 
     
    392448         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    393449         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    394          WRITE(numout,*) '      benchmark parameter (0/1)       nn_bench   = ', nn_bench 
     450         WRITE(numout,*) '      timing activated    (0/1)       nn_timing  = ', nn_timing 
    395451      ENDIF 
    396452      ! 
     
    402458      isplt     = nn_isplt 
    403459      jsplt     = nn_jsplt 
    404       nbench    = nn_bench 
    405460 
    406461      IF(lwp) THEN                  ! control print 
     
    409464         WRITE(numout,*) '~~~~~~~ ' 
    410465         WRITE(numout,*) '   Namelist namcfg' 
    411          WRITE(numout,*) '      configuration name              cp_cfg      = ', TRIM(cp_cfg) 
    412          WRITE(numout,*) '      configuration zoom name         cp_cfz      = ', TRIM(cp_cfz) 
    413          WRITE(numout,*) '      configuration resolution        jp_cfg      = ', jp_cfg 
    414          WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
     466         WRITE(numout,*) '      read configuration definition files          ln_read_cfg = ', ln_read_cfg 
     467         WRITE(numout,*) '      configuration name                               cp_cfg  = ', TRIM(cp_cfg) 
     468         WRITE(numout,*) '      configuration resolution                         jp_cfg  = ', jp_cfg 
    415469         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
    416470      ENDIF 
     
    609663 
    610664      ! Clear the error flag and initialise output vars 
    611       kerr = 0 
    612       kfax = 1 
     665      kerr  = 0 
     666      kfax  = 1 
    613667      knfax = 0 
    614  
     668      ! 
    615669      ! Find the factors of n. 
    616670      IF( kn == 1 )   GOTO 20 
     
    620674      ! l points to the allowed factor list. 
    621675      ! ifac holds the current factor. 
    622  
     676      ! 
    623677      inu   = kn 
    624678      knfax = 0 
    625  
     679      ! 
    626680      DO jl = ntest, 1, -1 
    627681         ! 
     
    647701         ! 
    648702      END DO 
    649  
     703      ! 
    650704   20 CONTINUE      ! Label 20 is the exit point from the factor search loop. 
    651705      ! 
     
    653707 
    654708#if defined key_mpp_mpi 
     709 
    655710   SUBROUTINE nemo_northcomms 
    656711      !!====================================================================== 
     
    666721      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC)  
    667722      !!---------------------------------------------------------------------- 
    668  
    669723      INTEGER  ::   sxM, dxM, sxT, dxT, jn 
    670724      INTEGER  ::   njmppmax 
    671  
     725      !!---------------------------------------------------------------------- 
     726      ! 
    672727      njmppmax = MAXVAL( njmppt ) 
    673      
     728      ! 
    674729      !initializes the north-fold communication variables 
    675730      isendto(:) = 0 
    676       nsndto = 0 
    677  
     731      nsndto     = 0 
     732      ! 
    678733      !if I am a process in the north 
    679734      IF ( njmpp == njmppmax ) THEN 
Note: See TracChangeset for help on using the changeset viewer.