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 12377 for NEMO/trunk/src/OCE/IOM – NEMO

Ignore:
Timestamp:
2020-02-12T15:39:06+01:00 (4 years ago)
Author:
acc
Message:

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge --ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The --ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

Location:
NEMO/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r11615_ENHANCE-04_namelists_as_internalfiles_agrif@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
  • NEMO/trunk/src/OCE/IOM/in_out_manager.F90

    r11536 r12377  
    8787   LOGICAL ::   lrst_oce              !: logical to control the oce restart write  
    8888   LOGICAL ::   lrst_ice              !: logical to control the ice restart write  
     89   LOGICAL ::   lrst_abl              !: logical to control the abl restart write  
    8990   INTEGER ::   numror = 0            !: logical unit for ocean restart (read). Init to 0 is needed for SAS (in daymod.F90) 
    9091   INTEGER ::   numrir                !: logical unit for ice   restart (read) 
     92   INTEGER ::   numrar                !: logical unit for abl   restart (read) 
    9193   INTEGER ::   numrow                !: logical unit for ocean restart (write) 
    9294   INTEGER ::   numriw                !: logical unit for ice   restart (write) 
     95   INTEGER ::   numraw                !: logical unit for abl   restart (write) 
    9396   INTEGER ::   nrst_lst              !: number of restart to output next 
    9497 
     
    9699   !!                    output monitoring 
    97100   !!---------------------------------------------------------------------- 
    98    LOGICAL ::   ln_ctl           !: run control for debugging 
    99    TYPE :: sn_ctl                !: optional use structure for finer control over output selection 
     101   TYPE :: sn_ctl                !: structure for control over output selection 
     102      LOGICAL :: l_glochk  = .FALSE.  !: range sanity checks are local (F) or global (T) 
     103                                      !  Use global setting for debugging only; 
     104                                      !  local breaches will still be reported 
     105                                      !  and stop the code in most cases. 
     106      LOGICAL :: l_allon   = .FALSE.  !: overall control; activate all following output options 
    100107      LOGICAL :: l_config  = .FALSE.  !: activate/deactivate finer control 
    101                                       !  Note if l_config is True then ln_ctl is ignored. 
    102                                       !  Otherwise setting ln_ctl True is equivalent to setting 
    103                                       !  all the following logicals in this structure True 
     108                                      !  Note if l_config is True then sn_cfctl%l_allon is ignored. 
     109                                      !  Otherwise setting sn_cfctl%l_allon T/F is equivalent to  
     110                                      !  setting all the following logicals in this structure T/F 
     111                                      !  and disabling subsetting of processors 
    104112      LOGICAL :: l_runstat = .FALSE.  !: Produce/do not produce run.stat file (T/F) 
    105113      LOGICAL :: l_trcstat = .FALSE.  !: Produce/do not produce tracer.stat file (T/F) 
    106114      LOGICAL :: l_oceout  = .FALSE.  !: Produce all ocean.outputs    (T) or just one (F) 
    107115      LOGICAL :: l_layout  = .FALSE.  !: Produce all layout.dat files (T) or just one (F) 
    108       LOGICAL :: l_mppout  = .FALSE.  !: Produce/do not produce mpp.output_XXXX files (T/F) 
    109       LOGICAL :: l_mpptop  = .FALSE.  !: Produce/do not produce mpp.top.output_XXXX files (T/F) 
     116      LOGICAL :: l_prtctl  = .FALSE.  !: Produce/do not produce mpp.output_XXXX files (T/F) 
     117      LOGICAL :: l_prttrc  = .FALSE.  !: Produce/do not produce mpp.top.output_XXXX files (T/F) 
     118      LOGICAL :: l_oasout  = .FALSE.  !: Produce/do not write oasis setup info to ocean.output (T/F) 
    110119                                      !  Optional subsetting of processor report files 
    111120                                      !  Default settings of 0/1000000/1 should ensure all areas report. 
     
    139148   INTEGER ::   numnul          =   -1      !: logical unit for /dev/null 
    140149      !                                     !  early output can be collected; do not change 
    141    INTEGER ::   numnam_ref      =   -1      !: logical unit for reference namelist 
    142    INTEGER ::   numnam_cfg      =   -1      !: logical unit for configuration specific namelist 
    143150   INTEGER ::   numond          =   -1      !: logical unit for Output Namelist Dynamics 
    144    INTEGER ::   numnam_ice_ref  =   -1      !: logical unit for ice reference namelist 
    145    INTEGER ::   numnam_ice_cfg  =   -1      !: logical unit for ice reference namelist 
    146151   INTEGER ::   numoni          =   -1      !: logical unit for Output Namelist Ice 
    147152   INTEGER ::   numevo_ice      =   -1      !: logical unit for ice variables (temp. evolution) 
    148153   INTEGER ::   numrun          =   -1      !: logical unit for run statistics 
    149154   INTEGER ::   numdct_in       =   -1      !: logical unit for transports computing 
    150    INTEGER ::   numdct_vol      =   -1      !: logical unit for voulume transports output 
    151    INTEGER ::   numdct_heat     =   -1      !: logical unit for heat    transports output 
    152    INTEGER ::   numdct_salt     =   -1      !: logical unit for salt    transports output 
     155   INTEGER ::   numdct_vol      =   -1      !: logical unit for volume transports output 
     156   INTEGER ::   numdct_heat     =   -1      !: logical unit for heat   transports output 
     157   INTEGER ::   numdct_salt     =   -1      !: logical unit for salt   transports output 
    153158   INTEGER ::   numfl           =   -1      !: logical unit for floats ascii output 
    154159   INTEGER ::   numflo          =   -1      !: logical unit for floats ascii output 
     160      ! 
     161   CHARACTER(LEN=:), ALLOCATABLE :: numnam_ref      !: character buffer for reference namelist 
     162   CHARACTER(LEN=:), ALLOCATABLE :: numnam_cfg      !: character buffer for configuration specific namelist 
     163   CHARACTER(LEN=:), ALLOCATABLE :: numnam_ice_ref  !: character buffer for ice reference namelist 
     164   CHARACTER(LEN=:), ALLOCATABLE :: numnam_ice_cfg  !: character buffer for ice configuration specific namelist 
    155165 
    156166   !!---------------------------------------------------------------------- 
     
    165175   CHARACTER(lc) ::   ctmp10                !: temporary character 10 
    166176   LOGICAL       ::   lwm      = .FALSE.    !: boolean : true on the 1st processor only (always) 
    167    LOGICAL       ::   lwp      = .FALSE.    !: boolean : true on the 1st processor only .OR. ln_ctl 
     177   LOGICAL       ::   lwp      = .FALSE.    !: boolean : true on the 1st processor only .OR. sn_cfctl%l_oceout=T 
    168178   LOGICAL       ::   lsp_area = .TRUE.     !: to make a control print over a specific area 
    169179   CHARACTER(lc) ::   cxios_context         !: context name used in xios 
     
    171181   CHARACTER(lc) ::   cwxios_context        !: context name used in xios to write restart file 
    172182 
     183   !! * Substitutions 
     184#  include "do_loop_substitute.h90" 
    173185   !!---------------------------------------------------------------------- 
    174186   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
  • NEMO/trunk/src/OCE/IOM/iom.F90

    r12283 r12377  
    2929   USE lib_mpp           ! MPP library 
    3030#if defined key_iomput 
    31    USE sbc_oce  , ONLY :   nn_fsbc         ! ocean space and time domain 
    32    USE trc_oce  , ONLY :   nn_dttrc        !  !: frequency of step on passive tracers 
     31   USE sbc_oce  , ONLY :   nn_fsbc, ght_abl, ghw_abl, e3t_abl, e3w_abl, jpka, jpkam1 
    3332   USE icb_oce  , ONLY :   nclasses, class_num       !  !: iceberg classes 
    3433#if defined key_si3 
     
    4645#endif 
    4746   USE lib_fortran  
    48    USE diurnal_bulk, ONLY : ln_diurnal_only, ln_diurnal 
     47   USE diu_bulk, ONLY : ln_diurnal_only, ln_diurnal 
    4948 
    5049   IMPLICIT NONE 
     
    5655   LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .FALSE.       !: iom_put flag 
    5756#endif 
    58    PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_get_var 
     57   PUBLIC iom_init, iom_init_closedef, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_get_var 
    5958   PUBLIC iom_chkatt, iom_getatt, iom_putatt, iom_getszuld, iom_rstput, iom_delay_rst, iom_put 
    60    PUBLIC iom_use, iom_context_finalize, iom_miss_val 
     59   PUBLIC iom_use, iom_context_finalize, iom_update_file_name, iom_miss_val 
    6160 
    6261   PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d 
     
    6564#if defined key_iomput 
    6665   PRIVATE iom_set_domain_attr, iom_set_axis_attr, iom_set_field_attr, iom_set_file_attr, iom_get_file_attr, iom_set_grid_attr 
    67    PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_update_file_name, iom_sdate 
     66   PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_sdate 
    6867   PRIVATE iom_set_rst_context, iom_set_rstw_active, iom_set_rstr_active 
    6968# endif 
     
    8685   END INTERFACE iom_put 
    8786   
     87   !! * Substitutions 
     88#  include "do_loop_substitute.h90" 
    8889   !!---------------------------------------------------------------------- 
    8990   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    9394CONTAINS 
    9495 
    95    SUBROUTINE iom_init( cdname, fname, ld_tmppatch )  
     96   SUBROUTINE iom_init( cdname, fname, ld_tmppatch, ld_closedef )  
    9697      !!---------------------------------------------------------------------- 
    9798      !!                     ***  ROUTINE   *** 
     
    103104      CHARACTER(len=*), OPTIONAL, INTENT(in)  :: fname 
    104105      LOGICAL         , OPTIONAL, INTENT(in)  :: ld_tmppatch 
     106      LOGICAL         , OPTIONAL, INTENT(in)  :: ld_closedef 
    105107#if defined key_iomput 
    106108      ! 
     
    113115      ! 
    114116      REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zt_bnds, zw_bnds 
     117      REAL(wp), DIMENSION(2,jpkam1)         :: za_bnds   ! ABL vertical boundaries 
    115118      LOGICAL ::   ll_tmppatch = .TRUE.    !: seb: patch before we remove periodicity 
    116119      INTEGER ::   nldi_save, nlei_save    !:      and close boundaries in output files 
    117120      INTEGER ::   nldj_save, nlej_save    !: 
     121      LOGICAL ::   ll_closedef = .TRUE. 
    118122      !!---------------------------------------------------------------------- 
    119123      ! 
     
    130134         IF( njmpp + jpj - 1 == jpjglo ) nlej = jpj 
    131135      ENDIF 
     136      IF ( PRESENT(ld_closedef) ) ll_closedef = ld_closedef 
    132137      ! 
    133138      ALLOCATE( zt_bnds(2,jpk), zw_bnds(2,jpk) ) 
     
    200205      ! vertical grid definition 
    201206      IF(.NOT.llrst_context) THEN 
    202           CALL iom_set_axis_attr( "deptht",  paxis = gdept_1d ) 
    203           CALL iom_set_axis_attr( "depthu",  paxis = gdept_1d ) 
    204           CALL iom_set_axis_attr( "depthv",  paxis = gdept_1d ) 
    205           CALL iom_set_axis_attr( "depthw",  paxis = gdepw_1d ) 
    206  
     207          CALL iom_set_axis_attr(  "deptht", paxis = gdept_1d ) 
     208          CALL iom_set_axis_attr(  "depthu", paxis = gdept_1d ) 
     209          CALL iom_set_axis_attr(  "depthv", paxis = gdept_1d ) 
     210          CALL iom_set_axis_attr(  "depthw", paxis = gdepw_1d ) 
     211 
     212          ! ABL 
     213          IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios)  
     214             ALLOCATE( ght_abl(jpka), ghw_abl(jpka), e3t_abl(jpka), e3w_abl(jpka) )   ! default allocation needed by iom 
     215             ght_abl(:) = -1._wp   ;   ghw_abl(:) = -1._wp 
     216             e3t_abl(:) = -1._wp   ;   e3w_abl(:) = -1._wp 
     217          ENDIF 
     218          CALL iom_set_axis_attr( "ght_abl", ght_abl(2:jpka) ) 
     219          CALL iom_set_axis_attr( "ghw_abl", ghw_abl(2:jpka) ) 
     220           
    207221          ! Add vertical grid bounds 
    208222          jkmin = MIN(2,jpk)  ! in case jpk=1 (i.e. sas2D) 
     
    213227          zw_bnds(2,1:jpkm1  ) = gdepw_1d(jkmin:jpk) 
    214228          zw_bnds(2,jpk:     ) = gdepw_1d(jpk) + e3t_1d(jpk) 
    215           CALL iom_set_axis_attr( "deptht", bounds=zw_bnds ) 
    216           CALL iom_set_axis_attr( "depthu", bounds=zw_bnds ) 
    217           CALL iom_set_axis_attr( "depthv", bounds=zw_bnds ) 
    218           CALL iom_set_axis_attr( "depthw", bounds=zt_bnds ) 
     229          CALL iom_set_axis_attr(  "deptht", bounds=zw_bnds ) 
     230          CALL iom_set_axis_attr(  "depthu", bounds=zw_bnds ) 
     231          CALL iom_set_axis_attr(  "depthv", bounds=zw_bnds ) 
     232          CALL iom_set_axis_attr(  "depthw", bounds=zt_bnds ) 
     233 
     234          ! ABL 
     235          za_bnds(1,:) = ghw_abl(1:jpkam1) 
     236          za_bnds(2,:) = ghw_abl(2:jpka  ) 
     237          CALL iom_set_axis_attr( "ght_abl", bounds=za_bnds ) 
     238          za_bnds(1,:) = ght_abl(2:jpka  ) 
     239          za_bnds(2,:) = ght_abl(2:jpka  ) + e3w_abl(2:jpka) 
     240          CALL iom_set_axis_attr( "ghw_abl", bounds=za_bnds ) 
     241 
    219242          CALL iom_set_axis_attr( "nfloat", (/ (REAL(ji,wp), ji=1,jpnfl) /) ) 
    220243# if defined key_si3 
     
    250273      ENDIF 
    251274      ! 
    252       ! end file definition 
     275      ! set time step length 
    253276      dtime%second = rdt 
    254277      CALL xios_set_timestep( dtime ) 
    255       CALL xios_close_context_definition() 
    256       CALL xios_update_calendar( 0 ) 
     278      ! 
     279      ! conditional closure of context definition 
     280      IF ( ll_closedef ) CALL iom_init_closedef 
    257281      ! 
    258282      DEALLOCATE( zt_bnds, zw_bnds ) 
     
    265289      ! 
    266290   END SUBROUTINE iom_init 
     291 
     292   SUBROUTINE iom_init_closedef 
     293      !!---------------------------------------------------------------------- 
     294      !!            ***  SUBROUTINE iom_init_closedef  *** 
     295      !!---------------------------------------------------------------------- 
     296      !! 
     297      !! ** Purpose : Closure of context definition 
     298      !! 
     299      !!---------------------------------------------------------------------- 
     300 
     301#if defined key_iomput 
     302      CALL xios_close_context_definition() 
     303      CALL xios_update_calendar( 0 ) 
     304#else 
     305      IF( .FALSE. )   WRITE(numout,*) 'iom_init_closedef: should not see this'   ! useless statement to avoid compilation warnings 
     306#endif 
     307 
     308   END SUBROUTINE iom_init_closedef 
    267309 
    268310   SUBROUTINE iom_set_rstw_var_active(field) 
     
    382424        CALL iom_set_rstw_var_active('sshn') 
    383425        CALL iom_set_rstw_var_active('rhop') 
    384      ! extra variable needed for the ice sheet coupling 
    385         IF ( ln_iscpl ) THEN 
    386              CALL iom_set_rstw_var_active('tmask') 
    387              CALL iom_set_rstw_var_active('umask') 
    388              CALL iom_set_rstw_var_active('vmask') 
    389              CALL iom_set_rstw_var_active('smask') 
    390              CALL iom_set_rstw_var_active('e3t_n') 
    391              CALL iom_set_rstw_var_active('e3u_n') 
    392              CALL iom_set_rstw_var_active('e3v_n') 
    393              CALL iom_set_rstw_var_active('gdepw_n') 
    394         END IF 
    395426      ENDIF 
    396427      IF(ln_diurnal) CALL iom_set_rstw_var_active('Dsst') 
     
    701732      clname   = trim(cdname) 
    702733      IF ( .NOT. Agrif_Root() .AND. .NOT. lliof ) THEN 
    703 !FUS         iln    = INDEX(clname,'/')  
    704          iln    = INDEX(clname,'/',BACK=.true.)  ! FUS: to insert the nest index at the right location within the string, the last / has to be found (search from the right to left) 
     734         iln    = INDEX(clname,'/')  
    705735         cltmpn = clname(1:iln) 
    706736         clname = clname(iln+1:LEN_TRIM(clname)) 
     
    11491179            WRITE(cldmspc , fmt='(i1)') idmspc 
    11501180            ! 
    1151             IF(     idmspc <  irankpv ) THEN  
    1152                CALL ctl_stop( TRIM(clinfo), 'The file has only '//cldmspc//' spatial dimension',   & 
    1153                   &                         'it is impossible to read a '//clrankpv//'D array from this file...' ) 
    1154             ELSEIF( idmspc == irankpv ) THEN 
     1181            !!GS: we consider 2D data as 3D data with vertical dim size = 1 
     1182            !IF(     idmspc <  irankpv ) THEN  
     1183            !   CALL ctl_stop( TRIM(clinfo), 'The file has only '//cldmspc//' spatial dimension',   & 
     1184            !      &                         'it is impossible to read a '//clrankpv//'D array from this file...' ) 
     1185            !ELSEIF( idmspc == irankpv ) THEN 
     1186            IF( idmspc == irankpv ) THEN 
    11551187               IF( PRESENT(pv_r1d) .AND. idom /= jpdom_unknown )   & 
    11561188                  &   CALL ctl_stop( TRIM(clinfo), 'case not coded...You must use jpdom_unknown' ) 
     
    17321764 
    17331765   SUBROUTINE iom_p4d( cdname, pfield4d ) 
    1734       CHARACTER(LEN=*)                  , INTENT(in) ::   cdname 
     1766      CHARACTER(LEN=*)                , INTENT(in) ::   cdname 
    17351767      REAL(wp),       DIMENSION(:,:,:,:), INTENT(in) ::   pfield4d 
    17361768#if defined key_iomput 
     
    19742006      ! 
    19752007      INTEGER :: ji, jj, jn, ni, nj 
    1976       INTEGER :: icnr, jcnr                                    ! Offset such that the vertex coordinate (i+icnr,j+jcnr) 
    1977       !                                                        ! represents the bottom-left corner of cell (i,j) 
     2008      INTEGER :: icnr, jcnr                             ! Offset such that the vertex coordinate (i+icnr,j+jcnr) 
     2009      !                                                 ! represents the bottom-left corner of cell (i,j) 
    19782010      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: z_bnds      ! Lat/lon coordinates of the vertices of cell (i,j) 
    19792011      REAL(wp), ALLOCATABLE, DIMENSION(:,:)     :: z_fld       ! Working array to determine where to rotate cells 
     
    21452177      f_op%timestep = nn_fsbc  ;  f_of%timestep =  0  ; CALL iom_set_field_attr('SBC'             , freq_op=f_op, freq_offset=f_of) 
    21462178      f_op%timestep = nn_fsbc  ;  f_of%timestep =  0  ; CALL iom_set_field_attr('SBC_scalar'      , freq_op=f_op, freq_offset=f_of) 
    2147       f_op%timestep = nn_dttrc ;  f_of%timestep =  0  ; CALL iom_set_field_attr('ptrc_T'          , freq_op=f_op, freq_offset=f_of) 
    2148       f_op%timestep = nn_dttrc ;  f_of%timestep =  0  ; CALL iom_set_field_attr('diad_T'          , freq_op=f_op, freq_offset=f_of) 
     2179      f_op%timestep = nn_fsbc  ;  f_of%timestep =  0  ; CALL iom_set_field_attr('ABL'             , freq_op=f_op, freq_offset=f_of) 
    21492180 
    21502181      ! output file names (attribut: name) 
     
    22712302      CHARACTER(LEN=20)  ::   clfreq 
    22722303      CHARACTER(LEN=20)  ::   cldate 
    2273       CHARACTER(LEN=256) ::   cltmpn                 !FUS needed for correct path with AGRIF 
    2274       INTEGER            ::   iln                    !FUS needed for correct path with AGRIF 
    22752304      INTEGER            ::   idx 
    22762305      INTEGER            ::   jn 
     
    23552384            END DO 
    23562385            ! 
    2357 !FUS            IF( jn == 1 .AND. TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 
    2358 !FUS see comment line 700  
    2359             IF( jn == 1 .AND. TRIM(Agrif_CFixed()) /= '0' ) THEN 
    2360              iln    = INDEX(clname,'/',BACK=.true.) 
    2361              cltmpn = clname(1:iln) 
    2362              clname = clname(iln+1:LEN_TRIM(clname)) 
    2363              clname = TRIM(cltmpn)//TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
    2364             ENDIF 
    2365 !FUS  
     2386            IF( jn == 1 .AND. TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 
    23662387            IF( jn == 1 )   CALL iom_set_file_attr( cdid, name        = clname ) 
    23672388            IF( jn == 2 )   CALL iom_set_file_attr( cdid, name_suffix = clname ) 
     
    24422463   END SUBROUTINE iom_context_finalize 
    24432464 
     2465   SUBROUTINE iom_update_file_name( cdid ) 
     2466      CHARACTER(LEN=*), INTENT(in) ::   cdid 
     2467      IF( .FALSE. )   WRITE(numout,*)  cdid   ! useless test to avoid compilation warnings 
     2468   END SUBROUTINE iom_update_file_name 
     2469 
    24442470#endif 
    24452471 
     
    24612487#else 
    24622488      IF( .FALSE. )   WRITE(numout,*) cdname, pmiss_val   ! useless test to avoid compilation warnings 
     2489      IF( .FALSE. )   pmiss_val = 0._wp                   ! useless assignment to avoid compilation warnings 
    24632490#endif 
    24642491   END SUBROUTINE iom_miss_val 
  • NEMO/trunk/src/OCE/IOM/iom_def.F90

    r10425 r12377  
    7777   TYPE(RST_FIELD), PUBLIC, SAVE :: rst_wfields(max_rst_fields), rst_rfields(max_rst_fields) 
    7878   ! 
     79   !! * Substitutions 
     80#  include "do_loop_substitute.h90" 
    7981   !!---------------------------------------------------------------------- 
    8082   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
  • NEMO/trunk/src/OCE/IOM/iom_nf90.F90

    r11536 r12377  
    1919   !!---------------------------------------------------------------------- 
    2020   USE dom_oce         ! ocean space and time domain 
     21   USE sbc_oce, ONLY: jpka, ght_abl ! abl vertical level number and height 
    2122   USE lbclnk          ! lateal boundary condition / mpp exchanges 
    2223   USE iom_def         ! iom variables definitions 
     
    5657      LOGICAL                , INTENT(in   )           ::   ldok        ! check the existence  
    5758      INTEGER, DIMENSION(2,5), INTENT(in   ), OPTIONAL ::   kdompar     ! domain parameters:  
    58       INTEGER                , INTENT(in   ), OPTIONAL ::   kdlev       ! size of the third dimension 
     59      INTEGER                , INTENT(in   ), OPTIONAL ::   kdlev       ! size of the ice/abl third dimension 
    5960 
    6061      CHARACTER(LEN=256) ::   clinfo           ! info character 
     
    6970      INTEGER            ::   ihdf5            ! local variable for retrieval of value for NF90_HDF5 
    7071      LOGICAL            ::   llclobber        ! local definition of ln_clobber 
    71       INTEGER            ::   ilevels           ! vertical levels 
     72      INTEGER            ::   ilevels          ! vertical levels 
    7273      !--------------------------------------------------------------------- 
    7374      ! 
     
    7677      ! 
    7778      !                 !number of vertical levels 
    78       IF( PRESENT(kdlev) ) THEN   ;   ilevels = kdlev    ! use input value (useful for sea-ice) 
    79       ELSE                        ;   ilevels = jpk      ! by default jpk 
     79      IF( PRESENT(kdlev) )   THEN   ;   ilevels = kdlev    ! use input value (useful for sea-ice and abl) 
     80      ELSE                          ;   ilevels = jpk      ! by default jpk 
    8081      ENDIF 
    8182      ! 
     
    126127            CALL iom_nf90_check(NF90_DEF_DIM( if90id,            'x',   kdompar(1,1), idmy ), clinfo) 
    127128            CALL iom_nf90_check(NF90_DEF_DIM( if90id,            'y',   kdompar(2,1), idmy ), clinfo) 
    128             CALL iom_nf90_check(NF90_DEF_DIM( if90id,      'nav_lev',            jpk, idmy ), clinfo) 
    129             CALL iom_nf90_check(NF90_DEF_DIM( if90id, 'time_counter', NF90_UNLIMITED, idmy ), clinfo) 
    130             IF( PRESENT(kdlev) )   & 
    131                CALL iom_nf90_check(NF90_DEF_DIM( if90id,    'numcat',          kdlev, idmy ), clinfo) 
     129            IF( PRESENT(kdlev) ) THEN 
     130              IF( kdlev == jpka ) THEN 
     131                 CALL iom_nf90_check(NF90_DEF_DIM( if90id, 'nav_lev',          kdlev, idmy ), clinfo) 
     132                 CALL iom_nf90_check(NF90_DEF_DIM( if90id, 'time_counter', NF90_UNLIMITED, idmy ), clinfo) 
     133              ELSE 
     134                 CALL iom_nf90_check(NF90_DEF_DIM( if90id, 'nav_lev',            jpk, idmy ), clinfo) 
     135                 CALL iom_nf90_check(NF90_DEF_DIM( if90id, 'time_counter', NF90_UNLIMITED, idmy ), clinfo) 
     136                 CALL iom_nf90_check(NF90_DEF_DIM( if90id,  'numcat',          kdlev, idmy ), clinfo) 
     137              ENDIF 
     138            ELSE 
     139               CALL iom_nf90_check(NF90_DEF_DIM( if90id, 'nav_lev',            jpk, idmy ), clinfo) 
     140               CALL iom_nf90_check(NF90_DEF_DIM( if90id, 'time_counter', NF90_UNLIMITED, idmy ), clinfo) 
     141            ENDIF 
    132142            ! global attributes 
    133143            CALL iom_nf90_check(NF90_PUT_ATT( if90id, NF90_GLOBAL, 'DOMAIN_number_total'   , jpnij              ), clinfo) 
     
    196206      CHARACTER(len=*)     , INTENT(in   )           ::   cdvar    ! name of the variable 
    197207      INTEGER              , INTENT(in   )           ::   kiv   !  
    198       INTEGER, DIMENSION(:), INTENT(  out), OPTIONAL ::   kdimsz   ! size of the dimensions 
    199       INTEGER,               INTENT(  out), OPTIONAL ::   kndims   ! size of the dimensions 
     208      INTEGER, DIMENSION(:), INTENT(  out), OPTIONAL ::   kdimsz   ! size of each dimension 
     209      INTEGER              , INTENT(  out), OPTIONAL ::   kndims   ! number of dimensions 
    200210      LOGICAL              , INTENT(  out), OPTIONAL ::   lduld    ! true if the last dimension is unlimited (time) 
    201211      ! 
     
    584594         IF(     PRESENT(pv_r0d) ) THEN   ;   idims = 0 
    585595         ELSEIF( PRESENT(pv_r1d) ) THEN 
    586             IF( SIZE(pv_r1d,1) == jpk ) THEN   ;   idim3 = 3 
    587             ELSE                               ;   idim3 = 5 
     596            IF(( SIZE(pv_r1d,1) == jpk ).OR.( SIZE(pv_r1d,1) == jpka )) THEN   ;   idim3 = 3 
     597            ELSE                                                               ;   idim3 = 5 
    588598            ENDIF 
    589599                                              idims = 2   ;   idimid(1:idims) = (/idim3,4/) 
    590600         ELSEIF( PRESENT(pv_r2d) ) THEN   ;   idims = 3   ;   idimid(1:idims) = (/1,2  ,4/) 
    591601         ELSEIF( PRESENT(pv_r3d) ) THEN 
    592             IF( SIZE(pv_r3d,3) == jpk ) THEN   ;   idim3 = 3 
    593             ELSE                               ;   idim3 = 5 
     602            IF(( SIZE(pv_r3d,3) == jpk ).OR.( SIZE(pv_r3d,3) == jpka )) THEN   ;   idim3 = 3 
     603            ELSE                                                               ;   idim3 = 5 
    594604            ENDIF 
    595605                                              idims = 4   ;   idimid(1:idims) = (/1,2,idim3,4/) 
     
    674684               CALL iom_nf90_check( NF90_PUT_VAR  ( if90id, idmy, gphit(ix1:ix2, iy1:iy2) ), clinfo ) 
    675685               CALL iom_nf90_check( NF90_INQ_VARID( if90id, 'nav_lev'     , idmy ), clinfo ) 
    676                CALL iom_nf90_check( NF90_PUT_VAR  ( if90id, idmy, gdept_1d       ), clinfo ) 
     686               IF (iom_file(kiomid)%nlev == jpka) THEN   ;   CALL iom_nf90_check( NF90_PUT_VAR  ( if90id, idmy,  ght_abl), clinfo ) 
     687               ELSE                                      ;   CALL iom_nf90_check( NF90_PUT_VAR  ( if90id, idmy, gdept_1d), clinfo ) 
     688               ENDIF 
    677689               IF( NF90_INQ_VARID( if90id, 'numcat', idmy ) == nf90_noerr ) THEN 
    678690                  CALL iom_nf90_check( NF90_PUT_VAR  ( if90id, idmy, (/ (idlv, idlv = 1,iom_file(kiomid)%nlev) /)), clinfo ) 
  • NEMO/trunk/src/OCE/IOM/prtctl.F90

    r10068 r12377  
    5050      !!                debugging a new parametrization in mono or mpp.  
    5151      !! 
    52       !! ** Method  : 2 possibilities exist when setting the ln_ctl parameter to 
     52      !! ** Method  : 2 possibilities exist when setting the sn_cfctl%prtctl parameter to 
    5353      !!                .true. in the ocean namelist: 
    5454      !!              - to debug a MPI run .vs. a mono-processor one;  
     
    6464      !!                name must be explicitly typed if used. For instance if the 3D 
    6565      !!                array tn(:,:,:) must be passed through the prt_ctl subroutine,  
    66       !!                it must looks like: CALL prt_ctl(tab3d_1=tn). 
     66      !!                it must look like: CALL prt_ctl(tab3d_1=tn). 
    6767      !! 
    6868      !!                    tab2d_1 : first 2D array 
  • NEMO/trunk/src/OCE/IOM/restart.F90

    r11536 r12377  
    2727   USE in_out_manager  ! I/O manager 
    2828   USE iom             ! I/O module 
    29    USE diurnal_bulk 
     29   USE diu_bulk 
    3030   USE lib_mpp         ! distribued memory computing library 
    3131 
     
    3838   PUBLIC   rst_read_open   ! routine called in rst_read and (possibly) in dom_vvl_init 
    3939 
    40    !! * Substitutions 
    41 #  include "vectopt_loop_substitute.h90" 
    4240   !!---------------------------------------------------------------------- 
    4341   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    133131 
    134132 
    135    SUBROUTINE rst_write( kt ) 
     133   SUBROUTINE rst_write( kt, Kbb, Kmm ) 
    136134      !!--------------------------------------------------------------------- 
    137135      !!                   ***  ROUTINE rstwrite  *** 
     
    142140      !!              file, save fields which are necessary for restart 
    143141      !!---------------------------------------------------------------------- 
    144       INTEGER, INTENT(in) ::   kt   ! ocean time-step 
     142      INTEGER, INTENT(in) ::   kt         ! ocean time-step 
     143      INTEGER, INTENT(in) ::   Kbb, Kmm   ! ocean time level indices 
    145144      !!---------------------------------------------------------------------- 
    146145                     IF(lwxios) CALL iom_swap(      cwxios_context          ) 
     
    149148 
    150149      IF ( .NOT. ln_diurnal_only ) THEN 
    151                      CALL iom_rstput( kt, nitrst, numrow, 'ub'     , ub, ldxios = lwxios        )     ! before fields 
    152                      CALL iom_rstput( kt, nitrst, numrow, 'vb'     , vb, ldxios = lwxios        ) 
    153                      CALL iom_rstput( kt, nitrst, numrow, 'tb'     , tsb(:,:,:,jp_tem), ldxios = lwxios ) 
    154                      CALL iom_rstput( kt, nitrst, numrow, 'sb'     , tsb(:,:,:,jp_sal), ldxios = lwxios ) 
    155                      CALL iom_rstput( kt, nitrst, numrow, 'sshb'   , sshb, ldxios = lwxios      ) 
     150                     CALL iom_rstput( kt, nitrst, numrow, 'ub'     , uu(:,:,:       ,Kbb), ldxios = lwxios        )     ! before fields 
     151                     CALL iom_rstput( kt, nitrst, numrow, 'vb'     , vv(:,:,:       ,Kbb), ldxios = lwxios        ) 
     152                     CALL iom_rstput( kt, nitrst, numrow, 'tb'     , ts(:,:,:,jp_tem,Kbb), ldxios = lwxios ) 
     153                     CALL iom_rstput( kt, nitrst, numrow, 'sb'     , ts(:,:,:,jp_sal,Kbb), ldxios = lwxios ) 
     154                     CALL iom_rstput( kt, nitrst, numrow, 'sshb'   ,ssh(:,:         ,Kbb), ldxios = lwxios      ) 
    156155                     ! 
    157                      CALL iom_rstput( kt, nitrst, numrow, 'un'     , un, ldxios = lwxios        )     ! now fields 
    158                      CALL iom_rstput( kt, nitrst, numrow, 'vn'     , vn, ldxios = lwxios        ) 
    159                      CALL iom_rstput( kt, nitrst, numrow, 'tn'     , tsn(:,:,:,jp_tem), ldxios = lwxios ) 
    160                      CALL iom_rstput( kt, nitrst, numrow, 'sn'     , tsn(:,:,:,jp_sal), ldxios = lwxios ) 
    161                      CALL iom_rstput( kt, nitrst, numrow, 'sshn'   , sshn, ldxios = lwxios      ) 
     156                     CALL iom_rstput( kt, nitrst, numrow, 'un'     , uu(:,:,:       ,Kmm), ldxios = lwxios        )     ! now fields 
     157                     CALL iom_rstput( kt, nitrst, numrow, 'vn'     , vv(:,:,:       ,Kmm), ldxios = lwxios        ) 
     158                     CALL iom_rstput( kt, nitrst, numrow, 'tn'     , ts(:,:,:,jp_tem,Kmm), ldxios = lwxios ) 
     159                     CALL iom_rstput( kt, nitrst, numrow, 'sn'     , ts(:,:,:,jp_sal,Kmm), ldxios = lwxios ) 
     160                     CALL iom_rstput( kt, nitrst, numrow, 'sshn'   ,ssh(:,:         ,Kmm), ldxios = lwxios      ) 
    162161                     CALL iom_rstput( kt, nitrst, numrow, 'rhop'   , rhop, ldxios = lwxios      ) 
    163                   ! extra variable needed for the ice sheet coupling 
    164                   IF ( ln_iscpl ) THEN  
    165                      CALL iom_rstput( kt, nitrst, numrow, 'tmask'  , tmask, ldxios = lwxios ) ! need to extrapolate T/S 
    166                      CALL iom_rstput( kt, nitrst, numrow, 'umask'  , umask, ldxios = lwxios ) ! need to correct barotropic velocity 
    167                      CALL iom_rstput( kt, nitrst, numrow, 'vmask'  , vmask, ldxios = lwxios ) ! need to correct barotropic velocity 
    168                      CALL iom_rstput( kt, nitrst, numrow, 'smask'  , ssmask, ldxios = lwxios) ! need to correct barotropic velocity 
    169                      CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:), ldxios = lwxios )   ! need to compute temperature correction 
    170                      CALL iom_rstput( kt, nitrst, numrow, 'e3u_n', e3u_n(:,:,:), ldxios = lwxios )   ! need to compute bt conservation 
    171                      CALL iom_rstput( kt, nitrst, numrow, 'e3v_n', e3v_n(:,:,:), ldxios = lwxios )   ! need to compute bt conservation 
    172                      CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', gdepw_n(:,:,:), ldxios = lwxios ) ! need to compute extrapolation if vvl 
    173                   END IF 
    174162      ENDIF 
    175163       
     
    240228 
    241229 
    242    SUBROUTINE rst_read 
     230   SUBROUTINE rst_read( Kbb, Kmm ) 
    243231      !!----------------------------------------------------------------------  
    244232      !!                   ***  ROUTINE rst_read  *** 
     
    248236      !! ** Method  :   Read in restart.nc file fields which are necessary for restart 
    249237      !!---------------------------------------------------------------------- 
     238      INTEGER, INTENT(in) ::   Kbb, Kmm   ! ocean time level indices 
    250239      REAL(wp) ::   zrdt 
    251240      INTEGER  ::   jk 
     
    270259         rhop = rau0 
    271260         CALL iom_get( numror, jpdom_autoglo, 'tn'     , w3d, ldxios = lrxios )  
    272          tsn(:,:,1,jp_tem) = w3d(:,:,1) 
     261         ts(:,:,1,jp_tem,Kmm) = w3d(:,:,1) 
    273262         RETURN  
    274263      ENDIF   
    275264       
    276265      IF( iom_varid( numror, 'ub', ldstop = .FALSE. ) > 0 ) THEN 
    277          CALL iom_get( numror, jpdom_autoglo, 'ub'     , ub, ldxios = lrxios                )   ! before fields 
    278          CALL iom_get( numror, jpdom_autoglo, 'vb'     , vb, ldxios = lrxios                ) 
    279          CALL iom_get( numror, jpdom_autoglo, 'tb'     , tsb(:,:,:,jp_tem), ldxios = lrxios ) 
    280          CALL iom_get( numror, jpdom_autoglo, 'sb'     , tsb(:,:,:,jp_sal), ldxios = lrxios ) 
    281          CALL iom_get( numror, jpdom_autoglo, 'sshb'   , sshb, ldxios = lrxios              ) 
     266         CALL iom_get( numror, jpdom_autoglo, 'ub'     , uu(:,:,:       ,Kbb), ldxios = lrxios )   ! before fields 
     267         CALL iom_get( numror, jpdom_autoglo, 'vb'     , vv(:,:,:       ,Kbb), ldxios = lrxios ) 
     268         CALL iom_get( numror, jpdom_autoglo, 'tb'     , ts(:,:,:,jp_tem,Kbb), ldxios = lrxios ) 
     269         CALL iom_get( numror, jpdom_autoglo, 'sb'     , ts(:,:,:,jp_sal,Kbb), ldxios = lrxios ) 
     270         CALL iom_get( numror, jpdom_autoglo, 'sshb'   ,ssh(:,:         ,Kbb), ldxios = lrxios ) 
    282271      ELSE 
    283272         neuler = 0 
    284273      ENDIF 
    285274      ! 
    286       CALL iom_get( numror, jpdom_autoglo, 'un'     , un, ldxios = lrxios )   ! now    fields 
    287       CALL iom_get( numror, jpdom_autoglo, 'vn'     , vn, ldxios = lrxios ) 
    288       CALL iom_get( numror, jpdom_autoglo, 'tn'     , tsn(:,:,:,jp_tem), ldxios = lrxios ) 
    289       CALL iom_get( numror, jpdom_autoglo, 'sn'     , tsn(:,:,:,jp_sal), ldxios = lrxios ) 
    290       CALL iom_get( numror, jpdom_autoglo, 'sshn'   , sshn, ldxios = lrxios ) 
     275      CALL iom_get( numror, jpdom_autoglo, 'un'     , uu(:,:,:       ,Kmm), ldxios = lrxios )       ! now    fields 
     276      CALL iom_get( numror, jpdom_autoglo, 'vn'     , vv(:,:,:       ,Kmm), ldxios = lrxios ) 
     277      CALL iom_get( numror, jpdom_autoglo, 'tn'     , ts(:,:,:,jp_tem,Kmm), ldxios = lrxios ) 
     278      CALL iom_get( numror, jpdom_autoglo, 'sn'     , ts(:,:,:,jp_sal,Kmm), ldxios = lrxios ) 
     279      CALL iom_get( numror, jpdom_autoglo, 'sshn'   ,ssh(:,:         ,Kmm), ldxios = lrxios ) 
    291280      IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN 
    292281         CALL iom_get( numror, jpdom_autoglo, 'rhop'   , rhop, ldxios = lrxios )   ! now    potential density 
    293282      ELSE 
    294          CALL eos( tsn, rhd, rhop, gdept_n(:,:,:) )    
     283         CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) )    
    295284      ENDIF 
    296285      ! 
    297286      IF( neuler == 0 ) THEN                                  ! Euler restart (neuler=0) 
    298          tsb  (:,:,:,:) = tsn  (:,:,:,:)                             ! all before fields set to now values 
    299          ub   (:,:,:)   = un   (:,:,:) 
    300          vb   (:,:,:)   = vn   (:,:,:) 
    301          sshb (:,:)     = sshn (:,:) 
     287         ts   (:,:,:,:,Kbb) = ts   (:,:,:,:,Kmm)              ! all before fields set to now values 
     288         uu   (:,:,:  ,Kbb) = uu   (:,:,:  ,Kmm) 
     289         vv   (:,:,:  ,Kbb) = vv   (:,:,:  ,Kmm) 
     290         ssh  (:,:    ,Kbb) = ssh  (:,:    ,Kmm) 
    302291         ! 
    303292         IF( .NOT.ln_linssh ) THEN 
    304293            DO jk = 1, jpk 
    305                e3t_b(:,:,jk) = e3t_n(:,:,jk) 
     294               e3t(:,:,jk,Kbb) = e3t(:,:,jk,Kmm) 
    306295            END DO 
    307296         ENDIF 
Note: See TracChangeset for help on using the changeset viewer.