psmile_generate_1d_3d_dble.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_Generate_1d_3d_dble
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_generate_1d_3d_dble (                 &
00012                            vector1, vector2, vector3, shape,  &
00013                            dest_array, dest_shape,            &
00014                            grid_valid_shape,                  &
00015                            ierror)
00016 !
00017 ! !USES:
00018 !
00019       use PRISM_constants
00020 !
00021       use PSMILe, dummy_interface => PSMILe_Generate_1d_3d_dble
00022 
00023       implicit none
00024 !
00025 ! !INPUT PARAMETERS:
00026 
00027       Integer, Intent (In)            :: shape (2, ndim_3d)
00028 
00029 !     Dimension of source vectors "vector1", "vector2", "vector3"
00030 !     which contain the values to be copied.
00031 !
00032       Double Precision, Intent (In)               :: vector1 (shape(1,1): 
00033                                                               shape(2,1))
00034       Double Precision, Intent (In)               :: vector2 (shape(1,2): 
00035                                                               shape(2,2))
00036       Double Precision, Intent (In)               :: vector3 (shape(1,3): 
00037                                                               shape(2,3))
00038 !     Data to be copied
00039 
00040       Integer, Intent (In)            :: dest_shape (2, ndim_3d)
00041 
00042 !     Dimension of 3-dimensional destination array "dest_array"
00043 
00044       Integer, Intent (In)            :: grid_valid_shape (2, ndim_3d)
00045       
00046 !     Specifies the subarray to be generated / copied.
00047 
00048 ! !OUTPUT PARAMETERS:
00049 
00050       Double Precision, Intent (Out)              :: dest_array ( 
00051                                              dest_shape(1,1):dest_shape(2,1), 
00052                                              dest_shape(1,2):dest_shape(2,2), 
00053                                              dest_shape(1,3):dest_shape(2,3))
00054 
00055 !     Destination array to be generated
00056 
00057       integer, Intent (Out)           :: ierror
00058 
00059 !     Returns the error code of PSMILe_info_trs_loc_3d_reg_dble;
00060 !             ierror = 0 : No error
00061 !             ierror > 0 : Severe error
00062 !
00063 ! !LOCAL VARIABLES
00064 !
00065 !     ... loop variables
00066 !
00067       Integer                         :: j, k
00068 !
00069 ! !DESCRIPTION:
00070 !
00071 ! Subroutine "PSMILe_Generate_1d_3d_dble" generates a 3-dimensional array
00072 ! out of 3 1-dimensional vectors.
00073 !
00074 ! !REVISION HISTORY:
00075 !
00076 !   Date      Programmer   Description
00077 ! ----------  ----------   -----------
00078 ! 03.07.21    H. Ritzdorf  created
00079 !
00080 !EOP
00081 !----------------------------------------------------------------------
00082 !
00083 !  $Id: psmile_generate_1d_3d_dble.F90 2325 2010-04-21 15:00:07Z valcke $
00084 !  $Author: valcke $
00085 !
00086    Character(len=len_cvs_string), save :: mycvs = 
00087        '$Id: psmile_generate_1d_3d_dble.F90 2325 2010-04-21 15:00:07Z valcke $'
00088 !
00089 !----------------------------------------------------------------------
00090 !
00091 !  Initialization
00092 !
00093 #ifdef VERBOSE
00094       print 9990, trim(ch_id)
00095 
00096       call psmile_flushstd
00097 #endif /* VERBOSE */
00098 !
00099       ierror = 0
00100 !
00101 !===> Generate 1st direction
00102 !
00103          do k = grid_valid_shape (1, 3), grid_valid_shape (2, 3)
00104             do j = grid_valid_shape (1, 2), grid_valid_shape (2, 2)
00105 
00106             dest_array (grid_valid_shape(1,1):grid_valid_shape(2,1), j, k) = &
00107                vector1 (grid_valid_shape(1,1):grid_valid_shape(2,1))
00108 
00109             end do ! j
00110          end do ! k
00111 !
00112 !===> Generate 2nd direction
00113 !
00114          do k = grid_valid_shape (1, 3), grid_valid_shape (2, 3)
00115             do j = grid_valid_shape (1, 2), grid_valid_shape (2, 2)
00116 
00117             dest_array (grid_valid_shape(1,1):grid_valid_shape(2,1), j, k) = &
00118                vector2 (j)
00119 
00120             end do ! j
00121          end do ! k
00122 !
00123 !===> Generate 3rd direction
00124 !
00125          do k = grid_valid_shape (1, 3), grid_valid_shape (2, 3)
00126             do j = grid_valid_shape (1, 2), grid_valid_shape (2, 2)
00127 
00128             dest_array (grid_valid_shape(1,1):grid_valid_shape(2,1), &
00129                         grid_valid_shape(1,2):grid_valid_shape(2,2), k) = &
00130                vector3 (k)
00131 
00132             end do ! j
00133          end do ! k
00134                 
00135 !===> All done
00136 !
00137 #ifdef VERBOSE
00138       print 9980, trim(ch_id), ierror
00139 
00140       call psmile_flushstd
00141 #endif /* VERBOSE */
00142 !
00143 !  Formats:
00144 !
00145 
00146 #ifdef VERBOSE
00147 
00148 9990 format (1x, a, ': psmile_generate_1d_3d_dble')
00149 9980 format (1x, a, ': psmile_generate_1d_3d_dble: eof ierror =', i3)
00150 
00151 #endif /* VERBOSE */
00152 
00153       end subroutine PSMILe_Generate_1d_3d_dble

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1