psmile_mg_coars_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_coars_level
00008 !
00009 ! !INTERFACE:
00010 
00011       subroutine psmile_mg_coars_level (grid_id, mg_info_fine,   &
00012                                                  mg_info_coarse, &
00013                                         icoarse, ierror)
00014 !
00015 ! !USES:
00016 !
00017       use PRISM_constants
00018 !
00019       use PSMILe, dummy_interface => PSMILe_MG_coars_level
00020 
00021       implicit none
00022 !
00023 ! !INPUT PARAMETERS:
00024 !
00025       integer, Intent (In)                :: grid_id
00026 
00027 !     Specifies the handle to the grid information.
00028 !
00029       Type (Enddef_mg), Intent (In)       :: mg_info_fine
00030 
00031 !     Structure containing the data on the finer multigrid level.
00032 
00033       Integer, Intent (In)                :: icoarse  (ndim_3d)
00034 
00035 !     Specifies the coarsening in each direction.
00036 !
00037 ! !INPUT/OUTPUT PARAMETERS:
00038 !
00039       Type (Enddef_mg), Intent (InOut)    :: mg_info_coarse
00040 
00041 !     Structure returning the data on the coarser multigrid level
00042 !     which is created by this routine.
00043 !
00044 !
00045 ! !OUTPUT PARAMETERS:
00046 !
00047       integer, Intent (Out)               :: ierror
00048 
00049 !     Returns the error code of PSMILe_MG_coars_level;
00050 !             ierror = 0 : No error
00051 !             ierror > 0 : Severe error
00052 !
00053 ! !LOCAL VARIABLES
00054 !
00055       Type (Corner_Block), Pointer        :: corner_pointer
00056 !
00057 !     ... for error parameters
00058 !
00059       integer, parameter                  :: nerrp = 1
00060       integer                             :: ierrp (nerrp)
00061 !
00062 ! !DESCRIPTION:
00063 !
00064 ! Subroutine "PSMILe_MG_coars_level" creates the next (coarser)
00065 ! multigrid level from an existing finer one.
00066 !
00067 !
00068 ! !REVISION HISTORY:
00069 !
00070 !   Date      Programmer   Description
00071 ! ----------  ----------   -----------
00072 ! 03.07.07    H. Ritzdorf  created
00073 !
00074 !EOP
00075 !----------------------------------------------------------------------
00076 !
00077 !  $Id: psmile_mg_coars_level.F90 2325 2010-04-21 15:00:07Z valcke $
00078 !  $Autor$
00079 !
00080    Character(len=len_cvs_string), save :: mycvs = 
00081        '$Id: psmile_mg_coars_level.F90 2325 2010-04-21 15:00:07Z valcke $'
00082 !
00083 !----------------------------------------------------------------------
00084 
00085 #ifdef VERBOSE
00086       print 9990, trim(ch_id), grid_id, icoarse
00087 
00088       call psmile_flushstd
00089 #endif /* VERBOSE */
00090 !
00091 !  Initialization
00092 !
00093       corner_pointer => Grids(grid_id)%corner_pointer
00094 !
00095       if (corner_pointer%corner_datatype == MPI_REAL) then
00096 
00097 !        ... Real datatype
00098 
00099          call psmile_mg_coars_level_real (grid_id, mg_info_fine,   &
00100                                                    mg_info_coarse, &
00101                                           icoarse, ierror)
00102 
00103       else if (corner_pointer%corner_datatype == MPI_DOUBLE_PRECISION) then
00104 
00105 !        ... Double datatype
00106 
00107          call psmile_mg_coars_level_dble (grid_id, mg_info_fine,   &
00108                                                    mg_info_coarse, &
00109                                           icoarse, ierror)
00110 
00111 #if defined ( PRISM_QUAD_TYPE )
00112       else if (corner_pointer%corner_datatype == MPI_REAL16) then
00113 
00114 !        ... Quadruple  datatype
00115 
00116          call psmile_mg_coars_level_quad (grid_id, mg_info_fine,   &
00117                                                    mg_info_coarse, &
00118                                           icoarse, ierror)
00119 
00120 #endif
00121 
00122       else
00123 !
00124 !        Unknown data type
00125 !
00126          ierrp (1) = corner_pointer%corner_datatype
00127          ierror = PRISM_Error_Internal
00128          call psmile_error ( ierror, 'unsupported data type', &
00129                              ierrp, 1, __FILE__, __LINE__ )
00130       endif
00131 !
00132 !===> All done
00133 !
00134 #ifdef VERBOSE
00135       print 9980, trim(ch_id), grid_id, ierror
00136 
00137       call psmile_flushstd
00138 #endif /* VERBOSE */
00139 !
00140 !  Formats:
00141 !
00142 9990 format (1x, a, ': PSMILe_MG_coars_level: grid_id =', i3, &
00143                     '; icoarse =', 3i4)
00144 9980 format (1x, a, ': PSMILe_MG_coars_level: end grid_id =', i3, &
00145                     '; ierror =', i4)
00146 
00147       end subroutine PSMILe_MG_coars_level

Generated on 18 Mar 2011 for Oasis4 by  doxygen 1.6.1