00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_mg_coarse_3d_real (lev, chmin, chmax, &
00012 found, locations, coords1, &
00013 coords2, coords3, ibeg, iend)
00014
00015
00016
00017 use PRISM_constants
00018
00019 use PSMILe, dummy_interface => PSMILe_mg_coarse_3d_real
00020
00021 implicit none
00022
00023
00024
00025 Integer, Intent (InOut) :: ibeg
00026
00027
00028
00029
00030 Integer, Intent (InOut) :: iend
00031
00032
00033
00034
00035 Integer, Intent (InOut) :: found (iend)
00036
00037
00038
00039
00040 Integer, Intent (InOut) :: locations (iend)
00041
00042
00043
00044
00045 Integer, Intent (In) :: lev
00046
00047
00048
00049 Type (real_vector), Intent (In) :: chmin (ndim_3d)
00050
00051
00052
00053 Type (real_vector), Intent (In) :: chmax (ndim_3d)
00054
00055
00056
00057
00058
00059
00060 Real, Intent (In) :: coords1 (iend)
00061 Real, Intent (In) :: coords2 (iend)
00062 Real, Intent (In) :: coords3 (iend)
00063
00064
00065
00066
00067
00068
00069
00070
00071 Integer :: i, i2
00072 #ifdef VERBOSE
00073 Integer :: n
00074 #endif
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095 Character(len=len_cvs_string), save :: mycvs =
00096 '$Id: psmile_mg_coarse_3d_real.F90 2325 2010-04-21 15:00:07Z valcke $'
00097
00098
00099
00100
00101
00102 #ifdef VERBOSE
00103 print 9990, trim(ch_id), lev, ibeg, iend
00104
00105 call psmile_flushstd
00106 #endif /* VERBOSE */
00107
00108 #ifdef PRISM_ASSERTION
00109 if (chmin(1)%vector(1) > chmax(1)%vector (1) .or. &
00110 chmin(2)%vector(1) > chmax(2)%vector (1) .or. &
00111 chmin(3)%vector(1) > chmax(3)%vector (1) ) then
00112 print *, 'chmin', chmin(1)%vector(1), chmin(2)%vector(1), chmin(3)%vector(1)
00113 print *, 'chmax', chmax(1)%vector(1), chmax(2)%vector(1), chmax(3)%vector(1)
00114 call psmile_assert ( __FILE__, __LINE__, &
00115 'incorrect coarsest box')
00116 endif
00117 #endif
00118
00119
00120
00121
00122 do i = ibeg, iend
00123 if (chmin(1)%vector(1) <= coords1(i) .and. &
00124 chmax(1)%vector(1) >= coords1(i) .and. &
00125 chmin(2)%vector(1) <= coords2(i) .and. &
00126 chmax(2)%vector(1) >= coords2(i) .and. &
00127 chmin(3)%vector(1) <= coords3(i) .and. &
00128 chmax(3)%vector(1) >= coords3(i)) then
00129 found (i) = lev
00130 endif
00131 end do
00132
00133
00134
00135
00136 do i = ibeg, iend
00137 if (found (i) == lev) exit
00138 enddo
00139
00140 if (i > iend) then
00141 iend = ibeg - 1
00142
00143 else
00144 ibeg = i
00145
00146 if (found(iend) /= lev) then
00147
00148 do i = ibeg, iend
00149 if (found(i) == lev) then
00150 i2 = i
00151 endif
00152 enddo
00153
00154 iend = i2
00155
00156 endif
00157 endif
00158
00159
00160
00161 #ifdef VERBOSE
00162
00163
00164
00165 n = count (found(ibeg:iend) == lev)
00166
00167 print 9980, trim(ch_id), lev, n
00168
00169 call psmile_flushstd
00170 #endif /* VERBOSE */
00171
00172
00173
00174 9990 format (1x, a, ': PSMILe_mg_coarse_3d_real: level', i3, &
00175 ', ibeg, iend', 2i6)
00176 9980 format (1x, a, ': PSMILe_mg_coarse_3d_real: eof, level', i3, &
00177 ', found =', i9)
00178
00179 end subroutine PSMILe_mg_coarse_3d_real