00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_mg_get_cyclic ( grid_id, range, tol, ierror)
00012
00013
00014
00015 use PRISM_constants
00016
00017 use PSMILe, dummy_interface => PSMILe_MG_get_cyclic
00018
00019 implicit none
00020
00021
00022
00023 integer, Intent (In) :: grid_id
00024
00025
00026
00027 Integer, Intent (In) :: range (2, ndim_3d)
00028
00029
00030
00031 Double precision, Intent (In) :: tol
00032
00033
00034
00035
00036
00037 integer, Intent (Out) :: ierror
00038
00039
00040
00041
00042
00043
00044
00045 Integer :: i
00046
00047 Type(Grid), Pointer :: grid_info
00048
00049
00050
00051 Integer :: nbr_lats
00052 #if 0
00053 Type (Corner_Block), Pointer :: corner_pointer
00054
00055
00056
00057 integer, parameter :: nerrp = 1
00058 integer :: ierrp (nerrp)
00059 #endif
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 Character(len=len_cvs_string), save :: mycvs =
00079 '$Id: psmile_mg_get_cyclic.F90 3248 2011-06-23 13:03:19Z coquart $'
00080
00081
00082
00083 #ifdef VERBOSE
00084 print 9990, trim(ch_id), grid_id
00085
00086 call psmile_flushstd
00087 #endif /* VERBOSE */
00088
00089
00090
00091
00092
00093
00094
00095
00096 #if 1
00097 ierror = 0
00098 grid_info => Grids(grid_id)
00099
00100 grid_info%cyclic = grid_info%periodic == PSMILE_true
00101
00102 if (grid_info%grid_type /= PRISM_Gaussreduced_regvrt) then
00103 if (Associated (grid_info%partition)) then
00104
00105
00106
00107 do i = 1, ndim_3d
00108 grid_info%cyclic (i) = grid_info%cyclic (i) .and. &
00109 grid_info%len_periodic(i) == &
00110 grid_info%grid_shape(2,i)-grid_info%grid_shape(1,i)+1
00111 end do
00112 else
00113
00114 endif
00115 else
00116
00117
00118
00119
00120 grid_info%cyclic(:) = .true.
00121
00122 endif
00123 #else
00124
00125 Grids(grid_id)%cyclic = .false.
00126
00127
00128
00129 corner_pointer => Grids(grid_id)%corner_pointer
00130
00131 if (corner_pointer%corner_datatype == MPI_REAL) then
00132
00133
00134
00135 call psmile_mg_get_cyclic_real ( grid_id, range, &
00136 real(tol), ierror)
00137
00138 else if (corner_pointer%corner_datatype == MPI_DOUBLE_PRECISION) then
00139
00140
00141
00142 call psmile_mg_get_cyclic_dble ( grid_id, range, &
00143 tol, ierror)
00144
00145 #if defined ( PRISM_QUAD_TYPE )
00146 else if (corner_pointer%corner_datatype == MPI_REAL16) then
00147
00148
00149
00150 call psmile_mg_get_cyclic_quad ( grid_id, range, &
00151 real(tol, 16), ierror)
00152 #endif
00153
00154 else
00155
00156
00157
00158 ierrp (1) = corner_pointer%corner_datatype
00159 ierror = PRISM_Error_Internal
00160 call psmile_error ( ierror, 'unsupported data type', &
00161 ierrp, 1, __FILE__, __LINE__ )
00162 endif
00163 #endif
00164
00165
00166
00167 #ifdef VERBOSE
00168 print 9980, trim(ch_id), ierror, Grids(grid_id)%cyclic
00169
00170 call psmile_flushstd
00171 #endif /* VERBOSE */
00172
00173
00174
00175
00176
00177 #ifdef VERBOSE
00178
00179 9990 format (1x, a, ': psmile_mg_get_cyclic: grid_id', i3)
00180 9980 format (1x, a, ': psmile_mg_get_cyclic: eof ierror =', i3, '; cyclic:', 3l3)
00181
00182 #endif /* VERBOSE */
00183
00184
00185 end subroutine PSMILe_MG_get_cyclic