37 PUBLIC ::
OPERATOR(==)
54 INTERFACE OPERATOR(==)
56 END INTERFACE OPERATOR(==)
63 '$Id: IRwaterCoeff_Define.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 70 REAL(fp),
PARAMETER ::
zero = 0.0_fp
71 REAL(fp),
PARAMETER ::
one = 1.0_fp
73 REAL(fp),
PARAMETER ::
pi = 3.141592653589793238462643383279_fp
76 INTEGER,
PARAMETER ::
ml = 256
85 LOGICAL :: is_allocated = .false.
90 INTEGER(Long) :: n_angles = 0
91 INTEGER(Long) :: n_frequencies = 0
92 INTEGER(Long) :: n_wind_speeds = 0
94 REAL(Double),
ALLOCATABLE :: angle(:)
95 REAL(Double),
ALLOCATABLE :: frequency(:)
96 REAL(Double),
ALLOCATABLE :: wind_speed(:)
98 REAL(Double),
ALLOCATABLE :: emissivity(:,:,:)
100 REAL(Double),
ALLOCATABLE :: secant_angle(:)
154 status = self%Is_Allocated
182 self%Is_Allocated = .false.
236 n_Frequencies, & ! Input
240 INTEGER ,
INTENT(IN) :: n_angles
241 INTEGER ,
INTENT(IN) :: n_frequencies
242 INTEGER ,
INTENT(IN) :: n_wind_speeds
244 INTEGER :: alloc_stat
247 IF ( n_angles < 1 .OR. &
248 n_frequencies < 1 .OR. &
249 n_wind_speeds < 1 )
RETURN 253 ALLOCATE( self%Angle( n_angles ), &
254 self%Frequency( n_frequencies ), &
255 self%Wind_Speed( n_wind_speeds ), &
256 self%Emissivity( n_angles, n_frequencies, n_wind_speeds ), &
257 self%Secant_Angle( n_angles ), &
259 IF ( alloc_stat /= 0 )
RETURN 264 self%n_Angles = n_angles
265 self%n_Frequencies = n_frequencies
266 self%n_Wind_Speeds = n_wind_speeds
269 self%Frequency =
zero 270 self%Wind_Speed =
zero 271 self%Emissivity =
zero 272 self%Secant_Angle =
zero 275 self%Is_Allocated = .true.
305 WRITE(*,
'(1x,"IRwaterCoeff OBJECT")')
307 WRITE(*,
'(3x,"Release.Version :",1x,i0,".",i0)') self%Release, self%Version
309 WRITE(*,
'(3x,"n_Angles :",1x,i0)') self%n_Angles
310 WRITE(*,
'(3x,"n_Frequencies :",1x,i0)') self%n_Frequencies
311 WRITE(*,
'(3x,"n_Wind_Speeds :",1x,i0)') self%n_Wind_Speeds
314 WRITE(*,
'(3x,"Angle :")')
315 WRITE(*,
'(5(1x,es13.6,:))') self%Angle
316 WRITE(*,
'(3x,"Frequency :")')
317 WRITE(*,
'(5(1x,es13.6,:))') self%Frequency
318 WRITE(*,
'(3x,"Wind_Speed :")')
319 WRITE(*,
'(5(1x,es13.6,:))') self%Wind_Speed
321 WRITE(*,
'(3x,"Emissivity :")')
322 DO i3 = 1, self%n_Wind_Speeds
323 WRITE(*,
'(5x,"WIND_SPEED :",es13.6)') self%Wind_Speed(i3)
324 DO i2 = 1, self%n_Frequencies
325 WRITE(*,
'(5x,"FREQUENCY :",es13.6)') self%Frequency(i2)
326 WRITE(*,
'(5(1x,es13.6,:))') self%Emissivity(:,i2,i3)
368 CHARACTER(*),
PARAMETER :: routine_name =
'IRwaterCoeff_ValidRelease' 379 WRITE( msg,
'("An IRwaterCoeff data update is needed. ", & 380 &"IRwaterCoeff release is ",i0,". Valid release is ",i0,"." )' ) &
389 WRITE( msg,
'("An IRwaterCoeff software update is needed. ", & 390 &"IRwaterCoeff release is ",i0,". Valid release is ",i0,"." )' ) &
432 CHARACTER(*),
INTENT(OUT) :: info
434 INTEGER,
PARAMETER :: carriage_return = 13
435 INTEGER,
PARAMETER :: linefeed = 10
437 CHARACTER(2000) :: long_string
440 WRITE( long_string, &
441 '( a,1x,"IRwaterCoeff RELEASE.VERSION: ", i2, ".", i2.2, 2x, & 443 &"N_FREQUENCIES=",i5,2x,& 444 &"N_WIND_SPEEDS=",i3 )' ) &
445 achar(carriage_return)//achar(linefeed), &
446 self%Release, self%Version, &
448 self%n_Frequencies, &
453 info = long_string(1:
min(len(info), len_trim(long_string)))
482 CHARACTER(*),
INTENT(OUT) :: id
589 n_Angles , & ! Optional output
590 n_Frequencies, & ! Optional output
591 n_Wind_Speeds, & ! Optional output
592 Release , & ! Optional output
593 Version , & ! Optional output
594 Title , & ! Optional output
595 History , & ! Optional output
599 CHARACTER(*),
INTENT(IN) :: filename
600 INTEGER ,
OPTIONAL,
INTENT(OUT) :: n_angles
601 INTEGER ,
OPTIONAL,
INTENT(OUT) :: n_frequencies
602 INTEGER ,
OPTIONAL,
INTENT(OUT) :: n_wind_speeds
603 INTEGER ,
OPTIONAL,
INTENT(OUT) :: release
604 INTEGER ,
OPTIONAL,
INTENT(OUT) :: version
605 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: title
606 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: history
607 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: comment
611 CHARACTER(*),
PARAMETER :: routine_name =
'IRwaterCoeff_InquireFile' 614 CHARACTER(ML) :: io_msg
624 msg =
'File '//trim(filename)//
' not found.' 631 IF ( err_stat /=
success )
THEN 632 msg =
'Error opening '//trim(filename)
638 READ( fid, iostat=io_stat, iomsg=io_msg ) &
639 irwatercoeff%Release, &
641 IF ( io_stat /= 0 )
THEN 642 msg =
'Error reading Release/Version - '//trim(io_msg)
648 READ( fid, iostat=io_stat, iomsg=io_msg ) &
649 irwatercoeff%n_Angles , &
650 irwatercoeff%n_Frequencies, &
651 irwatercoeff%n_Wind_Speeds
652 IF ( io_stat /= 0 )
THEN 653 msg =
'Error reading dimension values from '//trim(filename)//
' - '//trim(io_msg)
664 IF ( err_stat /=
success )
THEN 665 msg =
'Error reading global attributes' 671 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
672 IF ( io_stat /= 0 )
THEN 673 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
679 IF (
PRESENT(n_angles ) ) n_angles = irwatercoeff%n_Angles
680 IF (
PRESENT(n_frequencies) ) n_frequencies = irwatercoeff%n_Frequencies
681 IF (
PRESENT(n_wind_speeds) ) n_wind_speeds = irwatercoeff%n_Wind_Speeds
682 IF (
PRESENT(release ) ) release = irwatercoeff%Release
683 IF (
PRESENT(version ) ) version = irwatercoeff%Version
690 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
691 IF ( io_stat /= 0 ) &
692 msg = trim(msg)//
'; Error closing input file during error cleanup - '//trim(io_msg)
793 IRwaterCoeff, & ! Output
795 No_Close , & ! Optional input
796 Quiet , & ! Optional input
797 Title , & ! Optional output
798 History , & ! Optional output
799 Comment , & ! Optional output
804 CHARACTER(*),
INTENT(IN) :: filename
805 LOGICAL ,
OPTIONAL,
INTENT(IN) :: no_close
806 LOGICAL ,
OPTIONAL,
INTENT(IN) :: quiet
807 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: title
808 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: history
809 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: comment
810 LOGICAL ,
OPTIONAL,
INTENT(IN) :: debug
814 CHARACTER(*),
PARAMETER :: routine_name =
'IRwaterCoeff_ReadFile' 817 CHARACTER(ML) :: io_msg
818 LOGICAL :: close_file
829 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
832 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
834 IF (
PRESENT(debug) )
THEN 835 IF ( debug ) noisy = .true.
842 INQUIRE( file=filename, number=fid )
845 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 852 IF ( err_stat /=
success )
THEN 853 msg =
'Error opening '//trim(filename)
857 msg =
'File '//trim(filename)//
' not found.' 864 READ( fid, iostat=io_stat, iomsg=io_msg ) &
867 IF ( io_stat /= 0 )
THEN 868 msg =
'Error reading Release/Version - '//trim(io_msg)
872 msg =
'IRwaterCoeff Release check failed.' 878 READ( fid, iostat=io_stat, iomsg=io_msg ) &
880 dummy%n_Frequencies, &
882 IF ( io_stat /= 0 )
THEN 883 msg =
'Error reading dimension values from '//trim(filename)//
' - '//trim(io_msg)
890 dummy%n_Frequencies, &
891 dummy%n_Wind_Speeds )
893 msg =
'IRwaterCoeff object creation failed.' 897 irwatercoeff%Version = dummy%Version
906 IF ( err_stat /=
success )
THEN 907 msg =
'Error reading global attributes' 914 READ( fid, iostat=io_stat, iomsg=io_msg ) &
915 irwatercoeff%Angle , &
916 irwatercoeff%Frequency , &
917 irwatercoeff%Wind_Speed
918 IF ( io_stat /= 0 )
THEN 919 msg =
'Error reading dimensional vectors - '//trim(io_msg)
923 READ( fid, iostat=io_stat, iomsg=io_msg ) &
924 irwatercoeff%Emissivity
925 IF ( io_stat /= 0 )
THEN 926 msg =
'Error reading emissivity data - '//trim(io_msg)
933 IF ( close_file )
THEN 934 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
935 IF ( io_stat /= 0 )
THEN 936 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
952 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
953 IF ( io_stat /= 0 ) &
954 msg = trim(msg)//
'; Error closing input file during error cleanup - '//trim(io_msg)
1054 IRwaterCoeff, & ! Input
1055 Filename , & ! Input
1056 No_Close , & ! Optional input
1057 Quiet , & ! Optional input
1058 Title , & ! Optional input
1059 History , & ! Optional input
1060 Comment , & ! Optional input
1065 CHARACTER(*),
INTENT(IN) :: filename
1066 LOGICAL ,
OPTIONAL,
INTENT(IN) :: no_close
1067 LOGICAL ,
OPTIONAL,
INTENT(IN) :: quiet
1068 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: title
1069 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: history
1070 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: comment
1071 LOGICAL ,
OPTIONAL,
INTENT(IN) :: debug
1075 CHARACTER(*),
PARAMETER :: routine_name =
'IRwaterCoeff_WriteFile' 1077 CHARACTER(ML) :: msg
1078 CHARACTER(ML) :: io_msg
1079 LOGICAL :: close_file
1089 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
1092 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
1094 IF (
PRESENT(debug) )
THEN 1095 IF ( debug ) noisy = .true.
1099 msg =
'IRwaterCoeff object is empty.' 1107 INQUIRE( file=filename, number=fid )
1110 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 1116 IF ( err_stat /=
success )
THEN 1117 msg =
'Error opening '//trim(filename)
1124 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
1125 irwatercoeff%Release, &
1126 irwatercoeff%Version
1127 IF ( io_stat /= 0 )
THEN 1128 msg =
'Error writing Release/Version - '//trim(io_msg)
1134 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
1135 irwatercoeff%n_Angles , &
1136 irwatercoeff%n_Frequencies, &
1137 irwatercoeff%n_Wind_Speeds
1138 IF ( io_stat /= 0 )
THEN 1139 msg =
'Error writing dimension values to '//trim(filename)//
' - '//trim(io_msg)
1149 history = history, &
1151 IF ( err_stat /=
success )
THEN 1152 msg =
'Error writing global attributes' 1159 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
1160 irwatercoeff%Angle , &
1161 irwatercoeff%Frequency , &
1162 irwatercoeff%Wind_Speed
1163 IF ( io_stat /= 0 )
THEN 1164 msg =
'Error writing dimensional vectors - '//trim(io_msg)
1168 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
1169 irwatercoeff%Emissivity
1170 IF ( io_stat /= 0 )
THEN 1171 msg =
'Error writing emissivity data - '//trim(io_msg)
1177 IF ( close_file )
THEN 1178 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
1179 IF ( io_stat /= 0 )
THEN 1180 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
1197 IF ( io_stat /= 0 ) &
1198 msg = trim(msg)//
'; Error closing input file during error cleanup - '//trim(io_msg)
1262 IF ( (x%Release /= y%Release) .OR. &
1263 (x%Version /= y%Version) )
RETURN 1265 IF ( (x%n_Angles /= y%n_Angles ) .OR. &
1266 (x%n_Frequencies /= y%n_Frequencies ) .OR. &
1267 (x%n_Wind_Speeds /= y%n_Wind_Speeds ) )
RETURN 1269 IF ( all(x%Angle .equalto. y%Angle ) .AND. &
1270 all(x%Frequency .equalto. y%Frequency ) .AND. &
1271 all(x%Wind_Speed .equalto. y%Wind_Speed ) .AND. &
1272 all(x%Emissivity .equalto. y%Emissivity ) ) &
integer, parameter, public failure
subroutine, public irwatercoeff_info(self, Info)
real(fp), parameter, public zero
integer, parameter, public long
integer, parameter, public fp
elemental subroutine, public irwatercoeff_destroy(self)
integer function, public readgatts_binary_file(fid, Write_Module, Created_On, Title, History, Comment)
integer, parameter, public double
subroutine inquire_cleanup()
subroutine, public irwatercoeff_inspect(self)
subroutine read_cleanup()
subroutine write_cleanup()
character(*), parameter module_version_id
elemental subroutine, public irwatercoeff_create(self, n_Angles, n_Frequencies, n_Wind_Speeds)
subroutine, public irwatercoeff_defineversion(Id)
integer function, public open_binary_file(Filename, FileID, For_Output, No_Check)
real(fp), parameter, public one
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
integer, parameter irwatercoeff_version
real(fp), parameter, public degrees_to_radians
integer function, public writegatts_binary_file(fid, Write_Module, Created_On, Title, History, Comment)
character(*), parameter write_error_status
logical function, public irwatercoeff_validrelease(self)
integer, parameter irwatercoeff_release
integer function, public irwatercoeff_writefile(IRwaterCoeff, Filename, No_Close, Quiet, Title, History, Comment, Debug)
integer, parameter, public success
integer function, public irwatercoeff_inquirefile(Filename, n_Angles, n_Frequencies, n_Wind_Speeds, Release, Version, Title, History, Comment)
elemental logical function irwatercoeff_equal(x, y)
integer function, public irwatercoeff_readfile(IRwaterCoeff, Filename, No_Close, Quiet, Title, History, Comment, Debug)
integer, parameter, public information
real(fp), parameter, public pi
elemental logical function, public irwatercoeff_associated(self)