39 PUBLIC ::
OPERATOR(==)
56 INTERFACE OPERATOR(==)
58 END INTERFACE OPERATOR(==)
65 '$Id: MWwaterLUT_Define.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 72 REAL(fp),
PARAMETER ::
zero = 0.0_fp
73 REAL(fp),
PARAMETER ::
one = 1.0_fp
75 INTEGER,
PARAMETER ::
ml = 256
76 INTEGER,
PARAMETER ::
sl = 80
85 LOGICAL :: is_allocated = .false.
90 INTEGER(Long) :: n_angles = 0
91 INTEGER(Long) :: n_frequencies = 0
92 INTEGER(Long) :: n_temperatures = 0
93 INTEGER(Long) :: n_wind_speeds = 0
95 REAL(Double),
ALLOCATABLE :: angle(:)
96 REAL(Double),
ALLOCATABLE :: frequency(:)
97 REAL(Double),
ALLOCATABLE :: temperature(:)
98 REAL(Double),
ALLOCATABLE :: wind_speed(:)
100 REAL(Double),
ALLOCATABLE :: ev(:,:,:,:)
101 REAL(Double),
ALLOCATABLE :: eh(:,:,:,:)
155 status = self%Is_Allocated
183 self%Is_Allocated = .false.
185 self%n_Frequencies = 0
186 self%n_Temperatures = 0
187 self%n_Wind_Speeds = 0
252 n_Frequencies , & ! Input
253 n_Temperatures, & ! Input
257 INTEGER ,
INTENT(IN) :: n_angles
258 INTEGER ,
INTENT(IN) :: n_frequencies
259 INTEGER ,
INTENT(IN) :: n_temperatures
260 INTEGER ,
INTENT(IN) :: n_wind_speeds
262 INTEGER :: alloc_stat
265 IF ( n_angles < 1 .OR. &
266 n_frequencies < 1 .OR. &
267 n_temperatures < 1 .OR. &
268 n_wind_speeds < 1 )
RETURN 272 ALLOCATE( self%Angle( n_angles ), &
273 self%Frequency( n_frequencies ), &
274 self%Temperature( n_temperatures ), &
275 self%Wind_Speed( n_wind_speeds ), &
276 self%ev( n_angles, n_frequencies, n_temperatures, n_wind_speeds ), &
277 self%eh( n_angles, n_frequencies, n_temperatures, n_wind_speeds ), &
279 IF ( alloc_stat /= 0 )
RETURN 284 self%n_Angles = n_angles
285 self%n_Frequencies = n_frequencies
286 self%n_Temperatures = n_temperatures
287 self%n_Wind_Speeds = n_wind_speeds
290 self%Frequency =
zero 291 self%Temperature =
zero 292 self%Wind_Speed =
zero 297 self%Is_Allocated = .true.
326 LOGICAL,
OPTIONAL,
INTENT(IN) :: pause
328 INTEGER :: i2, i3, i4
331 IF (
PRESENT(pause) ) wait = pause
333 WRITE(*,
'(1x,"MWwaterLUT OBJECT")')
335 WRITE(*,
'(3x,"Release.Version : ",i0,".",i0)') self%Release, self%Version
337 WRITE(*,
'(3x,"n_Angles : ",i0)') self%n_Angles
338 WRITE(*,
'(3x,"n_Frequencies : ",i0)') self%n_Frequencies
339 WRITE(*,
'(3x,"n_Temperatures : ",i0)') self%n_Temperatures
340 WRITE(*,
'(3x,"n_Wind_Speeds : ",i0)') self%n_Wind_Speeds
343 WRITE(*,
'(3x,"Angle :")')
344 WRITE(*,
'(5(1x,es13.6,:))') self%Angle
345 WRITE(*,
'(3x,"Frequency :")')
346 WRITE(*,
'(5(1x,es13.6,:))') self%Frequency
347 WRITE(*,
'(3x,"Temperature :")')
348 WRITE(*,
'(5(1x,es13.6,:))') self%Temperature
349 WRITE(*,
'(3x,"Wind_Speed :")')
350 WRITE(*,
'(5(1x,es13.6,:))') self%Wind_Speed
353 WRITE(*,
'(/3x,"Emissivity(vertical polarisation) :")')
355 WRITE(*,fmt=
'(/1x,"Paused. Press <ENTER> to continue...")',advance=
'NO')
359 DO i4 = 1, self%n_Wind_Speeds
360 WRITE(*,
'(5x,"WIND_SPEED :",es13.6)') self%Wind_Speed(i4)
361 DO i3 = 1, self%n_Temperatures
362 WRITE(*,
'(5x,"TEMPERATURE :",es13.6)') self%Temperature(i3)
363 DO i2 = 1, self%n_Frequencies
364 WRITE(*,
'(5x,"FREQUENCY :",es13.6)') self%Frequency(i2)
365 WRITE(*,
'(5(1x,es13.6,:))') self%ev(:,i2,i3,i4)
370 WRITE(*,
'(/3x,"Emissivity(horizontal polarisation) :")')
372 WRITE(*,fmt=
'(/1x,"Paused. Press <ENTER> to continue...")',advance=
'NO')
376 DO i4 = 1, self%n_Wind_Speeds
377 WRITE(*,
'(5x,"WIND_SPEED :",es13.6)') self%Wind_Speed(i4)
378 DO i3 = 1, self%n_Temperatures
379 WRITE(*,
'(5x,"TEMPERATURE :",es13.6)') self%Temperature(i3)
380 DO i2 = 1, self%n_Frequencies
381 WRITE(*,
'(5x,"FREQUENCY :",es13.6)') self%Frequency(i2)
382 WRITE(*,
'(5(1x,es13.6,:))') self%eh(:,i2,i3,i4)
425 CHARACTER(*),
PARAMETER :: routine_name =
'MWwaterLUT_ValidRelease' 436 WRITE( msg,
'("An MWwaterLUT data update is needed. ", & 437 &"MWwaterLUT release is ",i0,". Valid release is ",i0,"." )' ) &
446 WRITE( msg,
'("An MWwaterLUT software update is needed. ", & 447 &"MWwaterLUT release is ",i0,". Valid release is ",i0,"." )' ) &
489 CHARACTER(*) ,
INTENT(OUT) :: info
491 INTEGER,
PARAMETER :: carriage_return = 13
492 INTEGER,
PARAMETER :: linefeed = 10
494 CHARACTER(2000) :: long_string
497 WRITE( long_string, &
498 '(a,1x,"MWwaterLUT RELEASE.VERSION: ",i2,".",i2.2,a,3x, & 500 &"N_FREQUENCIES=",i0,2x,& 501 &"N_TEMPERATURES=",i0,2x,& 502 &"N_WIND_SPEEDS=",i0 )' ) &
503 achar(carriage_return)//achar(linefeed), &
504 self%Release, self%Version, &
505 achar(carriage_return)//achar(linefeed), &
507 self%n_Frequencies , &
508 self%n_Temperatures, &
513 info = long_string(1:
min(len(info), len_trim(long_string)))
542 CHARACTER(*),
INTENT(OUT) :: id
656 n_Angles , & ! Optional output
657 n_Frequencies , & ! Optional output
658 n_Temperatures, & ! Optional output
659 n_Wind_Speeds , & ! Optional output
660 Release , & ! Optional output
661 Version , & ! Optional output
662 Title , & ! Optional output
663 History , & ! Optional output
667 CHARACTER(*),
INTENT(IN) :: filename
668 INTEGER ,
OPTIONAL,
INTENT(OUT) :: n_angles
669 INTEGER ,
OPTIONAL,
INTENT(OUT) :: n_frequencies
670 INTEGER ,
OPTIONAL,
INTENT(OUT) :: n_temperatures
671 INTEGER ,
OPTIONAL,
INTENT(OUT) :: n_wind_speeds
672 INTEGER ,
OPTIONAL,
INTENT(OUT) :: release
673 INTEGER ,
OPTIONAL,
INTENT(OUT) :: version
674 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: title
675 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: history
676 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: comment
680 CHARACTER(*),
PARAMETER :: routine_name =
'MWwaterLUT_InquireFile' 683 CHARACTER(ML) :: io_msg
693 msg =
'File '//trim(filename)//
' not found.' 700 IF ( err_stat /=
success )
THEN 701 msg =
'Error opening '//trim(filename)
707 READ( fid, iostat=io_stat, iomsg=io_msg ) &
708 mwwaterlut%Release, &
710 IF ( io_stat /= 0 )
THEN 711 msg =
'Error reading Release/Version - '//trim(io_msg)
715 msg =
'MWwaterLUT Release check failed.' 721 READ( fid, iostat=io_stat, iomsg=io_msg ) &
722 mwwaterlut%n_Angles , &
723 mwwaterlut%n_Frequencies , &
724 mwwaterlut%n_Temperatures, &
725 mwwaterlut%n_Wind_Speeds
726 IF ( io_stat /= 0 )
THEN 727 msg =
'Error reading dimension values from '//trim(filename)//
' - '//trim(io_msg)
738 IF ( err_stat /=
success )
THEN 739 msg =
'Error reading global attributes' 745 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
746 IF ( io_stat /= 0 )
THEN 747 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
753 IF (
PRESENT(n_angles ) ) n_angles = mwwaterlut%n_Angles
754 IF (
PRESENT(n_frequencies ) ) n_frequencies = mwwaterlut%n_Frequencies
755 IF (
PRESENT(n_temperatures) ) n_temperatures = mwwaterlut%n_Temperatures
756 IF (
PRESENT(n_wind_speeds ) ) n_wind_speeds = mwwaterlut%n_Wind_Speeds
757 IF (
PRESENT(release ) ) release = mwwaterlut%Release
758 IF (
PRESENT(version ) ) version = mwwaterlut%Version
765 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
766 IF ( io_stat /= 0 ) &
767 msg = trim(msg)//
'; Error closing input file during error cleanup - '//trim(io_msg)
868 MWwaterLUT, & ! Output
870 No_Close , & ! Optional input
871 Quiet , & ! Optional input
872 Title , & ! Optional output
873 History , & ! Optional output
874 Comment , & ! Optional output
879 CHARACTER(*),
INTENT(IN) :: filename
880 LOGICAL ,
OPTIONAL,
INTENT(IN) :: no_close
881 LOGICAL ,
OPTIONAL,
INTENT(IN) :: quiet
882 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: title
883 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: history
884 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: comment
885 LOGICAL ,
OPTIONAL,
INTENT(IN) :: debug
889 CHARACTER(*),
PARAMETER :: routine_name =
'MWwaterLUT_ReadFile' 892 CHARACTER(ML) :: io_msg
893 LOGICAL :: close_file
903 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
906 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
908 IF (
PRESENT(debug) )
THEN 909 IF ( debug ) noisy = .true.
916 INQUIRE( file=filename, number=fid )
919 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 926 IF ( err_stat /=
success )
THEN 927 msg =
'Error opening '//trim(filename)
931 msg =
'File '//trim(filename)//
' not found.' 938 READ( fid, iostat=io_stat, iomsg=io_msg ) &
941 IF ( io_stat /= 0 )
THEN 942 msg =
'Error reading Release/Version - '//trim(io_msg)
946 msg =
'MWwaterLUT Release check failed.' 952 READ( fid, iostat=io_stat, iomsg=io_msg ) &
954 dummy%n_Frequencies , &
955 dummy%n_Temperatures, &
957 IF ( io_stat /= 0 )
THEN 958 msg =
'Error reading data dimensions - '//trim(io_msg)
965 dummy%n_Frequencies , &
966 dummy%n_Temperatures, &
967 dummy%n_Wind_Speeds )
969 msg =
'MWwaterLUT object allocation failed.' 973 mwwaterlut%Version = dummy%Version
982 IF ( err_stat /=
success )
THEN 983 msg =
'Error reading global attributes' 990 READ( fid, iostat=io_stat, iomsg=io_msg ) &
992 mwwaterlut%Frequency , &
993 mwwaterlut%Temperature, &
994 mwwaterlut%Wind_Speed
995 IF ( io_stat /= 0 )
THEN 996 msg =
'Error reading dimensional vectors - '//trim(io_msg)
1000 READ( fid, iostat=io_stat, iomsg=io_msg ) &
1003 IF ( io_stat /= 0 )
THEN 1004 msg =
'Error reading emissivity data - '//trim(io_msg)
1010 IF ( close_file )
THEN 1011 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
1012 IF ( io_stat /= 0 )
THEN 1013 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
1029 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
1030 IF ( io_stat /= 0 ) &
1031 msg = trim(msg)//
'; Error closing input file during error cleanup - '//trim(io_msg)
1128 MWwaterLUT, & ! Input
1129 Filename , & ! Input
1130 No_Close , & ! Optional input
1131 Quiet , & ! Optional input
1132 Title , & ! Optional input
1133 History , & ! Optional input
1134 Comment , & ! Optional input
1139 CHARACTER(*),
INTENT(IN) :: filename
1140 LOGICAL ,
OPTIONAL,
INTENT(IN) :: no_close
1141 LOGICAL ,
OPTIONAL,
INTENT(IN) :: quiet
1142 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: title
1143 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: history
1144 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: comment
1145 LOGICAL ,
OPTIONAL,
INTENT(IN) :: debug
1149 CHARACTER(*),
PARAMETER :: routine_name =
'MWwaterLUT_WriteFile' 1151 CHARACTER(ML) :: msg
1152 CHARACTER(ML) :: io_msg
1153 LOGICAL :: close_file
1163 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
1166 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
1168 IF (
PRESENT(debug) )
THEN 1169 IF ( debug ) noisy = .true.
1173 msg =
'MWwaterLUT object is empty.' 1181 INQUIRE( file=filename, number=fid )
1184 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 1190 IF ( err_stat /=
success )
THEN 1191 msg =
'Error opening '//trim(filename)
1198 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
1199 mwwaterlut%Release, &
1201 IF ( io_stat /= 0 )
THEN 1202 msg =
'Error writing Release/Version - '//trim(io_msg)
1208 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
1209 mwwaterlut%n_Angles , &
1210 mwwaterlut%n_Frequencies , &
1211 mwwaterlut%n_Temperatures, &
1212 mwwaterlut%n_Wind_Speeds
1213 IF ( io_stat /= 0 )
THEN 1214 msg =
'Error writing data dimensions - '//trim(io_msg)
1224 history = history, &
1226 IF ( err_stat /=
success )
THEN 1227 msg =
'Error writing global attributes' 1234 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
1235 mwwaterlut%Angle , &
1236 mwwaterlut%Frequency , &
1237 mwwaterlut%Temperature, &
1238 mwwaterlut%Wind_Speed
1239 IF ( io_stat /= 0 )
THEN 1240 msg =
'Error writing dimensional vectors - '//trim(io_msg)
1244 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
1247 IF ( io_stat /= 0 )
THEN 1248 msg =
'Error writing the emissivity data - '//trim(io_msg)
1254 IF ( close_file )
THEN 1255 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
1256 IF ( io_stat /= 0 )
THEN 1257 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
1274 IF ( io_stat /= 0 ) &
1275 msg = trim(msg)//
'; Error closing output file during error cleanup - '//trim(io_msg)
1338 IF ( (x%Release /= y%Release) .OR. &
1339 (x%Version /= y%Version) )
RETURN 1341 IF ( (x%n_Angles /= y%n_Angles ) .OR. &
1342 (x%n_Frequencies /= y%n_Frequencies ) .OR. &
1343 (x%n_Temperatures /= y%n_Temperatures ) .OR. &
1344 (x%n_Wind_Speeds /= y%n_Wind_Speeds ) )
RETURN 1346 IF ( all(x%Angle .equalto. y%Angle ) .AND. &
1347 all(x%Frequency .equalto. y%Frequency ) .AND. &
1348 all(x%Temperature .equalto. y%Temperature ) .AND. &
1349 all(x%Wind_Speed .equalto. y%Wind_Speed ) .AND. &
1350 all(x%ev .equalto. y%ev ) .AND. &
1351 all(x%eh .equalto. y%eh ) ) &
integer, parameter, public failure
pure logical function, public mwwaterlut_associated(self)
real(fp), parameter, public zero
subroutine, public mwwaterlut_defineversion(Id)
subroutine, public mwwaterlut_info(self, Info)
character(*), parameter write_error_status
integer, parameter, public long
integer function, public mwwaterlut_inquirefile(Filename, n_Angles, n_Frequencies, n_Temperatures, n_Wind_Speeds, Release, Version, Title, History, Comment)
integer, parameter, public fp
subroutine, public mwwaterlut_inspect(self, pause)
integer function, public readgatts_binary_file(fid, Write_Module, Created_On, Title, History, Comment)
integer, parameter, public double
pure subroutine, public mwwaterlut_create(self, n_Angles, n_Frequencies, n_Temperatures, n_Wind_Speeds)
subroutine inquire_cleanup()
pure subroutine, public mwwaterlut_destroy(self)
subroutine read_cleanup()
integer, parameter mwwaterlut_release
subroutine write_cleanup()
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 function, public writegatts_binary_file(fid, Write_Module, Created_On, Title, History, Comment)
integer function, public mwwaterlut_writefile(MWwaterLUT, Filename, No_Close, Quiet, Title, History, Comment, Debug)
integer function, public mwwaterlut_readfile(MWwaterLUT, Filename, No_Close, Quiet, Title, History, Comment, Debug)
pure logical function mwwaterlut_equal(x, y)
integer, parameter, public success
integer, parameter, public information
integer, parameter mwwaterlut_version
character(*), parameter module_version_id
logical function, public mwwaterlut_validrelease(self)