38 PUBLIC ::
OPERATOR(==)
54 INTERFACE OPERATOR(==)
56 END INTERFACE OPERATOR(==)
63 '$Id: MWwaterCoeff_Define.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 73 INTEGER,
PARAMETER ::
ml = 256
74 INTEGER,
PARAMETER ::
sl = 80
83 LOGICAL :: is_allocated = .false.
148 status = self%Is_Allocated
176 self%Is_Allocated = .false.
207 self%Is_Allocated = .true.
235 LOGICAL,
OPTIONAL,
INTENT(IN) :: pause
239 IF (
PRESENT(pause) ) wait = pause
241 WRITE(*,
'(1x,"MWwaterCoeff OBJECT")')
243 WRITE(*,
'(3x,"Release.Version : ",i0,".",i0)') self%Release, self%Version
247 WRITE(*,
'(1x,"Foam coverage cofficients, ")',advance=
'NO')
251 WRITE(*,
'(1x,"Foam reflectivity cofficients, ")',advance=
'NO')
255 WRITE(*,
'(1x,"Reflection correction cofficients, ")',advance=
'NO')
259 WRITE(*,
'(1x,"Azimuth emissivity coefficients, ")',advance=
'NO')
263 WRITE(*,
'(1x,"Small-scale correction coefficients, ")',advance=
'NO')
267 WRITE(*,
'(1x,"Large-scale correction coefficients, ")',advance=
'NO')
271 WRITE(*,
'(1x,"Emissivity look-up table, ")',advance=
'NO')
313 CHARACTER(*),
PARAMETER :: routine_name =
'MWwaterCoeff_ValidRelease' 324 WRITE( msg,
'("An MWwaterCoeff data update is needed. ", & 325 &"MWwaterCoeff release is ",i0,". Valid release is ",i0,"." )' ) &
334 WRITE( msg,
'("An MWwaterCoeff software update is needed. ", & 335 &"MWwaterCoeff release is ",i0,". Valid release is ",i0,"." )' ) &
377 CHARACTER(*),
INTENT(OUT) :: info
379 INTEGER,
PARAMETER :: carriage_return = 13
380 INTEGER,
PARAMETER :: linefeed = 10
382 CHARACTER(2000) :: long_string
385 WRITE( long_string, &
386 '(a,1x,"MWwaterCoeff RELEASE.VERSION: ",i0,".",i0 )' ) &
387 achar(carriage_return)//achar(linefeed), &
388 self%Release, self%Version
392 info = long_string(1:
min(len(info), len_trim(long_string)))
421 CHARACTER(*),
INTENT(OUT) :: id
505 FCCoeff , & ! Optional input
506 FRCoeff , & ! Optional input
507 RCCoeff , & ! Optional input
508 AZCoeff , & ! Optional input
509 SSCCoeff , & ! Optional input
510 LSCCoeff , & ! Optional input
513 TYPE(MWwaterCoeff_type) ,
INTENT(IN OUT) :: self
514 TYPE(FitCoeff_1D_type),
OPTIONAL,
INTENT(IN) :: FCCoeff
515 TYPE(FitCoeff_1D_type),
OPTIONAL,
INTENT(IN) :: FRCoeff
516 TYPE(FitCoeff_3D_type),
OPTIONAL,
INTENT(IN) :: RCCoeff
517 TYPE(FitCoeff_3D_type),
OPTIONAL,
INTENT(IN) :: AZCoeff
518 TYPE(FitCoeff_1D_type),
OPTIONAL,
INTENT(IN) :: SSCCoeff
519 TYPE(FitCoeff_3D_type),
OPTIONAL,
INTENT(IN) :: LSCCoeff
520 TYPE(MWwaterLUT_type) ,
OPTIONAL,
INTENT(IN) :: MWwaterLUT
522 IF (
PRESENT(fccoeff ) ) self%FCCoeff = fccoeff
523 IF (
PRESENT(frcoeff ) ) self%FRCoeff = frcoeff
524 IF (
PRESENT(rccoeff ) ) self%RCCoeff = rccoeff
525 IF (
PRESENT(azcoeff ) ) self%AZCoeff = azcoeff
526 IF (
PRESENT(ssccoeff ) ) self%SSCCoeff = ssccoeff
527 IF (
PRESENT(lsccoeff ) ) self%LSCCoeff = lsccoeff
528 IF (
PRESENT(mwwaterlut) ) self%LUT = mwwaterlut
613 FCCoeff , & ! Optional output
614 FRCoeff , & ! Optional output
615 RCCoeff , & ! Optional output
616 AZCoeff , & ! Optional output
617 SSCCoeff , & ! Optional output
618 LSCCoeff , & ! Optional output
621 TYPE(MWwaterCoeff_type) ,
INTENT(IN) :: self
622 TYPE(FitCoeff_1D_type),
OPTIONAL,
INTENT(OUT) :: FCCoeff
623 TYPE(FitCoeff_1D_type),
OPTIONAL,
INTENT(OUT) :: FRCoeff
624 TYPE(FitCoeff_3D_type),
OPTIONAL,
INTENT(OUT) :: RCCoeff
625 TYPE(FitCoeff_3D_type),
OPTIONAL,
INTENT(OUT) :: AZCoeff
626 TYPE(FitCoeff_1D_type),
OPTIONAL,
INTENT(OUT) :: SSCCoeff
627 TYPE(FitCoeff_3D_type),
OPTIONAL,
INTENT(OUT) :: LSCCoeff
628 TYPE(MWwaterLUT_type) ,
OPTIONAL,
INTENT(OUT) :: MWwaterLUT
630 IF (
PRESENT(fccoeff ) ) fccoeff = self%FCCoeff
631 IF (
PRESENT(frcoeff ) ) frcoeff = self%FRCoeff
632 IF (
PRESENT(rccoeff ) ) rccoeff = self%RCCoeff
633 IF (
PRESENT(azcoeff ) ) azcoeff = self%AZCoeff
634 IF (
PRESENT(ssccoeff ) ) ssccoeff = self%SSCCoeff
635 IF (
PRESENT(lsccoeff ) ) lsccoeff = self%LSCCoeff
636 IF (
PRESENT(mwwaterlut) ) mwwaterlut = self%LUT
732 MWwaterCoeff, & ! Output
734 No_Close , & ! Optional input
735 Quiet , & ! Optional input
736 Title , & ! Optional output
737 History , & ! Optional output
738 Comment , & ! Optional output
743 CHARACTER(*),
INTENT(IN) :: filename
744 LOGICAL ,
OPTIONAL,
INTENT(IN) :: no_close
745 LOGICAL ,
OPTIONAL,
INTENT(IN) :: quiet
746 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: title
747 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: history
748 CHARACTER(*),
OPTIONAL,
INTENT(OUT) :: comment
749 LOGICAL ,
OPTIONAL,
INTENT(IN) :: debug
753 CHARACTER(*),
PARAMETER :: routine_name =
'MWwaterCoeff_ReadFile' 756 CHARACTER(ML) :: io_msg
757 LOGICAL :: close_file
761 INTEGER(Long) :: lut_present
768 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
771 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
773 IF (
PRESENT(debug) )
THEN 774 IF ( debug ) noisy = .true.
781 INQUIRE( file=filename, number=fid )
784 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 791 IF ( err_stat /=
success )
THEN 792 msg =
'Error opening '//trim(filename)
796 msg =
'File '//trim(filename)//
' not found.' 803 READ( fid, iostat=io_stat, iomsg=io_msg ) &
806 IF ( io_stat /= 0 )
THEN 807 msg =
'Error reading Release/Version - '//trim(io_msg)
811 msg =
'MWwaterCoeff Release check failed.' 819 mwwatercoeff%Version = dummy%Version
828 IF ( err_stat /=
success )
THEN 829 msg =
'Error reading global attributes' 837 mwwatercoeff%FCCoeff, &
842 IF ( err_stat /=
success )
THEN 843 msg =
'Error reading foam coverage coefficient data.' 848 mwwatercoeff%FRCoeff, &
853 IF ( err_stat /=
success )
THEN 854 msg =
'Error reading foam reflectivity coefficient data.' 859 mwwatercoeff%RCCoeff, &
864 IF ( err_stat /=
success )
THEN 865 msg =
'Error reading reflection correction coefficient data' 870 mwwatercoeff%AZCoeff, &
875 IF ( err_stat /=
success )
THEN 876 msg =
'Error reading azimuth emissivity coefficient data.' 881 mwwatercoeff%SSCCoeff, &
886 IF ( err_stat /=
success )
THEN 887 msg =
'Error reading small-scale correction coefficient data.' 892 mwwatercoeff%LSCCoeff, &
897 IF ( err_stat /=
success )
THEN 898 msg =
'Error reading large-scale correction coefficient data.' 905 READ( fid, iostat=io_stat, iomsg=io_msg ) lut_present
906 IF ( io_stat /= 0 )
THEN 907 msg =
'Error reading emissivity look-up table data indicator - '//trim(io_msg)
918 IF ( err_stat /=
success )
THEN 919 msg =
'Error reading emissivity look-up table data.' 926 IF ( close_file )
THEN 927 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
928 IF ( io_stat /= 0 )
THEN 929 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
945 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
946 IF ( io_stat /= 0 ) &
947 msg = trim(msg)//
'; Error closing input file during error cleanup - '//trim(io_msg)
1047 MWwaterCoeff, & ! Input
1048 Filename , & ! Input
1049 No_Close , & ! Optional input
1050 Quiet , & ! Optional input
1051 Title , & ! Optional input
1052 History , & ! Optional input
1053 Comment , & ! Optional input
1058 CHARACTER(*),
INTENT(IN) :: filename
1059 LOGICAL ,
OPTIONAL,
INTENT(IN) :: no_close
1060 LOGICAL ,
OPTIONAL,
INTENT(IN) :: quiet
1061 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: title
1062 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: history
1063 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: comment
1064 LOGICAL ,
OPTIONAL,
INTENT(IN) :: debug
1068 CHARACTER(*),
PARAMETER :: routine_name =
'MWwaterCoeff_WriteFile' 1070 CHARACTER(ML) :: msg
1071 CHARACTER(ML) :: io_msg
1072 LOGICAL :: close_file
1076 INTEGER(Long) :: lut_present
1083 IF (
PRESENT(no_close) ) close_file = .NOT. no_close
1086 IF (
PRESENT(quiet) ) noisy = .NOT. quiet
1088 IF (
PRESENT(debug) )
THEN 1089 IF ( debug ) noisy = .true.
1093 msg =
'MWwaterCoeff object is empty.' 1101 INQUIRE( file=filename, number=fid )
1104 msg =
'Error inquiring '//trim(filename)//
' for its FileID' 1110 IF ( err_stat /=
success )
THEN 1111 msg =
'Error opening '//trim(filename)
1118 WRITE( fid, iostat=io_stat, iomsg=io_msg ) &
1119 mwwatercoeff%Release, &
1120 mwwatercoeff%Version
1121 IF ( io_stat /= 0 )
THEN 1122 msg =
'Error writing Release/Version - '//trim(io_msg)
1132 history = history, &
1134 IF ( err_stat /=
success )
THEN 1135 msg =
'Error writing global attributes' 1143 mwwatercoeff%FCCoeff, &
1145 no_close = .true., &
1148 IF ( err_stat /=
success )
THEN 1149 msg =
'Error writing foam coverage coefficient data.' 1154 mwwatercoeff%FRCoeff, &
1156 no_close = .true., &
1159 IF ( err_stat /=
success )
THEN 1160 msg =
'Error writing foam reflectivity coefficient data.' 1165 mwwatercoeff%RCCoeff, &
1167 no_close = .true., &
1170 IF ( err_stat /=
success )
THEN 1171 msg =
'Error writing reflection correction coefficient data' 1176 mwwatercoeff%AZCoeff, &
1178 no_close = .true., &
1181 IF ( err_stat /=
success )
THEN 1182 msg =
'Error writing azimuth emissivity coefficient data.' 1187 mwwatercoeff%SSCCoeff, &
1189 no_close = .true., &
1192 IF ( err_stat /=
success )
THEN 1193 msg =
'Error writing small-scale correction coefficient data.' 1198 mwwatercoeff%LSCCoeff, &
1200 no_close = .true., &
1203 IF ( err_stat /=
success )
THEN 1204 msg =
'Error writing large-scale correction coefficient data.' 1216 WRITE( fid, iostat=io_stat, iomsg=io_msg ) lut_present
1217 IF ( io_stat /= 0 )
THEN 1218 msg =
'Error writing emissivity look-up table data indicator - '//trim(io_msg)
1226 no_close = .true., &
1229 IF ( err_stat /=
success )
THEN 1230 msg =
'Error writing emissivity look-up table data.' 1237 IF ( close_file )
THEN 1238 CLOSE( fid, iostat=io_stat, iomsg=io_msg )
1239 IF ( io_stat /= 0 )
THEN 1240 msg =
'Error closing '//trim(filename)//
' - '//trim(io_msg)
1257 IF ( io_stat /= 0 ) &
1258 msg = trim(msg)//
'; Error closing output file during error cleanup - '//trim(io_msg)
1321 IF ( (x%Release /= y%Release) .OR. &
1322 (x%Version /= y%Version) )
RETURN 1326 IF ( .NOT. (x%FCCoeff == y%FCCoeff) )
RETURN 1330 IF ( .NOT. (x%FRCoeff == y%FRCoeff) )
RETURN 1334 IF ( .NOT. (x%RCCoeff == y%RCCoeff) )
RETURN 1338 IF ( .NOT. (x%AZCoeff == y%AZCoeff) )
RETURN 1342 IF ( .NOT. (x%SSCCoeff == y%SSCCoeff) )
RETURN 1346 IF ( .NOT. (x%LSCCoeff == y%LSCCoeff) )
RETURN 1350 IF ( .NOT. (x%LUT == y%LUT) )
RETURN pure logical function mwwatercoeff_equal(x, y)
integer, parameter, public failure
integer, parameter data_present
pure logical function, public mwwaterlut_associated(self)
subroutine mwwatercoeff_getvalue(self, FCCoeff, FRCoeff, RCCoeff, AZCoeff, SSCCoeff, LSCCoeff, MWwaterLUT)
integer, parameter, public long
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 mwwatercoeff_version
subroutine, public mwwatercoeff_defineversion(Id)
integer, parameter, public double
pure logical function, public mwwatercoeff_associated(self)
character(*), parameter write_error_status
subroutine, public mwwatercoeff_inspect(self, pause)
pure subroutine, public mwwatercoeff_destroy(self)
subroutine read_cleanup()
subroutine write_cleanup()
pure subroutine, public mwwatercoeff_create(self)
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 mwwatercoeff_readfile(MWwaterCoeff, Filename, No_Close, Quiet, Title, History, Comment, Debug)
logical function, public mwwatercoeff_validrelease(self)
integer, parameter mwwatercoeff_release
integer function, public writegatts_binary_file(fid, Write_Module, Created_On, Title, History, Comment)
subroutine mwwatercoeff_setvalue(self, FCCoeff, FRCoeff, RCCoeff, AZCoeff, SSCCoeff, LSCCoeff, MWwaterLUT)
integer function, public mwwaterlut_writefile(MWwaterLUT, Filename, No_Close, Quiet, Title, History, Comment, Debug)
integer, parameter data_missing
subroutine, public mwwatercoeff_info(self, Info)
integer function, public mwwaterlut_readfile(MWwaterLUT, Filename, No_Close, Quiet, Title, History, Comment, Debug)
character(*), parameter module_version_id
integer function, public mwwatercoeff_writefile(MWwaterCoeff, Filename, No_Close, Quiet, Title, History, Comment, Debug)
integer, parameter, public success
integer, parameter, public information