26 module mpp_utilities_mod
31 #include<file_version.h>
53 subroutine mpp_array_global_min_max(in_array, tmask,isd,jsd,isc,iec,jsc,jec,nk, g_min, g_max, &
54 geo_x,geo_y,geo_z, xgmin, ygmin, zgmin, xgmax, ygmax, zgmax)
58 integer,
intent(in) :: isd,jsd,isc,iec,jsc,jec,nk
59 real,
dimension(isd:,jsd:,:),
intent(in) :: in_array
60 real,
dimension(isd:,jsd:,:),
intent(in) :: tmask
61 real,
intent(out):: g_min, g_max
62 real,
dimension(isd:,jsd:),
intent(in) :: geo_x,geo_y
63 real,
dimension(:),
intent(in) :: geo_z
64 real,
intent(out):: xgmin, ygmin, zgmin, xgmax, ygmax, zgmax
66 real :: tmax, tmin, tmax0, tmin0
67 integer :: itmax, jtmax, ktmax, itmin, jtmin, ktmin
71 integer :: iminarr(3),imaxarr(3)
73 g_min=-88888888888.0 ; g_max=-999999999.0
75 tmax=-1.e10;tmin=1.e10
76 itmax=0;jtmax=0;ktmax=0
77 itmin=0;jtmin=0;ktmin=0
79 if(any(tmask(isc:iec,jsc:jec,:) > 0.))
then
80 iminarr=minloc(in_array(isc:iec,jsc:jec,:),tmask(isc:iec,jsc:jec,:) > 0.)
81 imaxarr=maxloc(in_array(isc:iec,jsc:jec,:),tmask(isc:iec,jsc:jec,:) > 0.)
82 itmin=iminarr(1)+isc-1
83 jtmin=iminarr(2)+jsc-1
85 itmax=imaxarr(1)+isc-1
86 jtmax=imaxarr(2)+jsc-1
88 tmin=in_array(itmin,jtmin,ktmin)
89 tmax=in_array(itmax,jtmax,ktmax)
93 fudge = 1.0 + 1.e-12*real(
mpp_pe() )
97 tmax = tmax + 1.e-12*real(
mpp_pe() )
100 tmin = tmin + 1.e-12*real(
mpp_pe() )
104 tmax0=tmax;tmin0=tmin
121 xgmax=-999.; ygmax=-999.; zgmax=-999.
122 xgmin=-999.; ygmin=-999.; zgmin=-999.
126 if (tmax0 == tmax)
then
127 xgmax=geo_x(itmax,jtmax)
128 ygmax=geo_y(itmax,jtmax)
136 if (tmin0 == tmin)
then
137 xgmin=geo_x(itmin,jtmin)
138 ygmin=geo_y(itmin,jtmin)
154 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 .