source: LMDZ6/trunk/libf/phylmd/ecrad/driver/test_aerosol_optics_description.F90 @ 5446

Last change on this file since 5446 was 4773, checked in by idelkadi, 12 months ago
  • Update of Ecrad in LMDZ The same organization of the Ecrad offline version is retained in order to facilitate the updating of Ecrad in LMDZ and the comparison between online and offline results. version 1.6.1 of Ecrad (https://github.com/lguez/ecrad.git)
  • Implementation of the double call of Ecrad in LMDZ


File size: 1.9 KB
Line 
1! (C) Copyright 2022- ECMWF.
2!
3! This software is licensed under the terms of the Apache Licence Version 2.0
4! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5!
6! In applying this licence, ECMWF does not waive the privileges and immunities
7! granted to it by virtue of its status as an intergovernmental organisation
8! nor does it submit to any jurisdiction.
9!
10! Author:  Robin Hogan
11! Email:   r.j.hogan@ecmwf.int
12!
13
14! Program to test the functionality of the
15! radiation_aerosol_optics_description module. Usage is for example:
16! "test_aerosol_optics_description aerosol_ifs_49R1.nc"
17program test_aerosol_optics_description
18
19  use radiation_aerosol_optics_description
20
21  type(aerosol_optics_description_type) :: aer_desc
22
23  character(len=512) :: file_name
24
25  integer :: istatus
26
27  call get_command_argument(1, file_name, status=istatus)
28  if (istatus /= 0) then
29    stop 'Usage: test_aerosol_optics_description <aerosol_file.nc>'
30  end if
31
32  call aer_desc%read(file_name=file_name)
33
34  ! These two should issue a warning that the aerosol type is ambiguous
35  print *, 'DD: ', aer_desc%get_index('DD',.false.)
36  print *, 'DD (bin=2): ', aer_desc%get_index('DD',.false.,ibin=2)
37  ! Indicate preferred aerosol optical model, after which further
38  ! calls will prefer one particular model
39  print *, 'preferred_optical_model(DD,Fouquart)'
40  call aer_desc%preferred_optical_model('DD','Fouquart')
41  print *, 'DD (bin=2): ', aer_desc%get_index('DD',.false.,ibin=2)
42  print *, 'DD (bin=2,model=Woodward): ', aer_desc%get_index('DD',.false.,ibin=2,optical_model_str="Woodward")
43  print *, 'DD (bin=2,model=Woodward2001): ', aer_desc%get_index('DD',.false.,ibin=2,optical_model_str="Woodward2001")
44  ! This should fail to find a match, returning zero
45  print *, 'DD (model=Nobody): ', aer_desc%get_index('DD',.false.,optical_model_str="Nobody")
46  print *, 'SS (bin=3): ', aer_desc%get_index('SS',.true.,ibin=3)
47
48end program test_aerosol_optics_description
Note: See TracBrowser for help on using the repository browser.