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 15722 – NEMO

Changeset 15722


Ignore:
Timestamp:
2022-02-22T12:25:52+01:00 (2 years ago)
Author:
clne
Message:

Ugrade to XIOS2, needed for porting to new HPC

Location:
branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/CONFIG/AMM7_SURGE/EXP00/iodef.xml

    r6599 r15722  
    22<simulation>  
    33 
    4  <context id="nemo" time_origin="1950-01-01 00:00:00" > 
     4 <context id="nemo" > 
    55     
    66    <!-- $id$ --> 
     
    8989    
    9090   <grid_definition>     
    91      <grid id="grid_T_2D" domain_ref="grid_T"/> 
    92      <grid id="grid_T_3D" domain_ref="grid_T" axis_ref="deptht"/> 
    93      <grid id="grid_U_2D" domain_ref="grid_U"/> 
    94      <grid id="grid_U_3D" domain_ref="grid_U" axis_ref="depthu"/> 
    95      <grid id="grid_V_2D" domain_ref="grid_V"/> 
    96      <grid id="grid_V_3D" domain_ref="grid_V" axis_ref="depthv"/> 
    97      <grid id="grid_W_2D" domain_ref="grid_W"/> 
    98      <grid id="grid_W_3D" domain_ref="grid_W" axis_ref="depthw"/> 
    99      <grid id="gznl_T_2D" domain_ref="gznl"/> 
    100      <grid id="gznl_T_3D" domain_ref="gznl" axis_ref="deptht"/> 
    101      <grid id="gznl_W_3D" domain_ref="gznl" axis_ref="depthw"/> 
    102     </grid_definition>    
     91    <grid id="grid_T_2D" >  
     92      <domain id="grid_T" />  
     93    </grid>  
     94    <grid id="grid_T_3D" >  
     95      <domain id="grid_T" />  
     96      <axis id="deptht" />  
     97    </grid>  
     98    <grid id="grid_U_2D" >  
     99      <domain id="grid_U" />  
     100    </grid>  
     101    <grid id="grid_U_3D" >  
     102      <domain id="grid_U" />  
     103      <axis id="depthu" />  
     104    </grid>  
     105    <grid id="grid_V_2D" >  
     106      <domain id="grid_V" />  
     107    </grid>  
     108    <grid id="grid_V_3D" >  
     109      <domain id="grid_V" />  
     110      <axis id="depthv" />  
     111    </grid>  
     112    <grid id="grid_W_2D" >  
     113      <domain id="grid_W" />  
     114    </grid>  
     115    <grid id="grid_W_3D" >  
     116      <domain id="grid_W" />  
     117      <axis id="depthw" />  
     118    </grid>  
     119    <grid id="scalarpoint" />  
     120    </grid_definition>   
    103121  </context> 
    104122   
     
    111129        We must have buffer_size > jpi*jpj*jpk*8 (with jpi and jpj the subdomain size) 
    112130--> 
    113      <variable id="buffer_size"               type="integer">10000000</variable> 
    114      <variable id="buffer_server_factor_size" type="integer">2</variable> 
    115      <variable id="info_level"                type="integer">0</variable> 
    116      <variable id="using_server"              type="boolean">true</variable> 
    117      <variable id="using_oasis"               type="boolean">false</variable> 
     131    <variable id="info_level"                type="int">0</variable>  
     132    <variable id="using_server"              type="bool">true</variable>  
     133    <variable id="using_oasis"               type="bool">false</variable>  
    118134     <variable id="oasis_codes_id"            type="string" >oceanx</variable> 
    119135    
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/CONFIG/AMM7_SURGE/cpp_AMM7_SURGE.fcm

    r5762 r15722  
    1  bld::tool::fppkeys  key_nosignedzero key_bdy key_tide key_dynspg_ts key_vvl key_diainstant key_mpp_mpi key_iomput key_surge 
     1 bld::tool::fppkeys  key_nosignedzero key_bdy key_tide key_dynspg_ts key_vvl key_diainstant key_mpp_mpi key_iomput key_surge key_xios2 
  • branches/UKMO/dev_r5518_Surge_Modelling/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r6516 r15722  
    9494      CHARACTER(len=*), INTENT(in)  :: cdname 
    9595#if defined key_iomput 
    96       TYPE(xios_time)   :: dtime    = xios_time(0, 0, 0, 0, 0, 0) 
    97       CHARACTER(len=19) :: cldate  
    98       CHARACTER(len=10) :: clname 
    99       INTEGER           ::   ji 
     96#if ! defined key_xios2 
     97       TYPE(xios_time)     :: dtime    = xios_time(0, 0, 0, 0, 0, 0) 
     98       CHARACTER(len=19)   :: cldate  
     99#else 
     100       TYPE(xios_duration) :: dtime    = xios_duration(0, 0, 0, 0, 0, 0) 
     101       TYPE(xios_date)     :: start_date 
     102#endif 
     103       CHARACTER(len=10)   :: clname 
     104       INTEGER             :: ji 
    100105      ! 
    101106      REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_bnds 
    102107      !!---------------------------------------------------------------------- 
    103  
     108#if ! defined key_xios2 
    104109      ALLOCATE( z_bnds(jpk,2) ) 
    105  
     110#else 
     111       ALLOCATE( z_bnds(2,jpk) ) 
     112#endif 
    106113      clname = cdname 
    107114      IF( TRIM(Agrif_CFixed()) /= '0' )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(cdname) 
     
    110117 
    111118      ! calendar parameters 
     119#if ! defined key_xios2 
    112120      SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
    113121      CASE ( 1)   ;   CALL xios_set_context_attr(TRIM(clname), calendar_type= "Gregorian") 
     
    117125      WRITE(cldate,"(i4.4,'-',i2.2,'-',i2.2,' ',i2.2,':',i2.2,':00')") nyear,nmonth,nday,nhour,nminute 
    118126      CALL xios_set_context_attr(TRIM(clname), start_date=cldate ) 
    119  
     127#else 
     128       ! Calendar type is now defined in xml file 
     129       SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
     130       CASE ( 1)   ; CALL xios_define_calendar( TYPE = "Gregorian", time_origin = xios_date(1950,01,01,00,00,00), & 
     131           &                                    start_date = xios_date(nyear,nmonth,nday,nhour,nminute,0) ) 
     132       CASE ( 0)   ; CALL xios_define_calendar( TYPE = "NoLeap"   , time_origin = xios_date(1900,01,01,00,00,00), & 
     133           &                                    start_date = xios_date(nyear,nmonth,nday,nhour,nminute,0) ) 
     134       CASE (30)   ; CALL xios_define_calendar( TYPE = "D360"     , time_origin = xios_date(1900,01,01,00,00,00), & 
     135           &                                    start_date = xios_date(nyear,nmonth,nday,nhour,nminute,0) ) 
     136       END SELECT 
     137#endif 
    120138      ! horizontal grid definition 
    121139      CALL set_scalar 
     
    170188 
    171189      ! Add vertical grid bounds 
     190#if ! defined key_xios2 
    172191      z_bnds(:      ,1) = gdepw_1d(:) 
    173192      z_bnds(1:jpkm1,2) = gdepw_1d(2:jpk) 
    174193      z_bnds(jpk:   ,2) = gdepw_1d(jpk) + e3t_1d(jpk) 
     194#else 
     195       z_bnds(1      ,:) = gdepw_1d(:) 
     196       z_bnds(2,1:jpkm1) = gdepw_1d(2:jpk) 
     197       z_bnds(2,jpk:   ) = gdepw_1d(jpk) + e3t_1d(jpk) 
     198#endif 
    175199      CALL iom_set_axis_attr( "deptht", bounds=z_bnds ) 
    176200      CALL iom_set_axis_attr( "depthu", bounds=z_bnds ) 
    177201      CALL iom_set_axis_attr( "depthv", bounds=z_bnds ) 
    178       z_bnds(:    ,2) = gdept_1d(:) 
    179       z_bnds(2:jpk,1) = gdept_1d(1:jpkm1) 
    180       z_bnds(1    ,1) = gdept_1d(1) - e3w_1d(1) 
     202#if ! defined key_xios2 
     203       z_bnds(:    ,2)  = gdept_1d(:) 
     204       z_bnds(2:jpk,1)  = gdept_1d(1:jpkm1) 
     205       z_bnds(1    ,1)  = gdept_1d(1) - e3w_1d(1) 
     206#else 
     207       z_bnds(2,:    )  = gdept_1d(:) 
     208       z_bnds(1,2:jpk)  = gdept_1d(1:jpkm1) 
     209       z_bnds(1,1    )  = gdept_1d(1) - e3w_1d(1) 
     210#endif 
    181211      CALL iom_set_axis_attr( "depthw", bounds=z_bnds ) 
    182212 
     
    11041134      CHARACTER(LEN=*), INTENT(in) ::   cdname 
    11051135      REAL(wp)        , INTENT(in) ::   pfield0d 
     1136#if ! defined key_xios2 
    11061137      REAL(wp)        , DIMENSION(jpi,jpj) ::   zz     ! masson 
     1138#endif 
    11071139#if defined key_iomput 
     1140#if ! defined key_xios2 
    11081141      zz(:,:)=pfield0d 
    11091142      CALL xios_send_field(cdname, zz) 
    1110       !CALL xios_send_field(cdname, (/pfield0d/))  
     1143#else 
     1144       CALL xios_send_field(cdname, (/pfield0d/))  
     1145#endif 
    11111146#else 
    11121147      IF( .FALSE. )   WRITE(numout,*) cdname, pfield0d   ! useless test to avoid compilation warnings 
     
    11561191      REAL(wp), DIMENSION(:)   , OPTIONAL, INTENT(in) ::   lonvalue, latvalue 
    11571192      REAL(wp), DIMENSION(:,:) , OPTIONAL, INTENT(in) ::   bounds_lon, bounds_lat, area 
     1193#if ! defined key_xios2 
    11581194      LOGICAL,  DIMENSION(:,:) , OPTIONAL, INTENT(in) ::   mask 
    1159  
     1195#else 
     1196       LOGICAL,  DIMENSION(:) , OPTIONAL, INTENT(in) ::   mask 
     1197#endif 
     1198#if ! defined key_xios2 
    11601199      IF ( xios_is_valid_domain     (cdid) ) THEN 
    11611200         CALL xios_set_domain_attr     ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
     
    11731212            &    bounds_lat=bounds_lat, area=area ) 
    11741213      ENDIF 
     1214#else 
     1215       IF ( xios_is_valid_domain     (cdid) ) THEN 
     1216          CALL xios_set_domain_attr     ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
     1217             &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   & 
     1218             &    lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon,                  & 
     1219             &    bounds_lat_1D=bounds_lat, area=area, type='curvilinear') 
     1220      ENDIF 
     1221       IF ( xios_is_valid_domaingroup(cdid) ) THEN 
     1222          CALL xios_set_domaingroup_attr( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
     1223             &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   & 
     1224             &    lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon,                  & 
     1225             &    bounds_lat_1D=bounds_lat, area=area, type='curvilinear' ) 
     1226       ENDIF 
     1227#endif 
    11751228      CALL xios_solve_inheritance() 
    11761229 
    11771230   END SUBROUTINE iom_set_domain_attr 
    1178  
    1179  
     1231#if defined key_xios2 
     1232   SUBROUTINE iom_set_zoom_domain_attr( cdid, ibegin, jbegin, ni, nj) 
     1233      CHARACTER(LEN=*)                   , INTENT(in) ::   cdid 
     1234      INTEGER                  , OPTIONAL, INTENT(in) ::   ibegin, jbegin, ni, nj 
     1235      IF ( xios_is_valid_zoom_domain     (cdid) ) THEN 
     1236          CALL xios_set_zoom_domain_attr     ( cdid, ibegin=ibegin, jbegin=jbegin, ni=ni,    & 
     1237            &   nj=nj) 
     1238     ENDIF 
     1239   END SUBROUTINE iom_set_zoom_domain_attr 
     1240#endif 
    11801241   SUBROUTINE iom_set_axis_attr( cdid, paxis, bounds ) 
    11811242      CHARACTER(LEN=*)      , INTENT(in) ::   cdid 
     
    11831244      REAL(wp), DIMENSION(:,:), OPTIONAL, INTENT(in) ::   bounds 
    11841245      IF ( PRESENT(paxis) ) THEN 
     1246#if ! defined key_xios2 
    11851247         IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, size=SIZE(paxis), value=paxis ) 
    11861248         IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, size=SIZE(paxis), value=paxis ) 
     1249#else 
     1250          IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, n_glo=SIZE(paxis), value=paxis ) 
     1251          IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, n_glo=SIZE(paxis), value=paxis ) 
     1252#endif 
    11871253      ENDIF 
    11881254      IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, bounds=bounds ) 
     
    11941260   SUBROUTINE iom_set_field_attr( cdid, freq_op, freq_offset ) 
    11951261      CHARACTER(LEN=*)          , INTENT(in) ::   cdid 
    1196       CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_op 
    1197       CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_offset 
    1198       IF ( xios_is_valid_field     (cdid) )   CALL xios_set_field_attr     ( cdid, freq_op=freq_op, freq_offset=freq_offset ) 
    1199       IF ( xios_is_valid_fieldgroup(cdid) )   CALL xios_set_fieldgroup_attr( cdid, freq_op=freq_op, freq_offset=freq_offset ) 
     1262#if ! defined key_xios2 
     1263       CHARACTER(LEN=*)   ,OPTIONAL , INTENT(in) ::   freq_op 
     1264       CHARACTER(LEN=*)   ,OPTIONAL , INTENT(in) ::   freq_offset 
     1265#else 
     1266       TYPE(xios_duration),OPTIONAL , INTENT(in) ::   freq_op 
     1267       TYPE(xios_duration),OPTIONAL , INTENT(in) ::   freq_offset 
     1268#endif 
     1269       IF ( xios_is_valid_field     (cdid) )   CALL xios_set_field_attr       & 
     1270     &     ( cdid, freq_op=freq_op, freq_offset=freq_offset ) 
     1271       IF ( xios_is_valid_fieldgroup(cdid) )   CALL xios_set_fieldgroup_attr  & 
     1272     &                    ( cdid, freq_op=freq_op, freq_offset=freq_offset ) 
    12001273      CALL xios_solve_inheritance() 
    12011274   END SUBROUTINE iom_set_field_attr 
     
    12131286   SUBROUTINE iom_get_file_attr( cdid, name, name_suffix, output_freq ) 
    12141287      CHARACTER(LEN=*)          , INTENT(in ) ::   cdid 
    1215       CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::   name, name_suffix, output_freq 
     1288       CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::   name, name_suffix 
     1289#if ! defined key_xios2 
     1290       CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::    output_freq 
     1291#else 
     1292       TYPE(xios_duration)   ,OPTIONAL , INTENT(out) :: output_freq 
     1293#endif  
    12161294      LOGICAL                                 ::   llexist1,llexist2,llexist3 
    12171295      !--------------------------------------------------------------------- 
    12181296      IF( PRESENT( name        ) )   name = ''          ! default values 
    12191297      IF( PRESENT( name_suffix ) )   name_suffix = '' 
     1298#if ! defined key_xios2 
    12201299      IF( PRESENT( output_freq ) )   output_freq = '' 
     1300#else 
     1301       IF( PRESENT( output_freq ) )   output_freq = xios_duration(0,0,0,0,0,0) 
     1302#endif 
    12211303      IF ( xios_is_valid_file     (cdid) ) THEN 
    12221304         CALL xios_solve_inheritance() 
     
    12391321      CHARACTER(LEN=*)                   , INTENT(in) ::   cdid 
    12401322      LOGICAL, DIMENSION(:,:,:), OPTIONAL, INTENT(in) ::   mask 
     1323#if ! defined key_xios2 
    12411324      IF ( xios_is_valid_grid     (cdid) )   CALL xios_set_grid_attr     ( cdid, mask=mask ) 
    12421325      IF ( xios_is_valid_gridgroup(cdid) )   CALL xios_set_gridgroup_attr( cdid, mask=mask ) 
     1326#else 
     1327       IF ( xios_is_valid_grid     (cdid) )   CALL xios_set_grid_attr     ( cdid, mask_3D=mask ) 
     1328       IF ( xios_is_valid_gridgroup(cdid) )   CALL xios_set_gridgroup_attr( cdid, mask_3D=mask ) 
     1329#endif 
    12431330      CALL xios_solve_inheritance() 
    12441331   END SUBROUTINE iom_set_grid_attr 
     
    12811368       
    12821369      ni=nlei-nldi+1 ; nj=nlej-nldj+1 
    1283  
     1370#if ! defined key_xios2 
    12841371      CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-1, jbegin=njmpp+nldj-1, ni=ni, nj=nj) 
     1372#else 
     1373      CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 
     1374#endif      
    12851375      CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
    12861376      CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(nldi:nlei, nldj:nlej),(/ ni*nj /)),   & 
     
    12961386         END SELECT 
    12971387         ! 
     1388#if ! defined key_xios2 
    12981389         CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni,nj    /)) /= 0. ) 
     1390#else 
     1391          CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni*nj    /)) /= 0. ) 
     1392#endif  
    12991393         CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,:),(/ni,nj,jpk/)) /= 0. ) 
    13001394      ENDIF 
     
    14291523      ni=nlei-nldi+1 ; nj=nlej-nldj+1            ! define zonal mean domain (jpj*jpk) 
    14301524      ALLOCATE( zlon(ni*nj) )       ;       zlon(:) = 0. 
    1431  
     1525       CALL dom_ngb( -168.7, 65.6, ix, iy, 'T' ) !  i-line that passes across Bering strait to avoid land processor (used in plots) 
     1526#if ! defined key_xios2 
    14321527      CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-1, jbegin=njmpp+nldj-1, ni=ni, nj=nj) 
    14331528      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
     
    14351530         &                             latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /)))   
    14361531      ! 
    1437       CALL dom_ngb( 180., 90., ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
    14381532      CALL iom_set_domain_attr ('ptr', zoom_ibegin=ix, zoom_nj=jpjglo) 
     1533#else 
     1534 ! Pas teste : attention aux indices ! 
     1535       CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 
     1536       CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
     1537       CALL iom_set_domain_attr("gznl", lonvalue = zlon,   & 
     1538          &                             latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /)))  
     1539        CALL iom_set_zoom_domain_attr ("ptr", ibegin=ix-1, jbegin=0, ni=1, nj=jpjglo) 
     1540#endif 
    14391541      CALL iom_update_file_name('ptr') 
    14401542      ! 
     
    14501552      REAL(wp), DIMENSION(1)   ::   zz = 1. 
    14511553      !!---------------------------------------------------------------------- 
     1554#if ! defined key_xios2 
    14521555      CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea, jbegin=1, ni=1, nj=1) 
     1556#else 
     1557       CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea-1, jbegin=0, ni=1, nj=1) 
     1558#endif 
    14531559      CALL iom_set_domain_attr('scalarpoint', data_dim=2, data_ibegin = 1, data_ni = 1, data_jbegin = 1, data_nj = 1) 
    14541560       
     
    14791585      REAL(wp)        ,DIMENSION( 3) ::   zlonpira                 ! longitudes of pirata moorings 
    14801586      REAL(wp)        ,DIMENSION( 9) ::   zlatpira                 ! latitudes  of pirata moorings 
     1587#if  defined key_xios2 
     1588       TYPE(xios_duration)            ::   f_op, f_of 
     1589#endif 
     1590   
    14811591      !!---------------------------------------------------------------------- 
    14821592      !  
    14831593      ! frequency of the call of iom_put (attribut: freq_op) 
    1484       WRITE(cl1,'(i1)')        1   ;   CALL iom_set_field_attr('field_definition', freq_op = cl1//'ts', freq_offset='0ts') 
    1485       WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC'             , freq_op = cl1//'ts', freq_offset='0ts') 
    1486       WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC_scalar'      , freq_op = cl1//'ts', freq_offset='0ts') 
    1487       WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('ptrc_T'          , freq_op = cl1//'ts', freq_offset='0ts') 
    1488       WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('diad_T'          , freq_op = cl1//'ts', freq_offset='0ts') 
     1594#if ! defined key_xios2 
     1595       WRITE(cl1,'(i1)')        1   ;   CALL iom_set_field_attr('field_definition', freq_op=cl1//'ts', freq_offset='0ts') 
     1596       WRITE(cl1,'(i1)')        2   ;   CALL iom_set_field_attr('trendT_even'      , freq_op=cl1//'ts', freq_offset='0ts') 
     1597       WRITE(cl1,'(i1)')        2   ;   CALL iom_set_field_attr('trendT_odd'       , freq_op=cl1//'ts', freq_offset='-1ts') 
     1598       WRITE(cl1,'(i1)')        2   ;   CALL iom_set_field_attr('ptrd_T_even'      , freq_op=cl1//'ts', freq_offset='0ts') 
     1599       WRITE(cl1,'(i1)')        2   ;   CALL iom_set_field_attr('ptrd_T_odd'       , freq_op=cl1//'ts', freq_offset='-1ts') 
     1600       WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC'             , freq_op=cl1//'ts', freq_offset='0ts') 
     1601       WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC_scalar'      , freq_op=cl1//'ts', freq_offset='0ts') 
     1602       WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('ptrc_T'          , freq_op=cl1//'ts', freq_offset='0ts') 
     1603       WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('diad_T'          , freq_op=cl1//'ts', freq_offset='0ts') 
     1604#else 
     1605       f_op%timestep = 1        ;  f_of%timestep = 0  ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of) 
     1606       f_op%timestep = 2        ;  f_of%timestep = 0  ; CALL iom_set_field_attr('trendT_even'      , freq_op=f_op, freq_offset=f_of) 
     1607       f_op%timestep = 2        ;  f_of%timestep = -1 ; CALL iom_set_field_attr('trendT_odd'       , freq_op=f_op, freq_offset=f_of) 
     1608       f_op%timestep = 2        ;  f_of%timestep = 0  ; CALL iom_set_field_attr('ptrd_T_even'      , freq_op=f_op, freq_offset=f_of) 
     1609       f_op%timestep = 2        ;  f_of%timestep = -1 ; CALL iom_set_field_attr('ptrd_T_odd'       , freq_op=f_op, freq_offset=f_of) 
     1610       f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC'             , freq_op=f_op, freq_offset=f_of) 
     1611       f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC_scalar'      , freq_op=f_op, freq_offset=f_of) 
     1612       f_op%timestep = nn_dttrc ;  f_of%timestep = 0  ; CALL iom_set_field_attr('ptrc_T'          , freq_op=f_op, freq_offset=f_of) 
     1613       f_op%timestep = nn_dttrc ;  f_of%timestep = 0  ; CALL iom_set_field_attr('diad_T'          , freq_op=f_op, freq_offset=f_of) 
     1614#endif 
    14891615        
    14901616      ! output file names (attribut: name) 
     
    15081634         ! Equatorial section (attributs: jbegin, ni, name_suffix) 
    15091635         CALL dom_ngb( 0., 0., ix, iy, cl1 ) 
     1636#if ! defined key_xios2 
    15101637         CALL iom_set_domain_attr ('Eq'//cl1, zoom_jbegin=iy, zoom_ni=jpiglo) 
     1638#else 
     1639          CALL iom_set_zoom_domain_attr ('Eq'//cl1, jbegin=iy-1, ni=jpiglo) 
     1640#endif 
    15111641         CALL iom_get_file_attr   ('Eq'//cl1, name_suffix = clsuff             ) 
    15121642         CALL iom_set_file_attr   ('Eq'//cl1, name_suffix = TRIM(clsuff)//'_Eq') 
     
    15881718               ENDIF 
    15891719               clname = TRIM(ADJUSTL(clat))//TRIM(ADJUSTL(clon)) 
     1720#if ! defined key_xios2 
    15901721               CALL iom_set_domain_attr (TRIM(clname)//cl1, zoom_ibegin= ix, zoom_jbegin= iy) 
     1722#else 
     1723                CALL iom_set_zoom_domain_attr  (TRIM(clname)//cl1, ibegin= ix-1, jbegin= iy-1) 
     1724#endif 
    15911725               CALL iom_get_file_attr   (TRIM(clname)//cl1, name_suffix = clsuff                         ) 
    15921726               CALL iom_set_file_attr   (TRIM(clname)//cl1, name_suffix = TRIM(clsuff)//'_'//TRIM(clname)) 
     
    16171751      REAL(wp)           ::   zsec 
    16181752      LOGICAL            ::   llexist 
     1753#if  defined key_xios2 
     1754       TYPE(xios_duration)   ::   output_freq  
     1755#endif      
    16191756      !!---------------------------------------------------------------------- 
    16201757 
    16211758      DO jn = 1,2 
    1622  
     1759#if ! defined key_xios2 
    16231760         IF( jn == 1 )   CALL iom_get_file_attr( cdid, name        = clname, output_freq = clfreq ) 
     1761#else 
     1762          output_freq = xios_duration(0,0,0,0,0,0) 
     1763          IF( jn == 1 )   CALL iom_get_file_attr( cdid, name        = clname, output_freq = output_freq ) 
     1764#endif 
    16241765         IF( jn == 2 )   CALL iom_get_file_attr( cdid, name_suffix = clname ) 
    16251766 
     
    16311772               idx = INDEX(clname,'@expname@') + INDEX(clname,'@EXPNAME@') 
    16321773            END DO 
    1633  
     1774#if ! defined key_xios2 
    16341775            idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
    16351776            DO WHILE ( idx /= 0 )  
     
    16441785               idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
    16451786            END DO 
    1646  
     1787#else 
     1788             idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
     1789             DO WHILE ( idx /= 0 )  
     1790               IF ( output_freq%timestep /= 0) THEN 
     1791                  WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts' 
     1792                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1793               ELSE IF ( output_freq%second /= 0 ) THEN 
     1794                  WRITE(clfreq,'(I19,A1)')INT(output_freq%second),'s' 
     1795                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1796               ELSE IF ( output_freq%minute /= 0 ) THEN 
     1797                  WRITE(clfreq,'(I18,A2)')INT(output_freq%minute),'mi' 
     1798                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1799               ELSE IF ( output_freq%hour /= 0 ) THEN 
     1800                  WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h' 
     1801                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1802               ELSE IF ( output_freq%day /= 0 ) THEN 
     1803                  WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d' 
     1804                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1805               ELSE IF ( output_freq%month /= 0 ) THEN 
     1806                  WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m' 
     1807                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1808               ELSE IF ( output_freq%year /= 0 ) THEN 
     1809                  WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y' 
     1810                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1811               ELSE 
     1812                   CALL ctl_stop('error in the name of file id '//TRIM(cdid),   & 
     1813                      & ' attribute output_freq is undefined -> cannot replace @freq@ in '//TRIM(clname) ) 
     1814               ENDIF 
     1815               clname = clname(1:idx-1)//TRIM(ADJUSTL(clfreq))//clname(idx+6:LEN_TRIM(clname)) 
     1816               idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
     1817             END DO 
     1818#endif 
    16471819            idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@') 
    16481820            DO WHILE ( idx /= 0 )  
Note: See TracChangeset for help on using the changeset viewer.