27 module mpp_utilities_mod
32 #include<file_version.h>
54 subroutine mpp_array_global_min_max(in_array, tmask,isd,jsd,isc,iec,jsc,jec,nk, g_min, g_max, &
55 geo_x,geo_y,geo_z, xgmin, ygmin, zgmin, xgmax, ygmax, zgmax)
59 integer,
intent(in) :: isd,jsd,isc,iec,jsc,jec,nk
60 real,
dimension(isd:,jsd:,:),
intent(in) :: in_array
61 real,
dimension(isd:,jsd:,:),
intent(in) :: tmask
62 real,
intent(out):: g_min, g_max
63 real,
dimension(isd:,jsd:),
intent(in) :: geo_x,geo_y
64 real,
dimension(:),
intent(in) :: geo_z
65 real,
intent(out):: xgmin, ygmin, zgmin, xgmax, ygmax, zgmax
67 real :: tmax, tmin, tmax0, tmin0
68 integer :: itmax, jtmax, ktmax, itmin, jtmin, ktmin
72 integer :: iminarr(3),imaxarr(3)
74 g_min=-88888888888.0 ; g_max=-999999999.0
76 tmax=-1.e10;tmin=1.e10
77 itmax=0;jtmax=0;ktmax=0
78 itmin=0;jtmin=0;ktmin=0
80 if(any(tmask(isc:iec,jsc:jec,:) > 0.))
then
81 iminarr=minloc(in_array(isc:iec,jsc:jec,:),tmask(isc:iec,jsc:jec,:) > 0.)
82 imaxarr=maxloc(in_array(isc:iec,jsc:jec,:),tmask(isc:iec,jsc:jec,:) > 0.)
83 itmin=iminarr(1)+isc-1
84 jtmin=iminarr(2)+jsc-1
86 itmax=imaxarr(1)+isc-1
87 jtmax=imaxarr(2)+jsc-1
89 tmin=in_array(itmin,jtmin,ktmin)
90 tmax=in_array(itmax,jtmax,ktmax)
94 fudge = 1.0 + 1.e-12*real(
mpp_pe() )
98 tmax = tmax + 1.e-12*real(
mpp_pe() )
101 tmin = tmin + 1.e-12*real(
mpp_pe() )
105 tmax0=tmax;tmin0=tmin
122 xgmax=-999.; ygmax=-999.; zgmax=-999.
123 xgmin=-999.; ygmin=-999.; zgmin=-999.
127 if (tmax0 == tmax)
then
128 xgmax=geo_x(itmax,jtmax)
129 ygmax=geo_y(itmax,jtmax)
137 if (tmin0 == tmin)
then
138 xgmin=geo_x(itmin,jtmin)
139 ygmin=geo_y(itmin,jtmin)
155 end module mpp_utilities_mod
integer function mpp_pe()
Returns processor ID.
Reduction operations. Find the max of scalar a from the PEs in pelist result is also automatically br...
Reduction operations. Find the min of scalar a from the PEs in pelist result is also automatically br...
subroutine, public mpp_array_global_min_max(in_array, tmask, isd, jsd, isc, iec, jsc, jec, nk, g_min, g_max, geo_x, geo_y, geo_z, xgmin, ygmin, zgmin, xgmax, ygmax, zgmax)
Compute and return the global min and max of an array and the corresponding lat-lon-depth locations .