psmile_read_4d_dble.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2006-2010, SGI Germany, Munich, Germany.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !BOP
00006 !
00007 ! !ROUTINE:   psmile_read_4d_dble
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_read_4d_dble(unit                &
00012                                      ,var                 &
00013                                      ,domain              &
00014                                      ,a                   &
00015                                      ,a_shape             &
00016                                      ,v_shape             &
00017                                      ,itime               &
00018                                      ,time_used           &
00019                                      ,id_blockid          &
00020                                      ,block_used          &
00021                                      ,domain_used          &
00022                                      ,ierror)
00023 !
00024 ! !USES:
00025 !
00026       use psmile
00027 #ifdef __PSMILE_WITH_IO
00028       implicit none
00029       include 'prism.inc'
00030 !
00031 ! !INPUT PARAMETERS:
00032 !
00033       integer,intent(in) :: unit
00034       Type(fieldtype),intent(in) :: var
00035       Type(domain2D),intent(inout)  :: domain
00036       integer,intent(in) :: a_shape(2,*)
00037       integer,intent(in) :: v_shape(2,*)
00038       double precision   , intent(inout) :: a(a_shape(1,1):a_shape(2,1)  
00039                                        ,a_shape(1,2):a_shape(2,2)  
00040                                        ,a_shape(1,3):a_shape(2,3)  
00041                                        ,a_shape(1,4):a_shape(2,4)) 
00042       integer, intent(in) :: itime
00043       logical,intent(in) :: time_used
00044       integer,intent(in) :: id_blockid
00045       logical,intent(in) :: block_used
00046       logical,intent(in) :: domain_used
00047 !
00048 ! !OUTPUT PARAMETERS:
00049 !
00050       integer, intent(out) :: ierror
00051 !
00052 ! !LOCAL VARIABLES:
00053 !
00054       integer :: ierrp(2)
00055 !
00056 ! !DESCRIPTION:
00057 !
00058 ! Reads a double precision partitioned 4d array to a file.
00059 ! Subblocks are supported.
00060 !
00061 ! !REVISION HISTORY:
00062 !
00063 !   Date      Programmer   Description
00064 ! ----------  ----------   -----------
00065 !  09.12.03   R. Vogelsang created
00066 !
00067 !EOP
00068 !----------------------------------------------------------------------
00069 
00070       character(len=len_cvs_string),save :: mcvs = 
00071 '$Id: psmile_read_4d_dble.F90 2325 2010-04-21 15:00:07Z valcke $'
00072       
00073       ierror=0
00074 
00075 #ifdef VERBOSE
00076       print*,trim(ch_id),' :   psmile_read_4d_dble: start'
00077       print*,trim(ch_id),' :   psmile_read_4d_dble: size ',size(a)
00078       call psmile_flushstd
00079 
00080 #endif
00081 
00082       if(domain_used) then
00083       if(block_used) then
00084       if(id_blockid.le.0) then
00085          ierror = PRISM_Error_Internal
00086          call psmile_error ( ierror, 'id_blockid <= 0! ', &
00087                              ierrp, 0, __FILE__, __LINE__ )
00088       endif
00089       if(time_used) then
00090         call mpp_read(unit,var,domain,a(v_shape(1,1):v_shape(2,1) &
00091                                              ,v_shape(1,2):v_shape(2,2) &
00092                                              ,v_shape(1,3):v_shape(2,3) &
00093                                              ,v_shape(1,4):v_shape(2,4)) &
00094                                       ,tindex=itime,blockid=id_blockid)
00095       else
00096         call mpp_read( unit,var,domain,a(v_shape(1,1):v_shape(2,1) &
00097                                               ,v_shape(1,2):v_shape(2,2) &
00098                                              ,v_shape(1,3):v_shape(2,3) &
00099                                               ,v_shape(1,4):v_shape(2,4)) &
00100                                               , blockid=id_blockid)
00101       endif
00102       else
00103       if(time_used) then
00104         call mpp_read(unit,var,domain,a(v_shape(1,1):v_shape(2,1) &
00105                                              ,v_shape(1,2):v_shape(2,2) &
00106                                              ,v_shape(1,3):v_shape(2,3) &
00107                                              ,v_shape(1,4):v_shape(2,4)) &
00108                                       ,tindex=itime)
00109       else
00110         call mpp_read( unit,var,domain,a(v_shape(1,1):v_shape(2,1) &
00111                                               ,v_shape(1,2):v_shape(2,2) &
00112                                              ,v_shape(1,3):v_shape(2,3) &
00113                                               ,v_shape(1,4):v_shape(2,4)))
00114       endif
00115       endif
00116 !
00117       else
00118 !
00119       if(block_used) then
00120       if(id_blockid.le.0) then
00121          ierror = PRISM_Error_Internal
00122          call psmile_error ( ierror, 'id_blockid <= 0! ', &
00123                              ierrp, 0, __FILE__, __LINE__ )
00124       endif
00125       if(time_used) then
00126         call mpp_read(unit,var,a(v_shape(1,1):v_shape(2,1) &
00127                                              ,v_shape(1,2):v_shape(2,2) &
00128                                              ,v_shape(1,3):v_shape(2,3) &
00129                                              ,v_shape(1,4):v_shape(2,4)) &
00130                                       ,tindex=itime,blockid=id_blockid)
00131       else
00132         call mpp_read( unit,var,a(v_shape(1,1):v_shape(2,1) &
00133                                               ,v_shape(1,2):v_shape(2,2) &
00134                                              ,v_shape(1,3):v_shape(2,3) &
00135                                               ,v_shape(1,4):v_shape(2,4)) &
00136                                               , blockid=id_blockid)
00137       endif
00138       else
00139       if(time_used) then
00140         call mpp_read(unit,var,a(v_shape(1,1):v_shape(2,1) &
00141                                              ,v_shape(1,2):v_shape(2,2) &
00142                                              ,v_shape(1,3):v_shape(2,3) &
00143                                              ,v_shape(1,4):v_shape(2,4)) &
00144                                       ,tindex=itime)
00145       else
00146         call mpp_read( unit,var,a(v_shape(1,1):v_shape(2,1) &
00147                                               ,v_shape(1,2):v_shape(2,2) &
00148                                              ,v_shape(1,3):v_shape(2,3) &
00149                                               ,v_shape(1,4):v_shape(2,4)))
00150       endif
00151       endif
00152       endif
00153 
00154 
00155 #ifdef VERBOSE
00156       print*,trim(ch_id),' :   psmile_read_4d_dble: end'
00157       call psmile_flushstd
00158 
00159 #endif
00160 #endif
00161       end subroutine psmile_read_4d_dble

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1