Changeset 1331 for LMDZ4/trunk


Ignore:
Timestamp:
Mar 25, 2010, 11:52:08 AM (15 years ago)
Author:
yann meurdesoif
Message:

Correction problème de COSP : Les sorties 3D par histwrite_phy devaient avoir nécessairement "klev" niveaux verticaux. Cette contrainte est desormais relachee

File:
1 edited

Legend:

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

    r1001 r1331  
    44module iophy
    55 
    6   REAL,private,allocatable,dimension(:,:),save :: tmp_tab2d
    7   REAL,private,allocatable,dimension(:,:,:),save :: tmp_tab3d
    8   INTEGER,private,allocatable,dimension(:),save :: ndex2d
    9   INTEGER,private,allocatable,dimension(:),save :: ndex3d
    106! abd  REAL,private,allocatable,dimension(:),save :: io_lat
    117! abd  REAL,private,allocatable,dimension(:),save :: io_lon
     
    6157    io_lon(:)=rlon_glo(2-1/iim:iim+1-1/iim)
    6258
    63 
    64     allocate(tmp_tab2d(iim,jj_nb))
    65     allocate(tmp_tab3d(iim,jj_nb,klev))
    66     allocate(ndex2d(iim*jj_nb))
    67     allocate(ndex3d(iim*jj_nb*klev))
    68     ndex2d(:)=0
    69     ndex3d(:)=0
    70    
    7159    ddid=(/ 1,2 /)
    7260    dsg=(/ iim, jjm+1-1/iim /)
     
    11098    allocate(io_lon(iim))
    11199    io_lon(:)=lon(:)
    112     allocate(tmp_tab2d(iim,jj_nb))
    113     allocate(tmp_tab3d(iim,jj_nb,klev))
    114     allocate(ndex2d(iim*jj_nb))
    115     allocate(ndex3d(iim*jj_nb*klev))
    116     ndex2d(:)=0
    117     ndex3d(:)=0
    118    
     100   
    119101    ddid=(/ 1,2 /)
    120102    dsg=(/ iim, jjm+1-1/iim /)
     
    173155    character*(*), intent(IN) :: name
    174156    integer, intent(in) :: itau
    175     real,dimension(klon),intent(in) :: field
    176    
     157    real,dimension(:),intent(in) :: field
    177158    REAL,dimension(klon_mpi) :: buffer_omp
     159    INTEGER :: index2d(iim*jj_nb)
     160    REAL :: Field2d(iim,jj_nb)
     161
     162    IF (size(field)/=klon) CALL abort_gcm('iophy::histwrite2d','Field first dimension not equal to klon',1)
    178163   
    179164    CALL Gather_omp(field,buffer_omp)   
    180165!$OMP MASTER
    181     CALL grid1Dto2D_mpi(buffer_omp,tmp_tab2d)
    182     CALL histwrite(nid,name,itau,tmp_tab2d,iim*jj_nb,ndex2d)
     166    CALL grid1Dto2D_mpi(buffer_omp,Field2d)
     167    CALL histwrite(nid,name,itau,Field2d,iim*jj_nb,index2d)
    183168!$OMP END MASTER   
    184169  end subroutine histwrite2d_phy
     170
     171
    185172 
    186173  subroutine histwrite3d_phy(nid,name,itau,field)
     
    195182    character*(*), intent(IN) :: name
    196183    integer, intent(in) :: itau
    197     real,dimension(klon,klev),intent(in) :: field
    198 
    199     REAL,dimension(klon_mpi,klev) :: buffer_omp
     184    real,dimension(:,:),intent(in) :: field  ! --> field(klon,:)
     185    REAL,dimension(klon_mpi,size(field,2)) :: buffer_omp
     186    INTEGER :: nlev
     187    INTEGER :: index3d(iim*jj_nb*size(field,2))
     188    REAL :: Field3d(iim,jj_nb,size(field,2))
     189   
     190    IF (size(field,1)/=klon) CALL abort_gcm('iophy::histwrite3d','Field first dimension not equal to klon',1)
     191    nlev=size(field,2)
    200192   
    201193    CALL Gather_omp(field,buffer_omp)
    202194!$OMP MASTER
    203     CALL grid1Dto2D_mpi(buffer_omp,tmp_tab3d)
    204     CALL histwrite(nid,name,itau,tmp_tab3d,iim*jj_nb*klev,ndex3d)
     195    CALL grid1Dto2D_mpi(buffer_omp,field3d)
     196    CALL histwrite(nid,name,itau,Field3d,iim*jj_nb*nlev,index3d)
    205197!$OMP END MASTER   
    206198  end subroutine histwrite3d_phy
Note: See TracChangeset for help on using the changeset viewer.