NADCON5-ng  0.0.2
NADCON5 Next Generation Documentation
myrms.f File Reference

Go to the source code of this file.

Functions/Subroutines

program myrms
 Part of the NADCON5 build process, generates gmtbat05 More...
 
subroutine getrms (zs, max, inumlo, inumhi, indx, maxppcell, xlat, xlon, alat, alon, rval)
 

Function/Subroutine Documentation

subroutine getrms ( real*8, dimension(max)  zs,
  max,
integer*4  inumlo,
integer*4  inumhi,
integer*4, dimension(max)  indx,
  maxppcell,
real*8, dimension(max)  xlat,
real*8, dimension(max)  xlon,
real*8  alat,
real*8  alon,
real*8  rval 
)

Definition at line 1252 of file myrms.f.

Referenced by myrms().

1252 
1253 c - As of 10/28/2015, no longer using average
1254 c - lat/lon, but rather center of cell, to
1255 c - register the RMS vector
1256 
1257  real*8 xlat(max),xlon(max),zs(max)
1258  integer*4 indx(max),indx2(maxppcell)
1259  integer*4 inumlo,inumhi
1260 
1261  real*8 alat,alon,rval
1262 
1263 c write(6,1)inumlo,inumhi
1264  1 format('Inside getrms',/,
1265  *'inumlo,inumhi = ',i8,1x,i8)
1266 
1267 c - When the whole set of "zs" data is sorted by
1268 c - "whichcell", then the "indx" values are our
1269 c - key to that sort. The "zs" data remains
1270 c - in "read order" (1-nkt), but the indx values
1271 c - (also in "read order" point to the sorted
1272 c - order.
1273 
1274 c - Because we are NOT attempting any kind of
1275 c - median filter, there is no need to sort
1276 c - the "mini vector" of data in this cell.
1277 c - Just compute the average lat, average lon
1278 c - and RMS value and return.
1279 c - Change as of 10/28/2015: Do not
1280 c - use the avelat/avelon. Instead,
1281 c - register the RMS vector to the center of
1282 c - the cell. (See DRU-11, p. 145)
1283 
1284  rval = 0.d0
1285  alat = 0.d0
1286  alon = 0.d0
1287 
1288 
1289  nval = inumhi-inumlo+1
1290  iq = 0
1291  do 4 i=inumlo,inumhi
1292  iq = iq + 1
1293  rval = rval + zs(indx(i))**2
1294  alat = alat + xlat(indx(i))
1295  alon = alon + xlon(indx(i))
1296  4 continue
1297  rval = dsqrt(rval/nval)
1298  alat = alat/nval
1299  alon = alon/nval
1300 
1301  return

+ Here is the caller graph for this function: