Ignore:
Timestamp:
Apr 3, 2014, 3:52:45 PM (11 years ago)
Author:
Ehouarn Millour
Message:

Updates for XIOS outputs. NMC outputs now OK, as long as these are in output files number 6 and more (phys_out_filenames ordering in config.def).
Among things that need be worked on further with XIOS:

  • Station outputs form and format.
  • Extra axes can only be included in XIOS files if linked to given variables.
  • Further splitting of the XML files as iodef.xml, context_lmdz.xml, field_def_lmdz.xml and file_def_hist*_lmdz.xml.

EM

Location:
LMDZ5/trunk/libf/phylmd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/iophy.F90

    r1907 r2001  
    568568    INCLUDE "temps.h"
    569569    INCLUDE "clesphys.h"
     570    INCLUDE "iniprint.h"
    570571
    571572    INTEGER                          :: iff
     
    602603
    603604#ifdef CPP_XIOS
     605      IF ( var%flag(iff)<=lev_files(iff) ) THEN
    604606        CALL wxios_add_field_to_file(var%name, 2, iff, phys_out_filenames(iff), &
    605607        var%description, var%unit, var%flag(iff), typeecrit)
     608        IF (prt_level >= 10) THEN
     609          WRITE(lunout,*) 'histdef2d: call wxios_add_field_to_file var%name iff: ', &
     610                          trim(var%name),iff
     611        ENDIF
     612      ENDIF
    606613#endif
    607614#ifndef CPP_NO_IOIPSL
     
    628635    END IF
    629636  END SUBROUTINE histdef2d
     637
    630638  SUBROUTINE histdef3d (iff,var)
    631639
     
    645653    INCLUDE "temps.h"
    646654    INCLUDE "clesphys.h"
     655    INCLUDE "iniprint.h"
    647656
    648657    INTEGER                          :: iff
     
    679688
    680689#ifdef CPP_XIOS
     690      IF ( var%flag(iff)<=lev_files(iff) ) THEN
    681691        CALL wxios_add_field_to_file(var%name, 3, iff, phys_out_filenames(iff), &
    682692        var%description, var%unit, var%flag(iff), typeecrit)
     693        IF (prt_level >= 10) THEN
     694          WRITE(lunout,*) 'histdef3d: call wxios_add_field_to_file var%name iff: ', &
     695                          trim(var%name),iff
     696        ENDIF
     697      ENDIF
    683698#endif
    684699#ifndef CPP_NO_IOIPSL
     
    881896     
    882897    INTEGER :: iff, iff_beg, iff_end
    883      
     898    LOGICAL, SAVE  :: firstx
     899!$OMP THREADPRIVATE(firstx)
     900
    884901    REAL,DIMENSION(klon_mpi) :: buffer_omp
    885902    INTEGER, allocatable, DIMENSION(:) :: index2d
     
    889906    REAL, ALLOCATABLE, DIMENSION(:) :: fieldok
    890907
    891     IF (prt_level >= 10) WRITE(lunout,*)'Begin histwrite2d_phy ',trim(var%name)
    892 
     908    IF (prt_level >= 10) THEN
     909      WRITE(lunout,*)'Begin histwrite2d_phy for ',trim(var%name)
     910    ENDIF
    893911! ug RUSTINE POUR LES STD LEVS.....
    894912      IF (PRESENT(STD_iff)) THEN
     
    925943
    926944! La boucle sur les fichiers:
     945      firstx=.true.
    927946      DO iff=iff_beg, iff_end
    928947            IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN
    929    
     948
     949#ifdef CPP_XIOS
     950               IF (firstx) THEN
     951                  if (prt_level >= 10) then
     952                     write(lunout,*)'Dans iophy histwrite2D,iff,var%name ',&
     953                                    iff,trim(var%name)                       
     954                     write(lunout,*)"histwrite2d_phy:.NOT.clef_stations(iff)and iff==iff_beg, call wxios_write_2D"
     955                  endif
     956                  CALL wxios_write_2D(var%name, Field2d)
     957                  firstx=.false.
     958               ENDIF
     959#endif
     960
    930961                  IF(.NOT.clef_stations(iff)) THEN
    931962                        ALLOCATE(index2d(iim*jj_nb))
     
    934965                        CALL histwrite(nid_files(iff),var%name,itau_iophy,Field2d,iim*jj_nb,index2d)
    935966#endif
    936 #ifdef CPP_XIOS
    937                         IF (iff == iff_beg) THEN
    938                           if (prt_level >= 10) then
    939                             write(lunout,*)"histwrite2d_phy: .NOT.clef_stations(iff) and iff==iff_beg, call wxios_write_2D"
    940                           endif
    941                           CALL wxios_write_2D(var%name, Field2d)
    942                         ENDIF
    943 #endif
     967!#ifdef CPP_XIOS
     968!                        IF (iff == iff_beg) THEN
     969!                          if (prt_level >= 10) then
     970!                            write(lunout,*)"histwrite2d_phy: .NOT.clef_stations(iff) and iff==iff_beg, call wxios_write_2D"
     971!                          endif
     972!                          CALL wxios_write_2D(var%name, Field2d)
     973!                        ENDIF
     974!#endif
    944975                  ELSE
    945976                        ALLOCATE(fieldok(npstn))
     
    10011032     
    10021033    INTEGER :: iff, iff_beg, iff_end
    1003 
     1034    LOGICAL, SAVE  :: firstx
     1035!$OMP THREADPRIVATE(firstx)
    10041036    REAL,DIMENSION(klon_mpi,SIZE(field,2)) :: buffer_omp
    10051037    REAL :: Field3d(iim,jj_nb,SIZE(field,2))
    1006     INTEGER :: ip, n, nlev
     1038    INTEGER :: ip, n, nlev, nlevx
    10071039    INTEGER, ALLOCATABLE, DIMENSION(:) :: index3d
    10081040    REAL,ALLOCATABLE, DIMENSION(:,:) :: fieldok
     
    10331065    IF (SIZE(field,1)/=klon) CALL abort_gcm('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)
    10341066    nlev=SIZE(field,2)
    1035 
     1067    if (nlev.eq.klev+1) then
     1068        nlevx=klev
     1069    else
     1070        nlevx=nlev
     1071    endif
    10361072
    10371073    CALL Gather_omp(field,buffer_omp)
     
    10411077
    10421078! BOUCLE SUR LES FICHIERS
     1079     firstx=.true.
    10431080     DO iff=iff_beg, iff_end
    10441081            IF (var%flag(iff) <= lev_files(iff) .AND. clef_files(iff)) THEN
     1082#ifdef CPP_XIOS
     1083              IF (firstx) THEN
     1084                if (prt_level >= 10) then
     1085                  write(lunout,*)'Dans iophy, histwrite3D iff nlev klev firstx', &
     1086                                  iff,nlev,klev, firstx                       
     1087                  write(lunout,*)'histwrite3d_phy: call wxios_write_3D for ', &
     1088                                  trim(var%name), ' with iim jjm nlevx = ', &
     1089                                  iim,jj_nb,nlevx
     1090                endif
     1091                CALL wxios_write_3D(var%name, Field3d(:,:,1:nlevx))
     1092                            firstx=.false.
     1093              ENDIF
     1094#endif
    10451095                IF (.NOT.clef_stations(iff)) THEN
    10461096                        ALLOCATE(index3d(iim*jj_nb*nlev))
     
    10511101#endif
    10521102
    1053 #ifdef CPP_XIOS
    1054                         IF (iff == 1) THEN
    1055                               CALL wxios_write_3D(var%name, Field3d(:,:,1:klev))
    1056                         ENDIF
    1057 #endif
    1058                        
     1103!#ifdef CPP_XIOS
     1104!                        IF (iff == 1) THEN
     1105!                              CALL wxios_write_3D(var%name, Field3d(:,:,1:klev))
     1106!                        ENDIF
     1107!#endif
     1108!                       
    10591109                ELSE
    10601110                        nlev=size(field,2)
     
    12041254        ALLOCATE(index3d(iim*jj_nb*nlev))
    12051255        ALLOCATE(fieldok(iim*jj_nb,nlev))
    1206         CALL wxios_write_3D(field_name, Field3d(:,:,1:klev))
     1256        CALL wxios_write_3D(field_name, Field3d(:,:,1:nlev))
    12071257                       
    12081258    ELSE
  • LMDZ5/trunk/libf/phylmd/phys_output_mod.F90

    r1971 r2001  
    306306#ifdef CPP_XIOS
    307307!!! Ouverture de chaque fichier XIOS !!!!!!!!!!!
     308    if (prt_level >= 10) then
     309      print*,'phys_output_open: call wxios_add_file with phys_out_filenames(iff)=',trim(phys_out_filenames(iff))                                                                       
     310    endif
    308311    CALL wxios_add_file(phys_out_filenames(iff),chtimestep(iff),lev_files(iff)) 
    309     print*,'wxios_add_file phys_out_filenames(iff)',phys_out_filenames(iff)                                                                       
    310312
    311313!!! Declaration des axes verticaux de chaque fichier:
    312     print*,'Declaration des axes verticaux de chaque fichier '
     314    if (prt_level >= 10) then
     315      print*,'phys_output_open: Declare vertical axes for each file'
     316    endif
    313317   if (iff.le.6) then
    314318    CALL wxios_add_vaxis("presnivs", phys_out_filenames(iff), &
     
    318322    CALL wxios_add_vaxis("Bhyb", phys_out_filenames(iff), &
    319323            levmax(iff) - levmin(iff) + 1, Bhyb)
    320     CALL wxios_add_vaxis("Ahyb", phys_out_filenames(iff), &
     324    CALL wxios_add_vaxis("Alt", phys_out_filenames(iff), &
    321325            levmax(iff) - levmin(iff) + 1, Alt)
    322326   else
     327    ! NMC files
    323328    CALL wxios_add_vaxis("plev", phys_out_filenames(iff), &
    324329            levmax(iff) - levmin(iff) + 1, rlevSTD(levmin(iff):levmax(iff)))
     
    362367          else IF (clef_stations(iff)) THEN
    363368
    364              WRITE(lunout,*)'phys_output_mod phys_out_filenames=',phys_out_filenames(iff)
    365 
     369             if (prt_level >= 10) then
     370             WRITE(lunout,*)'phys_output_open: iff=',iff,'  phys_out_filenames(iff)=',phys_out_filenames(iff)
     371             endif
     372             
    366373             CALL histbeg_phy_all(rlon,rlat,pim,tabij,ipt,jpt,plon,plat,plon_bounds,plat_bounds, &
    367374                  phys_out_filenames(iff), &
     
    491498    ecrit_ins = ecrit_files(6)
    492499
    493     WRITE(lunout,*)'swaero_diag=',swaero_diag
    494     WRITE(lunout,*)'Fin phys_output_mod.F90'
     500    if (prt_level >= 10) then
     501      WRITE(lunout,*)'swaero_diag=',swaero_diag
     502      WRITE(lunout,*)'phys_output_open: ends here'
     503    endif
    495504
    496505  end SUBROUTINE phys_output_open
Note: See TracChangeset for help on using the changeset viewer.