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 4624 for trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90 – NEMO

Ignore:
Timestamp:
2014-04-28T14:09:03+02:00 (10 years ago)
Author:
acc
Message:

#1305. Fix slow start-up problems on some systems by introducing and using lwm logical to restrict output of merged namelists to the first (or only) processor. lwm is true only on the first processor regardless of ln_ctl. Small changes to all flavours of nemogcm.F90 are also required to write namctl and namcfg after the call to mynode which now opens output.namelist.dyn and writes nammpp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r4354 r4624  
    240240      CALL ctl_opn( numnam_ref, 'namelist_ref', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    241241      CALL ctl_opn( numnam_cfg, 'namelist_cfg', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. ) 
    242       CALL ctl_opn( numond, 'output.namelist.dyn', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE. , 1 ) 
    243242      ! 
    244243      REWIND( numnam_ref )              ! Namelist namctl in reference namelist : Control prints & Benchmark 
     
    249248      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 ) 
    250249902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namctl in configuration namelist', .TRUE. ) 
    251       WRITE( numond, namctl ) 
    252250 
    253251      ! 
     
    259257      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 ) 
    260258904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namcfg in configuration namelist', .TRUE. )    
    261       WRITE( numond, namcfg ) 
    262259 
    263260! Force values for AGRIF zoom (cf. agrif_user.F90) 
     
    279276      !                             !--------------------------------------------! 
    280277      !                             !  set communicator & select the local node  ! 
     278      !                             !  NB: mynode also opens output.namelist.dyn ! 
     279      !                             !      on unit number numond on first proc   ! 
    281280      !                             !--------------------------------------------! 
    282281#if defined key_iomput 
     
    303302      narea = narea + 1                                     ! mynode return the rank of proc (0 --> jpnij -1 ) 
    304303 
     304      lwm = (narea == 1)                                    ! control of output namelists 
    305305      lwp = (narea == 1) .OR. ln_ctl                        ! control of all listing output print 
     306 
     307      IF(lwm) THEN 
     308         ! write merged namelists from earlier to output namelist now that the 
     309         ! file has been opened in call to mynode. nammpp has already been 
     310         ! written in mynode (if lk_mpp_mpi) 
     311         WRITE( numond, namctl ) 
     312         WRITE( numond, namcfg ) 
     313      ENDIF 
    306314 
    307315      ! If dimensions of processor grid weren't specified in the namelist file 
     
    586594      IF( numnam_ref      /= -1 )   CLOSE( numnam_ref      )   ! oce reference namelist 
    587595      IF( numnam_cfg      /= -1 )   CLOSE( numnam_cfg      )   ! oce configuration namelist 
    588       IF( numond          /= -1 )   CLOSE( numond          )   ! oce output namelist 
     596      IF( lwm.AND.numond  /= -1 )   CLOSE( numond          )   ! oce output namelist 
    589597      IF( numnam_ice_ref  /= -1 )   CLOSE( numnam_ice_ref  )   ! ice reference namelist 
    590598      IF( numnam_ice_cfg  /= -1 )   CLOSE( numnam_ice_cfg  )   ! ice configuration namelist 
    591       IF( numoni          /= -1 )   CLOSE( numoni          )   ! ice output namelist 
     599      IF( lwm.AND.numoni  /= -1 )   CLOSE( numoni          )   ! ice output namelist 
    592600      IF( numevo_ice      /= -1 )   CLOSE( numevo_ice      )   ! ice variables (temp. evolution) 
    593601      IF( numout          /=  6 )   CLOSE( numout          )   ! standard model output file 
Note: See TracChangeset for help on using the changeset viewer.