psmile_mg_first_level.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_MG_first_level
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_mg_first_level (grid_id, range, &
00012                       mg_info, tol, simplified_grid, ierror)
00013 !
00014 ! !USES:
00015 !
00016       use PRISM_constants
00017 !
00018       use PSMILe, dummy_interface => PSMILe_MG_first_level
00019 
00020       implicit none
00021 !
00022 ! !INPUT PARAMETERS:
00023 !
00024       Integer,                  Intent (In) :: grid_id
00025 !
00026 !     Specifies the handle to the grid information.
00027 !
00028       Integer,                  Intent (In) :: range (2, ndim_3d)
00029 !
00030 !     Range for which MG sequence should be setup
00031 ! 
00032 !
00033       Real (PSMILe_float_kind), Intent (In) :: tol
00034 !
00035 !     Search tolerance
00036 !
00037       Logical,                  Intent (In) :: simplified_grid
00038 !
00039 !     Should the simplified grids for grids of type
00040 !     "PRISM_Gaussreduced_regvrt" be used ?
00041 !
00042 ! !INPUT/OUTPUT PARAMETERS:
00043 !
00044       Type (Enddef_mg),       Intent (InOut) :: mg_info
00045 !
00046 !     Structure returning the data on the first multigrid level
00047 !     which is created by this routine.
00048 !
00049 ! !OUTPUT PARAMETERS:
00050 !
00051       Integer,                  Intent (Out) :: ierror
00052 !
00053 !     Returns the error code of PSMILe_MG_first_level;
00054 !             ierror = 0 : No error
00055 !             ierror > 0 : Severe error
00056 !
00057 ! !LOCAL VARIABLES
00058 !
00059       Type (Corner_Block), Pointer        :: corner_pointer
00060 !
00061 !     ... for error parameters
00062 !
00063       integer, parameter                  :: nerrp = 1
00064       integer                             :: ierrp (nerrp)
00065 !
00066 ! !DESCRIPTION:
00067 !
00068 ! Subroutine "PSMILe_MG_first_level" computes
00069 !
00070 !
00071 ! !REVISION HISTORY:
00072 !
00073 !   Date      Programmer   Description
00074 ! ----------  ----------   -----------
00075 ! 03.06.25    H. Ritzdorf  created
00076 !
00077 !EOP
00078 !----------------------------------------------------------------------
00079 !
00080 !  $Id: psmile_mg_first_level.F90 2325 2010-04-21 15:00:07Z valcke $
00081 !  $Autor$
00082 !
00083    Character(len=len_cvs_string), save :: mycvs = 
00084        '$Id: psmile_mg_first_level.F90 2325 2010-04-21 15:00:07Z valcke $'
00085 !
00086 !----------------------------------------------------------------------
00087 
00088 #ifdef VERBOSE
00089       print *, trim(ch_id), ': psmile_mg_first_level: grid_id', grid_id
00090 
00091       call psmile_flushstd
00092 #endif /* VERBOSE */
00093 !
00094 !  Initialization
00095 !
00096       corner_pointer => Grids(grid_id)%corner_pointer
00097 !
00098       if (corner_pointer%corner_datatype == MPI_REAL) then
00099 
00100 !        ... Real datatype
00101 
00102          call psmile_mg_first_level_real (grid_id, range, &
00103                    mg_info, tol, simplified_grid, ierror)
00104 
00105       else if (corner_pointer%corner_datatype == MPI_DOUBLE_PRECISION) then
00106 
00107 !        ... Double datatype
00108 
00109          call psmile_mg_first_level_dble (grid_id, range, &
00110                    mg_info, tol, simplified_grid, ierror)
00111 
00112 #if defined ( PRISM_QUAD_TYPE )
00113       else if (corner_pointer%corner_datatype == MPI_REAL16) then
00114 
00115 !        ... Quadruple  datatype
00116 
00117          call psmile_mg_first_level_quad (grid_id, range, &
00118                    mg_info, tol, simplified_grid, ierror)
00119 #endif
00120 
00121       else
00122 !
00123 !        Unknown data type
00124 !
00125          ierrp (1) = corner_pointer%corner_datatype
00126          ierror = PRISM_Error_Internal
00127          call psmile_error ( ierror, 'unsupported data type', &
00128                              ierrp, 1, __FILE__, __LINE__ )
00129       endif
00130 !
00131 !===> All done
00132 !
00133 #ifdef VERBOSE
00134       print *, trim(ch_id), ': psmile_mg_first_level eof: grid_id',&
00135                              grid_id, ', ierror =', ierror
00136 
00137       call psmile_flushstd
00138 #endif /* VERBOSE */
00139 !
00140       end subroutine PSMILe_MG_first_level

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1