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 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90 – NEMO

Ignore:
Timestamp:
2010-12-27T18:33:53+01:00 (13 years ago)
Author:
rblod
Message:

Update NEMOGCM from branch nemo_v3_3_beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90

    • Property svn:eol-style deleted
    r1770 r2528  
    99   !!             3.0  !  2008-06  (G. Madec)   add ctmp4 to ctmp10 
    1010   !!             3.2  !  2009-08  (S. MAsson)  add new ctl_opn 
     11   !!             3.3  !  2010-10  (A. Coward)  add NetCDF4 usage 
    1112   !!---------------------------------------------------------------------- 
    1213 
     
    1617   !!   getunit    : give the index of an unused logical unit 
    1718   !!---------------------------------------------------------------------- 
    18    USE par_kind        ! kind definition 
    19    USE par_oce         ! ocean parameter 
    20    USE lib_print       ! formated print library 
     19   USE par_oce       ! ocean parameter 
     20   USE lib_print     ! formated print library 
     21   USE nc4interface  ! NetCDF4 interface 
    2122 
    2223   IMPLICIT NONE 
     
    2627   !!                   namrun namelist parameters 
    2728   !!---------------------------------------------------------------------- 
    28    CHARACTER(len=16) ::   cn_exp        = "exp0"      !: experiment name used for output filename 
    29    CHARACTER(len=32) ::   cn_ocerst_in  = "restart"   !: suffix of ocean restart name (input) 
    30    CHARACTER(len=32) ::   cn_ocerst_out = "restart"   !: suffix of ocean restart name (output) 
    31    LOGICAL            ::   ln_rstart     = .FALSE.     !: start from (F) rest or (T) a restart file 
    32    INTEGER            ::   nn_no         = 0           !: job number 
    33    INTEGER            ::   nn_rstctl     = 0           !: control of the time step (0, 1 or 2) 
    34    INTEGER            ::   nn_rstssh     = 0           !: hand made initilization of ssh or not (1/0) 
    35    INTEGER            ::   nn_it000      = 1           !: index of the first time step 
    36    INTEGER            ::   nn_itend      = 10          !: index of the last time step 
    37    INTEGER            ::   nn_date0      = 961115      !: initial calendar date aammjj 
    38    INTEGER            ::   nn_leapy      = 0           !: Leap year calendar flag (0/1 or 30) 
    39    INTEGER            ::   nn_istate     = 0           !: initial state output flag (0/1) 
    40    INTEGER            ::   nn_write      =   10        !: model standard output frequency 
    41    INTEGER            ::   nn_stock      =   10        !: restart file frequency 
    42    LOGICAL            ::   ln_dimgnnn    = .FALSE.     !: type of dimgout. (F): 1 file for all proc 
     29   CHARACTER(lc) ::   cn_exp        = "exp0"      !: experiment name used for output filename 
     30   CHARACTER(lc) ::   cn_ocerst_in  = "restart"   !: suffix of ocean restart name (input) 
     31   CHARACTER(lc) ::   cn_ocerst_out = "restart"   !: suffix of ocean restart name (output) 
     32   LOGICAL       ::   ln_rstart     = .FALSE.     !: start from (F) rest or (T) a restart file 
     33   INTEGER       ::   nn_no         = 0           !: job number 
     34   INTEGER       ::   nn_rstctl     = 0           !: control of the time step (0, 1 or 2) 
     35   INTEGER       ::   nn_rstssh     = 0           !: hand made initilization of ssh or not (1/0) 
     36   INTEGER       ::   nn_it000      = 1           !: index of the first time step 
     37   INTEGER       ::   nn_itend      = 10          !: index of the last time step 
     38   INTEGER       ::   nn_date0      = 961115      !: initial calendar date aammjj 
     39   INTEGER       ::   nn_leapy      = 0           !: Leap year calendar flag (0/1 or 30) 
     40   INTEGER       ::   nn_istate     = 0           !: initial state output flag (0/1) 
     41   INTEGER       ::   nn_write      =   10        !: model standard output frequency 
     42   INTEGER       ::   nn_stock      =   10        !: restart file frequency 
     43   LOGICAL       ::   ln_dimgnnn    = .FALSE.     !: type of dimgout. (F): 1 file for all proc 
    4344                                                       !:                  (T): 1 file per proc 
    44    LOGICAL            ::   ln_mskland    = .FALSE.     !: mask land points in NetCDF outputs (costly: + ~15%) 
    45    LOGICAL            ::   ln_clobber    = .FALSE.     !: clobber (overwrite) an existing file 
    46    INTEGER            ::   nn_chunksz    = 0           !: chunksize (bytes) for NetCDF file (working only with iom_nf90 routines) 
     45   LOGICAL       ::   ln_mskland    = .FALSE.     !: mask land points in NetCDF outputs (costly: + ~15%) 
     46   LOGICAL       ::   ln_clobber    = .FALSE.     !: clobber (overwrite) an existing file 
     47   INTEGER       ::   nn_chunksz    = 0           !: chunksize (bytes) for NetCDF file (works only with iom_nf90 routines) 
     48#if defined key_netcdf4 
     49   !!---------------------------------------------------------------------- 
     50   !!                   namnc4 namelist parameters                         (key_netcdf4) 
     51   !!---------------------------------------------------------------------- 
     52   ! The following four values determine the partitioning of the output fields 
     53   ! into netcdf4 chunks. They are unrelated to the nn_chunk_sz setting which is 
     54   ! for runtime optimisation. The individual netcdf4 chunks can be optionally  
     55   ! gzipped (recommended) leading to significant reductions in I/O volumes  
     56   !                                   !!!**  variables only used with iom_nf90 routines and key_netcdf4 ** 
     57   INTEGER ::   nn_nchunks_i = 1        !: number of chunks required in the i-dimension  
     58   INTEGER ::   nn_nchunks_j = 1        !: number of chunks required in the j-dimension  
     59   INTEGER ::   nn_nchunks_k = 1        !: number of chunks required in the k-dimension  
     60   INTEGER ::   nn_nchunks_t = 1        !: number of chunks required in the t-dimension  
     61   LOGICAL ::   ln_nc4zip    = .TRUE.   !: netcdf4 usage: (T) chunk and compress output using the HDF5 sublayers of netcdf4 
     62   !                                    !                 (F) ignore chunking request and use the netcdf4 library  
     63   !                                    !                     to produce netcdf3-compatible files  
     64#endif 
     65!$AGRIF_DO_NOT_TREAT 
     66   TYPE(snc4_ctl)     :: snc4set        !: netcdf4 chunking control structure (always needed for decision making) 
     67!$AGRIF_END_DO_NOT_TREAT 
     68 
    4769 
    4870   !! conversion of DOCTOR norm namelist name into model name 
    4971   !! (this should disappear in a near futur) 
    5072 
    51    CHARACTER(len=16) ::   cexper                      !: experiment name used for output filename 
    52    INTEGER            ::   no                          !: job number 
    53    INTEGER            ::   nrstdt                      !: control of the time step (0, 1 or 2) 
    54    INTEGER            ::   nit000                      !: index of the first time step 
    55    INTEGER            ::   nitend                      !: index of the last time step 
    56    INTEGER            ::   ndate0                      !: initial calendar date aammjj 
    57    INTEGER            ::   nleapy                      !: Leap year calendar flag (0/1 or 30) 
    58    INTEGER            ::   ninist                      !: initial state output flag (0/1) 
    59    INTEGER            ::   nwrite                      !: model standard output frequency 
    60    INTEGER            ::   nstock                      !: restart file frequency 
     73   CHARACTER(lc) ::   cexper                      !: experiment name used for output filename 
     74   INTEGER       ::   no                          !: job number 
     75   INTEGER       ::   nrstdt                      !: control of the time step (0, 1 or 2) 
     76   INTEGER       ::   nit000                      !: index of the first time step 
     77   INTEGER       ::   nitend                      !: index of the last time step 
     78   INTEGER       ::   ndate0                      !: initial calendar date aammjj 
     79   INTEGER       ::   nleapy                      !: Leap year calendar flag (0/1 or 30) 
     80   INTEGER       ::   ninist                      !: initial state output flag (0/1) 
     81   INTEGER       ::   nwrite                      !: model standard output frequency 
     82   INTEGER       ::   nstock                      !: restart file frequency 
    6183 
    6284   !!---------------------------------------------------------------------- 
    6385   !! was in restart but moved here because of the OFF line... better solution should be found... 
    6486   !!---------------------------------------------------------------------- 
    65    INTEGER            ::   nitrst                 !: time step at which restart file should be written 
     87   INTEGER ::   nitrst   !: time step at which restart file should be written 
    6688 
    6789   !!---------------------------------------------------------------------- 
    6890   !!                    output monitoring 
    6991   !!---------------------------------------------------------------------- 
    70    LOGICAL            ::   ln_ctl     = .FALSE.   !: run control for debugging 
    71    INTEGER            ::   nn_print     =    0    !: level of print (0 no print) 
    72    INTEGER            ::   nn_ictls     =    0    !: Start i indice for the SUM control 
    73    INTEGER            ::   nn_ictle     =    0    !: End   i indice for the SUM control 
    74    INTEGER            ::   nn_jctls     =    0    !: Start j indice for the SUM control 
    75    INTEGER            ::   nn_jctle     =    0    !: End   j indice for the SUM control 
    76    INTEGER            ::   nn_isplt     =    1    !: number of processors following i 
    77    INTEGER            ::   nn_jsplt     =    1    !: number of processors following j 
    78    INTEGER            ::   nn_bench     =    0    !: benchmark parameter (0/1) 
    79    INTEGER            ::   nn_bit_cmp   =    0    !: bit reproducibility  (0/1) 
    80  
    81    !                                              !: OLD namelist names 
    82    INTEGER ::   nprint, nictls, nictle, njctls, njctle, isplt, jsplt, nbench, nbit_cmp    
    83  
    84    INTEGER            ::   ijsplt     =    1      !: nb of local domain = nb of processors 
     92   LOGICAL ::   ln_ctl     = .FALSE.   !: run control for debugging 
     93   INTEGER ::   nn_print     =    0    !: level of print (0 no print) 
     94   INTEGER ::   nn_ictls     =    0    !: Start i indice for the SUM control 
     95   INTEGER ::   nn_ictle     =    0    !: End   i indice for the SUM control 
     96   INTEGER ::   nn_jctls     =    0    !: Start j indice for the SUM control 
     97   INTEGER ::   nn_jctle     =    0    !: End   j indice for the SUM control 
     98   INTEGER ::   nn_isplt     =    1    !: number of processors following i 
     99   INTEGER ::   nn_jsplt     =    1    !: number of processors following j 
     100   INTEGER ::   nn_bench     =    0    !: benchmark parameter (0/1) 
     101   INTEGER ::   nn_bit_cmp   =    0    !: bit reproducibility  (0/1) 
     102 
     103   !                                           
     104   INTEGER ::   nprint, nictls, nictle, njctls, njctle, isplt, jsplt, nbench    !: OLD namelist names 
     105 
     106   INTEGER ::   ijsplt     =    1      !: nb of local domain = nb of processors 
    85107 
    86108   !!---------------------------------------------------------------------- 
    87109   !!                        logical units 
    88110   !!---------------------------------------------------------------------- 
    89    INTEGER            ::   numstp     =   -1      !: logical unit for time step 
    90    INTEGER            ::   numout     =    6      !: logical unit for output print 
    91    INTEGER            ::   numnam     =   -1      !: logical unit for namelist 
    92    INTEGER            ::   numnam_ice =   -1      !: logical unit for ice namelist 
    93    INTEGER            ::   numevo_ice =   -1      !: logical unit for ice variables (temp. evolution) 
    94    INTEGER            ::   numsol     =   -1      !: logical unit for solver statistics 
     111   INTEGER ::   numstp     =   -1      !: logical unit for time step 
     112   INTEGER ::   numout     =    6      !: logical unit for output print 
     113   INTEGER ::   numnam     =   -1      !: logical unit for namelist 
     114   INTEGER ::   numnam_ice =   -1      !: logical unit for ice namelist 
     115   INTEGER ::   numevo_ice =   -1      !: logical unit for ice variables (temp. evolution) 
     116   INTEGER ::   numsol     =   -1      !: logical unit for solver statistics 
    95117 
    96118   !!---------------------------------------------------------------------- 
    97119   !!                          Run control   
    98120   !!---------------------------------------------------------------------- 
    99    INTEGER            ::   nstop = 0                !: error flag (=number of reason for a premature stop run) 
    100    INTEGER            ::   nwarn = 0                !: warning flag (=number of warning found during the run) 
    101    CHARACTER(len=200) ::   ctmp1, ctmp2, ctmp3      !: temporary characters 1 to 3 
    102    CHARACTER(len=200) ::   ctmp4, ctmp5, ctmp6      !: temporary characters 4 to 6 
    103    CHARACTER(len=200) ::   ctmp7, ctmp8, ctmp9      !: temporary characters 7 to 9 
    104    CHARACTER(len=200) ::   ctmp10                   !: temporary character 10 
    105    CHARACTER (len=64) ::   cform_err = "(/,' ===>>> : E R R O R',     /,'         ===========',/)"       !: 
    106    CHARACTER (len=64) ::   cform_war = "(/,' ===>>> : W A R N I N G', /,'         ===============',/)"   !: 
    107    LOGICAL            ::   lwp      = .FALSE.       !: boolean : true on the 1st processor only 
    108    LOGICAL            ::   lsp_area = .TRUE.        !: to make a control print over a specific area 
    109    !!---------------------------------------------------------------------- 
    110    !! NEMO/OPA 3.0 , LOCEAN-IPSL (2008)  
     121   INTEGER       ::   nstop = 0             !: error flag (=number of reason for a premature stop run) 
     122   INTEGER       ::   nwarn = 0             !: warning flag (=number of warning found during the run) 
     123   CHARACTER(lc) ::   ctmp1, ctmp2, ctmp3   !: temporary characters 1 to 3 
     124   CHARACTER(lc) ::   ctmp4, ctmp5, ctmp6   !: temporary characters 4 to 6 
     125   CHARACTER(lc) ::   ctmp7, ctmp8, ctmp9   !: temporary characters 7 to 9 
     126   CHARACTER(lc) ::   ctmp10                !: temporary character 10 
     127   CHARACTER(lc) ::   cform_err = "(/,' ===>>> : E R R O R',     /,'         ===========',/)"       !: 
     128   CHARACTER(lc) ::   cform_war = "(/,' ===>>> : W A R N I N G', /,'         ===============',/)"   !: 
     129   LOGICAL       ::   lwp      = .FALSE.    !: boolean : true on the 1st processor only 
     130   LOGICAL       ::   lsp_area = .TRUE.     !: to make a control print over a specific area 
     131 
     132   !!---------------------------------------------------------------------- 
     133   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
    111134   !! $Id$ 
    112    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    113    !!---------------------------------------------------------------------- 
    114  
     135   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
     136   !!---------------------------------------------------------------------- 
    115137CONTAINS 
    116138 
     
    129151      nstop = nstop + 1  
    130152      IF(lwp) THEN 
    131          WRITE(numout,"(/,' ===>>> : E R R O R',     /,'         ===========',/)")  
     153         WRITE(numout,cform_err) 
    132154         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1 
    133155         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2 
     
    163185      nwarn = nwarn + 1  
    164186      IF(lwp) THEN 
    165          WRITE(numout,"(/,' ===>>> : W A R N I N G', /,'         ===============',/)")  
     187         WRITE(numout,cform_war) 
    166188         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1 
    167189         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2 
     
    180202 
    181203 
    182    SUBROUTINE ctl_opn ( knum, cdfile, cdstat, cdform, cdacce, klengh, kout, ldwp, karea ) 
     204   SUBROUTINE ctl_opn( knum, cdfile, cdstat, cdform, cdacce, klengh, kout, ldwp, karea ) 
    183205      !!---------------------------------------------------------------------- 
    184206      !!                  ***  ROUTINE ctl_opn  *** 
     
    187209      !! 
    188210      !! ** Method  :   Fortan open 
    189       !! 
    190       !! History : 
    191       !!        !  1995-12  (G. Madec)  Original code 
    192       !!   8.5  !  2002-06  (G. Madec)  F90: Free form and module 
    193       !!---------------------------------------------------------------------- 
    194  
     211      !!---------------------------------------------------------------------- 
    195212      INTEGER          , INTENT(  out) ::   knum      ! logical unit to open 
    196213      CHARACTER(len=*) , INTENT(in   ) ::   cdfile    ! file name to open 
     
    205222      CHARACTER(len=80) ::   clfile 
    206223      INTEGER           ::   iost 
     224      !!---------------------------------------------------------------------- 
    207225 
    208226      ! adapt filename 
Note: See TracChangeset for help on using the changeset viewer.