39 PUBLIC ::
OPERATOR(==)
56 INTERFACE OPERATOR(==)
58 END INTERFACE OPERATOR(==)
66 '$Id: ACCoeff_Define.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 68 REAL(Double),
PARAMETER ::
zero = 0.0_double
69 REAL(Double),
PARAMETER ::
one = 1.0_double
71 INTEGER,
PARAMETER ::
ml = 512
73 INTEGER,
PARAMETER ::
sl = 20
84 LOGICAL :: is_allocated = .false.
89 INTEGER(Long) :: n_fovs = 0
90 INTEGER(Long) :: n_channels = 0
92 CHARACTER(SL) :: sensor_id =
'' 95 INTEGER(Long),
ALLOCATABLE :: sensor_channel(:)
97 REAL(Double) ,
ALLOCATABLE :: a_earth(:,:)
98 REAL(Double) ,
ALLOCATABLE :: a_space(:,:)
99 REAL(Double) ,
ALLOCATABLE :: a_platform(:,:)
152 status = accoeff%Is_Allocated
180 accoeff%Is_Allocated = .false.
182 accoeff%n_Channels = 0
183 accoeff%Sensor_Id =
'' 234 INTEGER ,
INTENT(IN) :: n_fovs
235 INTEGER ,
INTENT(IN) :: n_channels
237 INTEGER :: alloc_stat
240 IF ( n_fovs < 1 .OR. &
241 n_channels < 1 )
RETURN 244 ALLOCATE( accoeff%Sensor_Channel( 1:n_channels ), &
245 accoeff%A_earth( 1:n_fovs, 1:n_channels ), &
246 accoeff%A_space( 1:n_fovs, 1:n_channels ), &
247 accoeff%A_platform( 1:n_fovs, 1:n_channels ), &
249 IF ( alloc_stat /= 0 )
RETURN 254 accoeff%n_FOVs = n_fovs
255 accoeff%n_Channels = n_channels
257 accoeff%Sensor_Channel = 0
258 accoeff%A_earth =
one 259 accoeff%A_space =
zero 260 accoeff%A_platform =
zero 264 accoeff%Is_Allocated = .true.
293 WRITE(*,
'(1x,"ACCoeff OBJECT")')
295 WRITE(*,
'(3x,"Release.Version :",1x,i0,".",i0)') accoeff%Release, accoeff%Version
297 WRITE(*,
'(3x,"n_FOVs :",1x,i0)') accoeff%n_FOVs
298 WRITE(*,
'(3x,"n_Channels :",1x,i0)') accoeff%n_Channels
301 WRITE(*,
'(3x,"Sensor_Id :",1x,a )') trim(accoeff%Sensor_Id)
302 WRITE(*,
'(3x,"WMO_Satellite_ID :",1x,i0)') accoeff%WMO_Satellite_ID
303 WRITE(*,
'(3x,"WMO_Sensor_ID :",1x,i0)') accoeff%WMO_Sensor_ID
304 WRITE(*,
'(3x,"Sensor_Channel :")')
305 WRITE(*,
'(10(1x,i5,:))') accoeff%Sensor_Channel
307 WRITE(*,
'(3x,"A_earth :")')
308 WRITE(*,
'(5(1x,es13.6,:))') accoeff%A_earth
309 WRITE(*,
'(3x,"A_space :")')
310 WRITE(*,
'(5(1x,es13.6,:))') accoeff%A_space
311 WRITE(*,
'(3x,"A_platform :")')
312 WRITE(*,
'(5(1x,es13.6,:))') accoeff%A_platform
352 CHARACTER(*),
PARAMETER :: routine_name =
'ACCoeff_ValidRelease' 363 WRITE( msg,
'("An ACCoeff data update is needed. ", & 364 &"ACCoeff release is ",i0,". Valid release is ",i0,"." )' ) &
374 WRITE( msg,
'("An ACCoeff software update is needed. ", & 375 &"ACCoeff release is ",i0,". Valid release is ",i0,"." )' ) &
418 CHARACTER(*),
INTENT(OUT) :: info
420 INTEGER,
PARAMETER :: carriage_return = 13
421 INTEGER,
PARAMETER :: linefeed = 10
423 CHARACTER(2000) :: long_string
426 WRITE( long_string, &
427 '(a,1x,"ACCoeff RELEASE.VERSION: ",i2,".",i2.2,a,3x, & 429 &"N_CHANNELS=",i0 )' ) &
430 achar(carriage_return)//achar(linefeed), &
431 accoeff%Release, accoeff%Version, &
432 achar(carriage_return)//achar(linefeed), &
438 info = long_string(1:
min(len(info), len_trim(long_string)))
467 CHARACTER(*),
INTENT(OUT) :: id
512 Sensor_Channel, & ! Input
516 INTEGER ,
INTENT(IN) :: sensor_channel(:)
520 INTEGER :: n_subset_channels
521 INTEGER,
ALLOCATABLE :: idx(:)
530 accoeff%Sensor_Channel, &
536 CALL subset_getvalue( subset, n_values = n_subset_channels, index = idx )
537 CALL accoeff_create( ac_subset, accoeff%n_FOVs, n_subset_channels )
543 ac_subset%Version = accoeff%Version
544 ac_subset%Sensor_Id = accoeff%Sensor_Id
545 ac_subset%WMO_Satellite_ID = accoeff%WMO_Satellite_ID
546 ac_subset%WMO_Sensor_ID = accoeff%WMO_Sensor_ID
548 ac_subset%Sensor_Channel = accoeff%Sensor_Channel(idx)
549 ac_subset%A_earth = accoeff%A_earth(:,idx)
550 ac_subset%A_space = accoeff%A_space(:,idx)
551 ac_subset%A_platform = accoeff%A_platform(:,idx)
602 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: sensor_id
604 INTEGER,
ALLOCATABLE :: valid_index(:)
605 INTEGER :: i, j, n_ac, n_valid, n_channels
610 n_ac =
SIZE(ac_array)
611 IF ( n_ac < 1 )
RETURN 614 IF ( n_valid == 0 )
RETURN 616 ALLOCATE( valid_index(n_valid) )
621 IF ( ac_array(i)%n_FOVs /= ac_array(valid_index(1))%n_FOVs .OR. &
622 ac_array(i)%WMO_Satellite_ID /= ac_array(valid_index(1))%WMO_Satellite_ID .OR. &
623 ac_array(i)%WMO_Sensor_ID /= ac_array(valid_index(1))%WMO_Sensor_ID )
THEN 630 n_channels = sum(ac_array(valid_index)%n_Channels)
636 ac_array(valid_index(1))%n_FOVs, &
643 accoeff%Version = ac_array(valid_index(1))%Version
644 IF (
PRESENT(sensor_id) )
THEN 645 accoeff%Sensor_Id = adjustl(sensor_id)
647 accoeff%Sensor_Id = ac_array(valid_index(1))%Sensor_Id
649 accoeff%WMO_Satellite_ID = ac_array(valid_index(1))%WMO_Satellite_ID
650 accoeff%WMO_Sensor_ID = ac_array(valid_index(1))%WMO_Sensor_ID
656 ch2 = ch1 + ac_array(i)%n_Channels - 1
658 accoeff%Sensor_Channel(ch1:ch2) = ac_array(i)%Sensor_Channel
659 accoeff%A_earth(:,ch1:ch2) = ac_array(i)%A_earth
660 accoeff%A_space(:,ch1:ch2) = ac_array(i)%A_space
661 accoeff%A_platform(:,ch1:ch2) = ac_array(i)%A_platform
668 DEALLOCATE( valid_index )
705 ACCoeff , & ! In/output
709 INTEGER ,
INTENT(IN) :: sensor_channel(:)
713 INTEGER :: n_channels
717 n_channels =
SIZE(sensor_channel)
718 IF ( n_channels < 1 )
RETURN 735 accoeff%Version = ac_copy%Version
736 accoeff%Sensor_Id = ac_copy%Sensor_Id
737 accoeff%WMO_Satellite_ID = ac_copy%WMO_Satellite_ID
738 accoeff%WMO_Sensor_ID = ac_copy%WMO_Sensor_ID
740 accoeff%Sensor_Channel = sensor_channel
746 IF ( accoeff%Sensor_Channel(i) == ac_copy%Sensor_Channel(i_orig) )
THEN 747 accoeff%A_earth(:,i) = ac_copy%A_earth(:,i_orig)
748 accoeff%A_space(:,i) = ac_copy%A_space(:,i_orig)
749 accoeff%A_platform(:,i) = ac_copy%A_platform(:,i_orig)
816 IF ( (x%Release /= y%Release) .OR. &
817 (x%Version /= y%Version) )
RETURN 819 IF ( (x%n_FOVs /= y%n_FOVs ) .OR. &
820 (x%n_Channels /= y%n_Channels ) )
RETURN 822 IF ( (x%Sensor_Id /= y%Sensor_Id ) .OR. &
823 (x%WMO_Satellite_ID /= y%WMO_Satellite_ID) .OR. &
824 (x%WMO_Sensor_ID /= y%WMO_Sensor_ID ) )
RETURN 826 IF ( all(x%Sensor_Channel == y%Sensor_Channel ) .AND. &
827 all(x%A_earth .equalto. y%A_earth ) .AND. &
828 all(x%A_space .equalto. y%A_space ) .AND. &
829 all(x%A_platform .equalto. y%A_platform ) ) &
integer, parameter, public failure
subroutine, public accoeff_inspect(ACCoeff)
elemental logical function accoeff_equal(x, y)
integer, parameter, public long
subroutine, public accoeff_subset(ACCoeff, Sensor_Channel, AC_Subset)
integer, parameter accoeff_release
integer, parameter, public double
subroutine, public accoeff_info(ACCoeff, Info)
elemental subroutine, public accoeff_destroy(ACCoeff)
integer, parameter accoeff_version
elemental logical function, public subset_associated(Subset)
real(double), parameter zero
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
subroutine, public accoeff_defineversion(Id)
integer, parameter, public invalid_wmo_satellite_id
subroutine, public accoeff_concat(ACCoeff, AC_Array, Sensor_Id)
logical function, public accoeff_validrelease(ACCoeff)
real(double), parameter one
subroutine, public subset_getvalue(Subset, n_Values, Number, Index)
integer, parameter, public invalid_wmo_sensor_id
elemental subroutine, public accoeff_create(ACCoeff, n_FOVs, n_Channels)
subroutine, public subset_generate(Subset, List, Subset_List)
character(*), parameter module_version_id
integer, parameter, public success
subroutine, public accoeff_channelreindex(ACCoeff, Sensor_Channel)
elemental logical function, public accoeff_associated(ACCoeff)
integer, parameter, public information