Changeset 2002 for LMDZ5/trunk/libf


Ignore:
Timestamp:
Apr 4, 2014, 2:39:54 PM (11 years ago)
Author:
Ehouarn Millour
Message:

Further cleanup concerning XIOS (mainly about axes being defined as axes and not as groups of axes).
EM

Location:
LMDZ5/trunk/libf
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/bibio/wxios.F90

    r2001 r2002  
    292292    ! Pour déclarer un axe vertical !!!!!!!!!!!!!!!
    293293    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    294     SUBROUTINE wxios_add_vaxis(axisgroup_id, axis_file, axis_size, axis_value)
    295         IMPLICIT NONE
    296         INCLUDE 'iniprint.h'
    297 
    298         CHARACTER (len=*), INTENT(IN) :: axisgroup_id, axis_file
     294    SUBROUTINE wxios_add_vaxis(axis_id, axis_size, axis_value)
     295        IMPLICIT NONE
     296        INCLUDE 'iniprint.h'
     297
     298        CHARACTER (len=*), INTENT(IN) :: axis_id
    299299        INTEGER, INTENT(IN) :: axis_size
    300300        REAL, DIMENSION(axis_size), INTENT(IN) :: axis_value
    301301       
    302         TYPE(xios_axisgroup) :: axgroup
    303         TYPE(xios_axis) :: ax
    304         CHARACTER(len=50) :: axis_id
    305        
    306         IF (len_trim(axisgroup_id).gt.len(axis_id)) THEN
    307           WRITE(lunout,*) "wxios_add_vaxis: error, size of axis_id too small!!"
    308           WRITE(lunout,*) "     increase it to at least ",len_trim(axisgroup_id)
    309           CALL abort_gcm("wxios_add_vaxis","len(axis_id) too small",1)
    310         ENDIF
    311         axis_id=trim(axisgroup_id)
     302!        TYPE(xios_axisgroup) :: axgroup
     303!        TYPE(xios_axis) :: ax
     304!        CHARACTER(len=50) :: axis_id
     305       
     306!        IF (len_trim(axisgroup_id).gt.len(axis_id)) THEN
     307!          WRITE(lunout,*) "wxios_add_vaxis: error, size of axis_id too small!!"
     308!          WRITE(lunout,*) "     increase it to at least ",len_trim(axisgroup_id)
     309!          CALL abort_gcm("wxios_add_vaxis","len(axis_id) too small",1)
     310!        ENDIF
     311!        axis_id=trim(axisgroup_id)
    312312       
    313313        !On récupère le groupe d'axes qui va bien:
    314         CALL xios_get_axisgroup_handle(axisgroup_id, axgroup)
     314        !CALL xios_get_axisgroup_handle(axisgroup_id, axgroup)
    315315       
    316316        !On ajoute l'axe correspondant à ce fichier:
    317         CALL xios_add_axis(axgroup, ax, TRIM(ADJUSTL(axis_id)))
     317        !CALL xios_add_axis(axgroup, ax, TRIM(ADJUSTL(axis_id)))
    318318       
    319319        !Et on le parametrise:
    320         CALL xios_set_axis_attr_hdl(ax, size=axis_size, value=axis_value)
     320        !CALL xios_set_axis_attr_hdl(ax, size=axis_size, value=axis_value)
     321       
     322        ! Ehouarn: New way to declare axis, without axis_group:
     323        CALL xios_set_axis_attr(trim(axis_id),size=axis_size,value=axis_value)
    321324       
    322325        !Vérification:
     
    515518            !Sinon on se contente de l'activer:
    516519            CALL xios_set_field_attr(fieldname, enabled=.TRUE.)
     520            !NB: This will override an enable=.false. set by a user in the xml file;
     521            !   then the only way to not output the field is by changing its
     522            !   output level
    517523        ENDIF       
    518524       
    519525    END SUBROUTINE wxios_add_field_to_file
    520526   
    521     SUBROUTINE wxios_update_calendar(ito)
    522         INTEGER, INTENT(IN) :: ito
    523         CALL xios_update_calendar(ito)
    524     END SUBROUTINE wxios_update_calendar
    525    
    526     SUBROUTINE wxios_write_2D(fieldname, fdata)
    527         CHARACTER(len=*), INTENT(IN) :: fieldname
    528         REAL, DIMENSION(:,:), INTENT(IN) :: fdata
    529 
    530         CALL xios_send_field(fieldname, fdata)
    531     END SUBROUTINE wxios_write_2D
    532    
    533     SUBROUTINE wxios_write_3D(fieldname, fdata)
    534         CHARACTER(len=*), INTENT(IN) :: fieldname
    535         REAL, DIMENSION(:,:,:), INTENT(IN) :: fdata
    536        
    537         CALL xios_send_field(fieldname, fdata)
    538     END SUBROUTINE wxios_write_3D
     527!    SUBROUTINE wxios_update_calendar(ito)
     528!        INTEGER, INTENT(IN) :: ito
     529!        CALL xios_update_calendar(ito)
     530!    END SUBROUTINE wxios_update_calendar
     531!   
     532!    SUBROUTINE wxios_write_2D(fieldname, fdata)
     533!        CHARACTER(len=*), INTENT(IN) :: fieldname
     534!        REAL, DIMENSION(:,:), INTENT(IN) :: fdata
     535!
     536!        CALL xios_send_field(fieldname, fdata)
     537!    END SUBROUTINE wxios_write_2D
     538   
     539!    SUBROUTINE wxios_write_3D(fieldname, fdata)
     540!        CHARACTER(len=*), INTENT(IN) :: fieldname
     541!        REAL, DIMENSION(:,:,:), INTENT(IN) :: fdata
     542!       
     543!        CALL xios_send_field(fieldname, fdata)
     544!    END SUBROUTINE wxios_write_3D
    539545   
    540546    SUBROUTINE wxios_closedef()
  • LMDZ5/trunk/libf/phydev/iophy.F90

    r1907 r2002  
    340340  USE mod_phys_lmdz_para, only: gather_omp, grid1Dto2D_mpi, &
    341341                                jj_nb, klon_mpi
    342   USE wxios, only: wxios_write_2D
     342  USE xios, only: xios_send_field
    343343
    344344
     
    361361    CALL grid1Dto2D_mpi(buffer_omp,Field2d)
    362362   
    363     CALL wxios_write_2D(field_name, Field2d)
     363    CALL xios_send_field(field_name, Field2d)
    364364!$OMP END MASTER   
    365365
     
    376376  USE mod_phys_lmdz_para, only: gather_omp, grid1Dto2D_mpi, &
    377377                                jj_nb, klon_mpi
    378   USE wxios, only: wxios_write_3D
     378  USE xios, only: xios_send_field
    379379
    380380
     
    401401    CALL grid1Dto2D_mpi(buffer_omp,field3d)
    402402
    403     CALL wxios_write_3D(field_name, Field3d(:,:,1:klev))
     403    CALL xios_send_field(field_name, Field3d(:,:,1:nlev))
    404404!$OMP END MASTER   
    405405
  • LMDZ5/trunk/libf/phydev/physiq.F90

    r1907 r2002  
    2121
    2222#ifdef CPP_XIOS
     23      USE xios, ONLY: xios_update_calendar
    2324      USE wxios, only: wxios_add_vaxis, wxios_set_timestep, wxios_closedef, &
    24                        wxios_update_calendar, histwrite_phy
     25                       histwrite_phy
    2526#endif
    2627
     
    137138#ifdef CPP_XIOS
    138139!XIOS
    139     ! Déclaration de l'axe vertical du fichier:   
    140     CALL wxios_add_vaxis("presnivs", "histins", klev, presnivs)
    141 
    142     !Déclaration du pas de temps:
     140    ! Declare available vertical axes to be used in output files:   
     141    !CALL wxios_add_vaxis("presnivs", "dummy-not-used", klev, presnivs)
     142    CALL wxios_add_vaxis("presnivs", klev, presnivs)
     143
     144    ! Declare time step length (in s):
    143145    CALL wxios_set_timestep(dtime)
    144146
    145     !Finalisation du contexte:
     147    !Finalize the context:
    146148    CALL wxios_closedef()
    147149#endif
     
    187189!$OMP MASTER
    188190    !Increment XIOS time
    189     CALL wxios_update_calendar(itau)
     191    CALL xios_update_calendar(itau)
    190192!$OMP END MASTER
    191193!$OMP BARRIER
    192194
    193     !Send fields to XIOS:
     195    !Send fields to XIOS: (NB these fields must also be defined as
     196    ! <field id="..." /> in iodef.xml to be correctly used
    194197    CALL histwrite_phy("temperature",t)
     198    CALL histwrite_phy("temp_newton",temp_newton)
    195199    CALL histwrite_phy("u",u)
    196200    CALL histwrite_phy("v",v)
  • LMDZ5/trunk/libf/phylmd/iophy.F90

    r2001 r2002  
    883883                                 nid_files
    884884#ifdef CPP_XIOS
    885   USE wxios, only: wxios_write_2D
     885  USE xios, only: xios_send_field
    886886#endif
    887887
     
    952952                     write(lunout,*)'Dans iophy histwrite2D,iff,var%name ',&
    953953                                    iff,trim(var%name)                       
    954                      write(lunout,*)"histwrite2d_phy:.NOT.clef_stations(iff)and iff==iff_beg, call wxios_write_2D"
     954                     write(lunout,*)"histwrite2d_phy:.NOT.clef_stations(iff)and iff==iff_beg, call xios_send_field"
    955955                  endif
    956                   CALL wxios_write_2D(var%name, Field2d)
     956                  CALL xios_send_field(var%name, Field2d)
    957957                  firstx=.false.
    958958               ENDIF
     
    968968!                        IF (iff == iff_beg) THEN
    969969!                          if (prt_level >= 10) then
    970 !                            write(lunout,*)"histwrite2d_phy: .NOT.clef_stations(iff) and iff==iff_beg, call wxios_write_2D"
     970!                            write(lunout,*)"histwrite2d_phy: .NOT.clef_stations(iff) and iff==iff_beg, call xios_send_field"
    971971!                          endif
    972 !                          CALL wxios_write_2D(var%name, Field2d)
     972!                          CALL xios_send_field(var%name, Field2d)
    973973!                        ENDIF
    974974!#endif
     
    10191019                                 nid_files
    10201020#ifdef CPP_XIOS
    1021   USE wxios, only: wxios_write_3D
     1021  USE xios, only: xios_send_field
    10221022#endif
    10231023
     
    10851085                  write(lunout,*)'Dans iophy, histwrite3D iff nlev klev firstx', &
    10861086                                  iff,nlev,klev, firstx                       
    1087                   write(lunout,*)'histwrite3d_phy: call wxios_write_3D for ', &
     1087                  write(lunout,*)'histwrite3d_phy: call xios_send_field for ', &
    10881088                                  trim(var%name), ' with iim jjm nlevx = ', &
    10891089                                  iim,jj_nb,nlevx
    10901090                endif
    1091                 CALL wxios_write_3D(var%name, Field3d(:,:,1:nlevx))
     1091                CALL xios_send_field(var%name, Field3d(:,:,1:nlevx))
    10921092                            firstx=.false.
    10931093              ENDIF
     
    11031103!#ifdef CPP_XIOS
    11041104!                        IF (iff == 1) THEN
    1105 !                              CALL wxios_write_3D(var%name, Field3d(:,:,1:klev))
     1105!                              CALL xios_send_field(var%name, Field3d(:,:,1:klev))
    11061106!                        ENDIF
    11071107!#endif
     
    11491149                                is_sequential, klon_mpi_begin, klon_mpi_end, &
    11501150                                jj_nb, klon_mpi
    1151   USE wxios, only: wxios_write_2D
     1151  USE xios, only: xios_send_field
    11521152
    11531153
     
    11841184
    11851185
    1186         CALL wxios_write_2D(field_name, Field2d)
     1186        CALL xios_send_field(field_name, Field2d)
    11871187
    11881188    ELSE
     
    12201220                                is_sequential, klon_mpi_begin, klon_mpi_end, &
    12211221                                jj_nb, klon_mpi
    1222   USE wxios, only: wxios_write_3D
     1222  USE xios, only: xios_send_field
    12231223
    12241224
     
    12541254        ALLOCATE(index3d(iim*jj_nb*nlev))
    12551255        ALLOCATE(fieldok(iim*jj_nb,nlev))
    1256         CALL wxios_write_3D(field_name, Field3d(:,:,1:nlev))
     1256        CALL xios_send_field(field_name, Field3d(:,:,1:nlev))
    12571257                       
    12581258    ELSE
  • LMDZ5/trunk/libf/phylmd/phys_output_mod.F90

    r2001 r2002  
    316316    endif
    317317   if (iff.le.6) then
    318     CALL wxios_add_vaxis("presnivs", phys_out_filenames(iff), &
     318    CALL wxios_add_vaxis("presnivs", &
    319319            levmax(iff) - levmin(iff) + 1, presnivs(levmin(iff):levmax(iff)))
    320     CALL wxios_add_vaxis("Ahyb", phys_out_filenames(iff), &
     320    CALL wxios_add_vaxis("Ahyb", &
    321321            levmax(iff) - levmin(iff) + 1, Ahyb)
    322     CALL wxios_add_vaxis("Bhyb", phys_out_filenames(iff), &
     322    CALL wxios_add_vaxis("Bhyb", &
    323323            levmax(iff) - levmin(iff) + 1, Bhyb)
    324     CALL wxios_add_vaxis("Alt", phys_out_filenames(iff), &
     324    CALL wxios_add_vaxis("Alt", &
    325325            levmax(iff) - levmin(iff) + 1, Alt)
    326326   else
    327327    ! NMC files
    328     CALL wxios_add_vaxis("plev", phys_out_filenames(iff), &
     328    CALL wxios_add_vaxis("plev", &
    329329            levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff)))
    330330   endif
  • LMDZ5/trunk/libf/phylmd/phys_output_write_mod.F90

    r1971 r2002  
    230230#ifdef CPP_XIOS
    231231    ! ug Pour les sorties XIOS
    232     USE wxios, only: wxios_update_calendar, wxios_closedef
     232    USE xios, ONLY: xios_update_calendar
     233    USE wxios, only: wxios_closedef
    233234#endif
    234235    USE phys_cal_mod, only : mth_len
     
    292293       IF (vars_defined) THEN
    293294          if (prt_level >= 10) then
    294              write(lunout,*)"phys_output_write: call wxios_update_calendar, itau_w=",itau_w
     295             write(lunout,*)"phys_output_write: call xios_update_calendar, itau_w=",itau_w
    295296          endif
    296           CALL wxios_update_calendar(itau_w)
     297          CALL xios_update_calendar(itau_w)
    297298       END IF
    298299       !$OMP END MASTER
Note: See TracChangeset for help on using the changeset viewer.