00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 subroutine psmile_extent_subgrid_3d_dble ( &
00012 array, idlow, idhigh, jdlow, jdhigh, &
00013 kdlow, kdhigh, nbr_corners, &
00014 shape, &
00015 extent, ierror)
00016
00017
00018
00019 use PRISM_constants
00020
00021 use PSMILe, dummy_interface => PSMILe_Extent_Subgrid_3d_dble
00022
00023 implicit none
00024
00025
00026
00027 Integer, Intent (In) :: idlow, idhigh
00028 Integer, Intent (In) :: jdlow, jdhigh
00029 Integer, Intent (In) :: kdlow, kdhigh, nbr_corners
00030
00031
00032
00033 Double Precision, Intent (In) :: array (idlow:idhigh, jdlow:jdhigh,
00034 kdlow:kdhigh, nbr_corners)
00035
00036
00037
00038
00039 Integer, Intent (In) :: shape (2, ndim_3d)
00040
00041
00042
00043
00044
00045 Double Precision, Intent (Out) :: extent (2)
00046
00047
00048
00049 Integer, Intent (Out) :: ierror
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 Character(len=len_cvs_string), save :: mycvs =
00073 '$Id: psmile_extent_subgrid_3d_dble.F90 2325 2010-04-21 15:00:07Z valcke $'
00074
00075
00076
00077 #ifdef VERBOSE
00078 print *, trim(ch_id), ': PSMILe_Extent_Subgrid_3d_dble'
00079
00080 call psmile_flushstd
00081 #endif /* VERBOSE */
00082
00083
00084
00085 ierror = 0
00086
00087
00088
00089
00090
00091
00092
00093
00094 if (shape(1,1) == idlow .and. shape(2,1) == idhigh) then
00095 if (shape(1,2) == jdlow .and. shape(2,2) == jdhigh) then
00096 if (shape(1,3) == kdlow .and. shape(2,3) == kdhigh) then
00097 extent (1) = MINVAL (array)
00098 extent (2) = MAXVAL (array)
00099 else
00100 extent (1) = MINVAL (array (:, :, &
00101 shape(1,3):shape(1,3), &
00102 1:nbr_corners))
00103 extent (2) = MAXVAL (array (:, :, &
00104 shape(1,3):shape(1,3), &
00105 1:nbr_corners))
00106 endif
00107 else
00108 extent (1) = MINVAL (array (:, &
00109 shape(1,2):shape(1,2), &
00110 shape(1,3):shape(1,3), &
00111 1:nbr_corners))
00112 extent (2) = MAXVAL (array (:, &
00113 shape(1,2):shape(1,2), &
00114 shape(1,3):shape(1,3), &
00115 1:nbr_corners))
00116 endif
00117
00118 else
00119
00120 extent (1) = MINVAL (array (shape(1,1):shape(2,1), &
00121 shape(1,2):shape(1,2), &
00122 shape(1,3):shape(1,3), &
00123 1:nbr_corners))
00124 extent (2) = MAXVAL (array (shape(1,1):shape(2,1), &
00125 shape(1,2):shape(1,2), &
00126 shape(1,3):shape(1,3), &
00127 1:nbr_corners))
00128 endif
00129
00130
00131
00132 #ifdef VERBOSE
00133 print *, trim(ch_id), ': PSMILe_Extent_Subgrid_3d_dble eof', &
00134 ': ierror =', ierror, &
00135 ', extent ', extent
00136
00137 call psmile_flushstd
00138 #endif /* VERBOSE */
00139
00140 end subroutine PSMILe_Extent_Subgrid_3d_dble