42 real(kind=fms_top_kind_),
intent(in) :: lon(:)
43 real(kind=fms_top_kind_),
intent(in) :: lat(:)
44 real(kind=fms_top_kind_),
intent(out) :: zsurf(:,:)
47 integer,
parameter :: lkind=fms_top_kind_
49 if (.not.module_is_initialized)
then
50 call write_version_number(
"GAUSSIAN_TOPOG_MOD", version)
53 if(any(shape(zsurf) /= (/
size(lon(:)),
size(lat(:))/)))
then
54 call error_mesg (
'get_gaussian_topog in topography_mod', &
55 'shape(zsurf) is not equal to (/size(lon),size(lat)/)', fatal)
58 if (do_nml)
call read_namelist
61 zsurf(:,:) = 0.0_lkind
63 if ( height(n) == 0.0_r8_kind ) cycle
64 zsurf = zsurf + get_gaussian_topog( lon, lat, real(height(n),lkind), &
65 real(olon(n),lkind),
real(olat(n),lkind),
real(wlon(n),lkind), &
66 real(wlat(n),lkind),
real(rlon(n),lkind),
real(rlat(n),lkind))
68 module_is_initialized = .true.
101 olond, olatd, wlond, wlatd, rlond, rlatd ) &
104 real(kind=fms_top_kind_),
intent(in) :: lon(:), lat(:)
105 real(kind=fms_top_kind_),
intent(in) :: height
106 real(kind=fms_top_kind_),
intent(in),
optional :: olond, olatd, wlond, wlatd, rlond, rlatd
107 real(kind=fms_top_kind_) :: zsurf(
size(lon,1),
size(lat,1))
110 real(kind=fms_top_kind_) :: olon, olat, wlon, wlat, rlon, rlat
111 real(kind=fms_top_kind_) :: tpi, dtr, dx, dy, xx, yy
112 integer,
parameter :: lkind = fms_top_kind_
114 if (do_nml)
call read_namelist
117 if ( height == 0.0_lkind)
then
118 zsurf(:,:) = 0.0_lkind
122 tpi = 2.0_lkind*real(pi, fms_top_kind_)
123 dtr = tpi/360.0_lkind
126 olon = 90.0_r8_kind*real(dtr, r8_kind);
if (
present(olond)) olon=real(olond*dtr,r8_kind)
127 olat = 45.0_r8_kind*real(dtr, r8_kind);
if (
present(olatd)) olat=real(olatd*dtr,r8_kind)
128 wlon = 15.0_r8_kind*real(dtr, r8_kind);
if (
present(wlond)) wlon=real(wlond*dtr,r8_kind)
129 wlat = 15.0_r8_kind*real(dtr, r8_kind);
if (
present(wlatd)) wlat=real(wlatd*dtr,r8_kind)
130 rlon = 0.0_r8_kind ;
if (
present(rlond)) rlon=real(rlond*dtr,r8_kind)
131 rlat = 0.0_r8_kind ;
if (
present(rlatd)) rlat=real(rlatd*dtr,r8_kind)
135 dy = abs(lat(j) - real(olat,lkind))
136 yy = max(0.0_lkind, dy-real(rlat,lkind))/real(wlat,lkind)
138 dx = abs(lon(i) - real(olon,lkind))
139 dx = min(dx, abs(dx-tpi))
140 xx = max(0.0_lkind, dx-real(rlon,lkind))/real(wlon,lkind)
141 zsurf(i,j) = real(height,lkind)*exp(-xx**2 - yy**2)
real(kind=fms_top_kind_) function, dimension(size(lon, 1), size(lat, 1)) get_gaussian_topog_(lon, lat, height, olond, olatd, wlond, wlatd, rlond, rlatd)
The height, position, width, and elongation of the mountain is controlled by optional arguments.
subroutine gaussian_topog_init_(lon, lat, zsurf)
Returns a simple surface height field that consists of a single Gaussian-shaped mountain.