-
Notifications
You must be signed in to change notification settings - Fork 0
/
ds_vmr2du.pro
111 lines (91 loc) · 2.65 KB
/
ds_vmr2du.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
;===================================================================================================
; PROGRAM NAME:
; ds_vmr2du
;
; PURPOSE:
; convert volum mixing ratio(VMR) to dobson unit(DU)
;
; PROCESS:
;
; REFERENCE:
;
; INPUT:
; vmr_o3(nx, ny, nz) [volume mixing ratio]
; pressure(nx, ny, nz) [hPa]
; temperature(nx, ny, nz) [K]
; altitude(nx, ny, nz) [m]
;
; OUTPUT:
; o3_du_layer(nx, ny, nz-1) [DU]
;
; DEVELOPER:
; Dae Sung Choi(Choi)
; Satellite Remote Sensing Laboratory
; Department of Atmospheric Sciences
; College of Natural Science
; Pusan National University
; Tel: +82-51-510-2172
; E-mail: [email protected]
;
; Copyright (C) 2020 Satellite Remote Sensing Laboratory, PNU
; All right reserved.
;
;===================================================================================================
pro ds_vmr2du, vmr_o3, pressure, temperature, altitude, o3_du_layer, $
xaxis=xi, yaxis=yi, zaxis=zi, incresing_height=incheight
if not keyword_set(xi) then begin
xi = 0
endif
if not keyword_set(yi) then begin
yi = 1
endif
if not keyword_set(zi) then begin
zi = 2
endif
if not keyword_set(incheight) then begin
print, 'increasing_height keyword not set.'
print, 'the vertical axis of altitude index 0 for the bottom n-1 for top.'
;print, 'if this keyword as set to 0 then decreasing order.'
;pritn, 'if not set this keyword, default value is 1 to increasing order.'
incheight = 1
endif
print, 'ds_vmr2du, o3vmr,pressure, temperature, altitude'
vmr_o3_size = size(vmr_o3, /dim)
nx = vmr_o3_size[xi]
ny = vmr_o3_size[yi]
nz = vmr_o3_size[zi]
o3_du_layer = fltarR(nx,ny,nz-1) ;nlayer
;vmr to N_o3 (number density , molec/cm3)
k = 1.3807 * 10.^(-19); J K-1 molc-1 ; 10^4 * kg * cm^2 s^-2
; pV = NkT
;O3 number density
N_o3 = vmr_o3 * pressure/(temperature*k)
;Air number density
N_air = 2.69*10.^(16) ; molec/cm ^3
du_tmp1 = fltarr(nx,ny,nz-1)
dh = fltarr(nx,ny,nz-1)
FOR ih=0,nz-2 DO BEGIN
if zi eq 2 then begin
dh = altitude[*,*,ih+1] - altitude[*,*,ih] ; meter
endif else if zi eq 0 then begin
dh = altitude[ih, *,*] - altitude[ih, *,*] ; meter
endif
dh = dh * 100 ; centimeter
o3_du_layer[*,*,ih] = (N_o3[*,*,ih]+N_o3[*,*,ih+1])/2/N_air*dh ;cm thickness
ENDFOR
return
;tco = total(o3_du_layer,/nan,3)
;ip = value_locate(p,300)
;sco = total(o3_du_layer[*,*,0:ip],/nan,3)
;trco = total(o3_du_layer[*,*,ip+1:nz-2],/nan,3)
;;-----------------------------------------------
;NAN = !values.F_nan
;olon=REPLICATE(NaN,Sz[0],Sz[1])
;FOR iy=0,Sz[1]-1 DO BEGIN
;olon[*,iy]=lon[*]
;ENDFOR
;olat=REPLICATE(NaN,Sz[0],Sz[1])
;FOR ix=0,Sz[0]-1 DO BEGIN
;olat[ix,*]=lat[*]
;ENDFOR
END