psmile_copy_subarray_2d_real.F90

Go to the documentation of this file.
00001 !-----------------------------------------------------------------------
00002 ! Copyright 2006-2010, NEC Europe Ltd., London, UK.
00003 ! All rights reserved. Use is subject to OASIS4 license terms.
00004 !-----------------------------------------------------------------------
00005 !BOP
00006 !
00007 ! !ROUTINE: PSMILe_Copy_subarray_2d_real
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_copy_subarray_2d_real (dest_vector, size, &
00012                         darray, idlow, idhigh, jdlow, jdhigh, &
00013                                 ibeg,  iend,   jbeg,  jend,   ierror)
00014 !
00015 ! !USES:
00016 !
00017       use PRISM_constants
00018 !
00019       use PSMILe, dummy_interface => PSMILe_Copy_subarray_2d_real
00020 
00021       implicit none
00022 !
00023 ! !INPUT PARAMETERS:
00024 !
00025       integer(kind=int64), Intent (In)    :: size
00026 
00027 !     Size (length) of destination vector "dest"
00028 
00029       integer, Intent (In)                :: idlow
00030 
00031 !     Lowest  first  dimension of array "darray"
00032 
00033       integer, Intent (In)                :: idhigh
00034 
00035 !     Highest first  dimension of array "darray"
00036 
00037       integer, Intent (In)                :: jdlow
00038 
00039 !     Lowest  second dimension of array "darray"
00040 
00041       integer, Intent (In)                :: jdhigh
00042 
00043 !     Highest second dimension of array "darray"
00044 
00045       real, Intent (In)                   :: darray (idlow:idhigh, 
00046                                                      jdlow:jdhigh)
00047 
00048 !     Array containg the sub-array to be copied
00049 
00050       integer, Intent (In)                :: ibeg
00051 
00052 !     Lowest  first  index of sub-array to be copied
00053 
00054       integer, Intent (In)                :: iend
00055 
00056 !     Highest first index of sub-array to be copied
00057 
00058       integer, Intent (In)                :: jbeg
00059 
00060 !     Lowest  second index of sub-array to be copied
00061 
00062       integer, Intent (In)                :: jend
00063 !
00064 ! !OUTPUT PARAMETERS:
00065 !
00066       Real, Intent (Out)                  :: dest_vector (size)
00067 
00068 !     Destintation vector
00069 
00070       integer, Intent (Out)               :: ierror
00071 
00072 !     Returns the error code of PSMILe_Copy_subarray_2d_real;
00073 !             ierror = 0 : No error
00074 !             ierror > 0 : Severe error
00075 !
00076 ! !LOCAL VARIABLES
00077 !
00078       integer             :: i, j, leni
00079       integer(kind=int64) :: ip
00080 !
00081 ! !DESCRIPTION:
00082 !
00083 ! Subroutine "PSMILe_Copy_subarray_2d_real" copies the subarray
00084 ! darray (ibeg:iend, jbeg:jend) into the 1-dimensional destination
00085 ! vector "dest_vector".
00086 !
00087 ! !REVISION HISTORY:
00088 !
00089 !   Date      Programmer   Description
00090 ! ----------  ----------   -----------
00091 ! 01.12.03    H. Ritzdorf  created
00092 !
00093 !EOP
00094 !----------------------------------------------------------------------
00095 !
00096 ! $Id: psmile_copy_subarray_2d_real.F90 2325 2010-04-21 15:00:07Z valcke $
00097 ! $Author: valcke $
00098 
00099    Character(len=len_cvs_string), save :: mycvs = 
00100        '$Id: psmile_copy_subarray_2d_real.F90 2325 2010-04-21 15:00:07Z valcke $'
00101 !
00102 !----------------------------------------------------------------------
00103 !
00104 !  Initialization
00105 !
00106 ! ??? waere es moeglich dest_array als
00107 !  dest_array (sub(1,1):sub(2,1), sub(1,2):sub(2,2), sub (1,3):sub(2,3))
00108 ! zu deklariren und dann
00109 !
00110 !  dest_array = darray (sub(1,1):sub(2,1), sub(1,2):sub(2,2), sub (1,3):sub(2,3)
00111 !  asuzufuehren ?
00112 !
00113 !
00114       ierror = 0
00115 !
00116       ip = 1
00117 !
00118       leni = iend - ibeg + 1
00119 !
00120          do j = jbeg, jend
00121 !cdir vector
00122             do i = ibeg, iend
00123             dest_vector (ip+(i-ibeg)) = darray (i, j)
00124             enddo
00125 
00126             ip = ip + leni
00127          enddo
00128 !
00129       end subroutine PSMILe_Copy_subarray_2d_real

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1