Changeset 3867


Ignore:
Timestamp:
Jan 8, 2016, 9:52:14 AM (9 years ago)
Author:
ymipsl
Message:
  • Switch to XIOS 2
  • Append main part of forcing configuration (LMDZ stand alone)
  • Create etat0 and limit from usual LMDZ input files, using XIOS 2 interpolation functionnalities
    • missing parametrization of gravity waves
    • missing aerosol
Location:
dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/limit_read_mod.F90

    r3817 r3867  
    3131!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    3232
     33
     34  SUBROUTINE init_limit_read(first_day)
     35  USE mod_grid_phy_lmdz
     36  USE surface_data
     37  USE XIOS
     38  USE etat0_limit_unstruct_mod, ONLY: create_etat0_limit
     39  IMPLICIT NONE
     40    INTEGER, INTENT(IN) :: first_day
     41   
     42   
     43    IF ( type_ocean /= 'couple') THEN
     44      IF (grid_type==unstructured) THEN
     45        IF (.NOT. create_etat0_limit) CALL xios_set_file_attr("limit_read",enabled=.TRUE.,record_offset=first_day)
     46      ENDIF 
     47    ENDIF
     48 
     49  END SUBROUTINE init_limit_read
     50 
    3351  SUBROUTINE limit_read_frac(itime, dtime, jour, pctsrf_new, is_modified)
    3452!
     
    148166    USE netcdf
    149167    USE indice_sol_mod
    150 
     168    USE XIOS
     169   
    151170    IMPLICIT NONE
    152171   
     
    177196    REAL, DIMENSION(klon_glo)                 :: rug_glo  ! rugosity at global grid
    178197    REAL, DIMENSION(klon_glo)                 :: alb_glo  ! albedo at global grid
     198
     199    REAL, DIMENSION(klon_mpi,nbsrf)           :: pct_mpi  ! fraction at global grid
     200    REAL, DIMENSION(klon_mpi)                 :: sst_mpi  ! sea-surface temperature at global grid
     201    REAL, DIMENSION(klon_mpi)                 :: rug_mpi  ! rugosity at global grid
     202    REAL, DIMENSION(klon_mpi)                 :: alb_mpi  ! albedo at global grid
     203
    179204    CHARACTER(len=20)                         :: modname='limit_read_mod'     
    180205
     
    211236
    212237    is_modified = .FALSE.
    213     IF (MOD(itime-1, lmt_pas) == 0 .OR. jour_lu /= jour ) THEN   ! time to read
     238!ym    IF (MOD(itime-1, lmt_pas) == 0 .OR. jour_lu /= jour ) THEN   ! time to read
     239!  not REALLY PERIODIC
     240    IF (MOD(itime-1, lmt_pas) == 0) THEN   ! time to read
    214241       jour_lu = jour
    215242       is_modified = .TRUE.
     243
     244      IF (grid_type==unstructured) THEN
     245
    216246!$OMP MASTER  ! Only master thread
    217        IF (is_mpi_root) THEN ! Only master processus
    218 
    219           ierr = NF90_OPEN ('limit.nc', NF90_NOWRITE, nid)
    220           IF (ierr /= NF90_NOERR) CALL abort_physic(modname,&
    221                'Pb d''ouverture du fichier de conditions aux limites',1)
    222          
    223           ! La tranche de donnees a lire:
    224           start(1) = 1
    225           start(2) = jour
    226           epais(1) = klon_glo
    227           epais(2) = 1
    228 
    229 
    230 !****************************************************************************************
    231 ! 2) Read fraction if not type_ocean=couple
    232 !
    233 !****************************************************************************************
    234 
    235           IF ( type_ocean /= 'couple') THEN
    236 !
    237 ! Ocean fraction
    238              ierr = NF90_INQ_VARID(nid, 'FOCE', nvarid)
    239              IF (ierr /= NF90_NOERR) CALL abort_physic(modname, 'Le champ <FOCE> est absent',1)
    240              
    241              ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_oce),start,epais)
    242              IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FOCE>' ,1)
    243 !
    244 ! Sea-ice fraction
    245              ierr = NF90_INQ_VARID(nid, 'FSIC', nvarid)
    246              IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FSIC> est absent',1)
    247 
    248              ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_sic),start,epais)
    249              IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FSIC>' ,1)
    250 
    251 
    252 ! Read land and continentals fraction only if asked for
    253              IF (read_continents .OR. itime == 1) THEN
    254 !
    255 ! Land fraction
    256                 ierr = NF90_INQ_VARID(nid, 'FTER', nvarid)
    257                 IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FTER> est absent',1)
    258                
    259                 ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_ter),start,epais)
    260                 IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FTER>',1)
    261 !
    262 ! Continentale ice fraction
    263                 ierr = NF90_INQ_VARID(nid, 'FLIC', nvarid)
    264                 IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FLIC> est absent',1)
    265 
    266                 ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_lic),start,epais)
    267                 IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FLIC>',1)
    268              END IF
     247
     248
     249        IF ( type_ocean /= 'couple') THEN
     250
     251           CALL xios_recv_field("foce_limin",pct_mpi(:,is_oce))
     252           CALL xios_recv_field("fsic_limin",pct_mpi(:,is_sic))
     253  !         IF (read_continents .OR. itime == 1) THEN
     254             CALL xios_recv_field("fter_limin",pct_mpi(:,is_ter))
     255             CALL xios_recv_field("flic_limin",pct_mpi(:,is_lic))
     256  !         ENDIF
     257         ENDIF! type_ocean /= couple
     258         
     259         IF ( type_ocean /= 'couple') THEN                   
     260             CALL xios_recv_field("sst_limin",sst_mpi)
     261         ENDIF
     262       
     263         IF (.NOT. ok_veget) THEN
     264           CALL xios_recv_field("alb_limin",alb_mpi)
     265           CALL xios_recv_field("rug_limin",rug_mpi)
     266         ENDIF
     267
     268       IF ( type_ocean /= 'couple') THEN
     269          CALL Scatter_omp(sst_mpi,sst)
     270          CALL Scatter_omp(pct_mpi(:,is_oce),pctsrf(:,is_oce))
     271          CALL Scatter_omp(pct_mpi(:,is_sic),pctsrf(:,is_sic))
     272!          IF (read_continents .OR. itime == 1) THEN
     273             CALL Scatter_omp(pct_mpi(:,is_ter),pctsrf(:,is_ter))
     274             CALL Scatter_omp(pct_mpi(:,is_lic),pctsrf(:,is_lic))
     275!          END IF
     276       END IF
     277
     278       IF (.NOT. ok_veget) THEN
     279          CALL Scatter_omp(alb_mpi, albedo)
     280          CALL Scatter_omp(rug_mpi, rugos)
     281       END IF
     282
     283!$OMP END MASTER
     284
     285 
     286     ELSE      ! grid_type==regular
     287
     288!$OMP MASTER  ! Only master thread
     289
     290       IF (is_mpi_root) THEN ! Only master processus!
     291
     292            ierr = NF90_OPEN ('limit.nc', NF90_NOWRITE, nid)
     293            IF (ierr /= NF90_NOERR) CALL abort_physic(modname,&
     294                 'Pb d''ouverture du fichier de conditions aux limites',1)
     295           
     296            ! La tranche de donnees a lire:
     297            start(1) = 1
     298            start(2) = jour
     299            epais(1) = klon_glo
     300            epais(2) = 1
     301
     302
     303  !****************************************************************************************
     304  ! 2) Read fraction if not type_ocean=couple
     305  !
     306  !****************************************************************************************
     307
     308            IF ( type_ocean /= 'couple') THEN
     309  !
     310  ! Ocean fraction
     311               ierr = NF90_INQ_VARID(nid, 'FOCE', nvarid)
     312               IF (ierr /= NF90_NOERR) CALL abort_physic(modname, 'Le champ <FOCE> est absent',1)
     313               
     314               ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_oce),start,epais)
     315               IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FOCE>' ,1)
     316  !
     317  ! Sea-ice fraction
     318               ierr = NF90_INQ_VARID(nid, 'FSIC', nvarid)
     319               IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FSIC> est absent',1)
     320
     321               ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_sic),start,epais)
     322               IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FSIC>' ,1)
     323
     324
     325  ! Read land and continentals fraction only if asked for
     326               IF (read_continents .OR. itime == 1) THEN
     327  !
     328  ! Land fraction
     329                  ierr = NF90_INQ_VARID(nid, 'FTER', nvarid)
     330                  IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FTER> est absent',1)
     331                 
     332                  ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_ter),start,epais)
     333                  IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FTER>',1)
     334  !
     335  ! Continentale ice fraction
     336                  ierr = NF90_INQ_VARID(nid, 'FLIC', nvarid)
     337                  IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FLIC> est absent',1)
     338
     339                  ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_lic),start,epais)
     340                  IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FLIC>',1)
     341               END IF
     342
    269343
    270344          END IF ! type_ocean /= couple
     
    289363!****************************************************************************************
    290364
    291           IF (.NOT. ok_veget) THEN
    292 !
    293 ! Read albedo
    294              ierr = NF90_INQ_VARID(nid, 'ALB', nvarid)
    295              IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <ALB> est absent',1)
    296 
    297              ierr = NF90_GET_VAR(nid,nvarid,alb_glo,start,epais)
    298              IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <ALB>',1)
    299 !
    300 ! Read rugosity
    301              ierr = NF90_INQ_VARID(nid, 'RUG', nvarid)
    302              IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <RUG> est absent',1)
    303 
    304              ierr = NF90_GET_VAR(nid,nvarid,rug_glo,start,epais)
    305              IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <RUG>',1)
    306 
    307           END IF
     365             IF (.NOT. ok_veget) THEN
     366   !
     367   ! Read albedo
     368                ierr = NF90_INQ_VARID(nid, 'ALB', nvarid)
     369                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <ALB> est absent',1)
     370
     371                ierr = NF90_GET_VAR(nid,nvarid,alb_glo,start,epais)
     372                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <ALB>',1)
     373   !
     374   ! Read rugosity
     375                ierr = NF90_INQ_VARID(nid, 'RUG', nvarid)
     376                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <RUG> est absent',1)
     377
     378                ierr = NF90_GET_VAR(nid,nvarid,rug_glo,start,epais)
     379                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <RUG>',1)
     380
     381             END IF
    308382
    309383!****************************************************************************************
     
    314388          IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Pb when closing file', 1)
    315389       ENDIF ! is_mpi_root
    316 
    317 !$OMP END MASTER
    318 !$OMP BARRIER
     390   
     391
     392  !$OMP END MASTER
     393  !$OMP BARRIER
    319394
    320395       IF ( type_ocean /= 'couple') THEN
     
    332407          CALL Scatter(rug_glo, rugos)
    333408       END IF
     409     
     410     ENDIF    ! grid_type
    334411
    335412    ENDIF ! time to read
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phyaqua_mod.F90

    r3842 r3867  
    235235    CALL profil_sst(nlon, latitude, type_profil, phy_sst)
    236236
    237     CALL writelim(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, phy_ice, &
     237    CALL writelim_unstruct(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, phy_ice, &
    238238      phy_fter, phy_foce, phy_flic, phy_fsic)
    239239
     
    332332
    333333    PRINT *, 'iniaqua: after phyredem'
    334     CALL phys_state_var_end
     334!    CALL phys_state_var_end
    335335
    336336    RETURN
     
    455455  ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    456456
    457   SUBROUTINE writelim(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, &
     457  SUBROUTINE writelim_unstruct(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, &
    458458      phy_ice, phy_fter, phy_foce, phy_flic, phy_fsic)
    459459
    460     USE mod_phys_lmdz_para, ONLY: is_master
    461     USE mod_grid_phy_lmdz, ONLY: klon_glo
    462     USE mod_phys_lmdz_transfert_para, ONLY: gather
     460    USE mod_phys_lmdz_para, ONLY: is_omp_master, klon_mpi
     461    USE mod_phys_lmdz_transfert_para, ONLY: gather_omp
     462    USE xios
    463463    IMPLICIT NONE
    464464
     
    477477    REAL, INTENT (IN) :: phy_fsic(klon, 360)
    478478
     479    REAL :: phy_glo(klon_mpi, 360) ! temporary variable, to store phy_***(:)
     480      ! on the whole physics grid
     481 
     482
     483    PRINT *, 'writelim: Ecriture du fichier limit'
     484
     485    CALL gather_omp(phy_foce, phy_glo)
     486    IF (is_omp_master) CALL xios_send_field('foce_limout',phy_glo)
     487
     488    CALL gather_omp(phy_fsic, phy_glo)
     489    IF (is_omp_master) CALL xios_send_field('fsic_limout',phy_glo)
     490     
     491    CALL gather_omp(phy_fter, phy_glo)
     492    IF (is_omp_master) CALL xios_send_field('fter_limout',phy_glo)
     493     
     494    CALL gather_omp(phy_flic, phy_glo)
     495    IF (is_omp_master) CALL xios_send_field('flic_limout',phy_glo)
     496
     497    CALL gather_omp(phy_sst, phy_glo)
     498    IF (is_omp_master) CALL xios_send_field('sst_limout',phy_glo)
     499
     500    CALL gather_omp(phy_bil, phy_glo)
     501    IF (is_omp_master) CALL xios_send_field('bils_limout',phy_glo)
     502
     503    CALL gather_omp(phy_alb, phy_glo)
     504    IF (is_omp_master) CALL xios_send_field('alb_limout',phy_glo)
     505
     506    CALL gather_omp(phy_rug, phy_glo)
     507    IF (is_omp_master) CALL xios_send_field('rug_limout',phy_glo)
     508
     509  END SUBROUTINE writelim_unstruct
     510
     511
     512
     513  SUBROUTINE writelim(klon, phy_nat, phy_alb, phy_sst, phy_bil, phy_rug, &
     514      phy_ice, phy_fter, phy_foce, phy_flic, phy_fsic)
     515
     516    USE mod_phys_lmdz_para, ONLY: is_master
     517    USE mod_grid_phy_lmdz, ONLY: klon_glo
     518    USE mod_phys_lmdz_transfert_para, ONLY: gather
     519    IMPLICIT NONE
     520
     521    include "netcdf.inc"
     522
     523    INTEGER, INTENT (IN) :: klon
     524    REAL, INTENT (IN) :: phy_nat(klon, 360)
     525    REAL, INTENT (IN) :: phy_alb(klon, 360)
     526    REAL, INTENT (IN) :: phy_sst(klon, 360)
     527    REAL, INTENT (IN) :: phy_bil(klon, 360)
     528    REAL, INTENT (IN) :: phy_rug(klon, 360)
     529    REAL, INTENT (IN) :: phy_ice(klon, 360)
     530    REAL, INTENT (IN) :: phy_fter(klon, 360)
     531    REAL, INTENT (IN) :: phy_foce(klon, 360)
     532    REAL, INTENT (IN) :: phy_flic(klon, 360)
     533    REAL, INTENT (IN) :: phy_fsic(klon, 360)
     534
    479535    REAL :: phy_glo(klon_glo, 360) ! temporary variable, to store phy_***(:)
    480536      ! on the whole physics grid
     
    494550      PRINT *, 'writelim: Ecriture du fichier limit'
    495551
    496       ierr = nf_create('limit.nc', nf_clobber, nid)
     552      ierr = nf_create('limit.nc', NF_NETCDF4, nid)
    497553
    498554      ierr = nf_put_att_text(nid, nf_global, 'title', 30, &
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phyetat0.F90

    r3838 r3867  
    2828  USE ocean_slab_mod, ONLY: tslab, seaice, tice, ocean_slab_init
    2929  USE time_phylmdz_mod, ONLY: init_iteration, pdtphys, itau_phy
     30  USE create_etat0_unstruct_mod
     31  USE wxios
    3032
    3133  IMPLICIT none
     
    7476 
    7577  REAL :: lon_startphy(klon), lat_startphy(klon)
    76 
     78 
    7779  ! FH1D
    7880  !     real iolat(jjm+1)
     
    879881  ENDIF
    880882
    881   CALL init_iophy_new(lat_degrees,lon_degrees)
     883!  CALL init_iophy_new(lat_degrees,lon_degrees)
    882884
    883885  ! Initilialize module fonte_neige_mod     
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phys_cal_mod.F90

    r3849 r3867  
    3636 
    3737  SUBROUTINE phys_cal_init(annee_ref,day_ref)
    38   USE IOIPSL, ONLY:  ymds2ju, getin
     38  USE IOIPSL, ONLY:  ymds2ju, getin, ioconf_calendar
    3939  USE mod_phys_lmdz_para, ONLY:  is_master,bcast
    4040  IMPLICIT NONE
     
    5151    IF (is_master) CALL getin('calend', calend)
    5252    CALL bcast(calend)
     53
     54    IF (calend == 'earth_360d') THEN
     55      CALL ioconf_calendar('360d')
     56    ELSE IF (calend == 'earth_365d') THEN
     57      CALL ioconf_calendar('noleap')
     58    ELSE IF (calend == 'earth_366d') THEN
     59      CALL ioconf_calendar('gregorian')
     60    ELSE
     61      CALL abort_physic('phys_cal_init','Mauvais choix de calendrier',1)
     62    ENDIF
     63
    5364
    5465    CALL ymds2ju(annee_ref, 1, day_ref, 0., jD_ref)
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phys_output_write_mod.F90

    r3849 r3867  
    298298
    299299    IF(.NOT.vars_defined) THEN
    300        iinitend = 2
     300       iinitend = 1
    301301    ELSE
    302302       iinitend = 1
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phys_state_var_mod.F90

    r3838 r3867  
    397397      !$OMP THREADPRIVATE(du_gwd_rando, dv_gwd_rando)
    398398      ! tendencies on wind due to gravity waves
    399 
     399     
    400400CONTAINS
    401401
     
    419419
    420420include "clesphys.h"
     421      INTEGER,SAVE :: is_initialized=.FALSE.
     422!$OMP THREADPRIVATE(is_initialized)   
     423
     424      IF (is_initialized) RETURN
     425      is_initialized=.TRUE.
    421426      ALLOCATE(pctsrf(klon,nbsrf))
    422427      ALLOCATE(ftsol(klon,nbsrf))
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/physiq.F90

    r3842 r3867  
    5050                              set_timestep, pdtphys
    5151  USE tracinca_mod, ONLY : config_inca                   
    52   USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, grid1dTo2d_glo, klon_glo
     52  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, grid1dTo2d_glo, klon_glo, grid_type, unstructured
    5353#ifdef REPROBUS
    5454  USE CHEM_REP, ONLY : Init_chem_rep_xjour
     
    6464  USE CFMIP_point_locations
    6565  use FLOTT_GWD_rando_m, only: FLOTT_GWD_rando
    66 
     66  USE etat0_limit_unstruct_mod
     67  USE xios
     68  USE regr_lat_time_climoz_m
     69  USE climoz_mod
     70  USE limit_read_mod, ONLY : init_limit_read
    6771  IMPLICIT none
    6872  !>======================================================================
     
    247251  real clw(klon,klev),elij(klon,klev,klev)
    248252  real epmlmMm(klon,klev,klev),eplaMm(klon,klev)
     253  real delta_epsilon
    249254  ! RomP <<<
    250255  !IM definition dynamique o_trac dans phys_output_open
     
    798803  !     ascending order
    799804
    800   integer, save:: co3i = 0
     805  integer, save:: co3i = -1
    801806  !     time index in NetCDF file of current ozone fields
    802807  !$OMP THREADPRIVATE(co3i)
     
    876881  mydebug=.FALSE.
    877882  CALL set_timestep(pdtphys_)
    878 
     883  IF (.NOT. debut)  CALL xios_update_calendar(itap+1)
    879884  !======================================================================
    880885  ! Ecriture eventuelle d'un profil verticale en entree de la physique.
     
    904909
    905910  if (first) then
    906 
     911     CALL init_etat0_limit_unstruct
     912     CALL init_limit_read(days_elapsed)
     913     
    907914     !CR:nvelles variables convection/poches froides
    908915
     
    10551062     radpas = NINT( 86400./pdtphys/nbapp_rad)
    10561063!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    1057 
     1064     CALL init_iophy_new(lat_degrees,lon_degrees)
     1065
     1066     !=============================================================
     1067     !   Initialisation des sorties
     1068     !=============================================================
     1069
     1070#ifdef CPP_IOIPSL
     1071
     1072     !$OMP MASTER
     1073! FH : if ok_sync=.true. , the time axis is written at each time step
     1074! in the output files. Only at the end in the opposite case
     1075     ok_sync_omp=.false.
     1076     CALL getin('ok_sync',ok_sync_omp)
     1077     call phys_output_open(lon_degrees,lat_degrees,nCFMIP,tabijGCM, &
     1078          iGCM,jGCM,lonGCM,latGCM, &
     1079          jjmp1,nlevSTD,clevSTD,rlevSTD, pdtphys,ok_veget, &
     1080          type_ocean,iflag_pbl,iflag_pbl_split,ok_mensuel,ok_journe, &
     1081          ok_hf,ok_instan,ok_LES,ok_ade,ok_aie,  &
     1082          read_climoz, phys_out_filestations, &
     1083          new_aod, aerosol_couple, &
     1084          flag_aerosol_strat, pdtphys, paprs, pphis,  &
     1085          pplay, lmax_th, ptconv, ptconvth, ivap,  &
     1086          d_t, qx, d_qx, zmasse, ok_sync_omp)
     1087     !$OMP END MASTER
     1088     !$OMP BARRIER
     1089     ok_sync=ok_sync_omp
     1090
     1091     freq_outNMC(1) = ecrit_files(7)
     1092     freq_outNMC(2) = ecrit_files(8)
     1093     freq_outNMC(3) = ecrit_files(9)
     1094     WRITE(lunout,*)'OK freq_outNMC(1)=',freq_outNMC(1)
     1095     WRITE(lunout,*)'OK freq_outNMC(2)=',freq_outNMC(2)
     1096     WRITE(lunout,*)'OK freq_outNMC(3)=',freq_outNMC(3)
     1097
     1098     include "ini_histday_seri.h"
     1099
     1100     include "ini_paramLMDZ_phy.h"
     1101
     1102#endif
     1103     ecrit_reg = ecrit_reg * un_jour
     1104     ecrit_tra = ecrit_tra * un_jour
     1105
     1106     !XXXPB Positionner date0 pour initialisation de ORCHIDEE
     1107     date0 = jD_ref
     1108     WRITE(*,*) 'physiq date0 : ',date0
     1109     
     1110!--- OZONE CLIMATOLOGY
     1111!    create ozone file for unstuctured grid
     1112     CALL create_climoz(read_climoz)
     1113
     1114     CALL phys_output_write(itap, pdtphys, paprs, pphis,                    &
     1115                             pplay, lmax_th, aerosol_couple,                 &
     1116                             ok_ade, ok_aie, ivap, new_aod, ok_sync,         &
     1117                             ptconv, read_climoz, clevSTD,                   &
     1118                             ptconvth, d_t, qx, d_qx, zmasse,                &
     1119                             flag_aerosol, flag_aerosol_strat, ok_cdnc)
     1120
     1121     CALL xios_update_calendar(1)   
     1122
     1123     CALL create_etat0_limit_unstruct
     1124     
     1125   
    10581126     CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0)
    10591127     IF (klon_glo==1) THEN
     
    12301298     !IM cf. AM 081204 END
    12311299     !
    1232      !=============================================================
    1233      !   Initialisation des sorties
    1234      !=============================================================
    1235 
    1236 #ifdef CPP_IOIPSL
    1237 
    1238      !$OMP MASTER
    1239 ! FH : if ok_sync=.true. , the time axis is written at each time step
    1240 ! in the output files. Only at the end in the opposite case
    1241      ok_sync_omp=.false.
    1242      CALL getin('ok_sync',ok_sync_omp)
    1243      call phys_output_open(lon_degrees,lat_degrees,nCFMIP,tabijGCM, &
    1244           iGCM,jGCM,lonGCM,latGCM, &
    1245           jjmp1,nlevSTD,clevSTD,rlevSTD, pdtphys,ok_veget, &
    1246           type_ocean,iflag_pbl,iflag_pbl_split,ok_mensuel,ok_journe, &
    1247           ok_hf,ok_instan,ok_LES,ok_ade,ok_aie,  &
    1248           read_climoz, phys_out_filestations, &
    1249           new_aod, aerosol_couple, &
    1250           flag_aerosol_strat, pdtphys, paprs, pphis,  &
    1251           pplay, lmax_th, ptconv, ptconvth, ivap,  &
    1252           d_t, qx, d_qx, zmasse, ok_sync_omp)
    1253      !$OMP END MASTER
    1254      !$OMP BARRIER
    1255      ok_sync=ok_sync_omp
    1256 
    1257      freq_outNMC(1) = ecrit_files(7)
    1258      freq_outNMC(2) = ecrit_files(8)
    1259      freq_outNMC(3) = ecrit_files(9)
    1260      WRITE(lunout,*)'OK freq_outNMC(1)=',freq_outNMC(1)
    1261      WRITE(lunout,*)'OK freq_outNMC(2)=',freq_outNMC(2)
    1262      WRITE(lunout,*)'OK freq_outNMC(3)=',freq_outNMC(3)
    1263 
    1264      include "ini_histday_seri.h"
    1265 
    1266      include "ini_paramLMDZ_phy.h"
    1267 
    1268 #endif
    1269      ecrit_reg = ecrit_reg * un_jour
    1270      ecrit_tra = ecrit_tra * un_jour
    1271 
    1272      !XXXPB Positionner date0 pour initialisation de ORCHIDEE
    1273      date0 = jD_ref
    1274      WRITE(*,*) 'physiq date0 : ',date0
     1300
    12751301     !
    12761302     !
     
    16111637     ! Ozone from a file
    16121638     ! Update required ozone index:
    1613      ro3i = int((days_elapsed + jh_cur - jh_1jan) / year_len * 360.) + 1
     1639!ym     ro3i = int((days_elapsed + jh_cur - jh_1jan) / year_len * 360.) + 1
     1640!     ro3i = int((days_elapsed + jh_cur - jh_1jan )) + 1
     1641     
     1642     delta_epsilon=jh_cur-pdtphys/un_jour
     1643     if (ABS(delta_epsilon)<1e-6) delta_epsilon=0
     1644     ro3i = int((days_elapsed+delta_epsilon - jh_1jan ))+1
     1645     
     1646             
    16141647     if (ro3i == 361) ro3i = 360
    16151648     ! (This should never occur, except perhaps because of roundup
     
    16181651        ! Update ozone field:
    16191652        if (read_climoz == 1) then
    1620            call regr_pr_av(ncid_climoz, (/"tro3"/), julien=ro3i, &
     1653
     1654          IF (grid_type==unstructured) THEN
     1655            CALL get_ozone_var((/"tro3_read"/),press_climoz,paprs,wo)
     1656          ELSE
     1657             CALL regr_pr_av(ncid_climoz, (/"tro3"/), julien=ro3i, &
    16211658                press_in_edg=press_climoz, paprs=paprs, v3=wo)
     1659          ENDIF
     1660     
    16221661        else
    16231662           ! read_climoz == 2
    1624            call regr_pr_av(ncid_climoz, (/"tro3         ", "tro3_daylight"/), &
    1625                 julien=ro3i, press_in_edg=press_climoz, paprs=paprs, v3=wo)
     1663
     1664          IF (grid_type==unstructured) THEN
     1665            CALL get_ozone_var((/"tro3_read","tro3_daylight_read"/),press_climoz,paprs,wo)
     1666          ELSE
     1667            CALL regr_pr_av(ncid_climoz, (/"tro3         ", "tro3_daylight"/), &
     1668                 julien=ro3i, press_in_edg=press_climoz, paprs=paprs, v3=wo)
     1669          ENDIF
     1670
    16261671        end if
    16271672        ! Convert from mole fraction of ozone to column density of ozone in a
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/regr_lat_time_climoz_m.F90

    r3825 r3867  
    1111contains
    1212
    13   subroutine regr_lat_time_climoz(read_climoz)
     13  subroutine regr_lat_time_climoz(read_climoz, regr_lat)
    1414
    1515    ! "regr_lat_time_climoz" stands for "regrid latitude time
     
    6565    ! periodicity for interpolation at the beginning and at the end of the
    6666    ! year.
    67     use mod_grid_phy_lmdz, ONLY : nbp_lat
     67    use mod_grid_phy_lmdz, ONLY : nbp_lat, grid_type, unstructured
    6868    use regr1_step_av_m, only: regr1_step_av
    6969    use regr3_lint_m, only: regr3_lint
     
    7575    use regular_lonlat_mod, only : boundslat_reg, south
    7676    use nrtype, only: pi
     77    use regular_lonlat_mod, only : lat_reg
     78    implicit none
    7779    integer, intent(in):: read_climoz ! read ozone climatology
    7880    ! Allowed values are 1 and 2
     
    8284
    8385    ! Variables local to the procedure:
     86    LOGICAL, intent(in), OPTIONAL :: regr_lat
    8487
    8588    integer n_plev ! number of pressure levels in the input data
    8689    integer n_lat ! number of latitudes in the input data
    8790    integer n_month ! number of months in the input data
     91    integer n_lat_out ! number of latitudes in the output data
    8892
    8993    real, pointer:: latitude(:)
     
    158162    ! (time to middle of day, in days since January 1st 0h, in a
    159163    ! 360-day calendar)
    160 
     164    logical :: regr_lat_
     165    REAL,ALLOCATABLE :: lat_out(:)
     166   
    161167    !---------------------------------
     168    IF (PRESENT(regr_lat)) THEN
     169      regr_lat_=regr_lat
     170    ELSE
     171      regr_lat_=.TRUE.
     172    ENDIF
    162173
    163174    print *, "Call sequence information: regr_lat_time_climoz"
     
    183194    forall (j = 2:n_lat) lat_in_edg(j) = (latitude(j - 1) + latitude(j)) / 2
    184195    lat_in_edg(n_lat + 1) = pi / 2
    185     deallocate(latitude) ! pointer
    186196
    187197    call nf95_inq_varid(ncid_in, "plev", varid)
     
    204214    end if
    205215
     216    IF (regr_lat_) THEN
     217      n_lat_out=nbp_lat
     218      ALLOCATE(lat_out(n_lat_out))
     219      lat_out=lat_reg
     220    ELSE
     221      n_lat_out=n_lat
     222      ALLOCATE(lat_out(n_lat_out))
     223      lat_out=latitude
     224    ENDIF
     225
    206226    ! Create the output file and get the variable IDs:
    207     call prepare_out(ncid_in, n_plev, ncid_out, varid_out, varid_plev, &
     227    call prepare_out(ncid_in, n_lat_out, lat_out, n_plev, ncid_out, varid_out, varid_plev, &
    208228         varid_time)
     229
     230    deallocate(latitude) ! pointer
    209231
    210232    ! Write remaining coordinate variables:
     
    281303    call nf95_close(ncid_in)
    282304
    283     allocate(o3_regr_lat(nbp_lat, n_plev, 0:13, read_climoz))
    284     allocate(o3_out(nbp_lat, n_plev, 360, read_climoz))
    285 
    286     ! Regrid in latitude:
    287     ! We average with respect to sine of latitude, which is
    288     ! equivalent to weighting by cosine of latitude:
    289     if (n_month == 12) then
    290        print *, &
    291             "Found 12 months in ozone climatologies, assuming periodicity..."
    292        o3_regr_lat(nbp_lat:1:-1, :, 1:12, :) = regr1_step_av(o3_in, &
    293             xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
    294        ! (invert order of indices in "o3_regr_lat" because "rlatu" is
    295        ! in descending order)
    296 
    297        ! Duplicate January and December values, in preparation of time
    298        ! interpolation:
    299        o3_regr_lat(:, :, 0, :) = o3_regr_lat(:, :, 12, :)
    300        o3_regr_lat(:, :, 13, :) = o3_regr_lat(:, :, 1, :)
    301     else
    302        print *, "Using 14 months in ozone climatologies..."
    303        o3_regr_lat(nbp_lat:1:-1, :, :, :) = regr1_step_av(o3_in, &
    304             xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
    305        ! (invert order of indices in "o3_regr_lat" because "rlatu" is
    306        ! in descending order)
    307     end if
    308 
    309     ! Regrid in time by linear interpolation:
    310     o3_out = regr3_lint(o3_regr_lat, tmidmonth, tmidday)
     305    allocate(o3_out(n_lat_out, n_plev, 360, read_climoz))
     306    IF (regr_lat) THEN
     307      allocate(o3_regr_lat(nbp_lat, n_plev, 0:13, read_climoz))
     308
     309      ! Regrid in latitude:
     310      ! We average with respect to sine of latitude, which is
     311      ! equivalent to weighting by cosine of latitude:
     312      if (n_month == 12) then
     313         print *, &
     314              "Found 12 months in ozone climatologies, assuming periodicity..."
     315         o3_regr_lat(nbp_lat:1:-1, :, 1:12, :) = regr1_step_av(o3_in, &
     316              xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
     317         ! (invert order of indices in "o3_regr_lat" because "rlatu" is
     318         ! in descending order)
     319
     320         ! Duplicate January and December values, in preparation of time
     321         ! interpolation:
     322         o3_regr_lat(:, :, 0, :) = o3_regr_lat(:, :, 12, :)
     323         o3_regr_lat(:, :, 13, :) = o3_regr_lat(:, :, 1, :)
     324      else
     325         print *, "Using 14 months in ozone climatologies..."
     326         o3_regr_lat(nbp_lat:1:-1, :, :, :) = regr1_step_av(o3_in, &
     327              xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
     328         ! (invert order of indices in "o3_regr_lat" because "rlatu" is
     329         ! in descending order)
     330      end if
     331      ! Regrid in time by linear interpolation:
     332      o3_out = regr3_lint(o3_in, tmidmonth, tmidday)
     333    ELSE
     334      ! Regrid in time by linear interpolation:
     335      o3_out = regr3_lint(o3_in, tmidmonth, tmidday)
     336    ENDIF
    311337
    312338    ! Write to file:
     339
    313340    do m = 1, read_climoz
    314        call nf95_put_var(ncid_out, varid_out(m), o3_out(nbp_lat:1:-1, :, :, m))
     341       IF (grid_type==unstructured) THEN
     342         ! Doing spatial interpolation from XIOS need to have some point in longitude
     343         ! waiting zonal mean operation from XIOS
     344         call nf95_put_var(ncid_out, varid_out(m), SPREAD(o3_out(n_lat_out:1:-1, :, :, m),1,4))
     345       ELSE
     346         call nf95_put_var(ncid_out, varid_out(m), o3_out(n_lat_out:1:-1, :, :, m))
     347       ENDIF
     348       
    315349       ! (The order of "rlatu" is inverted in the output file)
    316350    end do
     
    322356  !********************************************
    323357
    324   subroutine prepare_out(ncid_in, n_plev, ncid_out, varid_out, varid_plev, &
     358  subroutine prepare_out(ncid_in, n_lat, lat, n_plev, ncid_out, varid_out, varid_plev, &
    325359       varid_time)
    326360
     
    328362    ! dimensions and variables, and writes one of the coordinate variables.
    329363
    330     use mod_grid_phy_lmdz, ONLY : nbp_lat
    331364    use netcdf95, only: nf95_create, nf95_def_dim, nf95_def_var, &
    332365         nf95_put_att, nf95_enddef, nf95_copy_att, nf95_put_var
    333     use netcdf, only: nf90_clobber, nf90_float, nf90_global
     366    use netcdf, only: nf90_clobber,nf90_netcdf4, nf90_float, nf90_global, nf90_unlimited
    334367    use nrtype, only: pi
    335     use regular_lonlat_mod, only : lat_reg
    336     integer, intent(in):: ncid_in, n_plev
     368    use mod_grid_phy_lmdz, ONLY :  grid_type, unstructured
     369
     370    integer, intent(in):: ncid_in, n_lat, n_plev
     371    real, intent(in):: lat(:)
    337372    integer, intent(out):: ncid_out, varid_plev, varid_time
    338373
     
    344379
    345380    integer ncerr
    346     integer dimid_rlatu, dimid_plev, dimid_time
    347     integer varid_rlatu
     381    integer dimid_rlatu, dimid_rlonv, dimid_plev, dimid_time
     382    integer varid_rlonv, varid_rlatu
    348383
    349384    !---------------------------
     
    351386    print *, "Call sequence information: prepare_out"
    352387
    353     call nf95_create("climoz_LMDZ.nc", nf90_clobber, ncid_out)
     388    call nf95_create("climoz_LMDZ.nc", NF90_CLOBBER + NF90_NETCDF4, ncid_out)
    354389
    355390    ! Dimensions:
    356     call nf95_def_dim(ncid_out, "time", 360, dimid_time)
     391    call nf95_def_dim(ncid_out, "time",  nf90_unlimited, dimid_time)
    357392    call nf95_def_dim(ncid_out, "plev", n_plev, dimid_plev)
    358     call nf95_def_dim(ncid_out, "rlatu", nbp_lat, dimid_rlatu)
     393    call nf95_def_dim(ncid_out, "rlatu", n_lat, dimid_rlatu)
     394    if (grid_type==unstructured) call nf95_def_dim(ncid_out, "rlonv", 4, dimid_rlonv)
    359395
    360396    ! Define coordinate variables:
     
    374410    call nf95_put_att(ncid_out, varid_rlatu, "standard_name", "latitude")
    375411
     412    if (grid_type==unstructured) then
     413      call nf95_def_var(ncid_out, "rlonv", nf90_float, dimid_rlonv, varid_rlonv)
     414      call nf95_put_att(ncid_out, varid_rlonv, "units", "degrees_east")
     415      call nf95_put_att(ncid_out, varid_rlonv, "standard_name", "longitude")
     416    endif
     417   
    376418    ! Define the primary variables:
    377419
    378     call nf95_def_var(ncid_out, "tro3", nf90_float, &
     420    if (grid_type==unstructured) then
     421        call nf95_def_var(ncid_out, "tro3", nf90_float, &
     422         (/dimid_rlonv, dimid_rlatu, dimid_plev, dimid_time/), varid_out(1))
     423    else
     424        call nf95_def_var(ncid_out, "tro3", nf90_float, &
    379425         (/dimid_rlatu, dimid_plev, dimid_time/), varid_out(1))
     426    endif 
     427   
    380428    call nf95_put_att(ncid_out, varid_out(1), "long_name", &
    381429         "ozone mole fraction")
     
    384432
    385433    if (size(varid_out) == 2) then
    386        call nf95_def_var(ncid_out, "tro3_daylight", nf90_float, &
    387             (/dimid_rlatu, dimid_plev, dimid_time/), varid_out(2))
     434      if (grid_type==unstructured) then
     435         call nf95_def_var(ncid_out, "tro3_daylight", nf90_float, &
     436             (/dimid_rlonv, dimid_rlatu, dimid_plev, dimid_time/), varid_out(2))
     437      else
     438         call nf95_def_var(ncid_out, "tro3_daylight", nf90_float, &
     439             (/ dimid_rlatu, dimid_plev, dimid_time/), varid_out(2))
     440      endif
     441       
    388442       call nf95_put_att(ncid_out, varid_out(2), "long_name", &
    389443            "ozone mole fraction in daylight")
     
    417471
    418472    ! Write one of the coordinate variables:
    419     call nf95_put_var(ncid_out, varid_rlatu, lat_reg(nbp_lat:1:-1) / pi * 180.)
     473    call nf95_put_var(ncid_out, varid_rlatu, lat(n_lat:1:-1) / pi * 180.)
    420474    ! (convert from rad to degrees and sort in ascending order)
     475    if (grid_type==unstructured)  call nf95_put_var(ncid_out, varid_rlonv, (/ 0., 90., 180.,270. /))
    421476
    422477  contains
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/wxios.F90

    r3849 r3867  
    3131    SUBROUTINE reformadate(odate, ndate)
    3232        CHARACTER(len=*), INTENT(IN) :: odate
    33         CHARACTER(len=100), INTENT(OUT) :: ndate
     33        TYPE(xios_duration) :: ndate
    3434       
    3535        INTEGER :: i = 0
     
    4646        i = INDEX(odate, "day")
    4747        IF (i > 0) THEN
    48             ndate = odate(1:i-1)//"d"
     48            read(odate(1:i-1),*) ndate%day
    4949        END IF
    5050
    5151        i = INDEX(odate, "hr")
    5252        IF (i > 0) THEN
    53             ndate = odate(1:i-1)//"h"
     53            read(odate(1:i-1),*) ndate%hour
    5454        END IF
    5555
    5656        i = INDEX(odate, "mth")
    5757        IF (i > 0) THEN
    58             ndate = odate(1:i-1)//"mo"
     58            read(odate(1:i-1),*) ndate%month
    5959        END IF
    6060       
     
    135135    SUBROUTINE wxios_context_init()
    136136        USE print_control_mod, ONLY : prt_level, lunout
     137        USE mod_phys_lmdz_mpi_data, ONLY : COMM_LMDZ_PHY
    137138        IMPLICIT NONE
    138139
     
    141142!$OMP MASTER
    142143        !Initialisation du contexte:
    143         CALL xios_context_initialize(g_ctx_name, g_comm)
     144        CALL xios_context_initialize(g_ctx_name, COMM_LMDZ_PHY)
    144145        CALL xios_get_handle(g_ctx_name, xios_ctx)    !Récupération
    145146        CALL xios_set_current_context(xios_ctx)            !Activation
     
    186187     
    187188     !Variables pour xios:
    188      TYPE(xios_time) :: mdtime
     189     TYPE(xios_duration) :: mdtime
    189190     !REAL(kind = 8) :: year=0, month=0, day=0, hour=0, minute=0, second=0
    190191     
    191         mdtime = xios_time(0, 0, 0, 0, 0, pasdetemps)
     192        mdtime%second=pasdetemps
    192193
    193194        !Réglage du calendrier:
    194195        SELECT CASE (calendrier)
    195196            CASE('earth_360d')
    196                 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "D360")
     197                CALL xios_define_calendar("D360")
    197198                IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 360 jours/an'
    198199            CASE('earth_365d')
    199                 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "NoLeap")
     200                CALL xios_define_calendar("NoLeap")
    200201                IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier terrestre a 365 jours/an'
    201202            CASE('earth_366d')
    202                 CALL xios_set_context_attr_hdl(g_ctx, calendar_type= "Gregorian")
     203                CALL xios_define_calendar("Gregorian")
    203204                IF (prt_level >= 10) WRITE(lunout,*) 'wxios_set_cal: Calendrier gregorien'
    204205            CASE DEFAULT
     
    211212       
    212213        IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Time origin: ", date
    213        
    214         CALL xios_set_context_attr_hdl(g_ctx, time_origin = date)
     214
     215        CALL xios_set_time_origin(xios_date(annee,mois,jour,int(heure),0,0))
    215216
    216217        !Formatage de la date de debut:
     
    220221        IF (prt_level >= 10) WRITE(lunout,*) "wxios_set_cal: Start date: ", date
    221222       
    222         CALL xios_set_context_attr_hdl(g_ctx, start_date = date)
     223        CALL xios_set_start_date(xios_date(ini_an,ini_mois,ini_jour,int(ini_heure),0,0))
    223224       
    224225        !Et enfin,le pas de temps:
     
    229230    SUBROUTINE wxios_set_timestep(ts)
    230231        REAL, INTENT(IN) :: ts
    231         TYPE(xios_time) :: mdtime     
    232 
    233         mdtime = xios_time(0, 0, 0, 0, 0, ts)
     232        TYPE(xios_duration) :: mdtime     
     233
     234        mdtime%timestep = ts
    234235
    235236        CALL xios_set_timestep(mdtime)
     
    285286       
    286287        !On parametrise le domaine:
    287         CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin, ni=ni)
    288         CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin, nj=nj, data_dim=2)
    289         CALL xios_set_domain_attr_hdl(dom, lonvalue=io_lon(ibegin:iend), latvalue=io_lat(jbegin:jend))
     288        CALL xios_set_domain_attr_hdl(dom, ni_glo=ni_glo, ibegin=ibegin-1, ni=ni)
     289        CALL xios_set_domain_attr_hdl(dom, nj_glo=nj_glo, jbegin=jbegin-1, nj=nj, data_dim=2)
     290        CALL xios_set_domain_attr_hdl(dom, lonvalue_1d=io_lon(ibegin:iend), latvalue_1d=io_lat(jbegin:jend))
    290291
    291292        IF (.NOT.is_sequential) THEN
     
    299300              WRITE(lunout,*) "wxios_domain_param: mpirank=",mpi_rank," mask(:,nj)=",mask(:,nj)
    300301            ENDIF
    301             CALL xios_set_domain_attr_hdl(dom, mask=mask)
     302            CALL xios_set_domain_attr_hdl(dom, mask_2d=mask)
    302303        END IF
    303304
     
    322323        REAL :: boundslon_mpi(klon_mpi,nvertex)
    323324        REAL :: boundslat_mpi(klon_mpi,nvertex)
    324         TYPE(xios_domain) :: dom
     325        TYPE(xios_domaingroup) :: dom
    325326
    326327
     
    331332
    332333!$OMP MASTER
    333         CALL xios_get_domain_handle("dom_glo", dom)
     334        CALL xios_get_domaingroup_handle("dom_glo", dom)
    334335       
    335336        !On parametrise le domaine:
    336         CALL xios_set_domain_attr_hdl(dom, ni_glo=klon_glo, ibegin=ij_begin, ni=ij_nb, data_dim=1, type="unstructured")
    337         CALL xios_set_domain_attr_hdl(dom, nvertex=nvertex, lonvalue=lon_mpi, latvalue=lat_mpi, bounds_lon=TRANSPOSE(boundslon_mpi), bounds_lat=TRANSPOSE(boundslat_mpi) )
     337        CALL xios_set_attr(dom, ni_glo=klon_glo, ibegin=ij_begin-1, ni=ij_nb, type="unstructured")
     338        CALL xios_set_attr(dom, nvertex=nvertex, lonvalue_1d=lon_mpi, latvalue_1d=lat_mpi, bounds_lon_1d=TRANSPOSE(boundslon_mpi), bounds_lat_1d=TRANSPOSE(boundslat_mpi) )
    338339!$OMP END MASTER
    339340
     
    375376       
    376377        ! Ehouarn: New way to declare axis, without axis_group:
    377         CALL xios_set_axis_attr(trim(axis_id),size=axis_size,value=axis_value)
     378        CALL xios_set_axis_attr(trim(axis_id),n_glo=axis_size,value=axis_value)
    378379       
    379380        !Vérification:
     
    400401        TYPE(xios_file) :: x_file
    401402        TYPE(xios_filegroup) :: x_fg
    402         CHARACTER(len=100) :: nffreq
     403!        CHARACTER(len=100) :: nffreq
     404        TYPE(xios_duration) :: nffreq
    403405       
    404406        !On regarde si le fichier n'est pas défini par XML:
     
    413415            !On configure:
    414416            CALL xios_set_file_attr_hdl(x_file, name="X"//fname,&
    415                 output_freq=TRIM(ADJUSTL(nffreq)), output_level=flvl, enabled=.TRUE.)
     417                output_freq=nffreq, output_level=flvl, enabled=.TRUE.)
    416418       
    417419            IF (xios_is_valid_file("X"//fname)) THEN
    418420                IF (prt_level >= 10) THEN
    419421                  WRITE(lunout,*) "wxios_add_file: New file: ", "X"//fname
    420                   WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl
     422                  WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl
    421423                ENDIF
    422424            ELSE
    423425                WRITE(lunout,*) "wxios_add_file: Error, invalid file: ", "X"//trim(fname)
    424                 WRITE(lunout,*) "wxios_add_file: output_freq=",TRIM(ADJUSTL(nffreq)),"; output_lvl=",flvl
     426                WRITE(lunout,*) "wxios_add_file: output_freq=",nffreq,"; output_lvl=",flvl
    425427            END IF
    426428        ELSE
     
    492494        TYPE(xios_field) :: field
    493495        TYPE(xios_fieldgroup) :: fieldgroup
     496        TYPE(xios_duration) :: freq_op
    494497        LOGICAL :: bool=.FALSE.
    495498        INTEGER :: lvl =0
     
    550553           
    551554            !L'operation, sa frequence:
    552             CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op="1ts", prec=4)
     555            freq_op%timestep=1
     556            CALL xios_set_field_attr_hdl(field, field_ref=fieldname, operation=TRIM(ADJUSTL(operation)), freq_op=freq_op, prec=4)
    553557
    554558           
Note: See TracChangeset for help on using the changeset viewer.