53 PUBLIC :: odas_algorithm
54 PUBLIC :: odps_algorithm
61 '$Id: ODSSU_Define.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 66 INTEGER,
PARAMETER ::
set = 1
68 INTEGER,
PARAMETER ::
sl = 20
69 INTEGER,
PARAMETER ::
ml = 256
96 INTEGER :: n_allocates = 0
102 INTEGER(Long) :: subalgorithm = 0
104 INTEGER(Long) :: n_channels = 0
105 INTEGER(Long) :: n_absorbers = 0
106 INTEGER(Long) :: n_tc_cellpressures = 0
107 INTEGER(Long) :: n_ref_cellpressures = 0
109 CHARACTER(SL) :: sensor_id =
' ' 114 INTEGER(Long),
POINTER,
DIMENSION(:) :: sensor_channel => null()
116 INTEGER(Long),
POINTER,
DIMENSION(:) :: absorber_id => null()
119 REAL(Double),
POINTER,
DIMENSION(:,:) :: tc_cellpressure => null()
120 REAL(Double),
POINTER,
DIMENSION(:) :: ref_time => null()
121 REAL(Double),
POINTER,
DIMENSION(:,:) :: ref_cellpressure => null()
124 TYPE(
odas_type),
POINTER,
DIMENSION(:) :: odas => null()
125 TYPE(
odps_type),
POINTER,
DIMENSION(:) :: odps => null()
179 result( association_status )
182 INTEGER,
OPTIONAL,
INTENT(IN) :: any_test
184 LOGICAL :: association_status
195 IF (
PRESENT( any_test ) )
THEN 196 IF ( any_test ==
set ) all_test = .false.
201 association_status = .false.
203 IF (
ASSOCIATED( odssu%Sensor_Channel ) .AND. &
204 ASSOCIATED( odssu%Absorber_ID ) .AND. &
205 ASSOCIATED( odssu%TC_CellPressure ) .AND. &
206 ASSOCIATED( odssu%Ref_Time ) .AND. &
207 ASSOCIATED( odssu%Ref_CellPressure ) )
THEN 208 association_status = .true.
210 IF(odssu%subAlgorithm == odas_algorithm)
THEN 211 association_status = association_status .AND.
ASSOCIATED( odssu%ODAS )
212 DO i = 1, odssu%n_TC_CellPressures
213 association_status = association_status .AND.
associated_odas( odssu%ODAS(i) )
217 IF(odssu%subAlgorithm == odps_algorithm)
THEN 218 association_status = association_status .AND.
ASSOCIATED( odssu%ODPS )
219 DO i = 1, odssu%n_TC_CellPressures
220 association_status = association_status .AND.
associated_odps( odssu%ODPS(i) )
224 IF (
ASSOCIATED( odssu%Sensor_Channel ) .OR. &
225 ASSOCIATED( odssu%Absorber_ID ) .OR. &
226 ASSOCIATED( odssu%TC_CellPressure ) .OR. &
227 ASSOCIATED( odssu%Ref_Time ) .OR. &
228 ASSOCIATED( odssu%Ref_CellPressure ) )
THEN 229 association_status = .true.
231 IF(odssu%subAlgorithm == odas_algorithm)
THEN 232 association_status = association_status .OR.
ASSOCIATED( odssu%ODAS )
233 DO i = 1, odssu%n_TC_CellPressures
234 association_status = association_status .OR.
associated_odas( odssu%ODAS(i) )
238 IF(odssu%subAlgorithm == odps_algorithm)
THEN 239 association_status = association_status .OR.
ASSOCIATED( odssu%ODPS )
240 DO i = 1, odssu%n_TC_CellPressures
241 association_status = association_status .OR.
associated_odps( odssu%ODPS(i) )
309 No_Clear , & ! Optional input
310 RCS_Id , & ! Revision control
312 result( error_status )
315 INTEGER,
OPTIONAL,
INTENT(IN) :: no_clear
316 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: rcs_id
317 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: message_log
319 INTEGER :: error_status
321 CHARACTER(*),
PARAMETER :: routine_name =
'Destroy_ODSSU' 323 CHARACTER(ML) :: message
325 INTEGER :: allocate_status1, allocate_status2
335 IF (
PRESENT( no_clear ) )
THEN 336 IF ( no_clear ==
set ) clear = .false.
343 IF(odssu%subAlgorithm == odas_algorithm)
THEN 344 DO i = 1, odssu%n_TC_CellPressures
346 message_log = message_log)
347 IF( error_status /=
success )
THEN 349 "Error deallocating ODAS for ODSSU", &
351 message_log=message_log )
356 IF(odssu%subAlgorithm == odps_algorithm)
THEN 357 DO i = 1, odssu%n_TC_CellPressures
359 message_log = message_log)
360 IF( error_status /=
success )
THEN 362 "Error deallocating ODPS for ODSSU", &
364 message_log=message_log )
372 DEALLOCATE( odssu%Sensor_Channel , &
373 odssu%Absorber_ID , &
374 odssu%TC_CellPressure , &
376 odssu%Ref_CellPressure, &
377 stat=allocate_status1 )
379 IF(odssu%subAlgorithm == odas_algorithm)
THEN 380 DEALLOCATE(odssu%ODAS, stat=allocate_status2)
382 IF(odssu%subAlgorithm == odps_algorithm)
THEN 383 DEALLOCATE(odssu%ODPS, stat=allocate_status2)
386 IF ( allocate_status1 /= 0 )
THEN 388 WRITE( message,
'("Error deallocating ODSSU components 1. STAT = ",i0)' ) &
393 message_log=message_log )
395 IF ( allocate_status2 /= 0 )
THEN 397 WRITE( message,
'("Error deallocating ODSSU components 2. STAT = ",i0)' ) &
402 message_log=message_log )
410 odssu%n_TC_CellPressures = 0
411 odssu%n_Ref_CellPressures = 0
416 odssu%n_Allocates = odssu%n_Allocates - 1
417 IF ( odssu%n_Allocates /= 0 )
THEN 419 WRITE( message,
'("Allocation counter /= 0, Value = ",i0)' ) &
424 message_log=message_log )
528 n_Channels , & ! Input
529 n_TC_CellPressures , & ! Input
530 n_Ref_CellPressures, & ! Input
532 RCS_Id , & ! Revision control
534 result( error_status )
536 INTEGER ,
INTENT(IN) :: n_absorbers
537 INTEGER ,
INTENT(IN) :: n_channels
538 INTEGER ,
INTENT(IN) :: n_tc_cellpressures
539 INTEGER ,
INTENT(IN) :: n_ref_cellpressures
541 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: rcs_id
542 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: message_log
544 INTEGER :: error_status
546 CHARACTER(*),
PARAMETER :: routine_name =
'Allocate_ODSSU' 548 CHARACTER(ML) :: message
549 INTEGER :: allocate_status1, allocate_status2
557 IF ( n_absorbers < 1 .OR. &
558 n_channels < 1 .OR. &
559 n_tc_cellpressures < 1 .OR. &
560 n_ref_cellpressures < 1 )
THEN 563 'Input ODSSU dimensions must all be > 0.', &
565 message_log=message_log )
574 message_log=message_log )
575 IF ( error_status /=
success )
THEN 577 'Error deallocating ODSSU prior to reallocation.', &
579 message_log=message_log )
586 ALLOCATE( odssu%TC_CellPressure( n_tc_cellpressures, n_channels) , &
587 odssu%Ref_Time( n_ref_cellpressures ) , &
588 odssu%Ref_CellPressure( n_ref_cellpressures, n_channels), &
589 odssu%Sensor_Channel( n_channels ) , &
590 odssu%Absorber_ID( n_absorbers ) , &
591 stat = allocate_status1 )
592 IF(odssu%subAlgorithm == odas_algorithm)
THEN 593 ALLOCATE(odssu%ODAS( n_tc_cellpressures ), stat=allocate_status2)
595 IF(odssu%subAlgorithm == odps_algorithm)
THEN 596 ALLOCATE(odssu%ODPS( n_tc_cellpressures ), stat=allocate_status2)
599 IF ( allocate_status1 /= 0 .OR. allocate_status2 /= 0)
THEN 601 WRITE( message,
'("Error allocating ODSSU data arrays. STAT = ",i0)' ) &
606 message_log=message_log )
611 odssu%n_Absorbers = n_absorbers
612 odssu%n_Channels = n_channels
613 odssu%n_TC_CellPressures = n_tc_cellpressures
614 odssu%n_Ref_CellPressures = n_ref_cellpressures
616 odssu%Sensor_Channel = 0
625 odssu%n_Allocates = odssu%n_Allocates + 1
626 IF ( odssu%n_Allocates /= 1 )
THEN 628 WRITE( message,
'("Allocation counter /= 1, Value = ",i0)' ) &
633 message_log=message_log )
692 RCS_Id , & ! Revision control
694 result( error_status )
697 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: rcs_id
698 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: message_log
700 INTEGER :: error_status
702 CHARACTER(*),
PARAMETER :: routine_name =
'CheckRelease_ODSSU' 704 CHARACTER(ML) :: message
717 WRITE( message,
'( "An ODSSU data update is needed. ", & 718 &"ODSSU release is ", i2, & 719 &". Valid release is ",i2,"." )' ) &
724 message_log=message_log )
731 WRITE( message,
'( "An ODSSU software update is needed. ", & 732 &"ODSSU release is ", i2, & 733 &". Valid release is ",i2,"." )' ) &
738 message_log=message_log )
795 RCS_Id , & ! Revision control
797 result( error_status )
800 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: rcs_id
801 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: message_log
803 INTEGER :: error_status
805 CHARACTER(*),
PARAMETER :: routine_name =
'CheckAlgorithm_ODSSU' 818 'The ODSSU Algorithm ID check failed. '//&
819 'The data structure is not an ODSSU structure', &
821 message_log=message_log )
871 CHARACTER(*),
INTENT(OUT) :: info
872 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: rcs_id
874 CHARACTER(2000) :: longstring
882 WRITE( longstring,
'( a,3x,"ODSSU RELEASE.VERSION: ",i2,".",i2.2,2x,& 883 &"SUBALGORITHM=",i2,2x,& 884 &"N_ABSORBERS=",i2,2x,& 885 &"N_CHANNELS=",i0,2x, & 886 &"N_TC_CELLPRESSURES=",i2,2x, & 887 &"N_REF_CELLPRESSURES=",i0)' ) &
889 odssu%Release, odssu%Version, &
890 odssu%subAlgorithm, &
893 odssu%n_TC_CellPressures, &
894 odssu%n_Ref_CellPressures
899 info = longstring(1:
min( len(info), len_trim(longstring) ))
936 TYPE(ODSSU_type),
INTENT(IN OUT) :: ODSSU
940 odssu%subAlgorithm = 0
941 odssu%Sensor_Id =
' ' integer, parameter, public failure
integer, parameter carriage_return
integer, parameter linefeed
integer, parameter, public warning
real(double), parameter fp_invalid
integer, parameter, public long
integer function, public destroy_odps(ODPS, No_Clear, RCS_Id, Message_Log)
integer function, public checkalgorithm_odssu(ODSSU, RCS_Id, Message_Log)
integer, parameter, public double
integer, parameter invalid_wmo_satellite_id
integer, parameter odssu_version
subroutine clear_odssu(ODSSU)
character(*), parameter module_rcs_id
integer, parameter infrared_sensor
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
integer, parameter invalid_sensor
integer function, public destroy_odssu(ODSSU, No_Clear, RCS_Id, Message_Log)
integer function, public destroy_odas(ODAS, No_Clear, RCS_Id, Message_Log)
logical function, public associated_odps(ODPS, ANY_Test)
subroutine, public info_odssu(ODSSU, Info, RCS_Id)
integer, parameter, public odssu_algorithm
integer, parameter, public odps_algorithm
integer function, public allocate_odssu(n_Absorbers, n_Channels, n_TC_CellPressures, n_Ref_CellPressures, ODSSU, RCS_Id, Message_Log)
logical function, public associated_odas(ODAS, ANY_Test)
integer, parameter odssu_release
integer, parameter, public odas_algorithm
integer, parameter ip_invalid
integer function, public checkrelease_odssu(ODSSU, RCS_Id, Message_Log)
character(*), parameter odssu_algorithm_name
integer, parameter invalid_wmo_sensor_id
integer, parameter, public success
logical function, public associated_odssu(ODSSU, ANY_Test)