33 PUBLIC ::
OPERATOR(==)
48 INTERFACE OPERATOR(==)
50 END INTERFACE OPERATOR(==)
57 '$Id: Zeeman_Input_Define.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 64 INTEGER,
PARAMETER ::
ml = 256
66 REAL(Double),
PARAMETER ::
zero = 0.0_double
84 REAL(Double) :: cos_thetab =
zero 86 REAL(Double) :: cos_phib =
zero 88 REAL(Double) :: doppler_shift =
zero 168 REAL(fp),
OPTIONAL,
INTENT(IN) :: field_strength
169 REAL(fp),
OPTIONAL,
INTENT(IN) :: cos_thetab
170 REAL(fp),
OPTIONAL,
INTENT(IN) :: cos_phib
171 REAL(fp),
OPTIONAL,
INTENT(IN) :: doppler_shift
173 IF (
PRESENT(field_strength) ) zeeman_input%Be = field_strength
174 IF (
PRESENT(cos_thetab ) ) zeeman_input%Cos_ThetaB = cos_thetab
175 IF (
PRESENT(cos_phib ) ) zeeman_input%Cos_PhiB = cos_phib
176 IF (
PRESENT(doppler_shift ) ) zeeman_input%Doppler_Shift = doppler_shift
244 REAL(fp),
OPTIONAL,
INTENT(OUT) :: field_strength
245 REAL(fp),
OPTIONAL,
INTENT(OUT) :: cos_thetab
246 REAL(fp),
OPTIONAL,
INTENT(OUT) :: cos_phib
247 REAL(fp),
OPTIONAL,
INTENT(OUT) :: doppler_shift
249 IF (
PRESENT(field_strength) ) field_strength = zeeman_input%Be
250 IF (
PRESENT(cos_thetab ) ) cos_thetab = zeeman_input%Cos_ThetaB
251 IF (
PRESENT(cos_phib ) ) cos_phib = zeeman_input%Cos_PhiB
252 IF (
PRESENT(doppler_shift ) ) doppler_shift = zeeman_input%Doppler_Shift
299 CHARACTER(*),
PARAMETER :: routine_name =
'Zeeman_Input_IsValid' 301 real(fp),
parameter :: big_number = 1.0e+09_fp
309 IF ( z%Be <
zero )
THEN 310 msg =
'Invalid field strength' 314 IF ( z%Cos_ThetaB > big_number )
THEN 315 msg =
'Invalid COS(ThetaB)' 319 IF ( z%Cos_PhiB > big_number )
THEN 320 msg =
'Invalid COS(PhiB)' 324 IF ( abs(z%Doppler_Shift) > big_number )
THEN 325 msg =
'Invalid Doppler shift' 357 WRITE(*,
'(3x,"Zeeman_Input OBJECT")')
358 WRITE(*,
'(5x,"Field strength (gauss):",1x,es22.15)') z%Be
359 WRITE(*,
'(5x,"COS(ThetaB) :",1x,es22.15)') z%Cos_ThetaB
360 WRITE(*,
'(5x,"COS(PhiB) :",1x,es22.15)') z%Cos_PhiB
361 WRITE(*,
'(5x,"Doppler shift (KHz) :",1x,es22.15)') z%Doppler_Shift
389 CHARACTER(*),
INTENT(OUT) :: id
429 CHARACTER(*),
PARAMETER :: routine_name =
'Zeeman_Input_ValidRelease' 440 WRITE( msg,
'("An Zeeman_Input data update is needed. ", & 441 &"Zeeman_Input release is ",i0,". Valid release is ",i0,"." )' ) &
450 WRITE( msg,
'("An Zeeman_Input software update is needed. ", & 451 &"Zeeman_Input release is ",i0,". Valid release is ",i0,"." )' ) &
526 Zeeman_Input, & ! Output
528 No_Close , & ! Optional input
529 Quiet , & ! Optional input
530 Title , & ! Optional output
531 History , & ! Optional output
532 Comment , & ! Optional output
537 CHARACTER(*),
INTENT(IN) :: filename
538 LOGICAL,
OPTIONAL,
INTENT(IN) :: no_close
539 LOGICAL,
OPTIONAL,
INTENT(IN) :: quiet
540 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: title
541 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: history
542 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: comment
543 LOGICAL,
OPTIONAL,
INTENT(IN) :: debug
547 CHARACTER(*),
PARAMETER :: routine_name =
'Zeeman_Input_ReadFile' 550 CHARACTER(ML) :: io_msg
551 LOGICAL :: close_file
561 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
564 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
566 IF (
PRESENT(debug) )
THEN 567 IF ( debug ) noisy = .true.
574 INQUIRE( file=filename, number=fid )
577 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 584 IF ( err_stat /=
success )
THEN 585 msg =
'Error opening '//trim(filename)
589 msg =
'File '//trim(filename)//
' not found.' 596 READ( fid, iostat=io_stat, iomsg=io_msg ) &
599 IF ( io_stat /= 0 )
THEN 600 msg =
'Error reading Release/Version - '//trim(io_msg)
604 msg =
'Zeeman_Input Release check failed.' 608 zeeman_input%Version = dummy%Version
617 IF ( err_stat /=
success )
THEN 618 msg =
'Error reading global attributes' 624 READ( fid, iostat=io_stat, iomsg=io_msg ) &
626 zeeman_input%Cos_ThetaB , &
627 zeeman_input%Cos_PhiB , &
628 zeeman_input%Doppler_Shift
629 IF ( io_stat /= 0 )
THEN 630 msg =
'Error reading data - '//trim(io_msg)
636 IF ( close_file )
THEN 637 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
638 IF ( io_stat /= 0 )
THEN 639 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
648 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
649 IF ( io_stat /= 0 ) &
650 msg = trim(msg)//
'; Error closing input file during error cleanup - '//trim(io_msg)
725 Zeeman_Input, & ! Input
727 No_Close , & ! Optional input
728 Quiet , & ! Optional input
729 Title , & ! Optional input
730 History , & ! Optional input
731 Comment , & ! Optional input
736 CHARACTER(*),
INTENT(IN) :: filename
737 LOGICAL,
OPTIONAL,
INTENT(IN) :: no_close
738 LOGICAL,
OPTIONAL,
INTENT(IN) :: quiet
739 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: title
740 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: history
741 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: comment
742 LOGICAL,
OPTIONAL,
INTENT(IN) :: debug
746 CHARACTER(*),
PARAMETER :: routine_name =
'Zeeman_Input_WriteFile' 749 CHARACTER(ML) :: io_msg
750 LOGICAL :: close_file
760 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
763 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
765 IF (
PRESENT(debug) )
THEN 766 IF ( debug ) noisy = .true.
773 INQUIRE( file=filename, number=fid )
776 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 782 IF ( err_stat /=
success )
THEN 783 msg =
'Error opening '//trim(filename)
790 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
791 zeeman_input%Release, &
793 IF ( io_stat /= 0 )
THEN 794 msg =
'Error writing Release/Version - '//trim(io_msg)
806 IF ( err_stat /=
success )
THEN 807 msg =
'Error writing global attributes' 813 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
815 zeeman_input%Cos_ThetaB , &
816 zeeman_input%Cos_PhiB , &
817 zeeman_input%Doppler_Shift
818 IF ( io_stat /= 0 )
THEN 819 msg =
'Error writing data - '//trim(io_msg)
825 IF ( close_file )
THEN 826 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
827 IF ( io_stat /= 0 )
THEN 828 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
837 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
838 IF ( io_stat /= 0 ) &
839 msg = trim(msg)//
'; Error closing output file during error cleanup - '//trim(io_msg)
860 is_equal = (x%Be .equalto. y%Be ) .AND. &
861 (x%Cos_ThetaB .equalto. y%Cos_ThetaB ) .AND. &
862 (x%Cos_PhiB .equalto. y%Cos_PhiB ) .AND. &
863 (x%Doppler_Shift .equalto. y%Doppler_Shift)
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
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