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 11317 for NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/BENCH/MY_SRC/usrdef_nam.F90 – NEMO

Ignore:
Timestamp:
2019-07-22T10:32:59+02:00 (5 years ago)
Author:
smasson
Message:

dev_r10984_HPC-13 : improve error handling, see #2307 and #2285

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/BENCH/MY_SRC/usrdef_nam.F90

    r10428 r11317  
    2929CONTAINS 
    3030 
    31    SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
     31   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) 
    3232      !!---------------------------------------------------------------------- 
    3333      !!                     ***  ROUTINE dom_nam  *** 
     
    4141      !! ** input   : - namusr_def namelist found in namelist_cfg 
    4242      !!---------------------------------------------------------------------- 
    43       CHARACTER(len=*), DIMENSION(:), INTENT(out) ::   ldtxt, ldnam    ! stored print information 
    4443      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name 
    4544      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution 
     
    4847      ! 
    4948      ! 
    50       INTEGER ::   ios, ii      ! Local integer 
     49      INTEGER ::   ios         ! Local integer 
    5150      !                              !!* namusr_def namelist *!! 
    5251      INTEGER ::   nn_isize    ! number of point in i-direction of global(local) domain if >0 (<0)   
     
    5554      INTEGER ::   nn_perio    ! periodicity 
    5655      !                              !!* nammpp namelist *!! 
    57       CHARACTER(len=1) ::   cn_mpi_send 
    58       INTEGER          ::   nn_buffer, jpni, jpnj 
     56      INTEGER          ::   jpni, jpnj 
    5957      LOGICAL          ::   ln_nnogather 
    6058      !! 
    6159      NAMELIST/namusr_def/ nn_isize, nn_jsize, nn_ksize, nn_perio 
    62       NAMELIST/nammpp/ cn_mpi_send, nn_buffer, jpni, jpnj, ln_nnogather 
     60      NAMELIST/nammpp/ jpni, jpnj, ln_nnogather 
    6361      !!----------------------------------------------------------------------      
    6462      ! 
    6563      REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only) 
    6664      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 903 ) 
    67 903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) 
    68       WRITE( ldnam(:), namusr_def )       
     65903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' ) 
     66      ! 
     67      WRITE( numond, namusr_def )       
    6968      ! 
    7069      cd_cfg = 'BENCH'             ! name & resolution (not used) 
     
    7574         REWIND( numnam_ref )              ! Namelist nammpp in reference namelist: mpi variables 
    7675         READ  ( numnam_ref, nammpp, IOSTAT = ios, ERR = 901) 
    77 901      IF( ios /= 0 )   CALL ctl_nam ( ios , 'nammpp in reference namelist', lwp ) 
     76901      IF( ios /= 0 )   CALL ctl_nam ( ios , 'nammpp in reference namelist' ) 
    7877         ! 
    7978         REWIND( numnam_cfg )              ! Namelist nammpp in configuration namelist: mpi variables 
    8079         READ  ( numnam_cfg, nammpp, IOSTAT = ios, ERR = 902 ) 
    81 902      IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist', lwp ) 
     80902      IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist' ) 
    8281 
    8382         kpi = ( -nn_isize - 2*nn_hls ) * jpni + 2*nn_hls 
     
    9291 
    9392      !                             ! control print 
    94       ii = 1 
    95       WRITE(ldtxt(ii),*) '   '                                                                          ;   ii = ii + 1 
    96       WRITE(ldtxt(ii),*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   ;   ii = ii + 1 
    97       WRITE(ldtxt(ii),*) '~~~~~~~~~~~ '                                                                 ;   ii = ii + 1 
    98       WRITE(ldtxt(ii),*) '   Namelist namusr_def : BENCH test case'                                     ;   ii = ii + 1 
     93      WRITE(numout,*) '   ' 
     94      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg' 
     95      WRITE(numout,*) '~~~~~~~~~~~ ' 
     96      WRITE(numout,*) '   Namelist namusr_def : BENCH test case' 
    9997      IF( nn_isize > 0 ) THEN 
    100          WRITE(ldtxt(ii),*) '      global domain size-x            nn_isize = ',  nn_isize              ;   ii = ii + 1 
     98         WRITE(numout,*) '      global domain size-x            nn_isize = ',  nn_isize 
    10199      ELSE 
    102          WRITE(ldtxt(ii),*) '                                          jpni = ', jpni                   ;   ii = ii + 1 
    103          WRITE(ldtxt(ii),*) '       local domain size-x           -nn_isize = ', -nn_isize              ;   ii = ii + 1 
    104          WRITE(ldtxt(ii),*) '      global domain size-x                 kpi = ', kpi                    ;   ii = ii + 1 
     100         WRITE(numout,*) '                                          jpni = ', jpni 
     101         WRITE(numout,*) '       local domain size-x           -nn_isize = ', -nn_isize 
     102         WRITE(numout,*) '      global domain size-x                 kpi = ', kpi 
    105103      ENDIF 
    106104      IF( nn_jsize > 0 ) THEN 
    107          WRITE(ldtxt(ii),*) '      global domain size-y            nn_jsize = ', nn_jsize               ;   ii = ii + 1 
     105         WRITE(numout,*) '      global domain size-y            nn_jsize = ', nn_jsize 
    108106      ELSE 
    109          WRITE(ldtxt(ii),*) '                                          jpnj = ', jpnj                   ;   ii = ii + 1 
    110          WRITE(ldtxt(ii),*) '       local domain size-y           -nn_jsize = ', -nn_jsize              ;   ii = ii + 1 
    111          WRITE(ldtxt(ii),*) '      global domain size-y                 kpj = ', kpj                    ;   ii = ii + 1 
     107         WRITE(numout,*) '                                          jpnj = ', jpnj 
     108         WRITE(numout,*) '       local domain size-y           -nn_jsize = ', -nn_jsize 
     109         WRITE(numout,*) '      global domain size-y                 kpj = ', kpj 
    112110      ENDIF 
    113       WRITE(ldtxt(ii),*) '      global domain size-z            nn_ksize = ', nn_ksize                  ;   ii = ii + 1 
    114       WRITE(ldtxt(ii),*) '      LBC of the global domain          kperio = ', kperio                    ;   ii = ii + 1 
     111      WRITE(numout,*) '      global domain size-z            nn_ksize = ', nn_ksize 
     112      WRITE(numout,*) '      LBC of the global domain          kperio = ', kperio 
    115113      ! 
    116114   END SUBROUTINE usr_def_nam 
Note: See TracChangeset for help on using the changeset viewer.