NADCON5-ng  0.0.1
NADCON5 Next Generation
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 1248 of file myrms.f.

Referenced by myrms().

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

+ Here is the caller graph for this function: