41 class(ufo_radiance),
intent(inout) :: self
42 type(c_ptr),
intent(in) :: c_conf
53 class(ufo_radiance),
intent(inout) :: self
64 class(ufo_radiance),
intent(in) :: self
65 type(ufo_geovals),
intent(in) :: geovals
66 real(c_double),
intent(inout) :: hofx(:)
67 type(c_ptr),
value,
intent(in) :: obss
70 character(*),
parameter :: PROGRAM_NAME =
'ufo_radiance_mod.F90' 71 character(255) :: message, version
72 integer :: err_stat, alloc_stat
73 integer :: l, m, n, i, s, ierr
74 type(ufo_geoval),
pointer :: temp
81 type(CRTM_ChannelInfo_type) :: chinfo(self%rc%n_Sensors)
82 type(CRTM_Geometry_type),
allocatable :: geo(:)
85 type(CRTM_Atmosphere_type),
allocatable :: atm(:)
86 type(CRTM_Surface_type),
allocatable :: sfc(:)
87 type(CRTM_RTSolution_type),
allocatable :: rts(:,:)
92 n_profiles = geovals%nobs
101 call program_message( program_name, &
102 'Check/example program for the CRTM Forward and K-Matrix functions using '//&
103 trim(self%rc%ENDIAN_type)//
' coefficient datafiles', &
104 'CRTM Version: '//trim(version) )
112 write( *,
'(/5x,"Initializing the CRTM...")' )
113 err_stat = crtm_init( self%rc%SENSOR_ID, &
115 file_path=trim(self%rc%COEFFICIENT_PATH), &
117 if ( err_stat /= success )
THEN 118 message =
'Error initializing CRTM' 119 call display_message( program_name, message, failure )
126 sensor_loop:
do n = 1, self%rc%n_Sensors
131 n_channels = crtm_channelinfo_n_channels(chinfo(n))
136 allocate( geo( n_profiles ), &
139 rts( n_channels, n_profiles ), &
141 if ( alloc_stat /= 0 )
THEN 142 message =
'Error allocating structure arrays' 143 call display_message( program_name, message, failure )
150 call crtm_atmosphere_create( atm, n_layers, self%rc%n_Absorbers, self%rc%n_Clouds, self%rc%n_Aerosols )
151 if ( any(.NOT. crtm_atmosphere_associated(atm)) )
THEN 152 message =
'Error allocating CRTM Forward Atmosphere structure' 153 CALL display_message( program_name, message, failure )
160 call crtm_surface_create(sfc, n_channels)
161 IF ( any(.NOT. crtm_surface_associated(sfc)) )
THEN 162 message =
'Error allocating CRTM Surface structure' 163 CALL display_message( program_name, message, failure )
171 call load_sfc_data(n_profiles,n_layers,n_channels,geovals,sfc,chinfo,obss)
177 call crtm_atmosphere_inspect(atm(12))
178 call crtm_surface_inspect(sfc(12))
179 call crtm_geometry_inspect(geo(12))
180 call crtm_channelinfo_inspect(chinfo(1))
185 err_stat = crtm_forward( atm , &
190 if ( err_stat /= success )
THEN 191 message =
'Error calling CRTM Forward Model for '//trim(self%rc%SENSOR_ID(n))
192 call display_message( program_name, message, failure )
201 hofx(:) = 0.0_kind_real
207 hofx(i) = rts(l,m)%Brightness_Temperature
216 call crtm_geometry_destroy(geo)
217 call crtm_atmosphere_destroy(atm)
218 call crtm_rtsolution_destroy(rts)
219 call crtm_surface_destroy(sfc)
224 deallocate(geo, atm, sfc, rts, stat = alloc_stat)
225 if ( alloc_stat /= 0 )
THEN 226 message =
'Error deallocating structure arrays' 227 call display_message( program_name, message, failure )
236 write( *,
'( /5x, "Destroying the CRTM..." )' )
237 err_stat = crtm_destroy( chinfo )
238 if ( err_stat /= success )
THEN 239 message =
'Error destroying CRTM' 240 call display_message( program_name, message, failure )
subroutine, public ufo_geovals_get_var(self, varname, geoval, status)
Fortran derived type for radiance trajectory.
Fortran module to handle radiance observations.
Fortran module to provide code shared between nonlinear and tlm/adm radiance calculations.
subroutine, public load_atm_data(N_PROFILES, N_LAYERS, geovals, atm)
subroutine, public load_sfc_data(n_Profiles, n_Layers, N_Channels, geovals, sfc, chinfo, obss)
subroutine, public load_geom_data(obss, geo)
subroutine ufo_radiance_delete(self)
subroutine, public rad_conf_setup(rc, c_conf)
subroutine, public rad_conf_delete(rc)
subroutine crtm_version(version)
type to hold interpolated fields required by the obs operators
subroutine ufo_radiance_simobs(self, geovals, hofx, obss)
Fortran interface to ObsSpace.
character(len=maxvarlen), public var_tv
type to hold interpolated field for one variable, one observation
subroutine, public delete(self)
subroutine ufo_radiance_setup(self, c_conf)