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 1579 for trunk/NEMO/OPA_SRC/opa.F90 – NEMO

Ignore:
Timestamp:
2009-08-05T12:14:11+02:00 (15 years ago)
Author:
smasson
Message:

avoid write in numout before definition of lwp, see ticket:237

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/opa.F90

    r1493 r1579  
    179179      INTEGER :: localComm 
    180180#endif 
    181       CHARACTER (len=20) ::   namelistname 
    182       CHARACTER (len=28) ::   file_out 
     181      CHARACTER(len=20)               ::   namelistname 
     182      CHARACTER(len=28)               ::   file_out 
     183      CHARACTER(len=80),dimension(10) ::   cltxt 
     184      INTEGER                         :: ji             ! local loop indicees 
    183185      NAMELIST/namctl/ ln_ctl, nprint, nictls, nictle,   & 
    184186         &             isplt , jsplt , njctls, njctle, nbench, nbit_cmp 
     
    187189      ! Initializations 
    188190      ! =============== 
    189  
     191      cltxt(:) = '' 
    190192      file_out = 'ocean.output' 
     193      namelistname = 'namelist' 
    191194       
    192       ! open listing and namelist units 
    193       CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED',   & 
    194          &         'SEQUENTIAL', 1, 6, .FALSE., 1 ) 
    195  
    196       WRITE(numout,*) 
    197       WRITE(numout,*) '                 L O D Y C - I P S L' 
    198       WRITE(numout,*) '                     O P A model' 
    199       WRITE(numout,*) '            Ocean General Circulation Model' 
    200       WRITE(numout,*) '               version OPA 9.0  (2005) ' 
    201       WRITE(numout,*) 
    202       WRITE(numout,*) 
    203  
    204       namelistname = 'namelist' 
    205       CALL ctlopn( numnam, namelistname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   & 
    206          &         1, numout, .FALSE., 1 ) 
    207  
    208195      ! Namelist namctl : Control prints & Benchmark 
    209       REWIND( numnam ) 
     196      CALL ctlopn( numnam, namelistname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., 1 ) 
     197      REWIND( numnam )   ! is this really needed? we just open the file... 
    210198      READ  ( numnam, namctl ) 
    211199 
     
    221209# endif 
    222210      ! Nodes selection 
    223       narea = mynode( localComm ) 
     211      narea = mynode( cltxt, localComm ) 
    224212#else 
    225213# if defined key_oasis3 || defined key_oasis4 
     
    227215      CALL cpl_prism_init( localComm ) 
    228216      ! Nodes selection 
    229       narea = mynode( localComm ) 
     217      narea = mynode( cltxt, localComm ) 
    230218# else 
    231219      ! Nodes selection 
    232       narea = mynode() 
     220      narea = mynode( cltxt ) 
    233221# endif 
    234222#endif 
    235223      narea = narea + 1    ! mynode return the rank of proc (0 --> jpnij -1 ) 
    236       lwp   = narea == 1 
    237  
    238       ! open additionnal listing 
    239       IF( ln_ctl )  THEN 
    240          IF( narea-1 > 0 )   THEN 
    241             WRITE(file_out,FMT="('ocean.output_',I4.4)") narea-1 
    242             CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED',   & 
    243                &         'SEQUENTIAL', 1, numout, .FALSE., 1 ) 
    244             lwp = .TRUE. 
    245             ! 
    246             WRITE(numout,*) 
    247             WRITE(numout,*) '                 L O D Y C - I P S L' 
    248             WRITE(numout,*) '                     O P A model' 
    249             WRITE(numout,*) '            Ocean General Circulation Model' 
    250             WRITE(numout,*) '               version OPA 9.0  (2005) ' 
    251             WRITE(numout,*) '                   MPI Ocean output ' 
    252             WRITE(numout,*) 
    253             WRITE(numout,*) 
    254          ENDIF 
     224 
     225      lwp = narea == 1 .OR. ln_ctl   ! print control 
     226 
     227      IF( lwp ) THEN 
     228         ! open listing and namelist units 
     229         IF( narea > 1 )   WRITE(file_out, "(a,'_',i4.4)") TRIM(file_out), narea-1 
     230         CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., 1 ) 
     231          
     232         WRITE(numout,*) 
     233         WRITE(numout,*) '                 L O D Y C - I P S L' 
     234         WRITE(numout,*) '                     O P A model' 
     235         WRITE(numout,*) '            Ocean General Circulation Model' 
     236         WRITE(numout,*) '               version OPA 9.0  (2005) ' 
     237         WRITE(numout,*) 
     238         WRITE(numout,*) 
     239         DO ji = 1, SIZE(cltxt) 
     240            IF (TRIM(cltxt(ji)) /= '') WRITE(numout,*) cltxt(ji) 
     241         END DO 
     242 
    255243      ENDIF 
    256244 
Note: See TracChangeset for help on using the changeset viewer.