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 12149 for NEMO/branches/2019/ENHANCE-03_closea/src/OFF/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2019-12-10T15:03:24+01:00 (4 years ago)
Author:
ayoung
Message:

Updated trunk to 12072

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/ENHANCE-03_closea/src/OFF/nemogcm.F90

    r10601 r12149  
    114114#else 
    115115                                CALL dta_dyn    ( istp )         ! Interpolation of the dynamical fields 
     116#endif 
     117                                CALL trc_stp    ( istp )         ! time-stepping 
     118#if ! defined key_sed_off 
    116119         IF( .NOT.ln_linssh )   CALL dta_dyn_swp( istp )         ! swap of sea  surface height and vertical scale factors 
    117120#endif 
    118                                 CALL trc_stp    ( istp )         ! time-stepping 
    119121                                CALL stp_ctl    ( istp, indic )  ! Time loop: control and print 
    120122         istp = istp + 1 
     
    131133 
    132134      IF( nstop /= 0 .AND. lwp ) THEN                 ! error print 
    133          WRITE(numout,cform_err) 
    134          WRITE(numout,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found' 
    135          WRITE(numout,*) 
     135         WRITE(ctmp1,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found' 
     136         CALL ctl_stop( ctmp1 ) 
    136137      ENDIF 
    137138      ! 
     
    146147#endif 
    147148      ! 
     149      IF(lwm) THEN 
     150         IF( nstop == 0 ) THEN   ;   STOP 0 
     151         ELSE                    ;   STOP 123 
     152         ENDIF 
     153      ENDIF 
     154      ! 
    148155   END SUBROUTINE nemo_gcm 
    149156 
     
    155162      !! ** Purpose :   initialization of the nemo model in off-line mode 
    156163      !!---------------------------------------------------------------------- 
    157       INTEGER  ::   ji                 ! dummy loop indices 
    158       INTEGER  ::   ios, ilocal_comm   ! local integers 
    159       CHARACTER(len=120), DIMENSION(30) ::   cltxt, cltxt2, clnam 
     164      INTEGER ::   ios, ilocal_comm   ! local integers 
    160165      !! 
    161166      NAMELIST/namctl/ ln_ctl   , sn_cfctl, nn_print, nn_ictls, nn_ictle,   & 
     
    165170      !!---------------------------------------------------------------------- 
    166171      ! 
    167       cltxt  = '' 
    168       cltxt2 = '' 
    169       clnam  = ''   
    170172      cxios_context = 'nemo' 
    171173      ! 
    172       !                             ! Open reference namelist and configuration namelist files 
    173       CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    174       CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
     174      !                             !-------------------------------------------------! 
     175      !                             !     set communicator & select the local rank    ! 
     176      !                             !  must be done as soon as possible to get narea  ! 
     177      !                             !-------------------------------------------------! 
     178      ! 
     179#if defined key_iomput 
     180      CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm )   ! nemo local communicator given by xios 
     181      CALL mpp_start( ilocal_comm ) 
     182#else 
     183      CALL mpp_start( ) 
     184#endif 
     185      ! 
     186      narea = mpprank + 1               ! mpprank: the rank of proc (0 --> mppsize -1 ) 
     187      lwm = (narea == 1)                ! control of output namelists 
     188      ! 
     189      !                             !---------------------------------------------------------------! 
     190      !                             ! Open output files, reference and configuration namelist files ! 
     191      !                             !---------------------------------------------------------------! 
     192      ! 
     193      ! open ocean.output as soon as possible to get all output prints (including errors messages) 
     194      IF( lwm )   CALL ctl_opn(     numout,        'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     195      ! open reference and configuration namelist files 
     196                  CALL ctl_opn( numnam_ref,        'namelist_ref',     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     197                  CALL ctl_opn( numnam_cfg,        'namelist_cfg',     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     198      IF( lwm )   CALL ctl_opn(     numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     199      ! open /dev/null file to be able to supress output write easily 
     200                  CALL ctl_opn(     numnul,           '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. ) 
     201      ! 
     202      !                             !--------------------! 
     203      !                             ! Open listing units !  -> need ln_ctl from namctl to define lwp 
     204      !                             !--------------------! 
    175205      ! 
    176206      REWIND( numnam_ref )              ! Namelist namctl in reference namelist 
    177207      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 ) 
    178 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namctl in reference namelist', .TRUE. ) 
     208901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namctl in reference namelist' ) 
    179209      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist 
    180210      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    181 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    182       ! 
    183       REWIND( numnam_ref )              ! Namelist namcfg in reference namelist 
    184       READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
    185 903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist', .TRUE. ) 
    186       REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist 
    187       READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
    188 904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    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 ) 
     211902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namctl in configuration namelist' ) 
     212      ! 
     213      lwp = (narea == 1) .OR. ln_ctl    ! control of all listing output print 
     214      ! 
     215      IF(lwp) THEN                            ! open listing units 
    195216         ! 
    196       ELSE                                ! user-defined namelist 
    197          CALL usr_def_nam( cltxt2, clnam, cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
    198       ENDIF 
    199       ! 
    200       l_offline = .true.                  ! passive tracers are run offline 
    201       ! 
    202       !                             !--------------------------------------------! 
    203       !                             !  set communicator & select the local node  ! 
    204       !                             !  NB: mynode also opens output.namelist.dyn ! 
    205       !                             !      on unit number numond on first proc   ! 
    206       !                             !--------------------------------------------! 
    207 #if defined key_iomput 
    208       CALL  xios_initialize( "for_xios_mpi_id",return_comm=ilocal_comm ) 
    209       narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop, ilocal_comm )   ! Nodes selection 
    210 #else 
    211       ilocal_comm = 0 
    212       narea = mynode( cltxt, 'output.namelist.dyn', numnam_ref, numnam_cfg, numond , nstop )                ! Nodes selection (control print return in cltxt) 
    213 #endif 
    214  
    215       narea = narea + 1                       ! mynode return the rank of proc (0 --> jpnij -1 ) 
    216  
     217         IF( .NOT. lwm )   &           ! alreay opened for narea == 1 
     218            &     CALL ctl_opn(     numout,        'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea ) 
     219         ! 
     220         WRITE(numout,*) 
     221         WRITE(numout,*) '   CNRS - NERC - Met OFFICE - MERCATOR-ocean - CMCC' 
     222         WRITE(numout,*) '                       NEMO team' 
     223         WRITE(numout,*) '                   Off-line TOP Model' 
     224         WRITE(numout,*) '                NEMO version 4.0  (2019) ' 
     225         WRITE(numout,*) 
     226         WRITE(numout,*) "           ._      ._      ._      ._      ._    " 
     227         WRITE(numout,*) "       _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ " 
     228         WRITE(numout,*) 
     229         WRITE(numout,*) "           o         _,           _,             " 
     230         WRITE(numout,*) "            o      .' (        .-' /             " 
     231         WRITE(numout,*) "           o     _/..._'.    .'   /              " 
     232         WRITE(numout,*) "      (    o .-'`      ` '-./  _.'               " 
     233         WRITE(numout,*) "       )    ( o)           ;= <_         (       " 
     234         WRITE(numout,*) "      (      '-.,\\__ __.-;`\   '.        )      " 
     235         WRITE(numout,*) "       )  )       \) |`\ \)  '.   \      (   (   " 
     236         WRITE(numout,*) "      (  (           \_/       '-._\      )   )  " 
     237         WRITE(numout,*) "       )  )                        `     (   (   " 
     238         WRITE(numout,*) "     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " 
     239         WRITE(numout,*) 
     240         ! 
     241         WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA 
     242         ! 
     243      ENDIF 
     244      ! 
     245      ! finalize the definition of namctl variables 
    217246      IF( sn_cfctl%l_config ) THEN 
    218247         ! Activate finer control of report outputs 
     
    226255         CALL nemo_set_cfctl( sn_cfctl, ln_ctl, .TRUE. ) 
    227256      ENDIF 
    228  
    229       lwm = (narea == 1)                      ! control of output namelists 
    230       lwp = (narea == 1) .OR. ln_ctl          ! control of all listing output print 
    231  
    232       IF(lwm) THEN               ! write merged namelists from earlier to output namelist  
    233          !                       ! now that the file has been opened in call to mynode.  
    234          !                       ! NB: nammpp has already been written in mynode (if lk_mpp_mpi) 
    235          WRITE( numond, namctl ) 
    236          WRITE( numond, namcfg ) 
    237          IF( .NOT.ln_read_cfg ) THEN 
    238             DO ji = 1, SIZE(clnam) 
    239                IF( TRIM(clnam(ji)) /= '' )   WRITE(numond, * ) clnam(ji)     ! namusr_def print 
    240             END DO 
    241          ENDIF 
    242       ENDIF 
    243  
    244       IF(lwp) THEN                            ! open listing units 
    245          ! 
    246          CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
    247          ! 
    248          WRITE(numout,*) 
    249          WRITE(numout,*) '   CNRS - NERC - Met OFFICE - MERCATOR-ocean - INGV - CMCC' 
    250          WRITE(numout,*) '                       NEMO team' 
    251          WRITE(numout,*) '                   Off-line TOP Model' 
    252          WRITE(numout,*) '                NEMO version 4.0  (2019) ' 
    253          WRITE(numout,*) 
    254          WRITE(numout,*) "           ._      ._      ._      ._      ._    " 
    255          WRITE(numout,*) "       _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ " 
    256          WRITE(numout,*) 
    257          WRITE(numout,*) "           o         _,           _,             " 
    258          WRITE(numout,*) "            o      .' (        .-' /             " 
    259          WRITE(numout,*) "           o     _/..._'.    .'   /              " 
    260          WRITE(numout,*) "      (    o .-'`      ` '-./  _.'               " 
    261          WRITE(numout,*) "       )    ( o)           ;= <_         (       " 
    262          WRITE(numout,*) "      (      '-.,\\__ __.-;`\   '.        )      " 
    263          WRITE(numout,*) "       )  )       \) |`\ \)  '.   \      (   (   " 
    264          WRITE(numout,*) "      (  (           \_/       '-._\      )   )  " 
    265          WRITE(numout,*) "       )  )                        `     (   (   " 
    266          WRITE(numout,*) "     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ " 
    267          WRITE(numout,*) 
    268          DO ji = 1, SIZE(cltxt) 
    269             IF( TRIM(cltxt (ji)) /= '' )   WRITE(numout,*) TRIM(cltxt(ji))    ! control print of mynode 
    270          END DO 
    271          WRITE(numout,*) 
    272          WRITE(numout,*) 
    273          DO ji = 1, SIZE(cltxt2) 
    274             IF( TRIM(cltxt2(ji)) /= '' )   WRITE(numout,*) TRIM(cltxt2(ji))   ! control print of domain size 
    275          END DO 
    276          ! 
    277          WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA 
    278          ! 
    279       ENDIF 
    280       ! open /dev/null file to be able to supress output write easily 
    281       CALL ctl_opn( numnul, '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    282       ! 
    283       !                                      ! Domain decomposition 
    284       CALL mpp_init                          ! MPP 
     257      ! 
     258      IF(lwm) WRITE( numond, namctl ) 
     259      ! 
     260      !                             !------------------------------------! 
     261      !                             !  Set global domain size parameters ! 
     262      !                             !------------------------------------! 
     263      !      
     264      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist 
     265      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 ) 
     266903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist' ) 
     267      REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist 
     268      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
     269904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )    
     270      ! 
     271      IF( ln_read_cfg ) THEN              ! Read sizes in domain configuration file 
     272         CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     273      ELSE                                ! user-defined namelist 
     274         CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio ) 
     275      ENDIF 
     276      ! 
     277      IF(lwm)   WRITE( numond, namcfg ) 
     278      l_offline = .true.                  ! passive tracers are run offline 
     279      ! 
     280      !                             !-----------------------------------------! 
     281      !                             ! mpp parameters and domain decomposition ! 
     282      !                             !-----------------------------------------! 
     283      ! 
     284      CALL mpp_init 
    285285 
    286286      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays 
Note: See TracChangeset for help on using the changeset viewer.