psmile_copy_subarray_2d_double.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_double
00008 !
00009 ! !INTERFACE:
00010 !
00011       subroutine psmile_copy_subarray_2d_double (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_double
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       double precision, 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 !     Highest second index of sub-array to be copied
00065 !
00066 ! !OUTPUT PARAMETERS:
00067 !
00068       double precision, Intent (Out)      :: dest_vector (size)
00069 
00070 !     Destintation vector
00071 
00072       integer, Intent (Out)               :: ierror
00073 
00074 !     Returns the error code of PSMILe_Copy_subarray_2d_double;
00075 !             ierror = 0 : No error
00076 !             ierror > 0 : Severe error
00077 !
00078 ! !LOCAL VARIABLES
00079 !
00080       integer             :: i, j, leni
00081       integer(kind=int64) :: ip
00082 !
00083 ! !DESCRIPTION:
00084 !
00085 ! Subroutine "PSMILe_Copy_subarray_2d_double" copies the subarray
00086 ! darray (ibeg:iend, jbeg:jend) into the 1-dimensional destination
00087 ! vector "dest_vector".
00088 !
00089 !
00090 ! !REVISION HISTORY:
00091 !   Date      Programmer   Description
00092 ! ----------  ----------   -----------
00093 ! 01.12.03    H. Ritzdorf  created
00094 !
00095 !EOP
00096 !----------------------------------------------------------------------
00097 !
00098 ! $Id: psmile_copy_subarray_2d_double.F90 2325 2010-04-21 15:00:07Z valcke $
00099 ! $Author: valcke $
00100 
00101    Character(len=len_cvs_string), save :: mycvs = 
00102        '$Id: psmile_copy_subarray_2d_double.F90 2325 2010-04-21 15:00:07Z valcke $'
00103 !
00104 !----------------------------------------------------------------------
00105 !
00106 !  Initialization
00107 !
00108 ! ??? waere es moeglich dest_array als
00109 !  dest_array (sub(1,1):sub(2,1), sub(1,2):sub(2,2), sub (1,3):sub(2,3))
00110 ! zu deklariren und dann
00111 !
00112 !  dest_array = darray (sub(1,1):sub(2,1), sub(1,2):sub(2,2), sub (1,3):sub(2,3)
00113 !  asuzufuehren ?
00114 !
00115 !
00116       ierror = 0
00117 !
00118       ip = 1
00119 !
00120       leni = iend - ibeg + 1
00121 !
00122          do j = jbeg, jend
00123 !cdir vector
00124             do i = ibeg, iend
00125             dest_vector (ip+(i-ibeg)) = darray (i, j)
00126             enddo
00127 
00128             ip = ip + leni
00129          enddo
00130 !
00131       end subroutine PSMILe_Copy_subarray_2d_double

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1