psmile_print_found_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_print_found_dble
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_print_found_dble (comp_info, lev,           &
00012                         found, loc, range,                          &
00013                         coords1, coords2, coords3,                  &
00014                         shape1,  shape2,  shape3,                   &
00015                         control, n_coords, message, ierror)
00016 !
00017 ! !USES:
00018 !
00019       use PRISM_constants
00020 !
00021       use PSMILe !, dummy_interface => PSMILe_print_found_dble
00022 
00023       implicit none
00024 !
00025 ! !INPUT PARAMETERS:
00026 !
00027       Type (Enddef_comp), Intent (In) :: comp_info
00028 
00029 !     Info on the component
00030 
00031       Integer, Intent (In)            :: lev
00032 
00033 !     Level number
00034 
00035       Integer, Intent (In)            :: range (2, ndim_3d)
00036 
00037 !     Dimension of loc and found
00038 
00039 !     Index range in "coords" to be searched
00040 !
00041       Integer, Intent (In)            :: found (range(1,1):range(2,1), 
00042                                                 range(1,2):range(2,2), 
00043                                                 range(1,3):range(2,3))
00044 
00045 !     Finest level number on which a grid cell was found for point i,j,k.
00046 !     Level number < -1: Point was not found and
00047 !                        and last level number was (-found(i,j,k))
00048 !     Level number = -(nlev+1): Never found
00049 !     found(i,j,k) = +1: Point (i,j,k) is located on a point
00050 !                        of the method grid.
00051 !     found(i,j,k) = -1: Point (i,j,k) is located in a cell
00052 !                        of the method grid.
00053 !
00054       Integer, Intent (In)           :: loc   (ndim_2d,               
00055                                                 range(1,1):range(2,1), 
00056                                                 range(1,2):range(2,2), 
00057                                                 range(1,3):range(2,3))
00058 
00059       Integer, Intent (In)            :: shape1 (2, ndim_3d)
00060       Integer, Intent (In)            :: shape2 (2, ndim_3d)
00061       Integer, Intent (In)            :: shape3 (2, ndim_3d)
00062 
00063 !     Dimension of coordinate arrays "coord1" and "coord2"
00064 !     which contain the coordinates to be searched.
00065 
00066 !     Indices of the grid cell in which the point was found.
00067 !     The indices are relative to "shape".
00068 
00069       Double Precision, Intent (In)   :: coords1 (shape1(1,1):shape1(2,1), 
00070                                                   shape1(1,2):shape1(2,2), 
00071                                                   shape1(1,3):shape1(2,3))
00072       Double Precision, Intent (In)   :: coords2 (shape2(1,1):shape2(2,1), 
00073                                                   shape2(1,2):shape2(2,2), 
00074                                                   shape2(1,3):shape2(2,3))
00075       Double Precision, Intent (In)   :: coords3 (shape3(1,1):shape3(2,1), 
00076                                                   shape3(1,2):shape3(2,2), 
00077                                                   shape3(1,3):shape3(2,3))
00078 
00079 !     Coordinates to be searched
00080 
00081       Integer, Intent (In)            :: control (2, ndim_3d)
00082 !
00083       Integer, Intent (In)           :: n_coords
00084 !
00085 !     Number of coordinate arrays
00086 !
00087       Character (len=*), Intent(In)  :: message
00088 !
00089 !     Message to be printed in the beginning
00090 !
00091 ! !OUTPUT PARAMETERS:
00092 !
00093       Integer, Intent (Out)           :: ierror
00094 
00095 !     Returns the error code of PSMILE_mg_method_2d_dble;
00096 !             ierror = 0 : No error
00097 !             ierror > 0 : Severe error
00098 !
00099 ! !DEFINED PARAMETERS:
00100 !
00101 !  val_direct  = Code for locations which should to be directly transferred
00102 !                to the destination process.
00103 !  val_coupler = Code for locations which should to be transferred
00104 !                to the coupler process.
00105 !
00106       Integer, Parameter              :: val_direct  =  1
00107       Integer, Parameter              :: val_coupler = -1
00108 !
00109 ! !LOCAL VARIABLES
00110 !
00111       Integer                         :: i, j, k
00112 !
00113       Double precision                :: xyz (n_coords)
00114 !
00115 ! !DESCRIPTION:
00116 !
00117 ! Subroutine "PSMILe_print_found_dble" write data out on the locations
00118 ! currently found.
00119 !
00120 !
00121 ! !REVISION HISTORY:
00122 !
00123 !   Date      Programmer   Description
00124 ! ----------  ----------   -----------
00125 ! 13.05.08    H. Ritzdorf  created
00126 !
00127 !EOP
00128 !----------------------------------------------------------------------
00129 !
00130 !  $Id: psmile_print_found_dble.F90,v 1.1.2.1 2008/06/20 10:43:50 ritzdorf Exp $
00131 !  $Author: ritzdorf $
00132 !
00133    Character(len=len_cvs_string), save :: mycvs = 
00134        '$Id: psmile_print_found_dble.F90,v 1.1.2.1 2008/06/20 10:43:50 ritzdorf Exp $'
00135 !
00136 !  Initialization
00137 !
00138       ierror = 0
00139 
00140 #ifdef PRISM_ASSERTION
00141       if (lev < 1) then
00142          call psmile_assert (__FILE__, __LINE__, &
00143                              "lev < 1")
00144       endif
00145 !
00146       if (n_coords > ndim_3d) then
00147          call psmile_assert (__FILE__, __LINE__, &
00148                              "n_coords > ndim_3d")
00149       endif
00150 #endif
00151 !
00152       print 9990, trim(ch_id), message, lev
00153 !
00154          do k = range(1,3), range(2,3)
00155             do j = range(1,2), range (2,2)
00156                do i = range (1,1), range (2,1)
00157 
00158                print 9980, i,j,k, abs(found (i,j,k)) == lev, &
00159                            found (i,j,k), loc (:, i,j,k)
00160 
00161                if (abs(found (i,j,k)) /= lev) then
00162              
00163                   xyz (1) = coords1 (i,j,k)
00164                   if (n_coords >= 2) xyz (2) = coords2 (i,j,k)
00165                   if (n_coords >= 3) xyz (3) = coords3 (i,j,k)
00166 
00167                   print 9970, i,j,k, xyz (1:n_coords)
00168                endif
00169 
00170                end do
00171             end do
00172          end do
00173 
00174       call psmile_flushstd
00175 !
00176 !  Formats:
00177 !
00178 9990  format (1x, a, ': ', a, ': lev =', i3)
00179 9980  format (1x, 'i,j,k', 3i5, ': found ', l1, ' (', i3, '), loc', 3i6)
00180 9970  format (1x, 'i,j,k', 3i5, ': coords', 3f20.12)
00181 
00182       end subroutine psmile_print_found_dble

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1