module parmwave

use parkind1, only: jpim, jprb

implicit none

save

integer (kind=jpim), parameter :: nmax_chan = 24  ! max number of channels allowed

! Number of diagnostics variables: must be the 0.5 * JP_NMWAVE_DIAG in
! ifs/module/yomdb.F90 and 0.5 * $NUMRAINTBDIAG in odb/ddl/cma.h 
integer (kind=jpim), parameter :: nmwave_diag = 8 

! Number of variables contributing to gradient norm
integer (kind=jpim), parameter :: nmwave_gnrm = 10 

! Indices for the diagnostics array
integer (kind=jpim), parameter :: imwave_rain_sfc = 1 
integer (kind=jpim), parameter :: imwave_snow_sfc = 2 
integer (kind=jpim), parameter :: imwave_tcwv     = 3 
integer (kind=jpim), parameter :: imwave_tclw     = 4 
integer (kind=jpim), parameter :: imwave_tciw     = 5 
integer (kind=jpim), parameter :: imwave_rwp      = 6 
integer (kind=jpim), parameter :: imwave_swp      = 7 
integer (kind=jpim), parameter :: imwave_cfrac    = 8 

! Normalised polarisation difference arrays - internal storage
integer (kind=jpim), parameter :: nmwave_p = 2 ! Observed ; simulated 
integer (kind=jpim), parameter :: imwave_p_obs = 1 
integer (kind=jpim), parameter :: imwave_p_sim = 2 

! Normalised polarisation difference arrays - ODB storage (see also JP_NMWAVE_P; as above)
integer (kind=jpim), parameter :: iodb_mwave_p_obs = 1  ! observed value
integer (kind=jpim), parameter :: iodb_mwave_p_fg  = 2  ! first guess value
integer (kind=jpim), parameter :: iodb_mwave_p_tbv = 3  ! working value; eventually == analysis 


real (kind=jprb), parameter :: rmissing_angle= -999.0_JPRB

real (kind=jprb), parameter :: zenangle_ssmi   = 53.1_JPRB ! SSM/I,SSMIS zenith angle
real (kind=jprb), parameter :: zenangle_amsre  = 55.2_JPRB ! AMSR-E zenith angle
real (kind=jprb), parameter :: zenangle_mwri   = 53.2_JPRB ! MWRI zenith angle

! Wavenumber above which snow is a problem (1cm=-1 approx. 30GHz)
real (kind=jprb), parameter :: wn_snow_rt_problem = 1.0_JPRB 

! Emissivity value that turns off emissivity estimation and uses
! RTTOV emissivity model instead
real (kind=jprb), parameter :: rmwave_no_emis = 2.0_JPRB 

end module parmwave
