36 PUBLIC ::
OPERATOR(==)
52 INTERFACE OPERATOR(==)
54 END INTERFACE OPERATOR(==)
61 '$Id: SSU_Input_Define.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 68 REAL(Double),
PARAMETER ::
zero = 0.0_double
70 INTEGER,
PARAMETER ::
ml = 256
85 REAL(Double) :: time =
zero 146 CHARACTER(*),
PARAMETER :: routine_name =
'SSU_Input_IsValid' 153 IF ( ssu%Time <
zero )
THEN 154 msg =
'Invalid mission time' 160 IF ( any(ssu%Cell_Pressure <
zero) )
THEN 161 msg =
'Invalid cell pressures' 193 WRITE(*,
'(3x,"SSU_Input OBJECT")')
194 WRITE(*,
'(5x,"Mission time:",1x,es22.15)') ssu%Time
195 WRITE(*,
'(5x,"Channel cell pressures:",10(1x,es22.15,:))') ssu%Cell_Pressure
234 CHARACTER(*),
PARAMETER :: routine_name =
'SSU_Input_ValidRelease' 245 WRITE( msg,
'("An SSU_Input data update is needed. ", & 246 &"SSU_Input release is ",i0,". Valid release is ",i0,"." )' ) &
255 WRITE( msg,
'("An SSU_Input software update is needed. ", & 256 &"SSU_Input release is ",i0,". Valid release is ",i0,"." )' ) &
288 CHARACTER(*),
INTENT(OUT) :: id
350 REAL(fp),
OPTIONAL,
INTENT(IN) :: time
351 REAL(fp),
OPTIONAL,
INTENT(IN) :: cell_pressure
352 INTEGER,
OPTIONAL,
INTENT(IN) :: channel
357 IF (
PRESENT(time) ) ssu_input%Time = time
358 IF (
PRESENT(channel) .AND.
PRESENT(cell_pressure) )
THEN 360 ssu_input%Cell_Pressure(n) = cell_pressure
431 INTEGER,
OPTIONAL,
INTENT(IN) :: channel
432 REAL(fp),
OPTIONAL,
INTENT(OUT) :: time
433 REAL(fp),
OPTIONAL,
INTENT(OUT) :: cell_pressure
434 INTEGER,
OPTIONAL,
INTENT(OUT) :: n_channels
439 IF (
PRESENT(time) ) time = ssu_input%Time
440 IF (
PRESENT(channel) .AND.
PRESENT(cell_pressure) )
THEN 442 cell_pressure = ssu_input%Cell_Pressure(n)
493 is_set = all(ssu%Cell_Pressure >
zero)
563 SSU_Input, & ! Output
565 No_Close , & ! Optional input
566 Quiet , & ! Optional input
567 Title , & ! Optional output
568 History , & ! Optional output
569 Comment , & ! Optional output
574 CHARACTER(*),
INTENT(IN) :: filename
575 LOGICAL,
OPTIONAL,
INTENT(IN) :: no_close
576 LOGICAL,
OPTIONAL,
INTENT(IN) :: quiet
577 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: title
578 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: history
579 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: comment
580 LOGICAL,
OPTIONAL,
INTENT(IN) :: debug
584 CHARACTER(*),
PARAMETER :: routine_name =
'SSU_Input_ReadFile' 587 CHARACTER(ML) :: io_msg
588 LOGICAL :: close_file
592 INTEGER :: n_channels
599 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
602 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
604 IF (
PRESENT(debug) )
THEN 605 IF ( debug ) noisy = .true.
612 INQUIRE( file=filename, number=fid )
615 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 622 IF ( err_stat /=
success )
THEN 623 msg =
'Error opening '//trim(filename)
627 msg =
'File '//trim(filename)//
' not found.' 634 READ( fid, iostat=io_stat, iomsg=io_msg ) &
637 IF ( io_stat /= 0 )
THEN 638 msg =
'Error reading Release/Version - '//trim(io_msg)
642 msg =
'SSU_Input Release check failed.' 648 READ( fid, iostat=io_stat, iomsg=io_msg ) &
650 IF ( io_stat /= 0 )
THEN 651 msg =
'Error reading data dimensions - '//trim(io_msg)
656 msg =
'Invalid channel dimension' 660 ssu_input%Version = dummy%Version
669 IF ( err_stat /=
success )
THEN 670 msg =
'Error reading global attributes' 676 READ( fid, iostat=io_stat, iomsg=io_msg ) &
678 IF ( io_stat /= 0 )
THEN 679 msg =
'Error reading decimal time - '//trim(io_msg)
685 READ( fid, iostat=io_stat, iomsg=io_msg ) &
686 ssu_input%Cell_Pressure
687 IF ( io_stat /= 0 )
THEN 688 msg =
'Error reading CO2 cell pressures - '//trim(io_msg)
694 IF ( close_file )
THEN 695 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
696 IF ( io_stat /= 0 )
THEN 697 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
706 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
707 IF ( io_stat /= 0 ) &
708 msg = trim(msg)//
'; Error closing input file during error cleanup - '//trim(io_msg)
785 No_Close , & ! Optional input
786 Quiet , & ! Optional input
787 Title , & ! Optional input
788 History , & ! Optional input
789 Comment , & ! Optional input
794 CHARACTER(*),
INTENT(IN) :: filename
795 LOGICAL,
OPTIONAL,
INTENT(IN) :: no_close
796 LOGICAL,
OPTIONAL,
INTENT(IN) :: quiet
797 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: title
798 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: history
799 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: comment
800 LOGICAL,
OPTIONAL,
INTENT(IN) :: debug
804 CHARACTER(*),
PARAMETER :: routine_name =
'SSU_Input_WriteFile' 807 CHARACTER(ML) :: io_msg
808 LOGICAL :: close_file
818 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
821 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
823 IF (
PRESENT(debug) )
THEN 824 IF ( debug ) noisy = .true.
831 INQUIRE( file=filename, number=fid )
834 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 840 IF ( err_stat /=
success )
THEN 841 msg =
'Error opening '//trim(filename)
848 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
851 IF ( io_stat /= 0 )
THEN 852 msg =
'Error writing Release/Version - '//trim(io_msg)
858 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
860 IF ( io_stat /= 0 )
THEN 861 msg =
'Error writing channel dimension - '//trim(io_msg)
873 IF ( err_stat /=
success )
THEN 874 msg =
'Error writing global attributes' 880 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
882 IF ( io_stat /= 0 )
THEN 883 msg =
'Error writing decimal time - '//trim(io_msg)
889 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
890 ssu_input%Cell_Pressure
891 IF ( io_stat /= 0 )
THEN 892 msg =
'Error writing cell pressures - '//trim(io_msg)
898 IF ( close_file )
THEN 899 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
900 IF ( io_stat /= 0 )
THEN 901 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
910 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
911 IF ( io_stat /= 0 ) &
912 msg = trim(msg)//
'; Error closing output file during error cleanup - '//trim(io_msg)
933 is_equal = (x%Time .equalto. y%Time) .AND. &
934 all(x%Cell_Pressure .equalto. y%Cell_Pressure)
integer, parameter, public failure
real(fp), parameter, public zero
integer, parameter, public long
integer, parameter, public fp
integer function, public readgatts_binary_file(fid, Write_Module, Created_On, Title, History, Comment)
integer, parameter, public double
integer, save, private max_n_channels
subroutine read_cleanup()
subroutine write_cleanup()
integer function, public open_binary_file(Filename, FileID, For_Output, No_Check)
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
integer function, public writegatts_binary_file(fid, Write_Module, Created_On, Title, History, Comment)
integer, parameter, public success
integer, parameter, public information