NADCON5-ng
0.0.2
NADCON5 Next Generation Documentation
|
Programs and Functions which are responsible for computing the grid transformations used to build NADCON5. More...
Directories | |
directory | BinSource |
Folder containing NADCON5 Core Library Programs. | |
directory | Subs |
Folder containing NADCON5 Core Library Subroutines. | |
Programs, Functions, and Subroutines | |
program | addem |
Part of the NADCON5 NADCON5 Core Library , adds one grid to another. More... | |
program | b2xyz |
Part of the NADCON5 NADCON5 Core Library , converts *.b grid to xyz More... | |
program | convlv |
Part of the NADCON5 NADCON5 Core Library , Convolves two grids. More... | |
program | decimate |
Part of the NADCON5 NADCON5 Core Library , Extract a reduced (1 of n) dataset. More... | |
program | gabs |
Part of the NADCON5 NADCON5 Core Library , Convert values in a *.b grid to absolute value. More... | |
program | gscale |
Part of the NADCON5 NADCON5 Core Library , Scales a grid by a factor. More... | |
program | gsqr |
Part of the NADCON5 NADCON5 Core Library , Squares values in a *.b grid. More... | |
program | gsqrt |
Part of the NADCON5 NADCON5 Core Library , Square Root of values in a *.b grid. More... | |
program | regrd2 |
Part of the NADCON5 NADCON5 Core Library , regrid data. More... | |
program | subtrc |
Part of the NADCON5 NADCON5 Core Library , Subtract one grid from another. More... | |
program | xyz2b |
Part of the NADCON5 NADCON5 Core Library , Converts GMT *.grd to a *.b NADCON style grid file. More... | |
subroutine | bicubic (z, glamn, glomn, dla, dlo, nla, nlo, maxla, maxlo, xla, xlo, val) |
Subroutine to perform a 2-D cubic ("bicubic") interpolation. More... | |
subroutine | bilin (data, glamn, glomn, dla, dlo, nla, nlo, maxla, maxlo, xla, xlo, val) |
Subroutine to perform bilinear interpolation. More... | |
subroutine | biquad (z, glamn, glomn, dla, dlo, nla, nlo, maxla, maxlo, xla, xlo, val) |
Subroutine to perform a 2-D quadratic ("biquadratic") interpolation. More... | |
subroutine | bwplotcv (ele, fname, bw, be, bs, bn, jm, b1, b2, maxplots, olddtm, newdtm, region, elecap, ij, igridsec, fn) |
Subroutine to make GMT calls to do a B/W coverage plot. More... | |
subroutine | bwplotvc (ele, fname, bw, be, bs, bn, jm, b1, b2, maxplots, olddtm, newdtm, region, elecap, ij, xvlon, xvlat, xllon, xllat, lorvog, lorvopc, igridsec, fn) |
Subroutine to make GMT calls to do a B/W vector plot. More... | |
subroutine | coplot (ele, fname, bw, be, bs, bn, jm, b1, b2, maxplots, olddtm, newdtm, region, elecap, ij, cptlo, cpthi, cptin6, suffixused, igridsec, fn) |
Subroutine to make GMT calls to do Color Raster Rendering of Gridded Data. More... | |
subroutine | coplotwcv (ele, fname, bw, be, bs, bn, jm, b1, b2, maxplots, olddtm, newdtm, region, elecap, ij, cptlo, cpthi, cptin6, suffixused, igridsec, fn, cvfname) |
Subroutine to make GMT calls to do a color raster rendering of gridded data, with coverage overlaid. More... | |
subroutine | cpt (ave, std, csm, xlo, xhi, xin) |
This subroutine generates the color pallette variables for a GMT color plot. More... | |
subroutine | cpt2 (med, csm, xlo, xhi, xin) |
This subroutine generates the color pallette variables for a GMT color plot. More... | |
real function | cubterp (x, f0, f1, f2, f3) |
This function fits a cubic function through four points. More... | |
subroutine | getgridbounds (region, xn, xs, xw, xe) |
Subroutine to collect up the GRID boundaries for use in creating NADCON 5. More... | |
subroutine | getmag (x, ix) |
Subroutine to return the magnitude of a double precision value. More... | |
subroutine | getmapbounds (mapflag, maxplots, region, nplots, olddtm, newdtm, bw, be, bs, bn, jm, b1, b2, fn, lrv, rv0x, rv0y, rl0y) |
Subroutine to collect up the MAP boundaries for use in creating NADCON 5. More... | |
subroutine | gridstats (fname, ave, std, med) |
Subroutine to print grid statistics to stdout. More... | |
subroutine | indexxd (n, nd, arr, indx) |
Subroutine to perform ?? indexing on floating point data (double precision) More... | |
subroutine | indexxi (n, nd, arr, indx) |
Subroutine to perform ?? indexing on integer data. More... | |
integer *2 function | iselect2 (k, n, arr, nmax) |
Function to select an element of a partially filled, but packed multi dimensional array, integer*2 More... | |
real *4 function | onzd (x) |
Function to round a digit to one significant figure (one non zero digit), single precision. More... | |
real *8 function | onzd2 (x) |
Function to round a digit to one significant figure (one non zero digit), double precision. More... | |
subroutine | plotcoast (region, ifnum) |
Subroutine to write GMT-based commands to create a shoreline Write GMT-based commands to create a shoreline based on region. More... | |
real function | qterp (x, f0, f1, f2) |
This function fits a quadratic function through 3 points. More... | |
real *8 function | select2 (k, n, arr, nmax) |
Function to select an element of a partially filled, but packed multi dimensional array, double precision. More... | |
real *4 function | select2 (k, n, arr, nmax) |
Function to select an element of a partially filled, but packed multi dimensional array, single precision. More... | |
subroutine | vecstats (fname, n) |
Subroutine to tell us how many thinned vectors were used to make a grid. More... | |
Programs and Functions which are responsible for computing the grid transformations used to build NADCON5.
The programs here can be considered "Library" Programs, or functions, which do the raw work of computing various transformations and conversions from *.b
NADCON binary grid to a GMT
style *.grd
program addem | ( | ) |
Part of the NADCON5 NADCON5 Core Library , adds one grid to another.
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infileA | First Input File Name |
infileB | Second Input File Name |
outfile | Output File Name of A+B |
lin1
Input File Alin2
Input File Blout
Output File to Write A+B program b2xyz | ( | ) |
Part of the NADCON5 NADCON5 Core Library , converts *.b
grid to xyz
Program to convert standard "*.b" grid formatted data to a binary xyz (lon, lat, value) list, which can then be used by GMT for various things (like running the GMT routine "xyz2grd", to get a "*.grd" file, which is useful for plotting, etc)
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infile | Input File Name |
infile
temp.xyz
subroutine bicubic | ( | real*4, dimension(maxla,maxlo) | z, |
glamn, | |||
glomn, | |||
dla, | |||
dlo, | |||
nla, | |||
nlo, | |||
maxla, | |||
maxlo, | |||
xla, | |||
xlo, | |||
val | |||
) |
Subroutine to perform a 2-D cubic ("bicubic") interpolation.
Performs interpolation at location "xla,xlo" off of grid "z", whose header information is the standard ".b" header information with additional inputs
[in] | z | Input Grid |
[in] | glamn | minimum latitude (real*8 decimal degrees) |
[in] | glomn | minimum longitude (real*8 decimal degrees) |
[in] | dla | latitude spacing (real*8 decimal degrees) |
[in] | dlo | longitude spacing (real*8 decimal degrees) |
[in] | nla | number of lat rows (integer*4) |
[in] | nlo | number of lon cols (integer*4) |
[in] | maxla | actual dimensioned size of "z" in rows |
[in] | maxlo | actual dimensioned size of "z" in cols |
[in] | xla | lat of pt for interpolation (real*8 dec. deg) |
[in] | xlo | lon of pt for interpolation (real*8 dec. deg) |
[out] | val | interpolated value (real*8) |
Fit a 4x4 window over the random point. Unless the point is less than one grid spacing from the edge of the grid, it will fall in the inner 2x2 cell, and the 4x4 cell will be centered upon that.
Thus, if our point of interest is the asterisk, the window will look like this:
. . . . . . . . . .* . . . . . .
Definition at line 41 of file bicubic.f.
Referenced by checkgrid().
subroutine bilin | ( | real*4, dimension(maxla,maxlo) | data, |
glamn, | |||
glomn, | |||
dla, | |||
dlo, | |||
nla, | |||
nlo, | |||
maxla, | |||
maxlo, | |||
xla, | |||
xlo, | |||
val | |||
) |
Subroutine to perform bilinear interpolation.
Performs a bilinear interpolation at location xla,xlo
off of grid data
, whose header information is the standard .b
header information
[in] | data | Input Data assumed to be real*4 |
[in] | glamn | minimum latitude (real*8 decimal degrees) *.b |
[in] | glomn | minimum longitude (real*8 decimal degrees) *.b |
[in] | dla | latitude spacing (real*8 decimal degrees) *.b |
[in] | dlo | longitude spacing (real*8 decimal degrees) *.b |
[in] | nla | number of lat rows (integer*4) *.b |
[in] | nlo | number of lon cols (integer*4) *.b |
[in] | maxla | actual dimensioned size of "data" in rows *.b |
[in] | maxlo | actual dimensioned size of "data" in cols *.b |
[in] | xla | lat of pt for interpolation (real*8 dec. def) |
[in] | xlo | lon of pt for interpolation (real*8 dec. def) |
[out] | val | interpolated value (real*8) |
Definition at line 27 of file bilin.f.
Referenced by checkgrid().
subroutine biquad | ( | real*4, dimension(maxla,maxlo) | z, |
glamn, | |||
glomn, | |||
dla, | |||
dlo, | |||
nla, | |||
nlo, | |||
maxla, | |||
maxlo, | |||
xla, | |||
xlo, | |||
val | |||
) |
Subroutine to perform a 2-D quadratic ("biquadratic") interpolation.
Performs a biquadratic interpolation at location xla,xlo
off of grid z
, whose header information is the standard ".b" header information
[in] | z | Input Grid |
[in] | glamn | minimum latitude (real*8 decimal degrees) |
[in] | glomn | minimum longitude (real*8 decimal degrees) |
[in] | dla | latitude spacing (real*8 decimal degrees) |
[in] | dlo | longitude spacing (real*8 decimal degrees) |
[in] | nla | number of lat rows (integer*4) |
[in] | nlo | number of lon cols (integer*4) |
[in] | maxla | actual dimensioned size of "z" in rows |
[in] | maxlo | actual dimensioned size of "z" in cols |
[in] | xla | lat of pt for interpolation (real*8 dec. deg) |
[in] | xlo | lon of pt for interpolation (real*8 dec. deg) |
[out] | val | interpolated value (real*8) |
Fit a 3x3 window over the random point. The closest 2x2 points will surround the point. But based on which quadrant of that 2x2 cell in which the point falls, the 3x3 window could extend NW, NE, SW or SE from the 2x2 cell.
Definition at line 33 of file biquad.f.
Referenced by checkgrid().
subroutine bwplotcv | ( | character*3 | ele, |
character*200 | fname, | ||
real*8, dimension(maxplots) | bw, | ||
real*8, dimension(maxplots) | be, | ||
real*8, dimension(maxplots) | bs, | ||
real*8, dimension(maxplots) | bn, | ||
real*4, dimension(maxplots) | jm, | ||
real*4, dimension(maxplots) | b1, | ||
real*4, dimension(maxplots) | b2, | ||
integer*4 | maxplots, | ||
character*10 | olddtm, | ||
character*10 | newdtm, | ||
character*10 | region, | ||
character*3 | elecap, | ||
ij, | |||
igridsec, | |||
character*10, dimension(maxplots) | fn | ||
) |
Subroutine to make GMT calls to do a B/W coverage plot.
Updated the -R
and -B
initial calls to 6 decimal places
.gmtdefaults4
has been changed so X_ORIGIN is equal to 0.0 Center the plot with "-Xc" at first "psxy" call Remove all "-JM**i+" references, and just use the actual width (jm) that came out of the "getmapbounds" routine and was sent here.
Modified use of JM command based on new forced sizes.
Updated to allow this subroutine to work earlier (in makeplotfiles01()), before igridsec
was defined. See DRU-11, p. 139
Definition at line 30 of file bwplotcv.f.
References plotcoast().
Referenced by makeplotfiles01(), makeplotfiles02(), and makeplotfiles03().
subroutine bwplotvc | ( | character*3 | ele, |
character*200 | fname, | ||
real*8, dimension(maxplots) | bw, | ||
real*8, dimension(maxplots) | be, | ||
real*8, dimension(maxplots) | bs, | ||
real*8, dimension(maxplots) | bn, | ||
real*4, dimension(maxplots) | jm, | ||
real*4, dimension(maxplots) | b1, | ||
real*4, dimension(maxplots) | b2, | ||
integer*4 | maxplots, | ||
character*10 | olddtm, | ||
character*10 | newdtm, | ||
character*10 | region, | ||
character*3 | elecap, | ||
ij, | |||
xvlon, | |||
xvlat, | |||
xllon, | |||
xllat, | |||
real*8 | lorvog, | ||
real*8 | lorvopc, | ||
igridsec, | |||
character*10, dimension(maxplots) | fn | ||
) |
Subroutine to make GMT calls to do a B/W vector plot.
Expanded the refence vector calls to be 6 decimal places, as well as the initial -R call for S/N/W/E and also the -B part of that call
.gmtdefaults4
has been changed so X_ORIGIN is equal to 0.0 Center the plot with "-Xc" at first "psxy" call Remove all "-JM**i+" references, and just use the actual width (jm) that came out of the "getmapbounds" routine and was sent here.
Updated the reference vector call to have the "-N" option, so it'll plot outside the map
Modified use of JM command based on new forced sizes.
Updated to allow this subroutine to work earlier (in makeplotfiles01()), before igridsec
was defined. See DRU-11, p. 139
Definition at line 37 of file bwplotvc.f.
References plotcoast().
Referenced by checkgrid(), makeplotfiles01(), makeplotfiles02(), and makeplotfiles03().
program convlv | ( | ) |
Part of the NADCON5 NADCON5 Core Library , Convolves two grids.
Convolves one grid against another
\[ c(i,j) = a(i,j) * b(i,j) \]
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infileA | First Input File Name |
infileB | Second Input File Name |
outfile | Output File Name of A*B |
lin1
Input File Alin2
Input File Blout
Output File to Write A+B subroutine coplot | ( | character*3 | ele, |
character*200 | fname, | ||
real*8, dimension(maxplots) | bw, | ||
real*8, dimension(maxplots) | be, | ||
real*8, dimension(maxplots) | bs, | ||
real*8, dimension(maxplots) | bn, | ||
real*4, dimension(maxplots) | jm, | ||
real*4, dimension(maxplots) | b1, | ||
real*4, dimension(maxplots) | b2, | ||
integer*4 | maxplots, | ||
character*10 | olddtm, | ||
character*10 | newdtm, | ||
character*10 | region, | ||
character*3 | elecap, | ||
ij, | |||
cptlo, | |||
cpthi, | |||
cptin6, | |||
character*200 | suffixused, | ||
igridsec, | |||
character*10, dimension(maxplots) | fn | ||
) |
Subroutine to make GMT calls to do Color Raster Rendering of Gridded Data.
Had to up the D_FORMAT default to %.3G because tight scalebar ranges with the newly allowed "more free" average values were showing repeating values when only 2 digits could be shown.
Had to add lines pre/post "makecpt" to change the D_FORMAT. This is because I had been forcing the "scave" in cpt.f to be ONZD. But that yielded bad values sometimes, so I switched it. With that switch, the scave could have lots of digits. Well, that means the newly adopted "D_FORMAT" of %.2G was insufficient for the CPT table. Who knew that D_FORMAT affected that! Anyway, so change "D_FORMAT" pre/post all makecpt calls.
See item #39 in Google ToDo list Changed "grdcontour" to have a blank "-R" call so it'll mimic whatever decimal places are in the "grdimage" call that came before it.
Updated the initial -R and -B calls to 6 decimal places
-.gmtdefaults4 has been changed so X_ORIGIN is equal to 0.0
Update to put more data into comment/echo
Also,
Definition at line 74 of file coplot.f.
References plotcoast().
Referenced by makeplotfiles02(), and makeplotfiles03().
subroutine coplotwcv | ( | character*3 | ele, |
character*200 | fname, | ||
real*8, dimension(maxplots) | bw, | ||
real*8, dimension(maxplots) | be, | ||
real*8, dimension(maxplots) | bs, | ||
real*8, dimension(maxplots) | bn, | ||
real*4, dimension(maxplots) | jm, | ||
real*4, dimension(maxplots) | b1, | ||
real*4, dimension(maxplots) | b2, | ||
integer*4 | maxplots, | ||
character*10 | olddtm, | ||
character*10 | newdtm, | ||
character*10 | region, | ||
character*3 | elecap, | ||
ij, | |||
cptlo, | |||
cpthi, | |||
cptin6, | |||
character*200 | suffixused, | ||
igridsec, | |||
character*10, dimension(maxplots) | fn, | ||
character*200 | cvfname | ||
) |
Subroutine to make GMT calls to do a color raster rendering of gridded data, with coverage overlaid.
Had to up the D_FORMAT default to %.3G because tight scalebar ranges with the newly allowed "more free" average values were showing repeating values when only 2 digits could be shown.
Had to add lines pre/post "makecpt" to change the D_FORMAT. This is because I had been forcing the "scave" in cpt.f to be ONZD. But that yielded bad values sometimes, so I switched it. With that switch, the scave could have lots of digits. Well, that means the newly adopted "D_FORMAT" of %.2G was insufficient for the CPT table. Who knew that D_FORMAT affected that! Anyway, so change "D_FORMAT" pre/post all makecpt calls.
See item #39 in Google ToDo list Changed "grdcontour" to have a blank "-R" call so it'll mimic whatever decimal places are in the "grdimage" call that came before it.
Updated the initial -R and -B calls to 6 decimal places
Definition at line 72 of file coplotwcv.f.
References plotcoast().
Referenced by makeplotfiles02().
subroutine cpt | ( | real*8 | ave, |
real*8 | std, | ||
real*8 | csm, | ||
real*8 | xlo, | ||
real*8 | xhi, | ||
real*8 | xin | ||
) |
This subroutine generates the color pallette variables for a GMT color plot.
[in] | ave | Average of the gridded data |
[in] | std | Standard deviation of the gridded data |
[in] | csm | Color Sigma Multiplier (how many sigmas on each side of the average do you want the colors to range?) |
[out] | xlo | Low value |
[out] | xhi | High value |
[out] | xin | Interval |
Modified because the forcing of "scave" to be one non zero digit was throwing off the scalebar so far in Guam that the data in Guam wasn't even plotting. Change to make the interval still be one non zero digit, but then a simpler formula for the scaled average was put in.
Modified from original version to reflect "new math" invented this week that helps shrink the color bar and/or widen the color bar (see issues 14 and 15 in DRU-12, p. 48)
Definition at line 32 of file cpt.f.
Referenced by makeplotfiles02().
subroutine cpt2 | ( | real*8 | med, |
real*8 | csm, | ||
real*8 | xlo, | ||
real*8 | xhi, | ||
real*8 | xin | ||
) |
This subroutine generates the color pallette variables for a GMT color plot.
This particular routine is best for data that are all positive, but cluster near a small value while having a lot of outliers to the high-side. The color plot uses the MEDIAN (and a multiplier) to set the upper limit, while forcing the lower limit to be ZERO.
[in] | med | Median of the gridded data |
[in] | csm | Color Sigma Multiplier (The maximum color range will be based on csm*med. The minimum color range will be zero) |
[out] | xlo | Low value |
[out] | xhi | High value |
[out] | xin | Interval |
Definition at line 25 of file cpt2.f.
Referenced by makeplotfiles02(), and makeplotfiles03().
real function cubterp | ( | x, | |
f0, | |||
f1, | |||
f2, | |||
f3 | |||
) |
This function fits a cubic function through four points.
This function fits a cubic function through four equally spaced points along the x-axis at indices 0, 1, 2 and 3. The spacing along the x-axis is "dx"
Thus:
\begin{eqnarray*} f0 = f_0 &= y(x_0) \\ f1 = f_1 &= y(x_1) \\ f2 = f_2 &= y(x_2) \\ f3 = f_3 &= y(x_3) \end{eqnarray*}
Where:
\begin{eqnarray*} x_1 &= x_0 + dx \\ x_2 &= x_1 + dx \\ x_3 &= x_2 + dx \end{eqnarray*}
The input value is some value of "x" that falls between 0 and 3. The output value (cubterp) is the cubic function at x.
[in] | x | Compute Interpolation at this positon, a value between 0 and 3 it is scaled relative to x_0 x_3 and dx . For example, a value of 1.5 is x_0 + 1.5*dx which falls between x1 and x2 |
[in] | f0 | y value at x_0 |
[in] | f1 | y value at x_1 = x_0 + dx |
[in] | f2 | y value at x_2 = x_0 + dx |
[in] | f3 | y value at x_3 = x_0 + dx ` |
This function uses Newton-Gregory forward polynomial
\begin{eqnarray*} \nabla f_0 &=& f_1 -f_0 \\ \nabla f_1 &=& f_2 -f_1 \\ \nabla^2 f_0 &=& \nabla f_1 - \nabla f_0 \\ cubterp(x, f_0, f_1, f_2, f_3) &=& f_0 + x \nabla f_0 + 0.5 x \left( x-1.0 \right) \nabla^2 f_0 \end{eqnarray*}
Definition at line 52 of file cubterp.f.
program decimate | ( | ) |
Part of the NADCON5 NADCON5 Core Library , Extract a reduced (1 of n) dataset.
Decimate - Extract 1
of every n
points
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infile | Input File Name |
outfile | Output File Name |
ny | Latitude Decimation Ratio 1:ny |
nx | Longitude Decimation Ratio 1:nx |
lin
Input File Alout
Output File to Write Decimated File Definition at line 29 of file decimate.f.
References inouti(), and inoutr().
program gabs | ( | ) |
Part of the NADCON5 NADCON5 Core Library , Convert values in a *.b
grid to absolute value.
Belongs to the suite of ".b" file manipulators
This program will convert every value in a ".b" grid to its absolute value.
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infile | Input File Name |
outfile | Output File Name |
lin
Input File (*.b
grid)lout
Output File (*.b
grid) subroutine getgridbounds | ( | character*10 | region, |
real*8 | xn, | ||
real*8 | xs, | ||
real*8 | xw, | ||
real*8 | xe | ||
) |
Subroutine to collect up the GRID boundaries for use in creating NADCON 5.
This CAN BE different than the MAP boundaries as such:
GRID boundaries will be just four values (n/s/w/e) for any region
MAP boundaries will allow multiple maps to be made and may or may not align with the GRID boundaries. Used to allow for more "close up" maps and such, without the need to screw up the MAP boundaries.
[in] | region | Region Name |
[out] | xn | north boundary for this region |
[out] | xs | south boundary for this region |
[out] | xw | west boundary for this region |
[out] | xe | east boundary for this region |
Definition at line 30 of file getgridbounds.f.
Referenced by checkgrid(), makework(), mymedian5(), and myrms().
subroutine getmag | ( | x, | |
ix | |||
) |
Subroutine to return the magnitude of a double precision value.
[out] | x | result, magnitude of ix |
[in] | ix | input douple precision |
subroutine getmapbounds | ( | character*1 | mapflag, |
maxplots, | |||
character*10 | region, | ||
nplots, | |||
character*10 | olddtm, | ||
character*10 | newdtm, | ||
real*8, dimension(maxplots) | bw, | ||
real*8, dimension(maxplots) | be, | ||
real*8, dimension(maxplots) | bs, | ||
real*8, dimension(maxplots) | bn, | ||
real*4, dimension(maxplots) | jm, | ||
real*4, dimension(maxplots) | b1, | ||
real*4, dimension(maxplots) | b2, | ||
character*10, dimension(maxplots) | fn, | ||
logical, dimension(maxplots) | lrv, | ||
real*8, dimension(maxplots) | rv0x, | ||
real*8, dimension(maxplots) | rv0y, | ||
real*8, dimension(maxplots) | rl0y | ||
) |
Subroutine to collect up the MAP boundaries for use in creating NADCON 5.
This CAN BE different than the GRID boundaries as such:
GRID boundaries will be just four values (n/s/w/e) for any region
MAP boundaries will allow multiple maps to be made and may or may not align with the GRID boundaries. Used to allow for more "close up" maps and such, without the need to screw up the MAP boundaries.
[in] | mapflag | Map Generation Flag |
[in] | maxplots | |
[in] | region | region to get map bounds |
[out] | nplots | number of plots generated |
[in] | olddtm | source datum |
[in] | newdtm | target datum |
[out] | bw | western bound of plot (Array of length maxplots ) |
[out] | be | eastern bound of plot (Array of length maxplots ) |
[out] | bs | southern bound of plot (Array of length maxplots ) |
[out] | bn | northern bound of plot (Array of length maxplots ) |
[out] | jm | (Array of length maxplots ) |
[out] | b1 | (Array of length maxplots ) |
[out] | b2 | (Array of length maxplots ) |
[out] | fn | (Array of length maxplots ) |
[out] | lrv | (Array of length maxplots ) |
[out] | rv0x | (Array of length maxplots ) |
[out] | rv0y | (Array of length maxplots ) |
[out] | rl0y | (Array of length maxplots ) |
Version for NADCON 5 Built upon the original version used in GEOCON v2.0 Do not use with GEOCON v2.0
Broken down into sub-subroutines to make it easier to swap out when I make different choices.
Taking in olddtm and newdtm now, and adding code to use that to filter out "Saint" regions in Alaska when plotting transformations not supported in those regions.
Used actual mercator projection math to compute the exact reference vector and label locations 1/2 inch and 3/4 inch respectively below the S/W corner of the plot.
Two new columns added to "map.parameters", which have the location of the reference vector. Return a logical "lrv" as true if there is an optional special location for the reverence vector. Return as false if not. If true, return lon/lat coords of ref vector origin in rv0x/rv0y. If false, return zeros in those fields.
Also, compute "jm" on the fly, ignoring what is in the table. All plots will now be forced PORTRAIT and forced no wider than 6" and no taller than 8", while maintaining proper X/Y ratios in a Mercator projection. That means, make the biggest plot possible, with the right ratio, that is neither wider than 6" nor taller than 8" and then, whatever the width of that largest plot is – return that width in the "jm" field.
Definition at line 77 of file getmapbounds.f.
Referenced by checkgrid(), makeplotfiles01(), makeplotfiles02(), and makeplotfiles03().
subroutine gridstats | ( | character*200 | fname, |
ave, | |||
std, | |||
real*8 | med | ||
) |
Subroutine to print grid statistics to stdout.
[in] | fname | name of grid stat file |
[out] | ave | average |
[out] | std | standard deviatio |
[out] | median |
Definition at line 14 of file gridstats.f.
Referenced by makeplotfiles02(), and makeplotfiles03().
program gscale | ( | ) |
Part of the NADCON5 NADCON5 Core Library , Scales a grid by a factor.
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infile | Input File Name |
factor | Scaling Factor |
outfile | Output File Name |
lin1
Input Filelout
Output File program gsqr | ( | ) |
Part of the NADCON5 NADCON5 Core Library , Squares values in a *.b
grid.
Belongs to the suite of ".b" file manipulators
This program will convert every value in a ".b" grid to its squared value.
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infile | Input File Name |
outfile | Output File Name |
lin
Input File (*.b
grid)lout
Output File (*.b
grid) program gsqrt | ( | ) |
Part of the NADCON5 NADCON5 Core Library , Square Root of values in a *.b
grid.
Belongs to the suite of ".b" file manipulators
This program will convert every value in a ".b" grid to its square-root value.
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infile | Input File Name |
outfile | Output File Name |
lin
Input File (*.b
grid)lout
Output File (*.b
grid) subroutine indexxd | ( | integer | n, |
integer | nd, | ||
real*8, dimension(nd) | arr, | ||
integer, dimension(nd) | indx | ||
) |
Subroutine to perform ?? indexing on floating point data (double precision)
[in] | n | number of iterations (rows?) |
[in] | nd | array and index dimensions |
[in] | arr | input data array |
[out] | indx | index out |
Modified to allow indx
and arr
to be DIMENSIONED differently than the number of good values they contain
Modified to REAL*8 by D. Smith,
Definition at line 24 of file indexxd.for.
Referenced by getmedian().
subroutine indexxi | ( | integer | n, |
integer | nd, | ||
integer*4, dimension(nd) | arr, | ||
integer, dimension(nd) | indx | ||
) |
Subroutine to perform ?? indexing on integer data.
[in] | n | number of iterations (rows?) |
[in] | nd | array and index dimensions |
[in] | arr | input data array |
[out] | indx | index out |
Modified by D. Smith. Arr has been changed to integer*4. And like other versions of "indexx" which I've modified, I allow indx and arr to be DIMENSIONED differently than the number of good values they contain
nd | Modified by D. Smith, 2/5/2013 . Arr has been changed to integer*4. And like other versions of "indexx" which I've modified, I allow indx and arr to be DIMENSIONED differently than the number of good values they contain |
Definition at line 24 of file indexxi.for.
Referenced by mymedian5(), and myrms().
integer*2 function iselect2 | ( | integer | k, |
integer | n, | ||
integer*2, dimension(nmax) | arr, | ||
integer | nmax | ||
) |
Function to select an element of a partially filled, but packed multi dimensional array, integer*2
Finds the "kth" element of an array, "arr", which is dimensioned to be "nmax" values long, but which only has data in the first "n" cells.
Like "select2" but modified by D. Smith to allow an "nmax" array given, but which only has values in elements 1-n, and to have "arr" be Integer*2
Definition at line 22 of file iselect2.for.
real*4 function onzd | ( | real*4 | x | ) |
Function to round a digit to one significant figure (one non zero digit), single precision.
Function "onzd" stands for "One Non Zero Digit"
It takes a Real*4 number as input, and rounds that number to the closest number containing only 1 non-zero digit. The list of such numbers is infifinite, but contain these, in order:
0.7 , 0.8 , 0.9 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9, 10 , 20 , 30 , etc etc
[in] | x | input value |
real*4
rounded value of x to one non zero digitExamples of input/output are:
0.000019 => 0.000020 0.007432 => 0.007000 1.7 => 2.000000 9.143 => 9.000000 17.4 => 20.000000 947.3 => 900.000000 987.432 => 1000.000000 1014.8 => 1000.000000 1502.7 => 2000.000000
Definition at line 33 of file onzd.f.
real*8 function onzd2 | ( | real*8 | x | ) |
Function to round a digit to one significant figure (one non zero digit), double precision.
Function "onzd" stands for "One Non Zero Digit"
Version 2 operates just like version 1 (onzd()), only the input and output will be real*8 values, not real*4.
It takes a Real*8 number as input, and rounds that number to the closest number containing only 1 non-zero digit. The list of such numbers is infifinite, but contain these, in order:
0.7 , 0.8 , 0.9 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9, 10 , 20 , 30 , etc etc
[in] | x | input value |
real*8
rounded value of x to one non zero digitExamples of input/output are:
0.000019 => 0.000020 0.007432 => 0.007000 1.7 => 2.000000 9.143 => 9.000000 17.4 => 20.000000 947.3 => 900.000000 987.432 => 1000.000000 1014.8 => 1000.000000 1502.7 => 2000.000000
Definition at line 36 of file onzd2.f.
Referenced by checkgrid(), makeplotfiles01(), makeplotfiles02(), makeplotfiles03(), and myrms().
subroutine plotcoast | ( | character*10 | region, |
ifnum | |||
) |
Subroutine to write GMT-based commands to create a shoreline Write GMT-based commands to create a shoreline based on region.
Use GMT-default coastline for:
conus
alaska
Use Dru's custome coastline for:
[in] | region | The Region to create coastline for |
[in] | ifnum | the file descriptor of the output file to write GMT commands to |
Forced the Alaska region to plot the islands of St. George, St. Matthew and St. Paul (St. Lawrence is already plotted), as well as 35 missing Aleutian Islands
Added four new regions:
Definition at line 44 of file plotcoast.f.
Referenced by bwplotcv(), bwplotvc(), coplot(), and coplotwcv().
real function qterp | ( | x, | |
f0, | |||
f1, | |||
f2 | |||
) |
This function fits a quadratic function through 3 points.
This function fits a parabola (quadratic) function through three equally spaced points along the x-axis at indices 0, 1, and 2. The spacing along the x-axis is "dx"
Thus:
\begin{eqnarray*} f0 = f_0 &= y(x_0) \\ f1 = f_1 &= y(x_1) \\ f2 = f_2 &= y(x_2) \end{eqnarray*}
Where:
\begin{eqnarray*} x_1 &= x_0 + dx \\ x_2 &= x_1 + dx \\ x_3 &= x_2 + dx \end{eqnarray*}
The input value is some value of "x" that falls between 0 and 2. The output value (qterp) is the quadratic function at x.
[in] | x | Compute Interpolation at this positon, a value between 0 and 3 it is scaled relative to x_0 x_2 and dx . For example, the value of 1.5 is x_0 + 1.5*dx which falls between x1 and x2 |
[in] | f0 | y value at x_0 |
[in] | f1 | y value at x_1 = x_0 + dx |
[in] | f2 | y value at x_2 = x_0 + dx |
real
quadratically interpolated value of f(x*)
where x* = x_0 + x*dxx
This function uses Newton-Gregory forward polynomial
\begin{eqnarray*} \nabla f_0 &=& f_1 -f_0 \\ \nabla f_1 &=& f_2 -f_1 \\ \nabla^2 f_0 &=& \nabla f_1 - \nabla f_0 \\ qterp(x, f_0, f_1, f_2) &=& f_0 + x \nabla f_0 + 0.5 x \left( x-1.0 \right) \nabla^2 f_0 \end{eqnarray*}
Definition at line 51 of file qterp.f.
program regrd2 | ( | ) |
Part of the NADCON5 NADCON5 Core Library , regrid data.
Regrid gridded data using biquadratic interpolation
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infile | Input Master Grid File Name |
outfile | Output Regrid File Name |
nrow | Number of rows in new Grid (Lat) |
ncol | Number of cols in new Grid (Lon) |
lin
Input Filelout
Output File Definition at line 29 of file regrd2.f.
References bquad1(), bquad2(), r1(), and r2().
real*8 function select2 | ( | integer | k, |
integer | n, | ||
real*8, dimension(nmax) | arr, | ||
integer | nmax | ||
) |
Function to select an element of a partially filled, but packed multi dimensional array, double precision.
Finds the "kth" element of an array, "arr", which is dimensioned to be "nmax" values long, but which only has data in the first "n" cells.
Like "select2" but modified by D. Smith to allow an "nmax" array given, but which only has values in elements 1-n, and to have "arr" be Integer*2
Definition at line 22 of file select2_dbl.for.
real*4 function select2 | ( | integer | k, |
integer | n, | ||
real*4, dimension(nmax) | arr, | ||
integer | nmax | ||
) |
Function to select an element of a partially filled, but packed multi dimensional array, single precision.
Finds the "kth" element of an array, "arr", which is dimensioned to be "nmax" values long, but which only has data in the first "n" cells.
Like "select2" but modified by D. Smith to allow an "nmax" array given, but which only has values in elements 1-n, and to have "arr" be Integer*2
Definition at line 22 of file select2_mod.for.
program subtrc | ( | ) |
Part of the NADCON5 NADCON5 Core Library , Subtract one grid from another.
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infileA | First Input File Name |
infileB | Second Input File Name |
outfile | Output File Name of A*B |
lin1
Input File Alin2
Input File Blout
Output File to Write A-B subroutine vecstats | ( | character*200 | fname, |
integer*4 | n | ||
) |
Subroutine to tell us how many thinned vectors were used to make a grid.
[in] | fname | vector filename to read |
[out] | n | number of thinned vectors |
Definition at line 12 of file vecstats.f.
Referenced by makeplotfiles02().
program xyz2b | ( | ) |
Part of the NADCON5 NADCON5 Core Library , Converts GMT *.grd
to a *.b
NADCON style grid file.
Turn gmt/netcdf grd dump into my grid file (real number version) assumes grd dump is longitude/latitude/real (binary s.p.)
Arguments are newline terminated and read from standard input
When run from the command line, the program prints a prompt for each argument
They are enumerated here
infile | Input File Name |
outfile | Output File Name |
lin
Input File (*.grd
)lout
Output File (*.b
) Definition at line 29 of file xyz2b.f.
References put1(), put2(), w1(), and w2().