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 7277 for branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2016-11-21T09:55:07+01:00 (8 years ago)
Author:
flavoni
Message:

update 2016 branch with simplif-2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_CNRS_2016/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90

    r6140 r7277  
    55   !!====================================================================== 
    66   !! History :  3.3  ! 2010-05  (C. Ethe)  Full reorganization of the off-line: phasing with the on-line 
    7    !!            4.0  ! 2011-01  (C. Ethe, A. R. Porter, STFC Daresbury) dynamical allocation 
     7   !!            3.4  ! 2011-01  (C. Ethe, A. R. Porter, STFC Daresbury) dynamical allocation 
     8   !!            4.0  ! 2016-10  (C. Ethe, G. Madec, S. Flavoni)  domain configuration / user defined interface 
    89   !!---------------------------------------------------------------------- 
    910 
     
    1718   USE oce             ! dynamics and tracers variables 
    1819   USE c1d             ! 1D configuration 
    19    USE domcfg          ! domain configuration               (dom_cfg routine) 
    2020   USE domain          ! domain initialization from coordinate & bathymetry (dom_init routine) 
    21    USE domrea          ! domain initialization from mesh_mask            (dom_init routine) 
     21   USE usrdef_nam      ! user defined configuration 
    2222   USE eosbn2          ! equation of state            (eos bn2 routine) 
    2323   !              ! ocean physics 
     
    3535   USE trcstp          ! passive tracer time-stepping      (trc_stp routine) 
    3636   USE dtadyn          ! Lecture and interpolation of the dynamical fields 
     37   !              ! Passive tracers needs 
     38   USE trc             ! passive tracer : variables 
     39   USE trcnam          ! passive tracer : namelist 
     40   USE trcrst          ! passive tracer restart 
     41   USE diaptr          ! Need to initialise this as some variables are used in if statements later 
     42   USE sbc_oce  , ONLY : ln_rnf 
     43   USE sbcrnf          ! surface boundary condition : runoffs 
    3744   !              ! I/O & MPP 
    3845   USE iom             ! I/O library 
     
    4855   USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 
    4956 
    50    USE trc 
    51    USE trcnam 
    52    USE trcrst 
    53    USE diaptr         ! Need to initialise this as some variables are used in if statements later 
    54    USE sbc_oce, ONLY: ln_rnf 
    55    USE sbcrnf 
     57 
    5658 
    5759   IMPLICIT NONE 
     
    104106      DO WHILE ( istp <= nitend .AND. nstop == 0 )    ! time stepping 
    105107         ! 
    106          IF( istp /= nit000 )   CALL day      ( istp )         ! Calendar (day was already called at nit000 in day_init) 
    107                                 CALL iom_setkt( istp - nit000 + 1, "nemo" )   ! say to iom that we are at time step kstp 
    108                                 CALL dta_dyn  ( istp )         ! Interpolation of the dynamical fields 
    109                                 CALL trc_stp  ( istp )         ! time-stepping 
    110                                 CALL stp_ctl  ( istp, indic )  ! Time loop: control and print 
     108         IF( istp /= nit000 )   CALL day        ( istp )         ! Calendar (day was already called at nit000 in day_init) 
     109                                CALL iom_setkt  ( istp - nit000 + 1, "nemo" )   ! say to iom that we are at time step kstp 
     110                                CALL dta_dyn    ( istp )         ! Interpolation of the dynamical fields 
     111         IF( .NOT.ln_linssh )   CALL dta_dyn_swp( istp )         ! swap of sea  surface height and vertical scale factors 
     112 
     113                                CALL trc_stp    ( istp )         ! time-stepping 
     114                                CALL stp_ctl    ( istp, indic )  ! Time loop: control and print 
    111115         istp = istp + 1 
    112116         IF( lk_mpp )   CALL mpp_max( nstop ) 
     
    147151      INTEGER ::   ji            ! dummy loop indices 
    148152      INTEGER ::   ilocal_comm   ! local integer 
    149       INTEGER ::   ios 
    150       LOGICAL ::   llexist 
    151       CHARACTER(len=80), DIMENSION(16) ::   cltxt 
     153      INTEGER ::   ios, inum 
     154      REAL(wp) ::   ziglo, zjglo, zkglo, zperio   ! local scalars 
     155      CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
    152156      !! 
    153157      NAMELIST/namctl/ ln_ctl  , nn_print, nn_ictls, nn_ictle,   & 
    154158         &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   & 
    155          &             nn_bench, nn_timing, nn_diacfl 
    156       NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, & 
    157          &             jpizoom, jpjzoom, jperio, ln_use_jattr 
    158       !!---------------------------------------------------------------------- 
    159       cltxt = '' 
     159         &             nn_timing, nn_diacfl 
     160 
     161      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_write_cfg, cn_domcfg_out, ln_use_jattr 
     162      !!---------------------------------------------------------------------- 
     163      cltxt  = '' 
     164      cltxt2 = '' 
     165      clnam  = ''   
    160166      cxios_context = 'nemo' 
    161167      ! 
     
    181187904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    182188 
     189 
     190      !                             !--------------------------! 
     191      !                             !  Set global domain size  !   (control print return in cltxt2) 
     192      ! 
     193      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
     194         CALL domain_cfg ( cltxt2,        cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     195         ! 
     196      ELSE                                ! user-defined namelist 
     197         CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     198      ENDIF 
     199      jpk    = jpkglo 
    183200      ! 
    184201      !                             !--------------------------------------------! 
     
    206223         WRITE( numond, namctl ) 
    207224         WRITE( numond, namcfg ) 
     225         IF( .NOT.ln_read_cfg ) THEN 
     226            DO ji = 1, SIZE(clnam) 
     227               IF( TRIM(clnam (ji)) /= '' )   WRITE(numond, * ) clnam(ji)    ! namusr_def print 
     228            END DO 
     229         ENDIF 
    208230      ENDIF 
    209231 
     
    225247      jpi = ( jpiglo-2*jpreci + (jpni-1) ) / jpni + 2*jpreci   ! first  dim. 
    226248      jpj = ( jpjglo-2*jprecj + (jpnj-1) ) / jpnj + 2*jprecj   ! second dim. 
    227       jpk = jpkdta                                             ! third dim 
    228249      jpim1 = jpi-1                                            ! inner domain indices 
    229250      jpjm1 = jpj-1                                            !   "           " 
     
    274295                            CALL     eos_init   ! Equation of state 
    275296      IF( lk_c1d        )   CALL     c1d_init   ! 1D column configuration 
    276                             CALL     dom_cfg    ! Domain configuration 
    277       ! 
    278       INQUIRE( FILE='coordinates.nc', EXIST = llexist )   ! Check if coordinate file exist 
    279       ! 
    280       IF( llexist )  THEN  ;  CALL  dom_init   !  compute the grid from coordinates and bathymetry 
    281       ELSE                 ;  CALL  dom_rea    !  read grid from the meskmask 
    282       ENDIF 
     297 
     298                            CALL     dom_init   ! Domain 
     299 
    283300                            CALL  istate_init   ! ocean initial state (Dynamics and tracers) 
    284301 
     
    315332      !!                     ***  ROUTINE nemo_ctl  *** 
    316333      !! 
    317       !! ** Purpose :   control print setting  
     334      !! ** Purpose :   control print setting 
    318335      !! 
    319336      !! ** Method  : - print namctl information and check some consistencies 
    320337      !!---------------------------------------------------------------------- 
    321338      ! 
    322       IF(lwp) THEN                  ! Parameter print 
     339      IF(lwp) THEN                  ! control print 
    323340         WRITE(numout,*) 
    324          WRITE(numout,*) 'nemo_flg: Control prints & Benchmark' 
     341         WRITE(numout,*) 'nemo_ctl: Control prints' 
    325342         WRITE(numout,*) '~~~~~~~ ' 
    326343         WRITE(numout,*) '   Namelist namctl' 
     
    333350         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt 
    334351         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt 
    335          WRITE(numout,*) '      benchmark parameter (0/1)       nn_bench   = ', nn_bench 
     352         WRITE(numout,*) '      timing activated    (0/1)       nn_timing  = ', nn_timing 
    336353      ENDIF 
    337354      ! 
     
    343360      isplt     = nn_isplt 
    344361      jsplt     = nn_jsplt 
    345       nbench    = nn_bench 
    346      IF(lwp) THEN                  ! control print 
     362 
     363 
     364      IF(lwp) THEN                  ! control print 
    347365         WRITE(numout,*) 
    348366         WRITE(numout,*) 'namcfg  : configuration initialization through namelist read' 
    349367         WRITE(numout,*) '~~~~~~~ ' 
    350368         WRITE(numout,*) '   Namelist namcfg' 
    351          WRITE(numout,*) '      configuration name              cp_cfg      = ', TRIM(cp_cfg) 
    352          WRITE(numout,*) '      configuration resolution        jp_cfg      = ', jp_cfg 
    353          WRITE(numout,*) '      1st lateral dimension ( >= jpi ) jpidta     = ', jpidta 
    354          WRITE(numout,*) '      2nd    "         "    ( >= jpj ) jpjdta     = ', jpjdta 
    355          WRITE(numout,*) '      3nd    "         "               jpkdta     = ', jpkdta 
    356          WRITE(numout,*) '      1st dimension of global domain in i jpiglo  = ', jpiglo 
    357          WRITE(numout,*) '      2nd    -                  -    in j jpjglo  = ', jpjglo 
    358          WRITE(numout,*) '      left bottom i index of the zoom (in data domain) jpizoom = ', jpizoom 
    359          WRITE(numout,*) '      left bottom j index of the zoom (in data domain) jpizoom = ', jpjzoom 
    360          WRITE(numout,*) '      lateral cond. type (between 0 and 6) jperio = ', jperio    
    361          WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr 
    362       ENDIF 
     369         WRITE(numout,*) '      read domain configuration files             ln_read_cfg      = ', ln_read_cfg 
     370         WRITE(numout,*) '         filename to be read                         cn_domcfg     = ', TRIM(cn_domcfg) 
     371         WRITE(numout,*) '      write  configuration definition files       ln_write_cfg     = ', ln_write_cfg 
     372         WRITE(numout,*) '         filename to be written                      cn_domcfg_out = ', TRIM(cn_domcfg_out) 
     373         WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr     = ', ln_use_jattr 
     374      ENDIF 
     375 
    363376      !                             ! Parameter control 
    364377      ! 
    365378      IF( ln_ctl ) THEN                 ! sub-domain area indices for the control prints 
    366          IF( lk_mpp ) THEN 
    367             isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real splitted domain 
     379         IF( lk_mpp .AND. jpnij > 1 ) THEN 
     380            isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real split domain 
    368381         ELSE 
    369382            IF( isplt == 1 .AND. jsplt == 1  ) THEN 
     
    400413      ENDIF 
    401414      ! 
    402       IF( nbench == 1 )   THEN            ! Benchmark  
    403          SELECT CASE ( cp_cfg ) 
    404          CASE ( 'gyre' )   ;   CALL ctl_warn( ' The Benchmark is activated ' ) 
    405          CASE DEFAULT      ;   CALL ctl_stop( ' The Benchmark is based on the GYRE configuration:',   & 
    406             &                                 ' cp_cfg="gyre" in namelsit &namcfg or set nbench = 0' ) 
    407          END SELECT 
    408       ENDIF 
    409       ! 
    410       IF( lk_c1d .AND. .NOT.lk_iomput )   CALL ctl_stop( 'nemo_ctl: The 1D configuration must be used ',   & 
    411          &                                               'with the IOM Input/Output manager. '        ,   & 
    412          &                                               'Compile with key_iomput enabled' ) 
    413       ! 
    414415      IF( 1_wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows ',  & 
    415416         &                                               'f2003 standard. '                              ,  & 
     
    434435      IF( numnam_cfg /= -1 )   CLOSE( numnam_cfg )   ! oce configuration namelist 
    435436      IF( numout     /=  6 )   CLOSE( numout     )   ! standard model output file 
     437      IF( lwm.AND.numond  /= -1 )   CLOSE( numond          )   ! oce output namelist 
     438 
    436439      numout = 6                                     ! redefine numout in case it is used after this point... 
    437440      ! 
Note: See TracChangeset for help on using the changeset viewer.