Learn R Programming

marelac (version 2.1.2)

earth_surf: Surface of 1 dg by 1 dg Cells of the Earth

Description

Computes the surface of 1d by 1dg grid cells as a function of latitude. Based on data that give the surface distance per 1 dg change in lat/lon from http://en.wikipedia.org/wiki/Latitude

Usage

earth_surf(lat = 0, lon = 0)

Arguments

lat
latitude (-90 - +90).
lon
longitude - not used.

Value

  • Surface of the grid cell, in $m^2$.

See Also

Bathymetry, Oceans

Examples

Run this code
earth_surf(seq(0, 90, by = 15))

 SURF <- outer(X = Bathymetry$x,
               Y = Bathymetry$y,
               FUN <- function(X, Y) earth_surf(Y, X))


 sum(SURF)                                   #is: 510,072,000  km2

# the surface of the Oceans, m2
 sum(SURF*(Bathymetry$z < 0))                  # is: 3.58e14

# the volume of the Oceans, m3
- sum(SURF*Bathymetry$z*(Bathymetry$z < 0))    # is: 1.34e+18

# the surface area at several depths
SurfDepth <- vector()

dseq <- seq(-7500, -250, by = 250)

for (i in 2:length(dseq)) {
  ii <- which (Bathymetry$z > dseq[i-1] & Bathymetry$z <= dseq[i])
  SurfDepth[i-1]<-sum(SURF[ii])
}

plot(dseq[-1], SurfDepth, xlab = "depth, m", log = "y",
     ylab = "m2", main = "Surface at ocean depths")

Run the code above in your browser using DataLab