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 1685 – NEMO

Changeset 1685


Ignore:
Timestamp:
2009-10-28T11:28:21+01:00 (14 years ago)
Author:
smasson
Message:

cleaning of logical units (use, flush and close), see ticket:570

Location:
trunk/NEMO
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DIA/diadimg.F90

    r1581 r1685  
    5757    INTEGER :: jk, jn           ! dummy loop indices 
    5858    INTEGER :: irecl4,             &    ! record length in bytes 
    59          &       inum,             &    ! logical unit (set to 14) 
     59         &       inum,             &    ! logical unit 
    6060         &       irec                   ! current record to be written 
    6161    REAL(sp)                    :: zdx,zdy,zspval,zwest,ztimm 
     
    7171 
    7272    irecl4 = MAX(jpi*jpj*sp , 84+18*sp + (jpk+8)*jpnij*sp  ) 
    73     inum = 14 
    7473 
    7574    zspval=0.0_sp    ! special values on land 
  • trunk/NEMO/OPA_SRC/DIA/diagap.F90

    r1601 r1685  
    3434   INTEGER ::   nn_prg = 15   ! switch for control print 
    3535 
     36   INTEGER ::   numgap                      ! logical unit for differences diagnostic 
    3637   INTEGER ::   nhoridg, ndepidg, ndex(1)   ! netcdf files and index common 
    3738 
  • trunk/NEMO/OPA_SRC/DIA/diaptr.F90

    r1636 r1685  
    6464   INTEGER ::   niter 
    6565   INTEGER ::   nidom_ptr 
     66   INTEGER ::   numptr                                              !: logical unit for Poleward TRansports 
    6667 
    6768   REAL(wp), DIMENSION(jpj,jpk) ::   tn_jk_glo  , sn_jk_glo       ! global       i-mean temperature and salinity 
  • trunk/NEMO/OPA_SRC/DIA/diawri_dimg.h90

    r1585 r1685  
    184184#endif 
    185185       ! 
    186        ! Output of dynamics and tracer fields and selected fields (numwri) 
    187        ! ----------------------------------------------------------------- 
     186       ! Output of dynamics and tracer fields and selected fields 
     187       ! -------------------------------------------------------- 
    188188       ! 
    189189       ! 
     
    361361 
    362362       IF( lwp)WRITE(numout,*) ' ' 
    363        IF( lwp)WRITE(numout,*) ' **** WRITE in numwri ',kt 
     363       IF( lwp)WRITE(numout,*) ' **** WRITE in dimg file ',kt 
    364364 
    365365       IF( lwp .AND.        ll_dia_inst) WRITE(numout,*) '    instantaneous fields' 
  • trunk/NEMO/OPA_SRC/FLO/flowri.F90

    r1601 r1685  
    2727   PUBLIC   flo_wri    ! routine called by floats.F90 
    2828 
    29    INTEGER ::   jfl    ! number of floats 
     29   INTEGER ::   jfl      ! number of floats 
     30   INTEGER ::   numflo   ! logical unit for drifting floats 
    3031 
    3132   !! * Substitutions 
     
    297298      ENDIF  
    298299 
     300      IF( kt == nitend )   CLOSE( numflo )  
     301     
    299302   END SUBROUTINE flo_wri 
    300303 
  • trunk/NEMO/OPA_SRC/IOM/in_out_manager.F90

    r1601 r1685  
    7777   INTEGER            ::   nn_jctls     =    0    !: Start j indice for the SUM control 
    7878   INTEGER            ::   nn_jctle     =    0    !: End   j indice for the SUM control 
    79    INTEGER            ::   nn_isplt      =    1   !: number of processors following i 
    80    INTEGER            ::   nn_jsplt      =    1   !: number of processors following j 
     79   INTEGER            ::   nn_isplt     =    1    !: number of processors following i 
     80   INTEGER            ::   nn_jsplt     =    1    !: number of processors following j 
    8181   INTEGER            ::   nn_bench     =    0    !: benchmark parameter (0/1) 
    8282   INTEGER            ::   nn_bit_cmp   =    0    !: bit reproducibility  (0/1) 
     
    9090   !!                        logical units 
    9191   !!---------------------------------------------------------------------- 
    92    INTEGER            ::   numstp                 !: logical unit for time step 
     92   INTEGER            ::   numstp     =   -1      !: logical unit for time step 
    9393   INTEGER            ::   numout     =    6      !: logical unit for output print 
    94    INTEGER            ::   numnam                 !: logical unit for namelist 
    95    INTEGER            ::   numnam_ice             !: logical unit for ice namelist 
    96    INTEGER            ::   numevo_ice             !: logical unit for ice variables (temp. evolution) 
    97    INTEGER            ::   numsol                 !: logical unit for solver statistics 
    98    INTEGER            ::   numwri                 !: logical unit for output write 
    99    INTEGER            ::   numgap                 !: logical unit for differences diagnostic 
    100    INTEGER            ::   numbol                 !: logical unit for "bol" diagnostics 
    101    INTEGER            ::   numptr                 !: logical unit for Poleward TRansports 
    102    INTEGER            ::   numflo                 !: logical unit for drifting floats 
     94   INTEGER            ::   numnam     =   -1      !: logical unit for namelist 
     95   INTEGER            ::   numnam_ice =   -1      !: logical unit for ice namelist 
     96   INTEGER            ::   numevo_ice =   -1      !: logical unit for ice variables (temp. evolution) 
     97   INTEGER            ::   numsol     =   -1      !: logical unit for solver statistics 
    10398 
    10499   !!---------------------------------------------------------------------- 
     
    149144         IF( PRESENT(cd10) ) WRITE(numout,*) cd10 
    150145      ENDIF 
    151       CALL FLUSH(numout) 
     146                               CALL FLUSH(numout    ) 
     147      IF( numstp     /= -1 )   CALL FLUSH(numstp    ) 
     148      IF( numsol     /= -1 )   CALL FLUSH(numsol    ) 
     149      IF( numevo_ice /= -1 )   CALL FLUSH(numevo_ice) 
    152150      ! 
    153151   END SUBROUTINE ctl_stop 
  • trunk/NEMO/OPA_SRC/TRD/trdmld.F90

    r1601 r1685  
    721721      !! * Local declarations 
    722722      INTEGER :: jl 
     723      INTEGER :: inum   ! logical unit 
    723724 
    724725      REAL(wp) ::   zjulian, zsto, zout 
     
    798799  
    799800      IF( nn_ctls == 1 ) THEN 
    800          CALL ctl_opn( numbol, 'ctlsurf_idx', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 
    801          READ ( numbol ) nbol 
    802          CLOSE( numbol ) 
     801         CALL ctl_opn( inum, 'ctlsurf_idx', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 
     802         READ ( inum ) nbol 
     803         CLOSE( inum ) 
    803804      END IF 
    804805 
  • trunk/NEMO/OPA_SRC/opa.F90

    r1627 r1685  
    386386      IF( lk_mpp )   CALL mppsync 
    387387      ! 
    388       IF(lwp) CLOSE( numstp )   ! time-step file 
    389       IF(lwp) CLOSE( numsol )   ! solver file 
    390       ! 
    391       CALL iom_close            ! close all input/output files 
    392       ! 
    393       CLOSE( numnam )           ! namelist 
    394       CLOSE( numout )           ! standard model output file 
     388      CALL iom_close                                 ! close all input/output files managed by iom_* 
     389      ! 
     390      IF( numstp     /= -1 )   CLOSE( numstp     )   ! time-step file 
     391      IF( numsol     /= -1 )   CLOSE( numsol     )   ! solver file 
     392      IF( numnam     /= -1 )   CLOSE( numnam     )   ! oce namelist 
     393      IF( numnam_ice /= -1 )   CLOSE( numnam_ice )   ! ice namelist 
     394      IF( numevo_ice /= -1 )   CLOSE( numevo_ice )   ! ice variables (temp. evolution) 
     395      IF( numout     /=  6 )   CLOSE( numout     )   ! standard model output file 
     396      numout = 6   ! redefine numout in case it is used after this point... 
    395397      ! 
    396398   END SUBROUTINE opa_closefile 
  • trunk/NEMO/TOP_SRC/TRP/trdmld_trc.F90

    r1581 r1685  
    12131213      !! 
    12141214      !!---------------------------------------------------------------------- 
     1215      INTEGER :: inum   ! logical unit 
    12151216      INTEGER :: ilseq, jl, jn 
    12161217      REAL(wp) ::   zjulian, zsto, zout 
     
    13641365      ! ---------------------------------------------- 
    13651366      IF( nctls_trc == 1 ) THEN 
    1366          CALL ctl_opn( numbol, 'ctlsurf_idx', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 
    1367          READ ( numbol ) nbol_trc 
    1368          CLOSE( numbol ) 
     1367         CALL ctl_opn( inum, 'ctlsurf_idx', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, lwp ) 
     1368         READ ( inum ) nbol_trc 
     1369         CLOSE( inum ) 
    13691370      ENDIF 
    13701371 
Note: See TracChangeset for help on using the changeset viewer.