MONC
compress_spectrum.F90
Go to the documentation of this file.
1 !
2 ! Subroutine to compress the spectral file data
3 !
4 ! Purpose:
5 ! Spectral data from the full spectrum is reduced to only
6 ! those properites required.
7 !
8 !------------------------------------------------------------------------------
9 SUBROUTINE compress_spectrum(con, spec)
10 
11 USE def_control, ONLY: strctrl
12 USE def_spectrum, ONLY: strspecdata
13 USE gas_list_pcf
14 USE missing_data_mod, ONLY: rmdi
15 
16 IMPLICIT NONE
17 
18 
19 TYPE (StrCtrl), INTENT(IN) :: con
20 TYPE (StrSpecData), INTENT(INOUT) :: spec
21 
22 ! Local variables
23 INTEGER :: i, j, n_band_absorb, n_aerosol_mr
24 LOGICAL :: l_retain_absorb(spec%gas%n_absorb)
25 ! Flags for the retention of gases in the spectral file
26 
27 ! Search the spectrum to find those gases to be retained.
28 l_retain_absorb=.false.
29 DO i=1, spec%gas%n_absorb
30  IF ((spec%gas%type_absorb(i) == ip_h2o) .OR. &
31  (spec%gas%type_absorb(i) == ip_co2) .OR. &
32  (spec%gas%type_absorb(i) == ip_o3) .OR. &
33  ((spec%gas%type_absorb(i) == ip_o2) .AND. con%l_o2 ) .OR. &
34  ((spec%gas%type_absorb(i) == ip_n2o) .AND. con%l_n2o ) .OR. &
35  ((spec%gas%type_absorb(i) == ip_ch4) .AND. con%l_ch4 ) .OR. &
36  ((spec%gas%type_absorb(i) == ip_cfc11) .AND. con%l_cfc11 ) .OR. &
37  ((spec%gas%type_absorb(i) == ip_cfc12) .AND. con%l_cfc12 ) .OR. &
38  ((spec%gas%type_absorb(i) == ip_cfc113) .AND. con%l_cfc113 ) .OR. &
39  ((spec%gas%type_absorb(i) == ip_cfc114) .AND. con%l_cfc114 ) .OR. &
40  ((spec%gas%type_absorb(i) == ip_hcfc22) .AND. con%l_hcfc22 ) .OR. &
41  ((spec%gas%type_absorb(i) == ip_hfc125) .AND. con%l_hfc125 ) .OR. &
42  ((spec%gas%type_absorb(i) == ip_hfc134a) .AND. con%l_hfc134a) .OR. &
43  ((spec%gas%type_absorb(i) == ip_co) .AND. con%l_co ) .OR. &
44  ((spec%gas%type_absorb(i) == ip_nh3) .AND. con%l_nh3 ) .OR. &
45  ((spec%gas%type_absorb(i) == ip_tio) .AND. con%l_tio ) .OR. &
46  ((spec%gas%type_absorb(i) == ip_vo) .AND. con%l_vo ) .OR. &
47  ((spec%gas%type_absorb(i) == ip_h2) .AND. con%l_h2 ) .OR. &
48  ((spec%gas%type_absorb(i) == ip_he) .AND. con%l_he ) .OR. &
49  ((spec%gas%type_absorb(i) == ip_na) .AND. con%l_na ) .OR. &
50  ((spec%gas%type_absorb(i) == ip_k) .AND. con%l_k )) THEN
51  l_retain_absorb(i)=.true.
52  END IF
53 END DO
54 
55 DO i=1, spec%basic%n_band
56  n_band_absorb=0
57  DO j=1, spec%gas%n_band_absorb(i)
58  IF (l_retain_absorb(spec%gas%index_absorb(j, i))) THEN
59  n_band_absorb = n_band_absorb + 1
60  spec%gas%index_absorb(n_band_absorb, i) = spec%gas%index_absorb(j, i)
61  END IF
62  END DO
63  spec%gas%n_band_absorb(i)=n_band_absorb
64 END DO
65 
66 END SUBROUTINE compress_spectrum
missing_data_mod::rmdi
real, parameter rmdi
Definition: missing_data_mod.F90:29
compress_spectrum
subroutine compress_spectrum(con, spec)
Definition: compress_spectrum.F90:10
missing_data_mod
Definition: missing_data_mod.F90:18