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 13806 for NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/IOM – NEMO

Ignore:
Timestamp:
2020-11-17T16:58:38+01:00 (4 years ago)
Author:
laurent
Message:

Various improvements and cleaning + keep up with "r13801" of the trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/IOM/iom.F90

    r13781 r13806  
    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 
    4949   IMPLICIT NONE 
    5050   PUBLIC   !   must be public to be able to access iom_def through iom 
    51     
     51 
    5252#if defined key_iomput 
    5353   LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .TRUE.        !: iom_put flag 
     
    9191      MODULE PROCEDURE iom_p0d_dp, iom_p1d_dp, iom_p2d_dp, iom_p3d_dp, iom_p4d_dp 
    9292   END INTERFACE iom_put 
    93    
     93 
    9494   !! * Substitutions 
    9595#  include "do_loop_substitute.h90" 
     
    101101CONTAINS 
    102102 
    103    SUBROUTINE iom_init( cdname, fname, ld_closedef )  
     103   SUBROUTINE iom_init( cdname, fname, ld_closedef ) 
    104104      !!---------------------------------------------------------------------- 
    105105      !!                     ***  ROUTINE   *** 
    106106      !! 
    107       !! ** Purpose :    
     107      !! ** Purpose : 
    108108      !! 
    109109      !!---------------------------------------------------------------------- 
     
    136136      llrst_context =  (TRIM(cdname) == TRIM(crxios_context) .OR. TRIM(cdname) == TRIM(cwxios_context)) 
    137137 
    138       ! Calendar type is now defined in xml file  
     138      ! Calendar type is now defined in xml file 
    139139      IF (.NOT.(xios_getvar('ref_year' ,irefyear ))) irefyear  = 1900 
    140140      IF (.NOT.(xios_getvar('ref_month',irefmonth))) irefmonth = 01 
     
    153153      IF(.NOT.llrst_context) CALL set_scalar 
    154154      ! 
    155       IF( TRIM(cdname) == TRIM(cxios_context) ) THEN   
    156          CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. )  
     155      IF( TRIM(cdname) == TRIM(cxios_context) ) THEN 
     156         CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. ) 
    157157         CALL set_grid( "U", glamu, gphiu, .FALSE., .FALSE. ) 
    158158         CALL set_grid( "V", glamv, gphiv, .FALSE., .FALSE. ) 
     
    172172      ENDIF 
    173173      ! 
    174       IF( TRIM(cdname) == TRIM(cxios_context)//"_crs" ) THEN   
     174      IF( TRIM(cdname) == TRIM(cxios_context)//"_crs" ) THEN 
    175175         CALL dom_grid_crs   ! Save the parent grid information  & Switch to coarse grid domain 
    176176         ! 
    177          CALL set_grid( "T", glamt_crs, gphit_crs, .FALSE., .FALSE. )  
    178          CALL set_grid( "U", glamu_crs, gphiu_crs, .FALSE., .FALSE. )  
    179          CALL set_grid( "V", glamv_crs, gphiv_crs, .FALSE., .FALSE. )  
    180          CALL set_grid( "W", glamt_crs, gphit_crs, .FALSE., .FALSE. )  
     177         CALL set_grid( "T", glamt_crs, gphit_crs, .FALSE., .FALSE. ) 
     178         CALL set_grid( "U", glamu_crs, gphiu_crs, .FALSE., .FALSE. ) 
     179         CALL set_grid( "V", glamv_crs, gphiv_crs, .FALSE., .FALSE. ) 
     180         CALL set_grid( "W", glamt_crs, gphit_crs, .FALSE., .FALSE. ) 
    181181         CALL set_grid_znl( gphit_crs ) 
    182182          ! 
     
    203203 
    204204          ! ABL 
    205           IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios)  
     205          IF( .NOT. ALLOCATED(ght_abl) ) THEN   ! force definition for xml files (xios) 
    206206             ALLOCATE( ght_abl(jpka), ghw_abl(jpka), e3t_abl(jpka), e3w_abl(jpka) )   ! default allocation needed by iom 
    207207             ght_abl(:) = -1._wp   ;   ghw_abl(:) = -1._wp 
     
    210210          CALL iom_set_axis_attr( "ght_abl", ght_abl(2:jpka) ) 
    211211          CALL iom_set_axis_attr( "ghw_abl", ghw_abl(2:jpka) ) 
    212            
     212 
    213213          ! Add vertical grid bounds 
    214214          zt_bnds(2,:      ) = gdept_1d(:) 
     
    302302      !!                   ***  SUBROUTINE  iom_set_rstw_var_active  *** 
    303303      !! 
    304       !! ** Purpose :  enable variable in restart file when writing with XIOS  
     304      !! ** Purpose :  enable variable in restart file when writing with XIOS 
    305305      !!--------------------------------------------------------------------- 
    306306   CHARACTER(len = *), INTENT(IN) :: field 
     
    313313 
    314314   DO i = 1, max_rst_fields 
    315        IF(TRIM(rst_wfields(i)%vname) == field) THEN  
     315       IF(TRIM(rst_wfields(i)%vname) == field) THEN 
    316316          rst_wfields(i)%active = .TRUE. 
    317317          llis_set = .TRUE. 
     
    321321!Warn if variable is not in defined in rst_wfields 
    322322   IF(.NOT.llis_set) THEN 
    323       WRITE(ctmp1,*) 'iom_set_rstw_var_active: variable ', field ,' is available for writing but not defined'  
     323      WRITE(ctmp1,*) 'iom_set_rstw_var_active: variable ', field ,' is available for writing but not defined' 
    324324      CALL ctl_stop( 'iom_set_rstw_var_active:', ctmp1 ) 
    325325   ENDIF 
     
    336336      !! 
    337337      !! ** Purpose :  define file name in XIOS context for reading restart file, 
    338       !!               enable variables present in restart file for reading with XIOS  
     338      !!               enable variables present in restart file for reading with XIOS 
    339339      !!--------------------------------------------------------------------- 
    340340 
     
    374374                 CASE ("grid_N") 
    375375                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 
    376                         domain_ref="grid_N", operation = "instant")  
     376                        domain_ref="grid_N", operation = "instant") 
    377377                CASE ("grid_vector") 
    378378                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 
     
    393393      !!                   ***  SUBROUTINE  iom_set_rstw_core  *** 
    394394      !! 
    395       !! ** Purpose :  set variables which are always in restart file  
     395      !! ** Purpose :  set variables which are always in restart file 
    396396      !!--------------------------------------------------------------------- 
    397397   CHARACTER (len=*), INTENT (IN) :: cdmdl ! model OPA or SAS 
     
    430430      !!                   ***  SUBROUTINE iom_set_rst_vars   *** 
    431431      !! 
    432       !! ** Purpose :  Fill array fields with the information about all  
    433       !!               possible variables and corresponding grids definition  
     432      !! ** Purpose :  Fill array fields with the information about all 
     433      !!               possible variables and corresponding grids definition 
    434434      !!               for reading/writing restart with XIOS 
    435435      !!--------------------------------------------------------------------- 
     
    442442        i = i + 1; fields(i)%vname="ub";             fields(i)%grid="grid_N_3D" 
    443443        i = i + 1; fields(i)%vname="vn";             fields(i)%grid="grid_N_3D" 
    444         i = i + 1; fields(i)%vname="vb";             fields(i)%grid="grid_N_3D"   
     444        i = i + 1; fields(i)%vname="vb";             fields(i)%grid="grid_N_3D" 
    445445        i = i + 1; fields(i)%vname="tn";             fields(i)%grid="grid_N_3D" 
    446446        i = i + 1; fields(i)%vname="tb";             fields(i)%grid="grid_N_3D" 
     
    458458        i = i + 1; fields(i)%vname="emp_b";          fields(i)%grid="grid_N" 
    459459        i = i + 1; fields(i)%vname="sfx_b";          fields(i)%grid="grid_N" 
    460         i = i + 1; fields(i)%vname="en" ;            fields(i)%grid="grid_N_3D"  
     460        i = i + 1; fields(i)%vname="en" ;            fields(i)%grid="grid_N_3D" 
    461461        i = i + 1; fields(i)%vname="avt_k";            fields(i)%grid="grid_N_3D" 
    462462        i = i + 1; fields(i)%vname="avm_k";            fields(i)%grid="grid_N_3D" 
     
    565565        CALL xios_get_handle("file_definition", filegroup_hdl ) 
    566566        CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart') 
    567         IF(nxioso.eq.1) THEN  
    568            CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,&  
    569                                     mode="write", output_freq=xios_timestep)  
    570            if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode'  
    571         ELSE   
    572            CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,&  
    573                                     mode="write", output_freq=xios_timestep)  
    574            if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode'  
    575         ENDIF  
     567        IF(nxioso.eq.1) THEN 
     568           CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 
     569                                    mode="write", output_freq=xios_timestep) 
     570           if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 
     571        ELSE 
     572           CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 
     573                                    mode="write", output_freq=xios_timestep) 
     574           if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 
     575        ENDIF 
    576576        CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file)) 
    577577!define fields for restart context 
     
    585585                 CASE ("grid_N") 
    586586                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 
    587                         domain_ref="grid_N", prec = 8, operation = "instant")  
     587                        domain_ref="grid_N", prec = 8, operation = "instant") 
    588588                 CASE ("grid_vector") 
    589589                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 
     
    598598   END SUBROUTINE iom_set_rstw_active 
    599599 
    600    SUBROUTINE iom_set_rst_context(ld_rstr)  
     600   SUBROUTINE iom_set_rst_context(ld_rstr) 
    601601     !!--------------------------------------------------------------------- 
    602602      !!                   ***  SUBROUTINE  iom_set_rst_context  *** 
    603603      !! 
    604       !! ** Purpose : Define domain, axis and grid for restart (read/write)  
    605       !!              context  
    606       !!                
     604      !! ** Purpose : Define domain, axis and grid for restart (read/write) 
     605      !!              context 
     606      !! 
    607607      !!--------------------------------------------------------------------- 
    608608   LOGICAL, INTENT(IN)               :: ld_rstr 
    609 !ld_rstr is true for restart context. There is no need to define grid for  
     609!ld_rstr is true for restart context. There is no need to define grid for 
    610610!restart read, because it's read from file 
    611611#if defined key_iomput 
    612    TYPE(xios_domaingroup)            :: domaingroup_hdl  
    613    TYPE(xios_domain)                 :: domain_hdl  
    614    TYPE(xios_axisgroup)              :: axisgroup_hdl  
    615    TYPE(xios_axis)                   :: axis_hdl  
    616    TYPE(xios_scalar)                 :: scalar_hdl  
    617    TYPE(xios_scalargroup)            :: scalargroup_hdl  
    618  
    619      CALL xios_get_handle("domain_definition",domaingroup_hdl)  
    620      CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N")  
    621      CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr)  
    622   
    623      CALL xios_get_handle("axis_definition",axisgroup_hdl)  
    624      CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev")  
     612   TYPE(xios_domaingroup)            :: domaingroup_hdl 
     613   TYPE(xios_domain)                 :: domain_hdl 
     614   TYPE(xios_axisgroup)              :: axisgroup_hdl 
     615   TYPE(xios_axis)                   :: axis_hdl 
     616   TYPE(xios_scalar)                 :: scalar_hdl 
     617   TYPE(xios_scalargroup)            :: scalargroup_hdl 
     618 
     619     CALL xios_get_handle("domain_definition",domaingroup_hdl) 
     620     CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N") 
     621     CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr) 
     622 
     623     CALL xios_get_handle("axis_definition",axisgroup_hdl) 
     624     CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev") 
    625625!AGRIF fails to compile when unit= is in call to xios_set_axis_attr 
    626 !    CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down")  
     626!    CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels",  unit="m", positive="down") 
    627627     CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels in meters", positive="down") 
    628      CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d )  
    629  
    630      CALL xios_get_handle("scalar_definition", scalargroup_hdl)  
    631      CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar")  
     628     CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d ) 
     629 
     630     CALL xios_get_handle("scalar_definition", scalargroup_hdl) 
     631     CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") 
    632632#endif 
    633633   END SUBROUTINE iom_set_rst_context 
     
    671671      CHARACTER(LEN=256)    ::   clname    ! the name of the file based on cdname [[+clcpu]+clcpu] 
    672672      CHARACTER(LEN=256)    ::   cltmpn    ! tempory name to store clname (in writting mode) 
    673       CHARACTER(LEN=10)     ::   clsuffix  ! ".nc"  
     673      CHARACTER(LEN=10)     ::   clsuffix  ! ".nc" 
    674674      CHARACTER(LEN=15)     ::   clcpu     ! the cpu number (max jpmax_digits digits) 
    675675      CHARACTER(LEN=256)    ::   clinfo    ! info character 
    676       LOGICAL               ::   llok      ! check the existence  
     676      LOGICAL               ::   llok      ! check the existence 
    677677      LOGICAL               ::   llwrt     ! local definition of ldwrt 
    678678      LOGICAL               ::   llstop    ! local definition of ldstop 
     
    680680      INTEGER               ::   icnt      ! counter for digits in clcpu (max = jpmax_digits) 
    681681      INTEGER               ::   iln, ils  ! lengths of character 
    682       INTEGER               ::   istop     !  
     682      INTEGER               ::   istop     ! 
    683683      ! local number of points for x,y dimensions 
    684684      ! position of first local point for x,y dimensions 
     
    716716      clname   = trim(cdname) 
    717717      IF ( .NOT. Agrif_Root() .AND. .NOT. lliof ) THEN 
    718          iln    = INDEX(clname,'/')  
     718         iln    = INDEX(clname,'/') 
    719719         cltmpn = clname(1:iln) 
    720720         clname = clname(iln+1:LEN_TRIM(clname)) 
     
    740740         clname = clname(1:iln-1)//'_'//TRIM(clcpu)//TRIM(clsuffix) 
    741741         icnt = 0 
    742          INQUIRE( FILE = clname, EXIST = llok )  
     742         INQUIRE( FILE = clname, EXIST = llok ) 
    743743         ! we try different formats for the cpu number by adding 0 
    744744         DO WHILE( .NOT.llok .AND. icnt < jpmax_digits ) 
     
    758758      ! if no file was found... 
    759759      IF( .NOT. llok ) THEN 
    760          IF( .NOT. llwrt ) THEN   ! we are in read mode  
     760         IF( .NOT. llwrt ) THEN   ! we are in read mode 
    761761            IF( llstop ) THEN   ;   CALL ctl_stop( TRIM(clinfo), 'File '//TRIM(cltmpn)//'* not found' ) 
    762762            ELSE                ;   istop = nstop + 1   ! make sure that istop /= nstop so we don't open the file 
    763763            ENDIF 
    764          ELSE                     ! we are in write mode so we  
     764         ELSE                     ! we are in write mode so we 
    765765            clname = cltmpn       ! get back the file name without the cpu number 
    766766         ENDIF 
    767767      ELSE 
    768          IF( llwrt .AND. .NOT. ln_clobber ) THEN   ! we stop as we want to write in a new file  
     768         IF( llwrt .AND. .NOT. ln_clobber ) THEN   ! we stop as we want to write in a new file 
    769769            CALL ctl_stop( TRIM(clinfo), 'We want to write in a new file but '//TRIM(clname)//' already exists...' ) 
    770770            istop = nstop + 1                      ! make sure that istop /= nstop so we don't open the file 
    771          ELSEIF( llwrt ) THEN     ! the file exists and we are in write mode with permission to  
     771         ELSEIF( llwrt ) THEN     ! the file exists and we are in write mode with permission to 
    772772            clname = cltmpn       ! overwrite so get back the file name without the cpu number 
    773773         ENDIF 
     
    810810            IF( iom_file(jf)%nfid > 0 ) THEN 
    811811               CALL iom_nf90_close( jf ) 
    812                iom_file(jf)%nfid       = 0          ! free the id  
     812               iom_file(jf)%nfid       = 0          ! free the id 
    813813               IF( PRESENT(kiomid) )   kiomid = 0   ! return 0 as id to specify that the file was closed 
    814814               IF(lwp) WRITE(numout,*) TRIM(clinfo)//' close file: '//TRIM(iom_file(jf)%name)//' ok' 
     
    819819         END DO 
    820820      ENDIF 
    821       !     
     821      ! 
    822822   END SUBROUTINE iom_close 
    823823 
    824824 
    825    FUNCTION iom_varid ( kiomid, cdvar, kdimsz, kndims, lduld, ldstop )   
     825   FUNCTION iom_varid ( kiomid, cdvar, kdimsz, kndims, lduld, ldstop ) 
    826826      !!----------------------------------------------------------------------- 
    827827      !!                  ***  FUNCTION  iom_varid  *** 
     
    849849      IF( kiomid > 0 ) THEN 
    850850         clinfo = 'iom_varid, file: '//trim(iom_file(kiomid)%name)//', var: '//trim(cdvar) 
    851          IF( iom_file(kiomid)%nfid == 0 ) THEN  
     851         IF( iom_file(kiomid)%nfid == 0 ) THEN 
    852852            CALL ctl_stop( trim(clinfo), 'the file is not open' ) 
    853853         ELSE 
     
    868868                        &                      'increase the parameter jpmax_vars') 
    869869               ENDIF 
    870                IF( llstop .AND. iom_varid == -1 )   CALL ctl_stop( TRIM(clinfo)//' not found' )  
     870               IF( llstop .AND. iom_varid == -1 )   CALL ctl_stop( TRIM(clinfo)//' not found' ) 
    871871            ELSE 
    872872               iom_varid = iiv 
    873                IF( PRESENT(kdimsz) ) THEN  
     873               IF( PRESENT(kdimsz) ) THEN 
    874874                  i_nvd = iom_file(kiomid)%ndims(iiv) 
    875875                  IF( i_nvd <= size(kdimsz) ) THEN 
     
    10011001      REAL(dp)        , ALLOCATABLE  , DIMENSION(:)           ::   ztmp_pvar ! tmp var to read field 
    10021002      INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number 
    1003       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading  
     1003      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
    10041004      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis 
    10051005      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS 
     
    10241024      REAL(dp)        , INTENT(  out), DIMENSION(:)           ::   pvar      ! read field 
    10251025      INTEGER         , INTENT(in   )              , OPTIONAL ::   ktime     ! record number 
    1026       INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading  
     1026      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kstart    ! start axis position of the reading 
    10271027      INTEGER         , INTENT(in   ), DIMENSION(1), OPTIONAL ::   kcount    ! number of points in each axis 
    10281028      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS 
     
    10451045      REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold 
    10461046      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1047       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading  
     1047      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
    10481048      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis 
    10491049      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS 
     
    10701070      REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.): (not) change sign across the north fold 
    10711071      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1072       INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading  
     1072      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kstart    ! start axis position of the reading 
    10731073      INTEGER         , INTENT(in   ), DIMENSION(2), OPTIONAL ::   kcount    ! number of points in each axis 
    10741074      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS 
     
    10911091      REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
    10921092      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1093       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading  
     1093      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
    10941094      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis 
    10951095      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS 
     
    11161116      REAL(dp)        , INTENT(in   )              , OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
    11171117      INTEGER         , INTENT(in   )              , OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1118       INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading  
     1118      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kstart    ! start axis position of the reading 
    11191119      INTEGER         , INTENT(in   ), DIMENSION(3), OPTIONAL ::   kcount    ! number of points in each axis 
    11201120      LOGICAL         , INTENT(in   ),               OPTIONAL ::   ldxios    ! read data using XIOS 
     
    11501150      REAL(dp)                   , INTENT(in   ), OPTIONAL ::   psgn      ! -1.(1.) : (not) change sign across the north fold 
    11511151      INTEGER                    , INTENT(in   ), OPTIONAL ::   kfill     ! value of kfillmode in lbc_lbk 
    1152       INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis  
     1152      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kstart    ! start position of the reading in each axis 
    11531153      INTEGER , DIMENSION(:)     , INTENT(in   ), OPTIONAL ::   kcount    ! number of points to be read in each axis 
    11541154      LOGICAL                    , INTENT(in   ), OPTIONAL ::   ldxios    ! use XIOS to read restart 
     
    11561156      LOGICAL                        ::   llok        ! true if ok! 
    11571157      LOGICAL                        ::   llxios      ! local definition for XIOS read 
    1158       INTEGER                        ::   jl          ! loop on number of dimension  
     1158      INTEGER                        ::   jl          ! loop on number of dimension 
    11591159      INTEGER                        ::   idom        ! type of domain 
    11601160      INTEGER                        ::   idvar       ! id of the variable 
    11611161      INTEGER                        ::   inbdim      ! number of dimensions of the variable 
    1162       INTEGER                        ::   idmspc      ! number of spatial dimensions  
     1162      INTEGER                        ::   idmspc      ! number of spatial dimensions 
    11631163      INTEGER                        ::   itime       ! record number 
    11641164      INTEGER                        ::   istop       ! temporary value of nstop 
    11651165      INTEGER                        ::   ix1, ix2, iy1, iy2   ! subdomain indexes 
    11661166      INTEGER                        ::   ji, jj      ! loop counters 
    1167       INTEGER                        ::   irankpv     !  
     1167      INTEGER                        ::   irankpv     ! 
    11681168      INTEGER                        ::   ind1, ind2  ! substring index 
    11691169      INTEGER, DIMENSION(jpmax_dims) ::   istart      ! starting point to read for each axis 
    1170       INTEGER, DIMENSION(jpmax_dims) ::   icnt        ! number of value to read along each axis  
     1170      INTEGER, DIMENSION(jpmax_dims) ::   icnt        ! number of value to read along each axis 
    11711171      INTEGER, DIMENSION(jpmax_dims) ::   idimsz      ! size of the dimensions of the variable 
    11721172      INTEGER, DIMENSION(jpmax_dims) ::   ishape      ! size of the dimensions of the variable 
     
    11761176      CHARACTER(LEN=256)             ::   clinfo      ! info character 
    11771177      CHARACTER(LEN=256)             ::   clname      ! file name 
    1178       CHARACTER(LEN=1)               ::   clrankpv, cldmspc      !  
     1178      CHARACTER(LEN=1)               ::   clrankpv, cldmspc      ! 
    11791179      CHARACTER(LEN=1)               ::   cl_type     ! local value of cd_type 
    11801180      LOGICAL                        ::   ll_only3rd  ! T => if kstart, kcount present then *only* use values for 3rd spatial dimension. 
     
    12051205         ! Search for the variable in the data base (eventually actualize data) 
    12061206         ! 
    1207          idvar = iom_varid( kiomid, cdvar )  
     1207         idvar = iom_varid( kiomid, cdvar ) 
    12081208         IF( idvar > 0 ) THEN 
    12091209            ! 
     
    12121212            idmspc = inbdim                                   ! number of spatial dimensions in the file 
    12131213            IF( iom_file(kiomid)%luld(idvar) )   idmspc = inbdim - 1 
    1214             IF( idmspc > 3 )   CALL ctl_stop(trim(clinfo), 'the file has more than 3 spatial dimensions this case is not coded...')  
     1214            IF( idmspc > 3 )   CALL ctl_stop(trim(clinfo), 'the file has more than 3 spatial dimensions this case is not coded...') 
    12151215            ! 
    12161216            ! Identify the domain in case of jpdom_auto definition 
    1217             IF( idom == jpdom_auto .OR. idom == jpdom_auto_xy ) THEN             
     1217            IF( idom == jpdom_auto .OR. idom == jpdom_auto_xy ) THEN 
    12181218               idom = jpdom_global   ! default 
    12191219               ! else: if the file name finishes with _xxxx.nc with xxxx any number 
     
    12521252                     CALL ctl_warn( trim(clinfo), '2D array input but 3 spatial dimensions in the file...'              ,   & 
    12531253                           &         'As the size of the z dimension is 1 and as we try to read the first record, ',   & 
    1254                            &         'we accept this case, even if there is a possible mix-up between z and time dimension' )    
     1254                           &         'we accept this case, even if there is a possible mix-up between z and time dimension' ) 
    12551255                     idmspc = idmspc - 1 
    12561256                  !!GS: possibility to read 3D ABL atmopsheric forcing and use 1st level to force BULK simulation 
     
    12641264            ! definition of istart and icnt 
    12651265            ! 
    1266             icnt  (:) = 1              ! default definition (simple way to deal with special cases listed above)  
    1267             istart(:) = 1              ! default definition (simple way to deal with special cases listed above)  
     1266            icnt  (:) = 1              ! default definition (simple way to deal with special cases listed above) 
     1267            istart(:) = 1              ! default definition (simple way to deal with special cases listed above) 
    12681268            istart(idmspc+1) = itime   ! temporal dimenstion 
    12691269            ! 
    12701270            IF( idom == jpdom_unknown ) THEN 
    1271                IF( PRESENT(kstart) .AND. idom /= jpdom_auto_xy ) THEN  
    1272                   istart(1:idmspc) = kstart(1:idmspc)  
     1271               IF( PRESENT(kstart) .AND. idom /= jpdom_auto_xy ) THEN 
     1272                  istart(1:idmspc) = kstart(1:idmspc) 
    12731273                  icnt  (1:idmspc) = kcount(1:idmspc) 
    12741274               ELSE 
     
    12761276               ENDIF 
    12771277            ELSE   !   not a 1D array as pv_r1d requires jpdom_unknown 
    1278                ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0  
     1278               ! we do not read the overlap and the extra-halos -> from Nis0 to Nie0 and from Njs0 to Nje0 
    12791279               IF( idom == jpdom_global )   istart(1:2) = (/ mig0(Nis0), mjg0(Njs0) /) 
    12801280               icnt(1:2) = (/ Ni_0, Nj_0 /) 
     
    12961296                  WRITE( ctmp1, FMT="('(istart(', i1, ') + icnt(', i1, ') - 1) = ', i5)" ) jl, jl, itmp 
    12971297                  WRITE( ctmp2, FMT="(' is larger than idimsz(', i1,') = ', i5)"         ) jl, idimsz(jl) 
    1298                   CALL ctl_stop( trim(clinfo), 'start and count too big regarding to the size of the data, ', ctmp1, ctmp2 )      
     1298                  CALL ctl_stop( trim(clinfo), 'start and count too big regarding to the size of the data, ', ctmp1, ctmp2 ) 
    12991299               ENDIF 
    13001300            END DO 
    13011301            ! 
    13021302            ! check that icnt matches the input array 
    1303             !-      
     1303            !- 
    13041304            IF( idom == jpdom_unknown ) THEN 
    13051305               IF( irankpv == 1 )        ishape(1:1) = SHAPE(pv_r1d) 
     
    13111311                  ishape(1:2) = SHAPE(pv_r2d(Nis0:Nie0,Njs0:Nje0  ))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0)' 
    13121312               ENDIF 
    1313                IF( irankpv == 3 ) THEN  
     1313               IF( irankpv == 3 ) THEN 
    13141314                  ishape(1:3) = SHAPE(pv_r3d(Nis0:Nie0,Njs0:Nje0,:))   ;   ctmp1 = 'd(Nis0:Nie0,Njs0:Nje0,:)' 
    13151315               ENDIF 
    1316             ENDIF          
     1316            ENDIF 
    13171317            DO jl = 1, irankpv 
    13181318               WRITE( ctmp2, FMT="(', ', i1,'): ', i5,' /= icnt(', i1,'):', i5)" ) jl, ishape(jl), jl, icnt(jl) 
     
    13231323 
    13241324         ! read the data 
    1325          !-      
     1325         !- 
    13261326         IF( idvar > 0 .AND. istop == nstop ) THEN   ! no additional errors until this point... 
    13271327            ! 
     
    13301330            ELSE                               ;   ix1 = 1      ;   ix2 = icnt(1)   ;   iy1 = 1      ;   iy2 = icnt(2) 
    13311331            ENDIF 
    1332        
     1332 
    13331333            CALL iom_nf90_get( kiomid, idvar, inbdim, istart, icnt, ix1, ix2, iy1, iy2, pv_r1d, pv_r2d, pv_r3d ) 
    13341334 
     
    13591359#if defined key_iomput 
    13601360!would be good to be able to check which context is active and swap only if current is not restart 
    1361          CALL iom_swap( TRIM(crxios_context) )  
     1361         CALL iom_swap( TRIM(crxios_context) ) 
    13621362         IF( PRESENT(pv_r3d) ) THEN 
    13631363            IF(lwp) WRITE(numout,*) 'XIOS RST READ (3D): ',TRIM(cdvar) 
     
    13741374         CALL iom_swap( TRIM(cxios_context) ) 
    13751375#else 
    1376          istop = istop + 1  
     1376         istop = istop + 1 
    13771377         clinfo = 'Can not use XIOS in iom_get_123d, file: '//trim(clname)//', var:'//trim(cdvar) 
    13781378#endif 
     
    13871387      zofs = iom_file(kiomid)%ofs(idvar)      ! offset 
    13881388      IF(     PRESENT(pv_r1d) ) THEN 
    1389          IF( zscf /= 1. )   pv_r1d(:) = pv_r1d(:) * zscf  
     1389         IF( zscf /= 1. )   pv_r1d(:) = pv_r1d(:) * zscf 
    13901390         IF( zofs /= 0. )   pv_r1d(:) = pv_r1d(:) + zofs 
    13911391      ELSEIF( PRESENT(pv_r2d) ) THEN 
     
    14011401   SUBROUTINE iom_get_var( cdname, z2d) 
    14021402      CHARACTER(LEN=*), INTENT(in ) ::   cdname 
    1403       REAL(wp), DIMENSION(jpi,jpj) ::   z2d  
     1403      REAL(wp), DIMENSION(jpi,jpj) ::   z2d 
    14041404#if defined key_iomput 
    14051405      IF( xios_field_is_active( cdname, at_current_timestep_arg = .TRUE. ) ) THEN 
     
    14131413 
    14141414 
    1415    FUNCTION iom_getszuld ( kiomid )   
     1415   FUNCTION iom_getszuld ( kiomid ) 
    14161416      !!----------------------------------------------------------------------- 
    14171417      !!                  ***  FUNCTION  iom_getszuld  *** 
     
    14291429      ENDIF 
    14301430   END FUNCTION iom_getszuld 
    1431     
     1431 
    14321432 
    14331433   !!---------------------------------------------------------------------- 
     
    14931493      ENDIF 
    14941494   END SUBROUTINE iom_g1d_ratt 
    1495     
     1495 
    14961496   SUBROUTINE iom_g0d_catt( kiomid, cdatt, cdatt0d, cdvar ) 
    14971497      INTEGER               , INTENT(in   )           ::   kiomid    ! Identifier of the file 
     
    15521552      ENDIF 
    15531553   END SUBROUTINE iom_p1d_ratt 
    1554     
     1554 
    15551555   SUBROUTINE iom_p0d_catt( kiomid, cdatt, cdatt0d, cdvar ) 
    15561556      INTEGER               , INTENT(in   )           ::   kiomid    ! Identifier of the file 
     
    15711571      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    15721572      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1573       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1573      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    15741574      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    15751575      REAL(sp)        , INTENT(in)                         ::   pvar     ! written field 
     
    16011601      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    16021602      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1603       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1603      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    16041604      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    16051605      REAL(dp)        , INTENT(in)                         ::   pvar     ! written field 
     
    16321632      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    16331633      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1634       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1634      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    16351635      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    16361636      REAL(sp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field 
     
    16621662      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    16631663      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1664       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1664      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    16651665      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    16661666      REAL(dp)        , INTENT(in), DIMENSION(          :) ::   pvar     ! written field 
     
    16931693      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    16941694      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1695       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1695      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    16961696      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    16971697      REAL(sp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field 
     
    17231723      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    17241724      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1725       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1725      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    17261726      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    17271727      REAL(dp)        , INTENT(in), DIMENSION(:,    :    ) ::   pvar     ! written field 
     
    17541754      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    17551755      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1756       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1756      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    17571757      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    17581758      REAL(sp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field 
     
    17841784      INTEGER         , INTENT(in)                         ::   kt       ! ocean time-step 
    17851785      INTEGER         , INTENT(in)                         ::   kwrite   ! writing time-step 
    1786       INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file  
     1786      INTEGER         , INTENT(in)                         ::   kiomid   ! Identifier of the file 
    17871787      CHARACTER(len=*), INTENT(in)                         ::   cdvar    ! time axis name 
    17881788      REAL(dp)        , INTENT(in),       DIMENSION(:,:,:) ::   pvar     ! written field 
     
    18541854         ! 
    18551855      ENDIF 
    1856        
     1856 
    18571857   END SUBROUTINE iom_delay_rst 
    1858    
    1859     
     1858 
     1859 
    18601860 
    18611861   !!---------------------------------------------------------------------- 
     
    18691869!!clem      zz(:,:)=pfield0d 
    18701870!!clem      CALL xios_send_field(cdname, zz) 
    1871       CALL xios_send_field(cdname, (/pfield0d/))  
     1871      CALL xios_send_field(cdname, (/pfield0d/)) 
    18721872#else 
    18731873      IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings 
     
    18821882!!clem      zz(:,:)=pfield0d 
    18831883!!clem      CALL xios_send_field(cdname, zz) 
    1884       CALL xios_send_field(cdname, (/pfield0d/))  
     1884      CALL xios_send_field(cdname, (/pfield0d/)) 
    18851885#else 
    18861886      IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings 
     
    20262026      TYPE(xios_gridgroup) :: gridgroup_hdl 
    20272027      TYPE(xios_grid)      :: grid_hdl 
    2028       TYPE(xios_domain)    :: domain_hdl  
    2029       TYPE(xios_axis)      :: axis_hdl  
     2028      TYPE(xios_domain)    :: domain_hdl 
     2029      TYPE(xios_axis)      :: axis_hdl 
    20302030      CHARACTER(LEN=64)    :: cldomrefid   ! domain_ref name 
    20312031      CHARACTER(len=1)     :: cl1          ! last character of this name 
     
    20472047         CALL xios_add_child(grid_hdl, axis_hdl, 'depth'//cl1)              ! add its axis 
    20482048      ENDIF 
    2049       !       
     2049      ! 
    20502050   END SUBROUTINE iom_set_zoom_domain_attr 
    20512051 
     
    21402140      !!---------------------------------------------------------------------- 
    21412141      !!---------------------------------------------------------------------- 
    2142       INTEGER         , INTENT(in) ::   kt  
     2142      INTEGER         , INTENT(in) ::   kt 
    21432143      CHARACTER(LEN=*), INTENT(in) ::   cdname 
    21442144      !!---------------------------------------------------------------------- 
     
    21552155      !!---------------------------------------------------------------------- 
    21562156      clname = cdname 
    2157       IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname  
     2157      IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname 
    21582158      IF( xios_is_valid_context(clname) ) THEN 
    21592159         CALL iom_swap( cdname )   ! swap to cdname context 
     
    21812181      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) 
    21822182      CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = -nn_hls, data_ni = jpi, data_jbegin = -nn_hls, data_nj = jpj) 
    2183 !don't define lon and lat for restart reading context.  
     2183!don't define lon and lat for restart reading context. 
    21842184      IF ( .NOT.ldrxios ) & 
    21852185         CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = real(RESHAPE(plon(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp),   & 
    2186          &                                        latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp ))   
     2186         &                                        latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp )) 
    21872187      ! 
    21882188      IF ( ln_mskland .AND. (.NOT.ldxios) ) THEN 
     
    22812281      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = -nn_hls, data_ni = jpi, data_jbegin = -nn_hls, data_nj = jpj) 
    22822282      CALL iom_set_domain_attr("gznl", lonvalue = real(zlon, dp),   & 
    2283          &                             latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp))   
     2283         &                             latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp)) 
    22842284      CALL iom_set_zoom_domain_attr("ptr", ibegin=ix-1, jbegin=0, ni=1, nj=Nj0glo) 
    22852285      ! 
     
    23302330      TYPE(xios_duration)            ::   f_op, f_of 
    23312331      !!---------------------------------------------------------------------- 
    2332       !  
     2332      ! 
    23332333      ! frequency of the call of iom_put (attribut: freq_op) 
    23342334      f_op%timestep = 1        ;  f_of%timestep =  0  ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of) 
     
    23412341      ! output file names (attribut: name) 
    23422342      DO ji = 1, 9 
    2343          WRITE(cl1,'(i1)') ji  
     2343         WRITE(cl1,'(i1)') ji 
    23442344         CALL iom_update_file_name('file'//cl1) 
    23452345      END DO 
    23462346      DO ji = 1, 99 
    2347          WRITE(cl2,'(i2.2)') ji  
     2347         WRITE(cl2,'(i2.2)') ji 
    23482348         CALL iom_update_file_name('file'//cl2) 
    23492349      END DO 
    23502350      DO ji = 1, 999 
    2351          WRITE(cl3,'(i3.3)') ji  
     2351         WRITE(cl3,'(i3.3)') ji 
    23522352         CALL iom_update_file_name('file'//cl3) 
    23532353      END DO 
    23542354 
    23552355      ! Zooms... 
    2356       clgrd = (/ 'T', 'U', 'W' /)  
     2356      clgrd = (/ 'T', 'U', 'W' /) 
    23572357      DO jg = 1, SIZE(clgrd)                                                                   ! grid type 
    23582358         cl1 = clgrd(jg) 
     
    24192419               IF( zlon == -10. .AND. zlat ==   4. ) THEN   ;   zlon = 0.   ;   zlat = 0.   ;   ENDIF 
    24202420               CALL dom_ngb( zlon, zlat, ix, iy, cl1 ) 
    2421                IF( zlon >= 0. ) THEN   
     2421               IF( zlon >= 0. ) THEN 
    24222422                  IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT( zlon), 'e' 
    24232423                  ELSE                                      ;   WRITE(clon, '(f5.1,a)')       zlon , 'e' 
    24242424                  ENDIF 
    2425                ELSE              
     2425               ELSE 
    24262426                  IF( zlon == REAL(NINT(zlon), wp) ) THEN   ;   WRITE(clon, '(i3,  a)') NINT(-zlon), 'w' 
    24272427                  ELSE                                      ;   WRITE(clon, '(f5.1,a)')      -zlon , 'w' 
    24282428                  ENDIF 
    24292429               ENDIF 
    2430                IF( zlat >= 0. ) THEN   
     2430               IF( zlat >= 0. ) THEN 
    24312431                  IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT( zlat), 'n' 
    24322432                  ELSE                                      ;   WRITE(clat, '(f4.1,a)')       zlat , 'n' 
    24332433                  ENDIF 
    2434                ELSE              
     2434               ELSE 
    24352435                  IF( zlat == REAL(NINT(zlat), wp) ) THEN   ;   WRITE(clat, '(i2,  a)') NINT(-zlat), 's' 
    24362436                  ELSE                                      ;   WRITE(clat, '(f4.1,a)')      -zlat , 's' 
     
    24462446         END DO 
    24472447      END DO 
    2448        
     2448 
    24492449   END SUBROUTINE set_mooring 
    24502450 
    2451     
     2451 
    24522452   SUBROUTINE iom_update_file_name( cdid ) 
    24532453      !!---------------------------------------------------------------------- 
    24542454      !!                     ***  ROUTINE iom_update_file_name  *** 
    24552455      !! 
    2456       !! ** Purpose :    
     2456      !! ** Purpose : 
    24572457      !! 
    24582458      !!---------------------------------------------------------------------- 
     
    24682468      REAL(wp)           ::   zsec 
    24692469      LOGICAL            ::   llexist 
    2470       TYPE(xios_duration)   ::   output_freq  
     2470      TYPE(xios_duration)   ::   output_freq 
    24712471      !!---------------------------------------------------------------------- 
    24722472      ! 
     
    24772477         IF( jn == 2 )   CALL iom_get_file_attr( cdid, name_suffix = clname ) 
    24782478         ! 
    2479          IF ( TRIM(clname) /= '' ) THEN  
     2479         IF ( TRIM(clname) /= '' ) THEN 
    24802480            ! 
    24812481            idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@') 
    2482             DO WHILE ( idx /= 0 )  
     2482            DO WHILE ( idx /= 0 ) 
    24832483               clname = clname(1:idx-1)//TRIM(cexper)//clname(idx+9:LEN_TRIM(clname)) 
    24842484               idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@') 
     
    24862486            ! 
    24872487            idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
    2488             DO WHILE ( idx /= 0 )  
     2488            DO WHILE ( idx /= 0 ) 
    24892489              IF ( output_freq%timestep /= 0) THEN 
    2490                   WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts'  
     2490                  WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts' 
    24912491                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    24922492              ELSE IF ( output_freq%second /= 0 ) THEN 
    2493                   WRITE(clfreq,'(I19,A1)')INT(output_freq%second),'s'  
     2493                  WRITE(clfreq,'(I19,A1)')INT(output_freq%second),'s' 
    24942494                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    24952495              ELSE IF ( output_freq%minute /= 0 ) THEN 
    2496                   WRITE(clfreq,'(I18,A2)')INT(output_freq%minute),'mi'  
     2496                  WRITE(clfreq,'(I18,A2)')INT(output_freq%minute),'mi' 
    24972497                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    24982498              ELSE IF ( output_freq%hour /= 0 ) THEN 
    2499                   WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h'  
     2499                  WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h' 
    25002500                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    25012501              ELSE IF ( output_freq%day /= 0 ) THEN 
    2502                   WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d'  
     2502                  WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d' 
    25032503                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    2504               ELSE IF ( output_freq%month /= 0 ) THEN    
    2505                   WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m'  
     2504              ELSE IF ( output_freq%month /= 0 ) THEN 
     2505                  WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m' 
    25062506                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    2507               ELSE IF ( output_freq%year /= 0 ) THEN    
    2508                   WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y'  
     2507              ELSE IF ( output_freq%year /= 0 ) THEN 
     2508                  WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y' 
    25092509                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
    25102510              ELSE 
     
    25172517            ! 
    25182518            idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@') 
    2519             DO WHILE ( idx /= 0 )  
     2519            DO WHILE ( idx /= 0 ) 
    25202520               cldate = iom_sdate( fjulday - rn_Dt / rday ) 
    25212521               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+11:LEN_TRIM(clname)) 
     
    25242524            ! 
    25252525            idx = INDEX(clname,'@startdatefull@') + INDEX(clname,'@STARTDATEFULL@') 
    2526             DO WHILE ( idx /= 0 )  
     2526            DO WHILE ( idx /= 0 ) 
    25272527               cldate = iom_sdate( fjulday - rn_Dt / rday, ldfull = .TRUE. ) 
    25282528               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+15:LEN_TRIM(clname)) 
     
    25312531            ! 
    25322532            idx = INDEX(clname,'@enddate@') + INDEX(clname,'@ENDDATE@') 
    2533             DO WHILE ( idx /= 0 )  
     2533            DO WHILE ( idx /= 0 ) 
    25342534               cldate = iom_sdate( fjulday + rn_Dt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE. ) 
    25352535               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+9:LEN_TRIM(clname)) 
     
    25382538            ! 
    25392539            idx = INDEX(clname,'@enddatefull@') + INDEX(clname,'@ENDDATEFULL@') 
    2540             DO WHILE ( idx /= 0 )  
     2540            DO WHILE ( idx /= 0 ) 
    25412541               cldate = iom_sdate( fjulday + rn_Dt / rday * REAL( nitend - nit000, wp ), ld24 = .TRUE., ldfull = .TRUE. ) 
    25422542               clname = clname(1:idx-1)//TRIM(cldate)//clname(idx+13:LEN_TRIM(clname)) 
     
    25662566      ! 
    25672567      CHARACTER(LEN=20) ::   iom_sdate 
    2568       CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date  
     2568      CHARACTER(LEN=50) ::   clfmt                         !  format used to write the date 
    25692569      INTEGER           ::   iyear, imonth, iday, ihour, iminute, isec 
    25702570      REAL(wp)          ::   zsec 
     
    25882588      ENDIF 
    25892589      ! 
    2590       IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date  
     2590      IF( iyear < 10000 ) THEN   ;   clfmt = "i4.4,2i2.2"                ! format used to write the date 
    25912591      ELSE                       ;   WRITE(clfmt, "('i',i1,',2i2.2')") INT(LOG10(REAL(iyear,wp))) + 1 
    25922592      ENDIF 
    25932593      ! 
    2594 !$AGRIF_DO_NOT_TREAT       
     2594!$AGRIF_DO_NOT_TREAT 
    25952595      ! needed in the conv 
    2596       IF( llfull ) THEN  
     2596      IF( llfull ) THEN 
    25972597         clfmt = TRIM(clfmt)//",'_',i2.2,':',i2.2,':',i2.2" 
    25982598         ihour   = isec / 3600 
     
    26042604         WRITE(iom_sdate, '('//TRIM(clfmt)//')') iyear, imonth, iday                          ! date of the end of run 
    26052605      ENDIF 
    2606 !$AGRIF_END_DO_NOT_TREAT       
     2606!$AGRIF_END_DO_NOT_TREAT 
    26072607      ! 
    26082608   END FUNCTION iom_sdate 
     
    26132613   !!---------------------------------------------------------------------- 
    26142614   SUBROUTINE iom_setkt( kt, cdname ) 
    2615       INTEGER         , INTENT(in)::   kt  
     2615      INTEGER         , INTENT(in)::   kt 
    26162616      CHARACTER(LEN=*), INTENT(in) ::   cdname 
    26172617      IF( .FALSE. )   WRITE(numout,*) kt, cdname   ! useless test to avoid compilation warnings 
     
    26412641   SUBROUTINE iom_miss_val( cdname, pmiss_val ) 
    26422642      CHARACTER(LEN=*), INTENT(in ) ::   cdname 
    2643       REAL(wp)        , INTENT(out) ::   pmiss_val    
    2644       REAL(dp)                      ::   ztmp_pmiss_val    
     2643      REAL(wp)        , INTENT(out) ::   pmiss_val 
     2644      REAL(dp)                      ::   ztmp_pmiss_val 
    26452645#if defined key_iomput 
    26462646      ! get missing value 
     
    26522652#endif 
    26532653   END SUBROUTINE iom_miss_val 
    2654    
     2654 
    26552655   !!====================================================================== 
    26562656END MODULE iom 
Note: See TracChangeset for help on using the changeset viewer.