88 PUBLIC ::
OPERATOR(==)
128 INTERFACE OPERATOR(==)
130 END INTERFACE OPERATOR(==)
138 '$Id: SpcCoeff_Define.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 140 REAL(Double),
PARAMETER ::
zero = 0.0_double
142 INTEGER,
PARAMETER ::
ml = 512
144 INTEGER,
PARAMETER ::
sl = 20
159 LOGICAL :: is_allocated = .false.
164 INTEGER(Long) :: n_channels = 0
166 CHARACTER(SL) :: sensor_id =
'' 171 INTEGER(Long),
ALLOCATABLE :: sensor_channel(:)
172 INTEGER(Long),
ALLOCATABLE :: polarization(:)
173 INTEGER(Long),
ALLOCATABLE :: channel_flag(:)
174 REAL(Double) ,
ALLOCATABLE :: frequency(:)
175 REAL(Double) ,
ALLOCATABLE :: wavenumber(:)
176 REAL(Double) ,
ALLOCATABLE :: planck_c1(:)
177 REAL(Double) ,
ALLOCATABLE :: planck_c2(:)
178 REAL(Double) ,
ALLOCATABLE :: band_c1(:)
179 REAL(Double) ,
ALLOCATABLE :: band_c2(:)
180 REAL(Double) ,
ALLOCATABLE :: cosmic_background_radiance(:)
181 REAL(Double) ,
ALLOCATABLE :: solar_irradiance(:)
237 status = spccoeff%Is_Allocated
265 spccoeff%Is_Allocated = .false.
266 spccoeff%n_Channels = 0
267 spccoeff%Sensor_Id =
'' 306 SpcCoeff , & ! Output
310 INTEGER ,
INTENT(IN) :: n_channels
312 INTEGER :: alloc_stat
315 IF ( n_channels < 1 )
RETURN 318 ALLOCATE( spccoeff%Sensor_Channel( n_channels ), &
319 spccoeff%Polarization( n_channels ), &
320 spccoeff%Channel_Flag( n_channels ), &
321 spccoeff%Frequency( n_channels ), &
322 spccoeff%Wavenumber( n_channels ), &
323 spccoeff%Planck_C1( n_channels ), &
324 spccoeff%Planck_C2( n_channels ), &
325 spccoeff%Band_C1( n_channels ), &
326 spccoeff%Band_C2( n_channels ), &
327 spccoeff%Cosmic_Background_Radiance( n_channels ), &
328 spccoeff%Solar_Irradiance( n_channels ), &
330 IF ( alloc_stat /= 0 )
RETURN 335 spccoeff%n_Channels = n_channels
337 spccoeff%Sensor_Channel = 0
339 spccoeff%Channel_Flag = 0
340 spccoeff%Frequency =
zero 341 spccoeff%Wavenumber =
zero 342 spccoeff%Planck_C1 =
zero 343 spccoeff%Planck_C2 =
zero 344 spccoeff%Band_C1 =
zero 345 spccoeff%Band_C2 =
zero 346 spccoeff%Cosmic_Background_Radiance =
zero 347 spccoeff%Solar_Irradiance =
zero 351 spccoeff%Is_Allocated = .true.
381 WRITE(*,
'(1x,"SpcCoeff OBJECT")')
383 WRITE(*,
'(3x,"Release.Version :",1x,i0,".",i0)') spccoeff%Release, spccoeff%Version
385 WRITE(*,
'(3x,"n_Channels :",1x,i0)') spccoeff%n_Channels
388 WRITE(*,
'(3x,"Sensor_Id :",1x,a )') trim(spccoeff%Sensor_Id)
389 WRITE(*,
'(3x,"WMO_Satellite_ID :",1x,i0)') spccoeff%WMO_Satellite_ID
390 WRITE(*,
'(3x,"WMO_Sensor_ID :",1x,i0)') spccoeff%WMO_Sensor_ID
391 WRITE(*,
'(3x,"Sensor_Type :",1x,a )') trim(
sensor_type_name(spccoeff%Sensor_Type))
392 WRITE(*,
'(3x,"Sensor_Channel :")')
393 WRITE(*,
'(10(1x,i5,:))') spccoeff%Sensor_Channel
396 WRITE(*,
'(3x,"Polarization :")')
397 DO n = 1, spccoeff%n_Channels
398 WRITE(*,
'(5x,"Channel ",i0,": ",a)') spccoeff%Sensor_Channel(n), &
402 WRITE(*,
'(3x,"Channel_Flag :")')
403 WRITE(*,
'(3(1x,b32.32,:))') spccoeff%Channel_Flag
404 WRITE(*,
'(3x,"Frequency :")')
405 WRITE(*,
'(5(1x,es13.6,:))') spccoeff%Frequency
406 WRITE(*,
'(3x,"Wavenumber :")')
407 WRITE(*,
'(5(1x,es13.6,:))') spccoeff%Wavenumber
408 WRITE(*,
'(3x,"Planck_C1 :")')
409 WRITE(*,
'(5(1x,es13.6,:))') spccoeff%Planck_C1
410 WRITE(*,
'(3x,"Planck_C2 :")')
411 WRITE(*,
'(5(1x,es13.6,:))') spccoeff%Planck_C2
412 WRITE(*,
'(3x,"Band_C1 :")')
413 WRITE(*,
'(5(1x,es13.6,:))') spccoeff%Band_C1
414 WRITE(*,
'(3x,"Band_C2 :")')
415 WRITE(*,
'(5(1x,es13.6,:))') spccoeff%Band_C2
416 WRITE(*,
'(3x,"Cosmic_Background_Radiance :")')
417 WRITE(*,
'(5(1x,es13.6,:))') spccoeff%Cosmic_Background_Radiance
418 WRITE(*,
'(3x,"Solar_Irradiance :")')
419 WRITE(*,
'(5(1x,es13.6,:))') spccoeff%Solar_Irradiance
462 CHARACTER(*),
PARAMETER :: routine_name =
'SpcCoeff_ValidRelease' 473 WRITE( msg,
'("An SpcCoeff data update is needed. ", & 474 &"SpcCoeff release is ",i0,". Valid release is ",i0,"." )' ) &
484 WRITE( msg,
'("An SpcCoeff software update is needed. ", & 485 &"SpcCoeff release is ",i0,". Valid release is ",i0,"." )' ) &
542 CHARACTER(*),
INTENT(OUT) :: info
543 LOGICAL,
OPTIONAL,
INTENT(IN) :: nocomponents
545 INTEGER,
PARAMETER :: carriage_return = 13
546 INTEGER,
PARAMETER :: linefeed = 10
548 LOGICAL :: includecomponents
549 CHARACTER(5000) :: long_string
550 CHARACTER(2000) :: ac_info, nc_info
553 includecomponents = .true.
554 IF (
PRESENT(nocomponents) ) includecomponents = .NOT. nocomponents
557 WRITE( long_string, &
558 '(a,1x,"SpcCoeff RELEASE.VERSION: ",i2,".",i2.2,a,3x, & 559 &"N_CHANNELS=",i0 )' ) &
560 achar(carriage_return)//achar(linefeed), &
561 spccoeff%Release, spccoeff%Version, &
562 achar(carriage_return)//achar(linefeed), &
566 IF ( includecomponents )
THEN 570 long_string = trim(long_string)//trim(ac_info)
575 long_string = trim(long_string)//trim(nc_info)
581 info = long_string(1:
min(len(info), len_trim(long_string)))
614 CHARACTER(*),
INTENT(OUT) :: id
615 INTEGER,
PARAMETER :: carriage_return = 13
616 INTEGER,
PARAMETER :: linefeed = 10
617 INTEGER,
PARAMETER ::
sl = 256
618 CHARACTER(SL) :: ac_id
619 CHARACTER(SL) :: nc_id
620 CHARACTER(SL*3) :: define_id
624 ' '//trim(ac_id)//
';'//achar(carriage_return)//achar(linefeed)//&
626 IF ( len_trim(define_id) <= len(id) )
THEN 674 Sensor_Channel, & ! Input
678 INTEGER ,
INTENT(IN) :: sensor_channel(:)
682 INTEGER :: n_subset_channels
683 INTEGER,
ALLOCATABLE :: idx(:)
691 spccoeff%Sensor_Channel, &
697 CALL subset_getvalue( subset, n_values = n_subset_channels, index = idx )
704 sc_subset%Version = spccoeff%Version
705 sc_subset%Sensor_Id = spccoeff%Sensor_Id
706 sc_subset%Sensor_Type = spccoeff%Sensor_Type
707 sc_subset%WMO_Satellite_ID = spccoeff%WMO_Satellite_ID
708 sc_subset%WMO_Sensor_ID = spccoeff%WMO_Sensor_ID
710 sc_subset%Sensor_Channel = spccoeff%Sensor_Channel(idx)
711 sc_subset%Polarization = spccoeff%Polarization(idx)
712 sc_subset%Channel_Flag = spccoeff%Channel_Flag(idx)
713 sc_subset%Frequency = spccoeff%Frequency(idx)
714 sc_subset%Wavenumber = spccoeff%Wavenumber(idx)
715 sc_subset%Planck_C1 = spccoeff%Planck_C1(idx)
716 sc_subset%Planck_C2 = spccoeff%Planck_C2(idx)
717 sc_subset%Band_C1 = spccoeff%Band_C1(idx)
718 sc_subset%Band_C2 = spccoeff%Band_C2(idx)
719 sc_subset%Cosmic_Background_Radiance = spccoeff%Cosmic_Background_Radiance(idx)
720 sc_subset%Solar_Irradiance = spccoeff%Solar_Irradiance(idx)
774 SpcCoeff , & ! Output
780 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: sensor_id
782 INTEGER,
ALLOCATABLE :: valid_index(:)
783 INTEGER :: i, j, n_sc, n_valid, n_channels
788 n_sc =
SIZE(sc_array)
789 IF ( n_sc < 1 )
RETURN 792 IF ( n_valid == 0 )
RETURN 794 ALLOCATE( valid_index(n_valid) )
799 IF ( sc_array(i)%Sensor_Type /= sc_array(valid_index(1))%Sensor_Type .OR. &
800 sc_array(i)%WMO_Satellite_ID /= sc_array(valid_index(1))%WMO_Satellite_ID .OR. &
801 sc_array(i)%WMO_Sensor_ID /= sc_array(valid_index(1))%WMO_Sensor_ID )
THEN 808 n_channels = sum(sc_array%n_Channels)
818 spccoeff%Version = sc_array(valid_index(1))%Version
819 IF (
PRESENT(sensor_id) )
THEN 820 spccoeff%Sensor_Id = adjustl(sensor_id)
822 spccoeff%Sensor_Id = sc_array(valid_index(1))%Sensor_Id
824 spccoeff%Sensor_Type = sc_array(valid_index(1))%Sensor_Type
825 spccoeff%WMO_Satellite_ID = sc_array(valid_index(1))%WMO_Satellite_ID
826 spccoeff%WMO_Sensor_ID = sc_array(valid_index(1))%WMO_Sensor_ID
832 ch2 = ch1 + sc_array(i)%n_Channels - 1
834 spccoeff%Sensor_Channel(ch1:ch2) = sc_array(i)%Sensor_Channel
835 spccoeff%Polarization(ch1:ch2) = sc_array(i)%Polarization
836 spccoeff%Channel_Flag(ch1:ch2) = sc_array(i)%Channel_Flag
837 spccoeff%Frequency(ch1:ch2) = sc_array(i)%Frequency
838 spccoeff%Wavenumber(ch1:ch2) = sc_array(i)%Wavenumber
839 spccoeff%Planck_C1(ch1:ch2) = sc_array(i)%Planck_C1
840 spccoeff%Planck_C2(ch1:ch2) = sc_array(i)%Planck_C2
841 spccoeff%Band_C1(ch1:ch2) = sc_array(i)%Band_C1
842 spccoeff%Band_C2(ch1:ch2) = sc_array(i)%Band_C2
843 spccoeff%Cosmic_Background_Radiance(ch1:ch2) = sc_array(i)%Cosmic_Background_Radiance
844 spccoeff%Solar_Irradiance(ch1:ch2) = sc_array(i)%Solar_Irradiance
852 CALL accoeff_concat( spccoeff%AC, sc_array%AC, sensor_id = sensor_id )
860 DEALLOCATE( valid_index )
899 INTEGER,
OPTIONAL,
INTENT(IN) :: channelindex
902 DO n = 0, bit_size(0_long)
960 INTEGER,
OPTIONAL,
INTENT(IN) :: channelindex
1011 INTEGER,
OPTIONAL,
INTENT(IN) :: channelindex
1053 INTEGER,
OPTIONAL,
INTENT(IN) :: channelindex
1093 INTEGER,
OPTIONAL,
INTENT(IN) :: channelindex
1134 INTEGER,
OPTIONAL,
INTENT(IN) :: channelindex
1175 INTEGER,
OPTIONAL,
INTENT(IN) :: channelindex
1542 IF ( (x%Release /= y%Release) .OR. &
1543 (x%Version /= y%Version) )
RETURN 1545 IF ( x%n_Channels /= y%n_Channels )
RETURN 1547 IF ( (x%Sensor_Id /= y%Sensor_Id ) .OR. &
1548 (x%WMO_Satellite_ID /= y%WMO_Satellite_ID) .OR. &
1549 (x%WMO_Sensor_ID /= y%WMO_Sensor_ID ) .OR. &
1550 (x%Sensor_Type /= y%Sensor_Type ) )
RETURN 1554 IF ( .NOT. (x%AC == y%AC) )
RETURN 1558 IF ( .NOT. (x%NC == y%NC) )
RETURN 1561 IF ( all(x%Sensor_Channel == y%Sensor_Channel ) .AND. &
1562 all(x%Polarization == y%Polarization ) .AND. &
1563 all(x%Channel_Flag == y%Channel_Flag ) .AND. &
1564 all(x%Frequency .equalto. y%Frequency ) .AND. &
1565 all(x%Wavenumber .equalto. y%Wavenumber ) .AND. &
1566 all(x%Planck_C1 .equalto. y%Planck_C1 ) .AND. &
1567 all(x%Planck_C2 .equalto. y%Planck_C2 ) .AND. &
1568 all(x%Band_C1 .equalto. y%Band_C1 ) .AND. &
1569 all(x%Band_C2 .equalto. y%Band_C2 ) .AND. &
1570 all(x%Cosmic_Background_Radiance .equalto. y%Cosmic_Background_Radiance) .AND. &
1571 all(x%Solar_Irradiance .equalto. y%Solar_Irradiance ) ) &
1579 INTEGER,
INTENT(IN) :: sensor_type
1583 is_set = (spccoeff%Sensor_Type == sensor_type)
1589 INTEGER ,
INTENT(IN) :: sensor_type
1590 spccoeff%Sensor_Type = sensor_type
1643 SpcCoeff , & ! Input
1644 Flag_Type , & ! Input
1649 INTEGER ,
INTENT(IN) :: flag_type
1650 INTEGER,
OPTIONAL ,
INTENT(IN) :: channelindex
1659 IF (
PRESENT(channelindex) )
THEN 1660 IF ( channelindex < 1 .OR. channelindex > spccoeff%n_Channels )
RETURN 1661 is_set = btest(spccoeff%Channel_Flag(channelindex),flag_type)
1663 is_set = any(btest(spccoeff%Channel_Flag,flag_type))
1711 SpcCoeff , & ! In/Output
1712 Flag_Type , & ! Input
1716 INTEGER ,
INTENT(IN) :: flag_type
1717 INTEGER,
OPTIONAL ,
INTENT(IN) :: channelindex
1720 IF (
PRESENT(channelindex) )
THEN 1721 IF ( channelindex < 1 .OR. channelindex > spccoeff%n_Channels )
RETURN 1722 spccoeff%Channel_Flag(channelindex) = ibset(spccoeff%Channel_Flag(channelindex),flag_type)
1724 spccoeff%Channel_Flag = ibset(spccoeff%Channel_Flag,flag_type)
1773 SpcCoeff , & ! In/Output
1774 Flag_Type , & ! Input
1778 INTEGER ,
INTENT(IN) :: flag_type
1779 INTEGER,
OPTIONAL ,
INTENT(IN) :: channelindex
1782 IF (
PRESENT(channelindex) )
THEN 1783 IF ( channelindex < 1 .OR. channelindex > spccoeff%n_Channels )
RETURN 1784 spccoeff%Channel_Flag(channelindex) = ibclr(spccoeff%Channel_Flag(channelindex),flag_type)
1786 spccoeff%Channel_Flag = ibclr(spccoeff%Channel_Flag,flag_type)
integer, parameter, public lc_polarization
integer, parameter, public second_stokes_component
integer, parameter, public invalid_polarization
subroutine, public spccoeff_inspect(SpcCoeff)
elemental subroutine, public spccoeff_setmicrowavesensor(SpcCoeff)
integer, parameter, public failure
integer, parameter, public invalid_wmo_sensor_id
elemental subroutine, public nltecoeff_create(NLTECoeff, n_Predictors, n_Sensor_Angles, n_Solar_Angles, n_NLTE_Channels, n_Channels)
elemental subroutine spccoeff_clearflag(SpcCoeff, Flag_Type, ChannelIndex)
real(fp), parameter, public zero
elemental subroutine, public spccoeff_clearallflags(SpcCoeff, ChannelIndex)
elemental subroutine, public spccoeff_setinfraredsensor(SpcCoeff)
subroutine, public accoeff_inspect(ACCoeff)
elemental logical function spccoeff_equal(x, y)
elemental logical function, public spccoeff_iszeeman(SpcCoeff, ChannelIndex)
integer, parameter, public long
subroutine, public accoeff_subset(ACCoeff, Sensor_Channel, AC_Subset)
integer, parameter, public hl_polarization
character(*), dimension(0:n_polarization_types), parameter, public polarization_type_name
elemental subroutine, public spccoeff_destroy(SpcCoeff)
elemental subroutine spccoeff_clearsensor(SpcCoeff)
character(*), dimension(0:n_sensor_types), parameter, public sensor_type_name
subroutine, public spccoeff_concat(SpcCoeff, SC_Array, Sensor_Id)
integer, parameter, public third_stokes_component
integer, parameter, public plus45l_polarization
integer, parameter, public double
integer, parameter, public hl_mixed_polarization
elemental subroutine, public spccoeff_clearsolar(SpcCoeff, ChannelIndex)
logical function, public nltecoeff_validrelease(NLTECoeff)
integer, parameter solar_flag
elemental logical function, public spccoeff_ismicrowavesensor(SpcCoeff)
integer, parameter, public invalid_wmo_satellite_id
integer, parameter, public visible_sensor
subroutine, public accoeff_info(ACCoeff, Info)
elemental subroutine, public accoeff_destroy(ACCoeff)
elemental logical function, public spccoeff_isinfraredsensor(SpcCoeff)
elemental subroutine, public spccoeff_setzeeman(SpcCoeff, ChannelIndex)
subroutine, public spccoeff_info(SpcCoeff, Info, NoComponents)
elemental logical function, public subset_associated(Subset)
elemental logical function, public spccoeff_isvisiblesensor(SpcCoeff)
elemental subroutine, public spccoeff_create(SpcCoeff, n_Channels)
elemental subroutine, public spccoeff_setvisiblesensor(SpcCoeff)
integer, parameter zeeman_flag
integer, parameter, public vl_mixed_polarization
integer, parameter, public first_stokes_component
integer, parameter, public vl_polarization
subroutine, public nltecoeff_subset(NLTECoeff, Sensor_Channel, NC_Subset)
subroutine, public spccoeff_defineversion(Id)
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
elemental subroutine, public spccoeff_setsolar(SpcCoeff, ChannelIndex)
elemental logical function, public spccoeff_issolar(SpcCoeff, ChannelIndex)
subroutine, public accoeff_defineversion(Id)
subroutine, public nltecoeff_channelreindex(NLTECoeff, Sensor_Channel)
subroutine, public accoeff_concat(ACCoeff, AC_Array, Sensor_Id)
integer, parameter, public intensity
logical function, public accoeff_validrelease(ACCoeff)
integer, parameter, public fourth_stokes_component
subroutine, public nltecoeff_inspect(NLTECoeff)
subroutine, public subset_getvalue(Subset, n_Values, Number, Index)
integer, parameter, public invalid_sensor
subroutine, public nltecoeff_info(NLTECoeff, Info)
elemental logical function spccoeff_issensor(SpcCoeff, Sensor_Type)
subroutine, public nltecoeff_defineversion(Id)
integer, parameter, public microwave_sensor
subroutine, public spccoeff_subset(SpcCoeff, Sensor_Channel, SC_Subset)
integer, parameter, public ultraviolet_sensor
integer, parameter, public n_sensor_types
integer, parameter, public unpolarized
character(*), parameter module_version_id
elemental subroutine, public nltecoeff_destroy(NLTECoeff)
elemental logical function, public spccoeff_isultravioletsensor(SpcCoeff)
elemental subroutine, public accoeff_create(ACCoeff, n_FOVs, n_Channels)
integer, parameter, public minus45l_polarization
integer, parameter, public n_polarization_types
elemental subroutine spccoeff_setflag(SpcCoeff, Flag_Type, ChannelIndex)
subroutine, public subset_generate(Subset, List, Subset_List)
integer, parameter, public rc_polarization
logical function, public spccoeff_validrelease(SpcCoeff)
elemental logical function spccoeff_isflagset(SpcCoeff, Flag_Type, ChannelIndex)
elemental subroutine spccoeff_setsensor(SpcCoeff, Sensor_Type)
integer, parameter, public success
elemental subroutine, public spccoeff_clearzeeman(SpcCoeff, ChannelIndex)
integer, parameter, public infrared_sensor
integer, parameter spccoeff_version
subroutine, public nltecoeff_concat(NLTECoeff, NC_Array, Sensor_Id)
subroutine, public accoeff_channelreindex(ACCoeff, Sensor_Channel)
elemental logical function, public accoeff_associated(ACCoeff)
integer, parameter spccoeff_release
elemental logical function, public spccoeff_associated(SpcCoeff)
integer, parameter, public information
elemental logical function, public nltecoeff_associated(NLTECoeff)
elemental subroutine, public spccoeff_setultravioletsensor(SpcCoeff)