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

Changeset 7401


Ignore:
Timestamp:
2016-11-30T17:10:04+01:00 (7 years ago)
Author:
cetlod
Message:

xios2 for trunk : updates routines & xml files for GYRE_XIOS

Location:
branches/2016/dev_r7161_trunk_XIOS2/NEMOGCM
Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/2016/dev_r7161_trunk_XIOS2/NEMOGCM/ARCH/arch-macport_osx.fcm

    r6387 r7401  
    4242%NCDF_HOME           /opt/local 
    4343%HDF5_HOME           /opt/local 
    44 %XIOS_HOME           /Users/$( whoami )/xios-1.0 
     44%XIOS_HOME           /Users/$( whoami )/xios-2.0_r966 
    4545%OASIS_HOME          /not/defined 
    4646 
  • branches/2016/dev_r7161_trunk_XIOS2/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/domain_def.xml

    r4373 r7401  
    1 link ../../SHARED/domain_def.xml 
     1link ../../SHARED/ForXIOS2/domain_def.xml 
  • branches/2016/dev_r7161_trunk_XIOS2/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/field_def.xml

    r4373 r7401  
    1 link ../../SHARED/field_def.xml 
     1link ../../SHARED/ForXIOS2/field_def.xml 
  • branches/2016/dev_r7161_trunk_XIOS2/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/iodef.xml

    r5363 r7401  
    22<simulation>  
    33 
    4  <context id="nemo" time_origin="1900-01-01 00:00:00" > 
     4 <context id="nemo" > 
    55     
    66    <!-- $id$ --> 
     
    2121    --> 
    2222     
    23     <file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4"> 
     23    <file_definition type="one_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="1d" min_digits="4"> 
    2424     
    2525      <file_group id="1ts" output_freq="1ts"  output_level="10" enabled=".TRUE."/> <!-- 1 time step files --> 
     
    9999   <domain_definition src="./domain_def.xml"/> 
    100100    
    101    <grid_definition>     
    102      <grid id="grid_T_2D" domain_ref="grid_T"/> 
    103      <grid id="grid_T_3D" domain_ref="grid_T" axis_ref="deptht"/> 
    104      <grid id="grid_U_2D" domain_ref="grid_U"/> 
    105      <grid id="grid_U_3D" domain_ref="grid_U" axis_ref="depthu"/> 
    106      <grid id="grid_V_2D" domain_ref="grid_V"/> 
    107      <grid id="grid_V_3D" domain_ref="grid_V" axis_ref="depthv"/> 
    108      <grid id="grid_W_2D" domain_ref="grid_W"/> 
    109      <grid id="grid_W_3D" domain_ref="grid_W" axis_ref="depthw"/> 
    110     </grid_definition>  
     101 
     102    <grid_definition> 
     103        <!--  --> 
     104       <grid id="grid_T_2D" > 
     105         <domain id="grid_T" /> 
     106       </grid> 
     107        <!--  --> 
     108       <grid id="grid_T_3D_ncatice" > 
     109         <domain id="grid_T" /> 
     110         <axis id="ncatice" /> 
     111       </grid> 
     112        <!--  --> 
     113       <grid id="grid_T_3D" > 
     114         <domain id="grid_T" /> 
     115         <axis id="deptht" /> 
     116       </grid> 
     117        <!--  --> 
     118       <grid id="grid_U_2D" > 
     119         <domain id="grid_U" /> 
     120       </grid> 
     121        <!--  --> 
     122       <grid id="grid_U_3D" > 
     123         <domain id="grid_U" /> 
     124         <axis id="depthu" /> 
     125       </grid> 
     126        <!--  --> 
     127       <grid id="grid_V_2D" > 
     128         <domain id="grid_V" /> 
     129       </grid> 
     130        <!--  --> 
     131       <grid id="grid_V_3D" > 
     132         <domain id="grid_V" /> 
     133         <axis id="depthv" /> 
     134       </grid> 
     135        <!--  --> 
     136       <grid id="grid_W_2D" > 
     137         <domain id="grid_W" /> 
     138       </grid> 
     139        <!--  --> 
     140       <grid id="grid_W_3D" > 
     141         <domain id="grid_W" /> 
     142         <axis id="depthw" /> 
     143       </grid> 
     144        <!--  --> 
     145       <grid id="grid_1point" > 
     146         <domain domain_ref="1point"/> 
     147       </grid> 
     148        <!--  --> 
     149       <grid id="grid_T_nfloat" > 
     150         <domain id="grid_T" /> 
     151         <axis id="nfloat" /> 
     152       </grid> 
     153        <!--  --> 
     154       <grid id="grid_EqT" > 
     155         <domain domain_ref="EqT" /> 
     156       </grid> 
     157        <!--  --> 
     158       <grid id="gznl_T_2D"> 
     159         <domain domain_ref="ptr" /> 
     160       </grid> 
     161        <!--  --> 
     162       <grid id="gznl_T_3D"> 
     163         <domain domain_ref="ptr" /> 
     164         <axis id="deptht" /> 
     165       </grid> 
     166        <!--  --> 
     167       <grid id="gznl_W_2D"> 
     168         <domain domain_ref="ptr" /> 
     169       </grid> 
     170        <!--  --> 
     171       <grid id="gznl_W_3D"> 
     172         <domain domain_ref="ptr" /> 
     173         <axis id="depthw" /> 
     174       </grid> 
     175    </grid_definition> 
     176 
    111177 
    112178  </context> 
     
    117183      <variable_definition> 
    118184    
    119      <!--  
    120         We must have buffer_size > jpi*jpj*jpk*8 (with jpi and jpj the subdomain size) 
    121 --> 
    122      <variable id="buffer_size"               type="integer">10000000</variable> 
    123      <variable id="buffer_server_factor_size" type="integer">2</variable> 
    124      <variable id="info_level"                type="integer">0</variable> 
    125      <variable id="using_server"              type="boolean">false</variable> 
    126      <variable id="using_oasis"               type="boolean">false</variable> 
     185     <variable id="info_level"                type="int">0</variable> 
     186     <variable id="using_server"              type="bool">false</variable> 
     187     <variable id="using_oasis"               type="bool">false</variable> 
    127188     <variable id="oasis_codes_id"            type="string" >oceanx</variable> 
    128189    
  • branches/2016/dev_r7161_trunk_XIOS2/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg

    r6489 r7401  
    1111   nn_stock    =    4320   !  frequency of creation of a restart file (modulo referenced to 1) 
    1212   nn_write    =      60   !  frequency of write in the output file   (modulo referenced to nn_it000) 
     13 
     14   ln_clobber  = .true.    !  clobber (overwrite) an existing file 
     15 
    1316/ 
    1417!----------------------------------------------------------------------- 
     
    4144   nn_bathy    =    0      !  compute (=0) or read (=1) the bathymetry file 
    4245   rn_rdt      = 7200.     !  time step for the dynamics  
    43 !   nn_baro     =   60      !  number of barotropic time step            ("key_dynspg_ts") 
    4446   jphgr_msh   =       5                 !  type of horizontal mesh 
    4547   ppglam0     =       0.0               !  longitude of first raw and column T-point (jphgr_msh = 1) 
     
    7779!----------------------------------------------------------------------- 
    7880   nn_fsbc     = 1         !  frequency of surface boundary condition computation 
    79                            !     (also = the frequency of sea-ice model call) 
     81   !                       !     (also = the frequency of sea-ice model call) 
    8082   ln_ana      = .true.    !  analytical formulation                    (T => fill namsbc_ana ) 
    8183   ln_blk_core = .false.   !  CORE bulk formulation                     (T => fill namsbc_core) 
     
    173175/ 
    174176!----------------------------------------------------------------------- 
    175 &nambbc        !   bottom temperature boundary condition                (default: NO) 
    176 !----------------------------------------------------------------------- 
     177&nambbc        !   bottom temperature boundary condition 
     178!----------------------------------------------------------------------- 
     179   ln_trabbc   = .false.   !  Apply a geothermal heating at the ocean bottom 
     180   nn_geoflx   =    0      !  geothermal heat flux: = 0 no flux 
    177181/ 
    178182!----------------------------------------------------------------------- 
     
    184188!----------------------------------------------------------------------- 
    185189   ln_eos80    = .true.         !  = Use EOS80 equation of state 
     190   !                             ! 
     191   !                      ! S-EOS coefficients : 
     192   !                             !  rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS 
     193   rn_a0       =  1.6550e-1      !  thermal expension coefficient (nn_eos= 1) 
     194   rn_b0       =  7.6554e-1      !  saline  expension coefficient (nn_eos= 1) 
     195   rn_lambda1  =  5.9520e-2      !  cabbeling coeff in T^2  (=0 for linear eos) 
     196   rn_lambda2  =  7.4914e-4      !  cabbeling coeff in S^2  (=0 for linear eos) 
     197   rn_mu1      =  1.4970e-4      !  thermobaric coeff. in T (=0 for linear eos) 
     198   rn_mu2      =  1.1090e-5      !  thermobaric coeff. in S (=0 for linear eos) 
     199   rn_nu       =  2.4341e-3      !  cabbeling coeff in T*S  (=0 for linear eos) 
     200!!org GYRE   rn_alpha    =   2.0e-4  !  thermal expension coefficient (nn_eos= 1 or 2) 
     201!!org GYRE   rn_beta     =   7.7e-4  !  saline  expension coefficient (nn_eos= 2) 
     202!!org  caution  now a0 = alpha / rau0   with rau0 = 1026 
    186203/ 
    187204!----------------------------------------------------------------------- 
    188205&namtra_adv    !   advection scheme for tracer 
    189206!----------------------------------------------------------------------- 
    190    ln_traadv_fct =  .true.    !  FCT scheme 
     207   ln_traadv_fct =  .true.   !  FCT scheme 
    191208      nn_fct_h   =  2               !  =2/4, horizontal 2nd / 4th order  
    192209      nn_fct_v   =  2               !  =2/4, vertical   2nd / COMPACT 4th order  
     
    207224   ln_traldf_lev   =  .false.  !  iso-level 
    208225   ln_traldf_hor   =  .false.  !  horizontal (geopotential) 
    209    ln_traldf_iso   =  .true.   !  iso-neutral (standard operator) 
    210    ln_traldf_triad =  .false.  !  iso-neutral (triad    operator) 
     226   ln_traldf_iso   =  .true.   !  iso-neutral 
     227   ln_traldf_triad =  .false.  !  iso-neutral using Griffies triads 
    211228   ! 
    212229   !                       !  iso-neutral options:         
    213    ln_traldf_msc   =  .true.   !  Method of Stabilizing Correction (both operators) 
     230   ln_traldf_msc   =  .false.  !  Method of Stabilizing Correction (both operators) 
    214231   rn_slpmax       =   0.01    !  slope limit                      (both operators) 
    215    ln_triad_iso    =  .false.  !  pure horizontal mixing in ML              (triad only) 
     232   ln_triad_iso    =  .false.  !  pure horizontal mixing in ML     (triad only) 
    216233   rn_sw_triad     =  1        !  =1 switching triad ; =0 all 4 triads used (triad only) 
    217    ln_botmix_triad =  .false.  !  lateral mixing on bottom                  (triad only) 
     234   ln_botmix_triad =  .false.  !  lateral mixing on bottom         (triad only) 
    218235   ! 
    219236   !                       !  Coefficients: 
     
    246263&namdyn_vor    !   option of physics/algorithm (not control by CPP keys) 
    247264!----------------------------------------------------------------------- 
    248    ln_dynvor_ene = .true.  !  energy    conserving scheme   
    249    ln_dynvor_ens = .false. !  enstrophy conserving scheme     
     265   ln_dynvor_ene = .true.  !  enstrophy conserving scheme 
     266   ln_dynvor_ens = .false. !  energy conserving scheme 
     267   ln_dynvor_mix = .false. !  mixed scheme 
    250268   ln_dynvor_een = .false. !  energy & enstrophy scheme 
     269      nn_een_e3f = 1             !  e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1) 
    251270/ 
    252271!----------------------------------------------------------------------- 
     
    257276/ 
    258277!----------------------------------------------------------------------- 
    259 &namdyn_spg    !   surface pressure gradient 
     278&namdyn_spg    !   surface pressure gradient  
    260279!----------------------------------------------------------------------- 
    261280   ln_dynspg_ts  = .true.  !  split-explicit free surface 
     
    264283&namdyn_ldf    !   lateral diffusion on momentum 
    265284!----------------------------------------------------------------------- 
    266    rn_ahm_0_lap     = 100000.   !  horizontal laplacian eddy viscosity   [m2/s] 
     285   !                       !  Type of the operator : 
     286   !                           !  no diffusion: set ln_dynldf_lap=..._blp=F  
     287   ln_dynldf_lap =  .true.     !    laplacian operator 
     288   ln_dynldf_blp =  .false.    !  bilaplacian operator 
     289   !                       !  Direction of action  : 
     290   ln_dynldf_lev =  .true.     !  iso-level 
     291   ln_dynldf_hor =  .false.    !  horizontal (geopotential) 
     292   ln_dynldf_iso =  .false.    !  iso-neutral 
     293   !                       !  Coefficient 
     294   nn_ahm_ijk_t  = 0           !  space/time variation of eddy coef 
     295   !                                !  =-30  read in eddy_viscosity_3D.nc file 
     296   !                                !  =-20  read in eddy_viscosity_2D.nc file 
     297   !                                !  =  0  constant  
     298   !                                !  = 10  F(k)=c1d 
     299   !                                !  = 20  F(i,j)=F(grid spacing)=c2d 
     300   !                                !  = 30  F(i,j,k)=c2d*c1d 
     301   !                                !  = 31  F(i,j,k)=F(grid spacing and local velocity) 
     302   rn_ahm_0      = 100000.     !  horizontal laplacian eddy viscosity   [m2/s] 
     303   rn_ahm_b      =      0.     !  background eddy viscosity for ldf_iso [m2/s] 
     304   rn_bhm_0      =      0.     !  horizontal bilaplacian eddy viscosity [m4/s] 
    267305/ 
    268306!----------------------------------------------------------------------- 
     
    279317!----------------------------------------------------------------------- 
    280318   nn_etau     =   0       !  penetration of tke below the mixed layer (ML) due to internal & intertial waves 
    281 / 
    282 !------------------------------------------------------------------------ 
    283 &namzdf_kpp    !   K-Profile Parameterization dependent vertical mixing  ("key_zdfkpp", and optionally: 
    284 !------------------------------------------------------------------------ "key_kppcustom" or "key_kpplktb") 
    285319/ 
    286320!----------------------------------------------------------------------- 
     
    313347!              !       or mixed-layer trends or barotropic vorticity    ("key_trdmld" or     "key_trdvor") 
    314348!----------------------------------------------------------------------- 
    315 / 
     349   ln_glo_trd  = .false.   ! (T) global domain averaged diag for T, T^2, KE, and PE 
     350   ln_dyn_trd  = .false.   ! (T) 3D momentum trend output 
     351   ln_dyn_mxl  = .FALSE.   ! (T) 2D momentum trends averaged over the mixed layer (not coded yet) 
     352   ln_vor_trd  = .FALSE.   ! (T) 2D barotropic vorticity trends (not coded yet) 
     353   ln_KE_trd   = .false.   ! (T) 3D Kinetic   Energy     trends 
     354   ln_PE_trd   = .false.   ! (T) 3D Potential Energy     trends 
     355   ln_tra_trd  = .false.    ! (T) 3D tracer trend output 
     356   ln_tra_mxl  = .false.   ! (T) 2D tracer trends averaged over the mixed layer (not coded yet) 
     357   nn_trd      = 365       !  print frequency (ln_glo_trd=T) (unit=time step) 
     358/ 
     359!!gm   nn_ctls     =   0       !  control surface type in mixed-layer trends (0,1 or n<jpk) 
     360!!gm   rn_ucf      =   1.      !  unit conversion factor (=1 -> /seconds ; =86400. -> /day) 
     361!!gm   cn_trdrst_in      = "restart_mld"   ! suffix of ocean restart name (input) 
     362!!gm   cn_trdrst_out     = "restart_mld"   ! suffix of ocean restart name (output) 
     363!!gm   ln_trdmld_restart = .false.         !  restart for ML diagnostics 
     364!!gm   ln_trdmld_instant = .false.         !  flag to diagnose trends of instantantaneous or mean ML T/S 
     365!!gm 
    316366!----------------------------------------------------------------------- 
    317367&namflo       !   float parameters                                      ("key_float") 
  • branches/2016/dev_r7161_trunk_XIOS2/NEMOGCM/CONFIG/GYRE_XIOS/cpp_GYRE_XIOS.fcm

    r5930 r7401  
    1  bld::tool::fppkeys key_zdftke key_iomput key_mpp_mpi 
     1 bld::tool::fppkeys key_zdftke key_iomput key_mpp_mpi key_xios2 key_nosignedzero 
  • branches/2016/dev_r7161_trunk_XIOS2/NEMOGCM/CONFIG/cfg.txt

    r6403 r7401  
    11GYRE_PISCES OPA_SRC TOP_SRC 
    22ORCA2_LIM_CFC_C14b OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
    3 GYRE_XIOS OPA_SRC 
    43ORCA2_SAS_LIM OPA_SRC SAS_SRC LIM_SRC_2 NST_SRC 
    54C1D_PAPA OPA_SRC 
     
    1110GYRE OPA_SRC 
    1211ORCA2_LIM_PISCES OPA_SRC LIM_SRC_2 NST_SRC TOP_SRC 
     12GYRE_XIOS OPA_SRC 
  • branches/2016/dev_r7161_trunk_XIOS2/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r6519 r7401  
    9393      CHARACTER(len=*), INTENT(in)  :: cdname 
    9494#if defined key_iomput 
    95       TYPE(xios_time)   :: dtime    = xios_time(0, 0, 0, 0, 0, 0) 
    96       CHARACTER(len=19) :: cldate  
     95 
     96#if defined key_xios2 
     97      TYPE(xios_duration) :: dtime    = xios_duration(0, 0, 0, 0, 0, 0) 
     98      TYPE(xios_date)     :: start_date 
     99#else 
     100      TYPE(xios_time)     :: dtime    = xios_time(0, 0, 0, 0, 0, 0) 
     101      CHARACTER(len=19)   :: cldate  
     102#endif 
    97103      CHARACTER(len=10) :: clname 
    98104      INTEGER           ::   ji 
    99105      ! 
    100       REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: z_bnds 
    101       !!---------------------------------------------------------------------- 
    102  
    103       ALLOCATE( z_bnds(jpk,2) ) 
     106      REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zt_bnds, zw_bnds 
     107      !!---------------------------------------------------------------------- 
     108 
     109#if  defined key_xios2 
     110      ALLOCATE( zt_bnds(2,jpk), zw_bnds(2,jpk) ) 
     111#else 
     112      ALLOCATE( zt_bnds(jpk,2), zw_bnds(jpk,2) ) 
     113#endif 
    104114 
    105115      clname = cdname 
     
    108118      CALL iom_swap( cdname ) 
    109119 
     120 
     121#if  defined key_xios2 
     122      ! Calendar type is now defined in xml file  
     123      SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
     124      CASE ( 1)   ; CALL xios_define_calendar( TYPE = "Gregorian", time_origin = xios_date(1900,01,01,00,00,00), & 
     125          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
     126      CASE ( 0)   ; CALL xios_define_calendar( TYPE = "NoLeap"   , time_origin = xios_date(1900,01,01,00,00,00), & 
     127          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
     128      CASE (30)   ; CALL xios_define_calendar( TYPE = "D360"     , time_origin = xios_date(1900,01,01,00,00,00), & 
     129          &                                    start_date = xios_date(nyear,nmonth,nday,0,0,0) ) 
     130      END SELECT 
     131#else 
    110132      ! calendar parameters 
    111133      SELECT CASE ( nleapy )        ! Choose calendar for IOIPSL 
     
    117139      CALL xios_set_context_attr(TRIM(clname), start_date=cldate ) 
    118140 
     141#endif 
    119142      ! horizontal grid definition 
    120143      CALL set_scalar 
     
    169192 
    170193      ! Add vertical grid bounds 
    171       z_bnds(:      ,1) = gdepw_1d(:) 
    172       z_bnds(1:jpkm1,2) = gdepw_1d(2:jpk) 
    173       z_bnds(jpk:   ,2) = gdepw_1d(jpk) + e3t_1d(jpk) 
    174       CALL iom_set_axis_attr( "deptht", bounds=z_bnds ) 
    175       CALL iom_set_axis_attr( "depthu", bounds=z_bnds ) 
    176       CALL iom_set_axis_attr( "depthv", bounds=z_bnds ) 
    177       z_bnds(:    ,2) = gdept_1d(:) 
    178       z_bnds(2:jpk,1) = gdept_1d(1:jpkm1) 
    179       z_bnds(1    ,1) = gdept_1d(1) - e3w_1d(1) 
    180       CALL iom_set_axis_attr( "depthw", bounds=z_bnds ) 
     194#if defined key_xios2 
     195      zt_bnds(2,:      ) = gdept_1d(:) 
     196      zt_bnds(1,2:jpk  ) = gdept_1d(1:jpkm1) 
     197      zt_bnds(1,1      ) = gdept_1d(1) - e3w_1d(1) 
     198      zw_bnds(1      ,:) = gdepw_1d(:) 
     199      zw_bnds(2,1:jpkm1) = gdepw_1d(2:jpk) 
     200      zw_bnds(2,jpk:   ) = gdepw_1d(jpk) + e3t_1d(jpk) 
     201#else 
     202      zt_bnds(:    ,2  ) = gdept_1d(:) 
     203      zt_bnds(2:jpk,1  ) = gdept_1d(1:jpkm1) 
     204      zt_bnds(1    ,1  ) = gdept_1d(1) - e3w_1d(1) 
     205      zw_bnds(:      ,1) = gdepw_1d(:) 
     206      zw_bnds(1:jpkm1,2) = gdepw_1d(2:jpk) 
     207      zw_bnds(jpk:   ,2) = gdepw_1d(jpk) + e3t_1d(jpk) 
     208#endif 
     209      CALL iom_set_axis_attr( "deptht", bounds=zt_bnds ) 
     210      CALL iom_set_axis_attr( "depthu", bounds=zt_bnds ) 
     211      CALL iom_set_axis_attr( "depthv", bounds=zt_bnds ) 
     212      CALL iom_set_axis_attr( "depthw", bounds=zw_bnds ) 
     213 
    181214 
    182215# if defined key_floats 
     
    200233      CALL xios_update_calendar(0) 
    201234 
    202       DEALLOCATE( z_bnds ) 
     235      DEALLOCATE( zt_bnds, zw_bnds ) 
    203236 
    204237#endif 
     
    11301163      REAL(wp), DIMENSION(:)   , OPTIONAL, INTENT(in) ::   lonvalue, latvalue 
    11311164      REAL(wp), DIMENSION(:,:) , OPTIONAL, INTENT(in) ::   bounds_lon, bounds_lat, area 
    1132       LOGICAL,  DIMENSION(:,:) , OPTIONAL, INTENT(in) ::   mask 
    1133  
     1165#if defined key_xios2 
     1166      LOGICAL, DIMENSION(:)   , OPTIONAL, INTENT(in) ::   mask 
     1167#else 
     1168      LOGICAL, DIMENSION(:,:) , OPTIONAL, INTENT(in) ::   mask 
     1169#endif 
     1170 
     1171 
     1172#if defined key_xios2 
     1173      IF ( xios_is_valid_domain     (cdid) ) THEN 
     1174         CALL xios_set_domain_attr     ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
     1175            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   & 
     1176            &    lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon,      & 
     1177            &    bounds_lat_1D=bounds_lat, area=area, type='curvilinear') 
     1178     ENDIF 
     1179      IF ( xios_is_valid_domaingroup(cdid) ) THEN 
     1180         CALL xios_set_domaingroup_attr( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
     1181            &    data_dim=data_dim, data_ibegin=data_ibegin, data_ni=data_ni, data_jbegin=data_jbegin, data_nj=data_nj ,   & 
     1182            &    lonvalue_1D=lonvalue, latvalue_1D=latvalue, mask_1D=mask, nvertex=nvertex, bounds_lon_1D=bounds_lon,      & 
     1183            &    bounds_lat_1D=bounds_lat, area=area, type='curvilinear' ) 
     1184      ENDIF 
     1185#else 
    11341186      IF ( xios_is_valid_domain     (cdid) ) THEN 
    11351187         CALL xios_set_domain_attr     ( cdid, ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, jbegin=jbegin, ni=ni, nj=nj,   & 
     
    11471199            &    bounds_lat=bounds_lat, area=area ) 
    11481200      ENDIF 
     1201#endif 
    11491202      CALL xios_solve_inheritance() 
    11501203 
    11511204   END SUBROUTINE iom_set_domain_attr 
     1205 
     1206#if defined key_xios2 
     1207  SUBROUTINE iom_set_zoom_domain_attr( cdid, ibegin, jbegin, ni, nj) 
     1208     CHARACTER(LEN=*)                   , INTENT(in) ::   cdid 
     1209     INTEGER                  , OPTIONAL, INTENT(in) ::   ibegin, jbegin, ni, nj 
     1210 
     1211     IF ( xios_is_valid_zoom_domain     (cdid) ) THEN 
     1212         CALL xios_set_zoom_domain_attr     ( cdid, ibegin=ibegin, jbegin=jbegin, ni=ni,    & 
     1213           &   nj=nj) 
     1214    ENDIF 
     1215  END SUBROUTINE iom_set_zoom_domain_attr 
     1216#endif 
    11521217 
    11531218 
     
    11561221      REAL(wp), DIMENSION(:)  , OPTIONAL, INTENT(in) ::   paxis 
    11571222      REAL(wp), DIMENSION(:,:), OPTIONAL, INTENT(in) ::   bounds 
     1223 
     1224#if defined key_xios2 
     1225      IF ( PRESENT(paxis) ) THEN 
     1226         IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, n_glo=SIZE(paxis), value=paxis ) 
     1227         IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, n_glo=SIZE(paxis), value=paxis ) 
     1228      ENDIF 
     1229#else 
    11581230      IF ( PRESENT(paxis) ) THEN 
    11591231         IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, size=SIZE(paxis), value=paxis ) 
    11601232         IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, size=SIZE(paxis), value=paxis ) 
    11611233      ENDIF 
     1234#endif 
    11621235      IF ( xios_is_valid_axis     (cdid) )   CALL xios_set_axis_attr     ( cdid, bounds=bounds ) 
    11631236      IF ( xios_is_valid_axisgroup(cdid) )   CALL xios_set_axisgroup_attr( cdid, bounds=bounds ) 
     
    11681241   SUBROUTINE iom_set_field_attr( cdid, freq_op, freq_offset ) 
    11691242      CHARACTER(LEN=*)          , INTENT(in) ::   cdid 
     1243#if defined key_xios2 
     1244      TYPE(xios_duration),OPTIONAL , INTENT(in) ::   freq_op 
     1245      TYPE(xios_duration),OPTIONAL , INTENT(in) ::   freq_offset 
     1246#else 
    11701247      CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_op 
    11711248      CHARACTER(LEN=*),OPTIONAL , INTENT(in) ::   freq_offset 
     1249#endif 
    11721250      IF ( xios_is_valid_field     (cdid) )   CALL xios_set_field_attr       & 
    11731251    &     ( cdid, freq_op=freq_op, freq_offset=freq_offset ) 
     
    11891267   SUBROUTINE iom_get_file_attr( cdid, name, name_suffix, output_freq ) 
    11901268      CHARACTER(LEN=*)          , INTENT(in ) ::   cdid 
    1191       CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::   name, name_suffix, output_freq 
     1269      CHARACTER(LEN=*),OPTIONAL , INTENT(out) ::   name, name_suffix 
     1270#if defined key_xios2 
     1271      TYPE(xios_duration), OPTIONAL , INTENT(out) :: output_freq 
     1272#else 
     1273      CHARACTER(LEN=*)   , OPTIONAL , INTENT(out) :: output_freq 
     1274#endif   
    11921275      LOGICAL                                 ::   llexist1,llexist2,llexist3 
    11931276      !--------------------------------------------------------------------- 
    11941277      IF( PRESENT( name        ) )   name = ''          ! default values 
    11951278      IF( PRESENT( name_suffix ) )   name_suffix = '' 
     1279#if defined key_xios2 
     1280      IF( PRESENT( output_freq ) )   output_freq = xios_duration(0,0,0,0,0,0) 
     1281#else 
    11961282      IF( PRESENT( output_freq ) )   output_freq = '' 
     1283#endif 
    11971284      IF ( xios_is_valid_file     (cdid) ) THEN 
    11981285         CALL xios_solve_inheritance() 
     
    12151302      CHARACTER(LEN=*)                   , INTENT(in) ::   cdid 
    12161303      LOGICAL, DIMENSION(:,:,:), OPTIONAL, INTENT(in) ::   mask 
     1304#if defined key_xios2 
     1305      IF ( xios_is_valid_grid     (cdid) )   CALL xios_set_grid_attr     ( cdid, mask_3D=mask ) 
     1306      IF ( xios_is_valid_gridgroup(cdid) )   CALL xios_set_gridgroup_attr( cdid, mask_3D=mask ) 
     1307#else 
    12171308      IF ( xios_is_valid_grid     (cdid) )   CALL xios_set_grid_attr     ( cdid, mask=mask ) 
    12181309      IF ( xios_is_valid_gridgroup(cdid) )   CALL xios_set_gridgroup_attr( cdid, mask=mask ) 
     1310#endif 
    12191311      CALL xios_solve_inheritance() 
    12201312   END SUBROUTINE iom_set_grid_attr 
     
    12581350      ni=nlei-nldi+1 ; nj=nlej-nldj+1 
    12591351 
     1352#if defined key_xios2 
     1353      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) 
     1354#else 
    12601355      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) 
     1356#endif      
    12611357      CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
    12621358      CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(nldi:nlei, nldj:nlej),(/ ni*nj /)),   & 
     
    12721368         END SELECT 
    12731369         ! 
     1370#if defined key_xios2 
     1371         CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni*nj    /)) /= 0. ) 
     1372#else 
    12741373         CALL iom_set_domain_attr( "grid_"//cdgrd       , mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,1),(/ni,nj    /)) /= 0. ) 
     1374#endif  
    12751375         CALL iom_set_grid_attr  ( "grid_"//cdgrd//"_3D", mask = RESHAPE(zmask(nldi:nlei,nldj:nlej,:),(/ni,nj,jpk/)) /= 0. ) 
    12761376      ENDIF 
     
    14061506      ALLOCATE( zlon(ni*nj) )       ;       zlon(:) = 0. 
    14071507 
     1508      CALL dom_ngb( 180., 90., ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
     1509#if  defined key_xios2 
     1510      CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 
     1511      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
     1512      CALL iom_set_domain_attr("gznl", lonvalue = zlon,   & 
     1513         &                             latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /)))   
     1514      CALL iom_set_zoom_domain_attr ("ptr", ibegin=ix-1, jbegin=0, ni=1, nj=jpjglo) 
     1515#else 
    14081516      CALL iom_set_domain_attr("gznl", ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-1, jbegin=njmpp+nldj-1, ni=ni, nj=nj) 
    14091517      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
    14101518      CALL iom_set_domain_attr("gznl", lonvalue = zlon,   & 
    14111519         &                             latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /)))   
    1412       ! 
    1413       CALL dom_ngb( 180., 90., ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
    14141520      CALL iom_set_domain_attr ('ptr', zoom_ibegin=ix, zoom_nj=jpjglo) 
     1521#endif 
     1522      ! 
    14151523      CALL iom_update_file_name('ptr') 
    14161524      ! 
     
    14261534      REAL(wp), DIMENSION(1)   ::   zz = 1. 
    14271535      !!---------------------------------------------------------------------- 
     1536 
     1537#if defined key_xios2 
     1538      CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea-1, jbegin=0, ni=1, nj=1) 
     1539#else 
    14281540      CALL iom_set_domain_attr('scalarpoint', ni_glo=jpnij, nj_glo=1, ibegin=narea, jbegin=1, ni=1, nj=1) 
     1541#endif 
    14291542      CALL iom_set_domain_attr('scalarpoint', data_dim=2, data_ibegin = 1, data_ni = 1, data_jbegin = 1, data_nj = 1) 
    14301543       
     
    14551568      REAL(wp)        ,DIMENSION( 3) ::   zlonpira                 ! longitudes of pirata moorings 
    14561569      REAL(wp)        ,DIMENSION( 9) ::   zlatpira                 ! latitudes  of pirata moorings 
     1570#if  defined key_xios2 
     1571      TYPE(xios_duration)            ::   f_op, f_of 
     1572#endif 
    14571573      !!---------------------------------------------------------------------- 
    14581574      !  
    14591575      ! frequency of the call of iom_put (attribut: freq_op) 
    1460       WRITE(cl1,'(i1)')        1   ;   CALL iom_set_field_attr('field_definition', freq_op = cl1//'ts', freq_offset='0ts') 
    1461       WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC'             , freq_op = cl1//'ts', freq_offset='0ts') 
    1462       WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC_scalar'      , freq_op = cl1//'ts', freq_offset='0ts') 
    1463       WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('ptrc_T'          , freq_op = cl1//'ts', freq_offset='0ts') 
    1464       WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('diad_T'          , freq_op = cl1//'ts', freq_offset='0ts') 
    1465         
     1576#if defined key_xios2 
     1577      f_op%timestep = 1        ;  f_of%timestep = 0  ; CALL iom_set_field_attr('field_definition', freq_op=f_op, freq_offset=f_of) 
     1578      f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC'             , freq_op=f_op, freq_offset=f_of) 
     1579      f_op%timestep = nn_fsbc  ;  f_of%timestep = 0  ; CALL iom_set_field_attr('SBC_scalar'      , freq_op=f_op, freq_offset=f_of) 
     1580      f_op%timestep = nn_dttrc ;  f_of%timestep = 0  ; CALL iom_set_field_attr('ptrc_T'          , freq_op=f_op, freq_offset=f_of) 
     1581      f_op%timestep = nn_dttrc ;  f_of%timestep = 0  ; CALL iom_set_field_attr('diad_T'          , freq_op=f_op, freq_offset=f_of) 
     1582#else 
     1583      WRITE(cl1,'(i1)')        1   ;   CALL iom_set_field_attr('field_definition', freq_op=cl1//'ts', freq_offset='0ts') 
     1584      WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC'             , freq_op=cl1//'ts', freq_offset='0ts') 
     1585      WRITE(cl1,'(i1)')  nn_fsbc   ;   CALL iom_set_field_attr('SBC_scalar'      , freq_op=cl1//'ts', freq_offset='0ts') 
     1586      WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('ptrc_T'          , freq_op=cl1//'ts', freq_offset='0ts') 
     1587      WRITE(cl1,'(i1)') nn_dttrc   ;   CALL iom_set_field_attr('diad_T'          , freq_op=cl1//'ts', freq_offset='0ts') 
     1588#endif 
     1589 
    14661590      ! output file names (attribut: name) 
    14671591      DO ji = 1, 9 
     
    14841608         ! Equatorial section (attributs: jbegin, ni, name_suffix) 
    14851609         CALL dom_ngb( 0., 0., ix, iy, cl1 ) 
     1610#if defined key_xios2 
     1611         CALL iom_set_zoom_domain_attr ('Eq'//cl1, jbegin=iy-1, ni=jpiglo) 
     1612#else 
    14861613         CALL iom_set_domain_attr ('Eq'//cl1, zoom_jbegin=iy, zoom_ni=jpiglo) 
     1614#endif 
    14871615         CALL iom_get_file_attr   ('Eq'//cl1, name_suffix = clsuff             ) 
    14881616         CALL iom_set_file_attr   ('Eq'//cl1, name_suffix = TRIM(clsuff)//'_Eq') 
     
    15641692               ENDIF 
    15651693               clname = TRIM(ADJUSTL(clat))//TRIM(ADJUSTL(clon)) 
     1694#if defined key_xios2 
     1695               CALL iom_set_zoom_domain_attr  (TRIM(clname)//cl1, ibegin= ix-1, jbegin= iy-1) 
     1696#else 
    15661697               CALL iom_set_domain_attr (TRIM(clname)//cl1, zoom_ibegin= ix, zoom_jbegin= iy) 
     1698#endif 
     1699 
    15671700               CALL iom_get_file_attr   (TRIM(clname)//cl1, name_suffix = clsuff                         ) 
    15681701               CALL iom_set_file_attr   (TRIM(clname)//cl1, name_suffix = TRIM(clsuff)//'_'//TRIM(clname)) 
     
    15931726      REAL(wp)           ::   zsec 
    15941727      LOGICAL            ::   llexist 
     1728#if  defined key_xios2 
     1729      TYPE(xios_duration)   ::   output_freq  
     1730#endif  
    15951731      !!---------------------------------------------------------------------- 
    15961732 
    15971733      DO jn = 1,2 
    15981734 
     1735#if defined key_xios2 
     1736         output_freq = xios_duration(0,0,0,0,0,0) 
     1737         IF( jn == 1 )   CALL iom_get_file_attr( cdid, name        = clname, output_freq = output_freq ) 
     1738#else 
    15991739         IF( jn == 1 )   CALL iom_get_file_attr( cdid, name        = clname, output_freq = clfreq ) 
     1740#endif 
    16001741         IF( jn == 2 )   CALL iom_get_file_attr( cdid, name_suffix = clname ) 
    16011742 
     
    16081749            END DO 
    16091750 
     1751#if defined key_xios2 
     1752            idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
     1753            DO WHILE ( idx /= 0 )  
     1754              IF ( output_freq%timestep /= 0) THEN 
     1755                  WRITE(clfreq,'(I18,A2)')INT(output_freq%timestep),'ts'  
     1756                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1757              ELSE IF ( output_freq%hour /= 0 ) THEN 
     1758                  WRITE(clfreq,'(I19,A1)')INT(output_freq%hour),'h'  
     1759                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1760              ELSE IF ( output_freq%day /= 0 ) THEN 
     1761                  WRITE(clfreq,'(I19,A1)')INT(output_freq%day),'d'  
     1762                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1763              ELSE IF ( output_freq%month /= 0 ) THEN    
     1764                  WRITE(clfreq,'(I19,A1)')INT(output_freq%month),'m'  
     1765                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1766              ELSE IF ( output_freq%year /= 0 ) THEN    
     1767                  WRITE(clfreq,'(I19,A1)')INT(output_freq%year),'y'  
     1768                  itrlen = LEN_TRIM(ADJUSTL(clfreq)) 
     1769              ELSE 
     1770                  CALL ctl_stop('error in the name of file id '//TRIM(cdid),   & 
     1771                     & ' attribute output_freq is undefined -> cannot replace @freq@ in '//TRIM(clname) ) 
     1772              ENDIF 
     1773              clname = clname(1:idx-1)//TRIM(ADJUSTL(clfreq))//clname(idx+6:LEN_TRIM(clname)) 
     1774              idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
     1775            END DO 
     1776#else 
    16101777            idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
    16111778            DO WHILE ( idx /= 0 )  
     
    16201787               idx = INDEX(clname,'@freq@') + INDEX(clname,'@FREQ@') 
    16211788            END DO 
    1622  
     1789#endif 
    16231790            idx = INDEX(clname,'@startdate@') + INDEX(clname,'@STARTDATE@') 
    16241791            DO WHILE ( idx /= 0 )  
Note: See TracChangeset for help on using the changeset viewer.