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 14072 for NEMO/trunk/src/OCE/IOM/iom.F90 – NEMO

Ignore:
Timestamp:
2020-12-04T08:48:38+01:00 (3 years ago)
Author:
laurent
Message:

Merging branch "2020/dev_r13648_ASINTER-04_laurent_bulk_ice", ticket #2369

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/IOM/iom.F90

    r14068 r14072  
    77   !!            2.0  ! 2006-02  (S. Masson) Adaptation to NEMO 
    88   !!            3.0  ! 2007-07  (D. Storkey) Changes to iom_gettime 
    9    !!            3.4  ! 2012-12  (R. Bourdalle-Badie and G. Reffray)  add C1D case   
     9   !!            3.4  ! 2012-12  (R. Bourdalle-Badie and G. Reffray)  add C1D case 
    1010   !!            3.6  ! 2014-15  DIMG format removed 
    1111   !!            3.6  ! 2015-15  (J. Harle) Added procedure to read REAL attributes 
     
    2121   !!---------------------------------------------------------------------- 
    2222   USE dom_oce         ! ocean space and time domain 
    23    USE domutl          !  
     23   USE domutl          ! 
    2424   USE c1d             ! 1D vertical configuration 
    2525   USE flo_oce         ! floats module declarations 
     
    4444   USE trc, ONLY    :  profsed 
    4545#endif 
    46    USE lib_fortran  
     46   USE lib_fortran 
    4747   USE diu_bulk, ONLY : ln_diurnal_only, ln_diurnal 
    4848   USE iom_nf90 
     
    5151   IMPLICIT NONE 
    5252   PUBLIC   !   must be public to be able to access iom_def through iom 
    53     
     53 
    5454#if defined key_iomput 
    5555   LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .TRUE.        !: iom_put flag 
     
    9595      MODULE PROCEDURE iom_p0d_dp, iom_p1d_dp, iom_p2d_dp, iom_p3d_dp, iom_p4d_dp 
    9696   END INTERFACE iom_put 
    97    
     97 
    9898   !! * Substitutions 
    9999#  include "do_loop_substitute.h90" 
     
    105105CONTAINS 
    106106 
    107    SUBROUTINE iom_init( cdname, kdid, ld_closedef )  
     107   SUBROUTINE iom_init( cdname, kdid, ld_closedef ) 
    108108      !!---------------------------------------------------------------------- 
    109109      !!                     ***  ROUTINE   *** 
    110110      !! 
    111       !! ** Purpose :    
     111      !! ** Purpose : 
    112112      !! 
    113113      !!---------------------------------------------------------------------- 
    114114      CHARACTER(len=*),           INTENT(in)  :: cdname 
    115       INTEGER         , OPTIONAL, INTENT(in)  :: kdid           
     115      INTEGER         , OPTIONAL, INTENT(in)  :: kdid 
    116116      LOGICAL         , OPTIONAL, INTENT(in)  :: ld_closedef 
    117117#if defined key_iomput 
     
    123123      INTEGER           :: ji 
    124124      LOGICAL           :: llrst_context              ! is context related to restart 
    125       LOGICAL           :: llrstr, llrstw  
     125      LOGICAL           :: llrstr, llrstw 
    126126      INTEGER           :: inum 
    127127      ! 
     
    152152      llrst_context = llrstr .OR. llrstw 
    153153 
    154       ! Calendar type is now defined in xml file  
     154      ! Calendar type is now defined in xml file 
    155155      IF (.NOT.(xios_getvar('ref_year' ,irefyear ))) irefyear  = 1900 
    156156      IF (.NOT.(xios_getvar('ref_month',irefmonth))) irefmonth = 01 
     
    169169      IF(.NOT.llrst_context) CALL set_scalar 
    170170      ! 
    171       IF( cdname == cxios_context ) THEN   
    172          CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. )  
     171      IF( cdname == cxios_context ) THEN 
     172         CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. ) 
    173173         CALL set_grid( "U", glamu, gphiu, .FALSE., .FALSE. ) 
    174174         CALL set_grid( "V", glamv, gphiv, .FALSE., .FALSE. ) 
     
    191191      ENDIF 
    192192      ! 
    193       IF( TRIM(cdname) == TRIM(cxios_context)//"_crs" ) THEN   
     193      IF( TRIM(cdname) == TRIM(cxios_context)//"_crs" ) THEN 
    194194         CALL dom_grid_crs   ! Save the parent grid information  & Switch to coarse grid domain 
    195195         ! 
     
    223223 
    224224          ! ABL 
    225          IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios)  
     225         IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios) 
    226226            ALLOCATE( ght_abl(jpka), ghw_abl(jpka), e3t_abl(jpka), e3w_abl(jpka) )   ! default allocation needed by iom 
    227227            ght_abl(:) = -1._wp   ;   ghw_abl(:) = -1._wp 
     
    230230         CALL iom_set_axis_attr( "ght_abl", ght_abl(2:jpka) ) 
    231231         CALL iom_set_axis_attr( "ghw_abl", ghw_abl(2:jpka) ) 
    232            
     232 
    233233         ! Add vertical grid bounds 
    234234         zt_bnds(2,:      ) = gdept_1d(:) 
     
    338338      !! 
    339339      !! ** Purpose :  define filename in XIOS context for reading file, 
    340       !!               enable variables present in a file for reading with XIOS  
     340      !!               enable variables present in a file for reading with XIOS 
    341341      !!               id of the file is assumed to be rrestart. 
    342342      !!--------------------------------------------------------------------- 
    343       INTEGER, INTENT(IN) :: idnum  
    344        
     343      INTEGER, INTENT(IN) :: idnum 
     344 
    345345#if defined key_iomput 
    346346      INTEGER                                    :: ndims, nvars, natts, unlimitedDimId, dimlen, xtype,mdims 
     
    423423               CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname,  & 
    424424                                   domain_ref="grid_N", prec = 8,                & 
    425                                    operation = "instant"                         )  
     425                                   operation = "instant"                         ) 
    426426            ELSEIF(mdims == 1) THEN 
    427427               CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname, & 
     
    433433                                   operation = "instant"                        ) 
    434434            ELSE 
    435                WRITE(ctmp1,*) 'iom_set_vars_active: variable ', TRIM(varname) ,' incorrect number of dimensions'  
     435               WRITE(ctmp1,*) 'iom_set_vars_active: variable ', TRIM(varname) ,' incorrect number of dimensions' 
    436436               CALL ctl_stop( 'iom_set_vars_active:', ctmp1 ) 
    437437            ENDIF 
     
    457457      CALL xios_get_handle("file_definition", filegroup_hdl ) 
    458458      CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart') 
    459       IF(nxioso.eq.1) THEN  
    460          CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,&  
    461                                        mode="write", output_freq=xios_timestep)  
    462          IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode'  
    463       ELSE   
    464          CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,&  
    465                                             mode="write", output_freq=xios_timestep)  
    466          IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode'  
    467       ENDIF  
     459      IF(nxioso.eq.1) THEN 
     460         CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 
     461                                       mode="write", output_freq=xios_timestep) 
     462         IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 
     463      ELSE 
     464         CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 
     465                                            mode="write", output_freq=xios_timestep) 
     466         IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 
     467      ENDIF 
    468468      CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file)) 
    469469#endif 
     
    486486      REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :)    :: rd2 
    487487      REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:, :)    :: rs2 
    488       REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rd3   
     488      REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rd3 
    489489      REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rs3 
    490490#if defined key_iomput 
     
    509509         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 
    510510                             domain_ref = "grid_N", prec = 8,             & 
    511                              operation = "instant"                        )  
     511                             operation = "instant"                        ) 
    512512      ELSEIF(PRESENT(rs2)) THEN 
    513513         CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 
     
    540540      !! ** Purpose : Used for grid definition when XIOS is used to read/write 
    541541      !!              restart. Returns axis corresponding to the number of levels 
    542       !!              given as an input variable. Axes are defined in routine  
     542      !!              given as an input variable. Axes are defined in routine 
    543543      !!              iom_set_rst_context 
    544544      !!--------------------------------------------------------------------- 
     
    551551      ELSEIF(idlev == jpl) THEN 
    552552         axis_ref="numcat" 
    553 #endif          
     553#endif 
    554554      ELSE 
    555555         write(str, *) idlev 
     
    562562      !!                   ***  FUNCTION    *** 
    563563      !! 
    564       !! ** Purpose : this function returns first available id to keep information about file  
     564      !! ** Purpose : this function returns first available id to keep information about file 
    565565      !!              sets filename in iom_file structure and sets name 
    566566      !!              of XIOS context depending on cdcomp 
     
    583583   END FUNCTION iom_xios_setid 
    584584 
    585    SUBROUTINE iom_set_rst_context(ld_rstr)  
     585   SUBROUTINE iom_set_rst_context(ld_rstr) 
    586586      !!--------------------------------------------------------------------- 
    587587      !!                   ***  SUBROUTINE  iom_set_rst_context  *** 
    588588      !! 
    589       !! ** Purpose : Define domain, axis and grid for restart (read/write)  
    590       !!              context  
    591       !!                
     589      !! ** Purpose : Define domain, axis and grid for restart (read/write) 
     590      !!              context 
     591      !! 
    592592      !!--------------------------------------------------------------------- 
    593593      LOGICAL, INTENT(IN)               :: ld_rstr 
    594594      INTEGER :: ji 
    595595#if defined key_iomput 
    596       TYPE(xios_domaingroup)            :: domaingroup_hdl  
    597       TYPE(xios_domain)                 :: domain_hdl  
    598       TYPE(xios_axisgroup)              :: axisgroup_hdl  
    599       TYPE(xios_axis)                   :: axis_hdl  
    600       TYPE(xios_scalar)                 :: scalar_hdl  
    601       TYPE(xios_scalargroup)            :: scalargroup_hdl  
    602  
    603       CALL xios_get_handle("domain_definition",domaingroup_hdl)  
    604       CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N")  
    605       CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr)  
    606   
    607       CALL xios_get_handle("axis_definition",axisgroup_hdl)  
    608       CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev")  
     596      TYPE(xios_domaingroup)            :: domaingroup_hdl 
     597      TYPE(xios_domain)                 :: domain_hdl 
     598      TYPE(xios_axisgroup)              :: axisgroup_hdl 
     599      TYPE(xios_axis)                   :: axis_hdl 
     600      TYPE(xios_scalar)                 :: scalar_hdl 
     601      TYPE(xios_scalargroup)            :: scalargroup_hdl 
     602 
     603      CALL xios_get_handle("domain_definition",domaingroup_hdl) 
     604      CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N") 
     605      CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr) 
     606 
     607      CALL xios_get_handle("axis_definition",axisgroup_hdl) 
     608      CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev") 
    609609!AGRIF fails to compile when unit= is in call to xios_set_axis_attr 
    610 !     CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down")  
     610!     CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down") 
    611611      CALL xios_set_axis_attr( "nav_lev", long_name = "Vertical levels in meters", positive = "down") 
    612       CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d )  
     612      CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d ) 
    613613#if defined key_si3 
    614614      CALL xios_add_child(axisgroup_hdl, axis_hdl, "numcat") 
    615615      CALL iom_set_axis_attr( "numcat", (/ (REAL(ji,wp), ji=1,jpl) /) ) 
    616616#endif 
    617       CALL xios_get_handle("scalar_definition", scalargroup_hdl)  
    618       CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar")  
     617      CALL xios_get_handle("scalar_definition", scalargroup_hdl) 
     618      CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") 
    619619#endif 
    620620   END SUBROUTINE iom_set_rst_context 
    621621 
    622622 
    623    SUBROUTINE set_xios_context(kdid, cdcont)  
     623   SUBROUTINE set_xios_context(kdid, cdcont) 
    624624      !!--------------------------------------------------------------------- 
    625625      !!                   ***  SUBROUTINE  iom_set_rst_context  *** 
    626626      !! 
    627627      !! ** Purpose : set correct XIOS context based on kdid 
    628       !!                
     628      !! 
    629629      !!--------------------------------------------------------------------- 
    630630      INTEGER,           INTENT(IN)     :: kdid           ! Identifier of the file 
    631631      CHARACTER(LEN=lc), INTENT(OUT)    :: cdcont         ! name of the context for XIOS read/write 
    632        
     632 
    633633      cdcont = "NONE" 
    634634 
     
    637637            cdcont = cr_ocerst_cxt 
    638638         ELSEIF(kdid == numrir) THEN 
    639             cdcont = cr_icerst_cxt  
     639            cdcont = cr_icerst_cxt 
    640640         ELSEIF(kdid == numrtr) THEN 
    641641            cdcont = cr_toprst_cxt 
     
    696696      CHARACTER(LEN=256)    ::   clname    ! the name of the file based on cdname [[+clcpu]+clcpu] 
    697697      CHARACTER(LEN=256)    ::   cltmpn    ! tempory name to store clname (in writting mode) 
    698       CHARACTER(LEN=10)     ::   clsuffix  ! ".nc"  
     698      CHARACTER(LEN=10)     ::   clsuffix  ! ".nc" 
    699699      CHARACTER(LEN=15)     ::   clcpu     ! the cpu number (max jpmax_digits digits) 
    700700      CHARACTER(LEN=256)    ::   clinfo    ! info character 
    701       LOGICAL               ::   llok      ! check the existence  
     701      LOGICAL               ::   llok      ! check the existence 
    702702      LOGICAL               ::   llwrt     ! local definition of ldwrt 
    703703      LOGICAL               ::   llstop    ! local definition of ldstop 
     
    705705      INTEGER               ::   icnt      ! counter for digits in clcpu (max = jpmax_digits) 
    706706      INTEGER               ::   iln, ils  ! lengths of character 
    707       INTEGER               ::   istop     !  
     707      INTEGER               ::   istop     ! 
    708708      ! local number of points for x,y dimensions 
    709709      ! position of first local point for x,y dimensions 
     
    741741      clname   = trim(cdname) 
    742742      IF ( .NOT. Agrif_Root() .AND. .NOT. lliof ) THEN 
    743          iln    = INDEX(clname,'/')  
     743         iln    = INDEX(clname,'/') 
    744744         cltmpn = clname(1:iln) 
    745745         clname = clname(iln+1:LEN_TRIM(clname)) 
     
    765765         clname = clname(1:iln-1)//'_'//TRIM(clcpu)//TRIM(clsuffix) 
    766766         icnt = 0 
    767          INQUIRE( FILE = clname, EXIST = llok )  
     767         INQUIRE( FILE = clname, EXIST = llok ) 
    768768         ! we try different formats for the cpu number by adding 0 
    769769         DO WHILE( .NOT.llok .AND. icnt < jpmax_digits ) 
     
    783783      ! if no file was found... 
    784784      IF( .NOT. llok ) THEN 
    785          IF( .NOT. llwrt ) THEN   ! we are in read mode  
     785         IF( .NOT. llwrt ) THEN   ! we are in read mode 
    786786            IF( llstop ) THEN   ;   CALL ctl_stop( TRIM(clinfo), 'File '//TRIM(cltmpn)//'* not found' ) 
    787787            ELSE                ;   istop = nstop + 1   ! make sure that istop /= nstop so we don't open the file 
    788788            ENDIF 
    789          ELSE                     ! we are in write mode so we  
     789         ELSE                     ! we are in write mode so we 
    790790            clname = cltmpn       ! get back the file name without the cpu number 
    791791         ENDIF 
    792792      ELSE 
    793          IF( llwrt .AND. .NOT. ln_clobber ) THEN   ! we stop as we want to write in a new file  
     793         IF( llwrt .AND. .NOT. ln_clobber ) THEN   ! we stop as we want to write in a new file 
    794794            CALL ctl_stop( TRIM(clinfo), 'We want to write in a new file but '//TRIM(clname)//' already exists...' ) 
    795795            istop = nstop + 1                      ! make sure that istop /= nstop so we don't open the file 
    796          ELSEIF( llwrt ) THEN     ! the file exists and we are in write mode with permission to  
     796         ELSEIF( llwrt ) THEN     ! the file exists and we are in write mode with permission to 
    797797            clname = cltmpn       ! overwrite so get back the file name without the cpu number 
    798798         ENDIF 
     
    835835            IF( iom_file(jf)%nfid > 0 ) THEN 
    836836               CALL iom_nf90_close( jf ) 
    837                iom_file(jf)%nfid       = 0          ! free the id  
     837               iom_file(jf)%nfid       = 0          ! free the id 
    838838               IF( PRESENT(kiomid) )   kiomid = 0   ! return 0 as id to specify that the file was closed 
    839839               IF(lwp) WRITE(numout,*) TRIM(clinfo)//' close file: '//TRIM(iom_file(jf)%name)//' ok' 
     
    844844         END DO 
    845845      ENDIF 
    846       !     
     846      ! 
    847847   END SUBROUTINE iom_close 
    848848 
    849849 
    850    FUNCTION iom_varid ( kiomid, cdvar, kdimsz, kndims, lduld, ldstop )   
     850   FUNCTION iom_varid ( kiomid, cdvar, kdimsz, kndims, lduld, ldstop ) 
    851851      !!----------------------------------------------------------------------- 
    852852      !!                  ***  FUNCTION  iom_varid  *** 
     
    874874      IF( kiomid > 0 ) THEN 
    875875         clinfo = 'iom_varid, file: '//trim(iom_file(kiomid)%name)//', var: '//trim(cdvar) 
    876          IF( iom_file(kiomid)%nfid == 0 ) THEN  
     876         IF( iom_file(kiomid)%nfid == 0 ) THEN 
    877877            CALL ctl_stop( trim(clinfo), 'the file is not open' ) 
    878878         ELSE 
     
    893893                        &                      'increase the parameter jpmax_vars') 
    894894               ENDIF 
    895                IF( llstop .AND. iom_varid == -1 )   CALL ctl_stop( TRIM(clinfo)//' not found' )  
     895               IF( llstop .AND. iom_varid == -1 )   CALL ctl_stop( TRIM(clinfo)//' not found' ) 
    896896            ELSE 
    897897               iom_varid = iiv 
    898                IF( PRESENT(kdimsz) ) THEN  
     898               IF( PRESENT(kdimsz) ) THEN 
    899899                  i_nvd = iom_file(kiomid)%ndims(iiv) 
    900900                  IF( i_nvd <= size(kdimsz) ) THEN 
     
    10221022      REAL(dp)        , ALLOCATABLE  , DIMENSION(:)           ::   ztmp_pvar ! tmp var to read field 
    10231023      INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number 
    1024       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading  
     1024      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
    10251025      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis 
    10261026      ! 
     
    10431043      REAL(dp)        , INTENT(  out), DIMENSION(:)           ::   pvar      ! read field 
    10441044      INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number 
    1045       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading  
     1045      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
    10461046      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis 
    10471047      ! 
     
    10621062      REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold 
    10631063      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1064       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading  
     1064      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
    10651065      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis 
    10661066      ! 
     
    10861086      REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold 
    10871087      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1088       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading  
     1088      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
    10891089      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis 
    10901090      ! 
     
    11061106      REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
    11071107      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1108       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading  
     1108      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
    11091109      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis 
    11101110      ! 
     
    11301130      REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
    11311131      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1132       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading  
     1132      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
    11331133      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis 
    11341134      ! 
     
    11631163      REAL(dp)                   , INTENT(in   ), OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
    11641164      INTEGER                    , INTENT(in   ), OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1165       INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis  
     1165      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis 
    11661166      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kcount    ! number of points to be read in each axis 
    11671167      ! 
    11681168      LOGICAL                        ::   llok        ! true if ok! 
    1169       INTEGER                        ::   jl          ! loop on number of dimension  
     1169      INTEGER                        ::   jl          ! loop on number of dimension 
    11701170      INTEGER                        ::   idom        ! type of domain 
    11711171      INTEGER                        ::   idvar       ! id of the variable 
    11721172      INTEGER                        ::   inbdim      ! number of dimensions of the variable 
    1173       INTEGER                        ::   idmspc      ! number of spatial dimensions  
     1173      INTEGER                        ::   idmspc      ! number of spatial dimensions 
    11741174      INTEGER                        ::   itime       ! record number 
    11751175      INTEGER                        ::   istop       ! temporary value of nstop 
    11761176      INTEGER                        ::   ix1, ix2, iy1, iy2   ! subdomain indexes 
    11771177      INTEGER                        ::   ji, jj      ! loop counters 
    1178       INTEGER                        ::   irankpv     !  
     1178      INTEGER                        ::   irankpv     ! 
    11791179      INTEGER                        ::   ind1, ind2  ! substring index 
    11801180      INTEGER, DIMENSION(jpmax_dims) ::   istart      ! starting point to read for each axis 
    1181       INTEGER, DIMENSION(jpmax_dims) ::   icnt        ! number of value to read along each axis  
     1181      INTEGER, DIMENSION(jpmax_dims) ::   icnt        ! number of value to read along each axis 
    11821182      INTEGER, DIMENSION(jpmax_dims) ::   idimsz      ! size of the dimensions of the variable 
    11831183      INTEGER, DIMENSION(jpmax_dims) ::   ishape      ! size of the dimensions of the variable 
     
    11871187      CHARACTER(LEN=256)             ::   clinfo      ! info character 
    11881188      CHARACTER(LEN=256)             ::   clname      ! file name 
    1189       CHARACTER(LEN=1)               ::   clrankpv, cldmspc      !  
     1189      CHARACTER(LEN=1)               ::   clrankpv, cldmspc      ! 
    11901190      CHARACTER(LEN=1)               ::   cl_type     ! local value of cd_type 
    11911191      LOGICAL                        ::   ll_only3rd  ! T => if kstart, kcount present then *only* use values for 3rd spatial dimension. 
     
    12151215         ! Search for the variable in the data base (eventually actualize data) 
    12161216         ! 
    1217          idvar = iom_varid( kiomid, cdvar )  
     1217         idvar = iom_varid( kiomid, cdvar ) 
    12181218         IF( idvar > 0 ) THEN 
    12191219            ! 
     
    12221222            idmspc = inbdim                                   ! number of spatial dimensions in the file 
    12231223            IF( iom_file(kiomid)%luld(idvar) )   idmspc = inbdim - 1 
    1224             IF( idmspc > 3 )   CALL ctl_stop(trim(clinfo), 'the file has more than 3 spatial dimensions this case is not coded...')  
     1224            IF( idmspc > 3 )   CALL ctl_stop(trim(clinfo), 'the file has more than 3 spatial dimensions this case is not coded...') 
    12251225            ! 
    12261226            ! Identify the domain in case of jpdom_auto definition 
    1227             IF( idom == jpdom_auto .OR. idom == jpdom_auto_xy ) THEN             
     1227            IF( idom == jpdom_auto .OR. idom == jpdom_auto_xy ) THEN 
    12281228               idom = jpdom_global   ! default 
    12291229               ! else: if the file name finishes with _xxxx.nc with xxxx any number 
     
    12621262                     CALL ctl_warn( trim(clinfo), '2D array input but 3 spatial dimensions in the file...'              ,   & 
    12631263                           &         'As the size of the z dimension is 1 and as we try to read the first record, ',   & 
    1264                            &         'we accept this case, even if there is a possible mix-up between z and time dimension' )    
     1264                           &         'we accept this case, even if there is a possible mix-up between z and time dimension' ) 
    12651265                     idmspc = idmspc - 1 
    12661266                  !!GS: possibility to read 3D ABL atmopsheric forcing and use 1st level to force BULK simulation 
     
    12741274            ! definition of istart and icnt 
    12751275            ! 
    1276             icnt  (:) = 1              ! default definition (simple way to deal with special cases listed above)  
    1277             istart(:) = 1              ! default definition (simple way to deal with special cases listed above)  
     1276            icnt  (:) = 1              ! default definition (simple way to deal with special cases listed above) 
     1277            istart(:) = 1              ! default definition (simple way to deal with special cases listed above) 
    12781278            istart(idmspc+1) = itime   ! temporal dimenstion 
    12791279            ! 
    12801280            IF( idom == jpdom_unknown ) THEN 
    1281                IF( PRESENT(kstart) .AND. idom /= jpdom_auto_xy ) THEN  
    1282                   istart(1:idmspc) = kstart(1:idmspc)  
     1281               IF( PRESENT(kstart) .AND. idom /= jpdom_auto_xy ) THEN 
     1282                  istart(1:idmspc) = kstart(1:idmspc) 
    12831283                  icnt  (1:idmspc) = kcount(1:idmspc) 
    12841284               ELSE 
     
    12861286               ENDIF 
    12871287            ELSE   !   not a 1D array as pv_r1d requires jpdom_unknown 
    1288                ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0  
     1288               ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0 
    12891289               IF( idom == jpdom_global )   istart(1:2) = (/ mig0(Nis0), mjg0(Njs0) /) 
    12901290               icnt(1:2) = (/ Ni_0, Nj_0 /) 
     
    13061306                  WRITE( ctmp1, FMT="('(istart(', i1, ') + icnt(', i1, ') - 1) = ', i5)" ) jl, jl, itmp 
    13071307                  WRITE( ctmp2, FMT="(' is larger than idimsz(', i1,') = ', i5)"         ) jl, idimsz(jl) 
    1308                   CALL ctl_stop( trim(clinfo), 'start and count too big regarding to the size of the data, ', ctmp1, ctmp2 )      
     1308                  CALL ctl_stop( trim(clinfo), 'start and count too big regarding to the size of the data, ', ctmp1, ctmp2 ) 
    13091309               ENDIF 
    13101310            END DO 
    13111311            ! 
    13121312            ! check that icnt matches the input array 
    1313             !-      
     1313            !- 
    13141314            IF( idom == jpdom_unknown ) THEN 
    13151315               IF( irankpv == 1 )        ishape(1:1) = SHAPE(pv_r1d) 
     
    13211321                  ishape(1:2) = SHAPE(pv_r2d(Nis0:Nie0,Njs0:Nje0  ))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0)' 
    13221322               ENDIF 
    1323                IF( irankpv == 3 ) THEN  
     1323               IF( irankpv == 3 ) THEN 
    13241324                  ishape(1:3) = SHAPE(pv_r3d(Nis0:Nie0,Njs0:Nje0,:))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0,:)' 
    13251325               ENDIF 
    1326             ENDIF          
     1326            ENDIF 
    13271327            DO jl = 1, irankpv 
    13281328               WRITE( ctmp2, FMT="(', ', i1,'): ', i5,' /= icnt(', i1,'):', i5)" ) jl, ishape(jl), jl, icnt(jl) 
     
    13331333 
    13341334         ! read the data 
    1335          !-      
     1335         !- 
    13361336         IF( idvar > 0 .AND. istop == nstop ) THEN   ! no additional errors until this point... 
    13371337            ! 
     
    13401340            ELSE                               ;   ix1 = 1      ;   ix2 = icnt(1)   ;   iy1 = 1      ;   iy2 = icnt(2) 
    13411341            ENDIF 
    1342        
     1342 
    13431343            CALL iom_nf90_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, pv_r1d, pv_r2d, pv_r3d ) 
    13441344 
     
    13941394         CALL iom_swap(cxios_context) 
    13951395#else 
    1396          istop = istop + 1  
     1396         istop = istop + 1 
    13971397         clinfo = 'Can not use XIOS in iom_get_123d, file: '//trim(clname)//', var:'//trim(cdvar) 
    13981398#endif 
     
    14071407      zofs = iom_file(kiomid)%ofs(idvar)      ! offset 
    14081408      IF(     PRESENT(pv_r1d) ) THEN 
    1409          IF( zscf /= 1._wp )   pv_r1d(:) = pv_r1d(:) * zscf  
     1409         IF( zscf /= 1._wp )   pv_r1d(:) = pv_r1d(:) * zscf 
    14101410         IF( zofs /= 0._wp )   pv_r1d(:) = pv_r1d(:) + zofs 
    14111411      ELSEIF( PRESENT(pv_r2d) ) THEN 
     
    14211421   SUBROUTINE iom_get_var( cdname, z2d) 
    14221422      CHARACTER(LEN=*), INTENT(in ) ::   cdname 
    1423       REAL(wp), DIMENSION(jpi,jpj) ::   z2d  
     1423      REAL(wp), DIMENSION(jpi,jpj) ::   z2d 
    14241424#if defined key_iomput 
    14251425      IF( xios_field_is_active( cdname, at_current_timestep_arg = .TRUE. ) ) THEN 
     
    14331433 
    14341434 
    1435    FUNCTION iom_getszuld ( kiomid )   
     1435   FUNCTION iom_getszuld ( kiomid ) 
    14361436      !!----------------------------------------------------------------------- 
    14371437      !!                  ***  FUNCTION  iom_getszuld  *** 
     
    14491449      ENDIF 
    14501450   END FUNCTION iom_getszuld 
    1451     
     1451 
    14521452 
    14531453   !!---------------------------------------------------------------------- 
     
    15131513      ENDIF 
    15141514   END SUBROUTINE iom_g1d_ratt 
    1515     
     1515 
    15161516   SUBROUTINE iom_g0d_catt( kiomid, cdatt, cdatt0d, cdvar ) 
    15171517      INTEGER               , INTENT(in   )           ::   kiomid    ! Identifier of the file 
     
    15721572      ENDIF 
    15731573   END SUBROUTINE iom_p1d_ratt 
    1574     
     1574 
    15751575   SUBROUTINE iom_p0d_catt( kiomid, cdatt, cdatt0d, cdvar ) 
    15761576      INTEGER               , INTENT(in   )           ::   kiomid    ! Identifier of the file 
     
    15911591      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    15921592      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1593       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1593      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    15941594      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    15951595      REAL(sp)        , INTENT(in)                         ::   pvar     ! written field 
     
    16141614            IF(lwp) write(numout,*) 'RESTART: define (XIOS 0D) ',trim(cdvar) 
    16151615            CALL iom_swap(context) 
    1616             CALL iom_set_rstw_active( trim(cdvar), rs0 = pvar )  
     1616            CALL iom_set_rstw_active( trim(cdvar), rs0 = pvar ) 
    16171617            CALL iom_swap(cxios_context) 
    16181618         ENDIF 
     
    16311631      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    16321632      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1633       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1633      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    16341634      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    16351635      REAL(dp)        , INTENT(in)                         ::   pvar     ! written field 
     
    16541654            IF(lwp) write(numout,*) 'RESTART: define (XIOS 0D) ',trim(cdvar) 
    16551655            CALL iom_swap(context) 
    1656             CALL iom_set_rstw_active( trim(cdvar), rd0 = pvar )  
     1656            CALL iom_set_rstw_active( trim(cdvar), rd0 = pvar ) 
    16571657            CALL iom_swap(cxios_context) 
    16581658         ENDIF 
     
    16721672      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    16731673      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1674       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1674      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    16751675      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    16761676      REAL(sp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field 
     
    17121712      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    17131713      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1714       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1714      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    17151715      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    17161716      REAL(dp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field 
     
    17531753      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    17541754      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1755       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1755      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    17561756      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    17571757      REAL(sp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field 
     
    17931793      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    17941794      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1795       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1795      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    17961796      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    17971797      REAL(dp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field 
     
    18341834      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    18351835      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1836       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1836      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    18371837      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    18381838      REAL(sp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field 
     
    18741874      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    18751875      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1876       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1876      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    18771877      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    18781878      REAL(dp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field 
     
    19541954         ! 
    19551955      ENDIF 
    1956        
     1956 
    19571957   END SUBROUTINE iom_delay_rst 
    1958    
    1959     
     1958 
     1959 
    19601960 
    19611961   !!---------------------------------------------------------------------- 
     
    19691969!!clem      zz(:,:)=pfield0d 
    19701970!!clem      CALL xios_send_field(cdname, zz) 
    1971       CALL xios_send_field(cdname, (/pfield0d/))  
     1971      CALL xios_send_field(cdname, (/pfield0d/)) 
    19721972#else 
    19731973      IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings 
     
    19821982!!clem      zz(:,:)=pfield0d 
    19831983!!clem      CALL xios_send_field(cdname, zz) 
    1984       CALL xios_send_field(cdname, (/pfield0d/))  
     1984      CALL xios_send_field(cdname, (/pfield0d/)) 
    19851985#else 
    19861986      IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings 
     
    21262126      TYPE(xios_gridgroup) :: gridgroup_hdl 
    21272127      TYPE(xios_grid)      :: grid_hdl 
    2128       TYPE(xios_domain)    :: domain_hdl  
    2129       TYPE(xios_axis)      :: axis_hdl  
     2128      TYPE(xios_domain)    :: domain_hdl 
     2129      TYPE(xios_axis)      :: axis_hdl 
    21302130      CHARACTER(LEN=64)    :: cldomrefid   ! domain_ref name 
    21312131      CHARACTER(len=1)     :: cl1          ! last character of this name 
     
    21472147         CALL xios_add_child(grid_hdl, axis_hdl, 'depth'//cl1)              ! add its axis 
    21482148      ENDIF 
    2149       !       
     2149      ! 
    21502150   END SUBROUTINE iom_set_zoom_domain_attr 
    21512151 
     
    22402240      !!---------------------------------------------------------------------- 
    22412241      !!---------------------------------------------------------------------- 
    2242       INTEGER         , INTENT(in) ::   kt  
     2242      INTEGER         , INTENT(in) ::   kt 
    22432243      CHARACTER(LEN=*), INTENT(in) ::   cdname 
    22442244      !!---------------------------------------------------------------------- 
     
    22552255      !!---------------------------------------------------------------------- 
    22562256      clname = cdname 
    2257       IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname  
     2257      IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname 
    22582258      IF( xios_is_valid_context(clname) ) THEN 
    22592259         CALL iom_swap( cdname )   ! swap to cdname context 
     
    22812281      CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=Ni0glo,nj_glo=Nj0glo,ibegin=mig0(Nis0)-1,jbegin=mjg0(Njs0)-1,ni=Ni_0,nj=Nj_0) 
    22822282      CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = -nn_hls, data_ni=jpi, data_jbegin = -nn_hls, data_nj=jpj) 
    2283 !don't define lon and lat for restart reading context.  
     2283!don't define lon and lat for restart reading context. 
    22842284      IF ( .NOT.ldrxios ) & 
    22852285         CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = real(RESHAPE(plon(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp),   & 
    2286          &                                        latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp ))   
     2286         &                                        latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp )) 
    22872287      ! 
    22882288      IF ( ln_mskland .AND. (.NOT.ldxios) ) THEN 
     
    23842384      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = -nn_hls, data_ni = jpi, data_jbegin = -nn_hls, data_nj = jpj) 
    23852385      CALL iom_set_domain_attr("gznl", lonvalue = real(zlon, dp),   & 
    2386          &                             latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp))   
     2386         &                             latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp)) 
    23872387      CALL iom_set_zoom_domain_attr("ptr", ibegin=ix-1, jbegin=0, ni=1, nj=Nj0glo) 
    23882388      ! 
     
    24332433      TYPE(xios_duration)            ::   f_op, f_of 
    24342434      !!---------------------------------------------------------------------- 
    2435       !  
     2435      ! 
    24362436      ! frequency of the call of iom_put (attribut: freq_op) 
    24372437      f_op%timestep = 1        ;  f_of%timestep =  0  ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of) 
     
    24442444      ! output file names (attribut: name) 
    24452445      DO ji = 1, 9 
    2446          WRITE(cl1,'(i1)') ji  
     2446         WRITE(cl1,'(i1)') ji 
    24472447         CALL iom_update_file_name('file'//cl1) 
    24482448      END DO 
    24492449      DO ji = 1, 99 
    2450          WRITE(cl2,'(i2.2)') ji  
     2450         WRITE(cl2,'(i2.2)') ji 
    24512451         CALL iom_update_file_name('file'//cl2) 
    24522452      END DO 
    24532453      DO ji = 1, 999 
    2454          WRITE(cl3,'(i3.3)') ji  
     2454         WRITE(cl3,'(i3.3)') ji 
    24552455         CALL iom_update_file_name('file'//cl3) 
    24562456      END DO 
    24572457 
    24582458      ! Zooms... 
    2459       clgrd = (/ 'T', 'U', 'W' /)  
     2459      clgrd = (/ 'T', 'U', 'W' /) 
    24602460      DO jg = 1, SIZE(clgrd)                                                                   ! grid type 
    24612461         cl1 = clgrd(jg) 
     
    25222522               IF( zlon == -10. .AND. zlat ==   4. ) THEN   ;   zlon = 0.   ;   zlat = 0.   ;   ENDIF 
    25232523               CALL dom_ngb( zlon, zlat, ix, iy, cl1 ) 
    2524                IF( zlon >= 0. ) THEN   
     2524               IF( zlon >= 0. ) THEN 
    25252525                  IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT( zlon), 'e' 
    25262526                  ELSE                                      ;   WRITE(clon, '(f5.1,a)')       zlon , 'e' 
    25272527                  ENDIF 
    2528                ELSE              
     2528               ELSE 
    25292529                  IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT(-zlon), 'w' 
    25302530                  ELSE                                      ;   WRITE(clon, '(f5.1,a)')      -zlon , 'w' 
    25312531                  ENDIF 
    25322532               ENDIF 
    2533                IF( zlat >= 0. ) THEN   
     2533               IF( zlat >= 0. ) THEN 
    25342534                  IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT( zlat), 'n' 
    25352535                  ELSE                                      ;   WRITE(clat, '(f4.1,a)')       zlat , 'n' 
    25362536                  ENDIF 
    2537                ELSE              
     2537               ELSE 
    25382538                  IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT(-zlat), 's' 
    25392539                  ELSE                                      ;   WRITE(clat, '(f4.1,a)')      -zlat , 's' 
     
    25492549         END DO 
    25502550      END DO 
    2551        
     2551 
    25522552   END SUBROUTINE set_mooring 
    25532553 
    2554     
     2554 
    25552555   SUBROUTINE iom_update_file_name( cdid ) 
    25562556      !!---------------------------------------------------------------------- 
    25572557      !!                     ***  ROUTINE iom_update_file_name  *** 
    25582558      !! 
    2559       !! ** Purpose :    
     2559      !! ** Purpose : 
    25602560      !! 
    25612561      !!---------------------------------------------------------------------- 
     
    25712571      REAL(wp)           ::   zsec 
    25722572      LOGICAL            ::   llexist 
    2573       TYPE(xios_duration)   ::   output_freq  
     2573      TYPE(xios_duration)   ::   output_freq 
    25742574      !!---------------------------------------------------------------------- 
    25752575      ! 
     
    25802580         IF( jn == 2 )   CALL iom_get_file_attr( cdid, name_suffix = clname ) 
    25812581         ! 
    2582          IF ( TRIM(clname) /= '' ) THEN  
     2582         IF ( TRIM(clname) /= '' ) THEN 
    25832583            ! 
    25842584            idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@') 
    2585             DO WHILE ( idx /= 0 )  
     2585            DO WHILE ( idx /= 0 ) 
    25862586               clname = clname(1:idx-1)//TRIM(cexper)//clname(idx+9:LEN_TRIM(clname)) 
    25872587               idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@') 
     
    25892589            ! 
    25902590            idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
    2591             DO WHILE ( idx /= 0 )  
     2591            DO WHILE ( idx /= 0 ) 
    25922592              IF ( output_freq%timestep /= 0) THEN 
    2593                   WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts'  
     2593                  WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts' 
    25942594                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    25952595              ELSE IF ( output_freq%second /= 0 ) THEN 
    2596                   WRITE(clfreq,'(I19,A1)')INT(output_freq%second),'s'  
     2596                  WRITE(clfreq,'(I19,A1)')INT(output_freq%second),'s' 
    25972597                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    25982598              ELSE IF ( output_freq%minute /= 0 ) THEN 
    2599                   WRITE(clfreq,'(I18,A2)')INT(output_freq%minute),'mi'  
     2599                  WRITE(clfreq,'(I18,A2)')INT(output_freq%minute),'mi' 
    26002600                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    26012601              ELSE IF ( output_freq%hour /= 0 ) THEN 
    2602                   WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h'  
     2602                  WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h' 
    26032603                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    26042604              ELSE IF ( output_freq%day /= 0 ) THEN 
    2605                   WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d'  
     2605                  WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d' 
    26062606                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    2607               ELSE IF ( output_freq%month /= 0 ) THEN    
    2608                   WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m'  
     2607              ELSE IF ( output_freq%month /= 0 ) THEN 
     2608                  WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m' 
    26092609                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    2610               ELSE IF ( output_freq%year /= 0 ) THEN    
    2611                   WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y'  
     2610              ELSE IF ( output_freq%year /= 0 ) THEN 
     2611                  WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y' 
    26122612                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    26132613              ELSE 
     
    26202620            ! 
    26212621            idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@') 
    2622             DO WHILE ( idx /= 0 )  
     2622            DO WHILE ( idx /= 0 ) 
    26232623               cldate = iom_sdate( fjulday - rn_Dt / rday ) 
    26242624               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+11:LEN_TRIM(clname)) 
     
    26272627            ! 
    26282628            idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@') 
    2629             DO WHILE ( idx /= 0 )  
     2629            DO WHILE ( idx /= 0 ) 
    26302630               cldate = iom_sdate( fjulday - rn_Dt / rday, ldfull = .TRUE. ) 
    26312631               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+15:LEN_TRIM(clname)) 
     
    26342634            ! 
    26352635            idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@') 
    2636             DO WHILE ( idx /= 0 )  
     2636            DO WHILE ( idx /= 0 ) 
    26372637               cldate = iom_sdate( fjulday + rn_Dt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE. ) 
    26382638               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+9:LEN_TRIM(clname)) 
     
    26412641            ! 
    26422642            idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@') 
    2643             DO WHILE ( idx /= 0 )  
     2643            DO WHILE ( idx /= 0 ) 
    26442644               cldate = iom_sdate( fjulday + rn_Dt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE., ldfull = .TRUE. ) 
    26452645               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+13:LEN_TRIM(clname)) 
     
    26692669      ! 
    26702670      CHARACTER(LEN=20) ::   iom_sdate 
    2671       CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date  
     2671      CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date 
    26722672      INTEGER           ::   iyear, imonth, iday, ihour, iminute, isec 
    26732673      REAL(wp)          ::   zsec 
     
    26912691      ENDIF 
    26922692      ! 
    2693       IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date  
     2693      IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date 
    26942694      ELSE                       ;   WRITE(clfmt, "('i',i1,',2i2.2')") INT(LOG10(REAL(iyear,wp))) + 1 
    26952695      ENDIF 
    26962696      ! 
    2697 !$AGRIF_DO_NOT_TREAT       
     2697!$AGRIF_DO_NOT_TREAT 
    26982698      ! needed in the conv 
    2699       IF( llfull ) THEN  
     2699      IF( llfull ) THEN 
    27002700         clfmt = TRIM(clfmt)//",'_',i2.2,':',i2.2,':',i2.2" 
    27012701         ihour   = isec / 3600 
     
    27072707         WRITE(iom_sdate, '('//TRIM(clfmt)//')') iyear, imonth, iday                          ! date of the end of run 
    27082708      ENDIF 
    2709 !$AGRIF_END_DO_NOT_TREAT       
     2709!$AGRIF_END_DO_NOT_TREAT 
    27102710      ! 
    27112711   END FUNCTION iom_sdate 
     
    27162716   !!---------------------------------------------------------------------- 
    27172717   SUBROUTINE iom_setkt( kt, cdname ) 
    2718       INTEGER         , INTENT(in)::   kt  
     2718      INTEGER         , INTENT(in)::   kt 
    27192719      CHARACTER(LEN=*), INTENT(in) ::   cdname 
    27202720      IF( .FALSE. )   WRITE(numout,*) kt, cdname   ! useless test to avoid compilation warnings 
     
    27442744   SUBROUTINE iom_miss_val( cdname, pmiss_val ) 
    27452745      CHARACTER(LEN=*), INTENT(in ) ::   cdname 
    2746       REAL(wp)        , INTENT(out) ::   pmiss_val    
    2747       REAL(dp)                      ::   ztmp_pmiss_val    
     2746      REAL(wp)        , INTENT(out) ::   pmiss_val 
     2747      REAL(dp)                      ::   ztmp_pmiss_val 
    27482748#if defined key_iomput 
    27492749      ! get missing value 
     
    27552755#endif 
    27562756   END SUBROUTINE iom_miss_val 
    2757    
     2757 
    27582758   !!====================================================================== 
    27592759END MODULE iom 
Note: See TracChangeset for help on using the changeset viewer.