27 spccoeff_ismicrowavesensor , &
28 spccoeff_isinfraredsensor , &
29 spccoeff_isvisiblesensor , &
30 spccoeff_isultravioletsensor
79 '$Id: CRTM_LifeCycle.f90 60152 2015-08-13 19:19:13Z paul.vandelst@noaa.gov $' 81 INTEGER,
PARAMETER ::
ml = 256
82 INTEGER,
PARAMETER ::
sl = 5000
337 Sensor_ID , & ! Input
338 ChannelInfo , & ! Output
339 CloudCoeff_File , & ! Optional input
340 AerosolCoeff_File , & ! Optional input
341 EmisCoeff_File , & ! Optional input ! *** DEPRECATED. Replaced by IRwaterCoeff_File
342 IRwaterCoeff_File , & ! Optional input
343 IRlandCoeff_File , & ! Optional input
344 IRsnowCoeff_File , & ! Optional input
345 IRiceCoeff_File , & ! Optional input
346 VISwaterCoeff_File, & ! Optional input
347 VISlandCoeff_File , & ! Optional input
348 VISsnowCoeff_File , & ! Optional input
349 VISiceCoeff_File , & ! Optional input
350 MWwaterCoeff_File , & ! Optional input
351 File_Path , & ! Optional input
352 Load_CloudCoeff , & ! Optional input
353 Load_AerosolCoeff , & ! Optional input
354 Quiet , & ! Optional input
355 Process_ID , & ! Optional input
356 Output_Process_ID ) &
359 CHARACTER(*) ,
INTENT(IN) :: sensor_id(:)
361 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: cloudcoeff_file
362 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: aerosolcoeff_file
363 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: emiscoeff_file
364 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: irwatercoeff_file
365 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: irlandcoeff_file
366 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: irsnowcoeff_file
367 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: iricecoeff_file
368 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: viswatercoeff_file
369 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: vislandcoeff_file
370 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: vissnowcoeff_file
371 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: visicecoeff_file
372 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: mwwatercoeff_file
373 CHARACTER(*),
OPTIONAL,
INTENT(IN) :: file_path
374 LOGICAL ,
OPTIONAL,
INTENT(IN) :: load_cloudcoeff
375 LOGICAL ,
OPTIONAL,
INTENT(IN) :: load_aerosolcoeff
376 LOGICAL ,
OPTIONAL,
INTENT(IN) :: quiet
377 INTEGER ,
OPTIONAL,
INTENT(IN) :: process_id
378 INTEGER ,
OPTIONAL,
INTENT(IN) :: output_process_id
382 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Init' 384 CHARACTER(ML) :: msg, pid_msg
385 CHARACTER(SL) :: default_cloudcoeff_file
386 CHARACTER(SL) :: default_aerosolcoeff_file
387 CHARACTER(SL) :: default_irwatercoeff_file
388 CHARACTER(SL) :: default_irlandcoeff_file
389 CHARACTER(SL) :: default_irsnowcoeff_file
390 CHARACTER(SL) :: default_iricecoeff_file
391 CHARACTER(SL) :: default_viswatercoeff_file
392 CHARACTER(SL) :: default_vislandcoeff_file
393 CHARACTER(SL) :: default_vissnowcoeff_file
394 CHARACTER(SL) :: default_visicecoeff_file
395 CHARACTER(SL) :: default_mwwatercoeff_file
397 INTEGER :: l, n, n_sensors
398 LOGICAL :: local_load_cloudcoeff
399 LOGICAL :: local_load_aerosolcoeff
405 IF (
PRESENT(quiet) )
THEN 415 IF (
PRESENT(process_id) )
THEN 416 WRITE( pid_msg,
'("; Process ID: ",i0)' ) process_id
421 local_load_cloudcoeff = .true.
422 IF(
PRESENT(load_cloudcoeff) ) local_load_cloudcoeff = load_cloudcoeff
423 local_load_aerosolcoeff = .true.
424 IF(
PRESENT(load_aerosolcoeff) ) local_load_aerosolcoeff = load_aerosolcoeff
426 n_sensors =
SIZE(sensor_id)
427 IF (
SIZE(channelinfo) /= n_sensors )
THEN 429 msg =
'Inconsistent Sensor_ID and ChannelInfo dimensions' 434 IF (
PRESENT(emiscoeff_file) )
THEN 436 msg =
'The EmisCoeff_File optional argument is deprecated. Use IRwaterCoeff_File instead' 437 CALL display_message( routine_name, trim(msg)//trim(pid_msg), err_stat )
444 default_cloudcoeff_file =
'CloudCoeff.bin' 445 default_aerosolcoeff_file =
'AerosolCoeff.bin' 446 default_irwatercoeff_file =
'Nalli.IRwater.EmisCoeff.bin' 447 default_irlandcoeff_file =
'NPOESS.IRland.EmisCoeff.bin' 448 default_irsnowcoeff_file =
'NPOESS.IRsnow.EmisCoeff.bin' 449 default_iricecoeff_file =
'NPOESS.IRice.EmisCoeff.bin' 450 default_viswatercoeff_file =
'NPOESS.VISwater.EmisCoeff.bin' 451 default_vislandcoeff_file =
'NPOESS.VISland.EmisCoeff.bin' 452 default_vissnowcoeff_file =
'NPOESS.VISsnow.EmisCoeff.bin' 453 default_visicecoeff_file =
'NPOESS.VISice.EmisCoeff.bin' 454 default_mwwatercoeff_file =
'FASTEM6.MWwater.EmisCoeff.bin' 456 IF (
PRESENT(cloudcoeff_file ) ) default_cloudcoeff_file = trim(adjustl(cloudcoeff_file))
457 IF (
PRESENT(aerosolcoeff_file ) ) default_aerosolcoeff_file = trim(adjustl(aerosolcoeff_file))
458 IF (
PRESENT(irwatercoeff_file ) ) default_irwatercoeff_file = trim(adjustl(irwatercoeff_file))
459 IF (
PRESENT(irlandcoeff_file ) ) default_irlandcoeff_file = trim(adjustl(irlandcoeff_file))
460 IF (
PRESENT(irsnowcoeff_file ) ) default_irsnowcoeff_file = trim(adjustl(irsnowcoeff_file))
461 IF (
PRESENT(iricecoeff_file ) ) default_iricecoeff_file = trim(adjustl(iricecoeff_file))
462 IF (
PRESENT(viswatercoeff_file) ) default_viswatercoeff_file = trim(adjustl(viswatercoeff_file))
463 IF (
PRESENT(vislandcoeff_file ) ) default_vislandcoeff_file = trim(adjustl(vislandcoeff_file))
464 IF (
PRESENT(vissnowcoeff_file ) ) default_vissnowcoeff_file = trim(adjustl(vissnowcoeff_file))
465 IF (
PRESENT(visicecoeff_file ) ) default_visicecoeff_file = trim(adjustl(visicecoeff_file))
466 IF (
PRESENT(mwwatercoeff_file ) ) default_mwwatercoeff_file = trim(adjustl(mwwatercoeff_file))
468 IF (
PRESENT(file_path) )
THEN 469 default_cloudcoeff_file = trim(adjustl(file_path)) // trim(default_cloudcoeff_file)
470 default_aerosolcoeff_file = trim(adjustl(file_path)) // trim(default_aerosolcoeff_file)
471 default_irwatercoeff_file = trim(adjustl(file_path)) // trim(default_irwatercoeff_file)
472 default_irlandcoeff_file = trim(adjustl(file_path)) // trim(default_irlandcoeff_file)
473 default_irsnowcoeff_file = trim(adjustl(file_path)) // trim(default_irsnowcoeff_file)
474 default_iricecoeff_file = trim(adjustl(file_path)) // trim(default_iricecoeff_file)
475 default_viswatercoeff_file = trim(adjustl(file_path)) // trim(default_viswatercoeff_file)
476 default_vislandcoeff_file = trim(adjustl(file_path)) // trim(default_vislandcoeff_file)
477 default_vissnowcoeff_file = trim(adjustl(file_path)) // trim(default_vissnowcoeff_file)
478 default_visicecoeff_file = trim(adjustl(file_path)) // trim(default_visicecoeff_file)
479 default_mwwatercoeff_file = trim(adjustl(file_path)) // trim(default_mwwatercoeff_file)
486 file_path = file_path , &
488 process_id = process_id , &
489 output_process_id = output_process_id )
490 IF ( err_stat /=
success )
THEN 491 CALL display_message( routine_name,
'Error loading SpcCoeff data'//trim(pid_msg),err_stat )
498 sensor_id = sensor_id , &
499 file_path = file_path , &
501 process_id = process_id , &
502 output_process_id = output_process_id )
503 IF ( err_stat /=
success )
THEN 504 CALL display_message( routine_name,
'Error loading TauCoeff data'//trim(pid_msg),err_stat )
510 IF ( local_load_cloudcoeff )
THEN 512 default_cloudcoeff_file, &
514 process_id = process_id , &
515 output_process_id = output_process_id )
516 IF ( err_stat /=
success )
THEN 517 msg =
'Error loading CloudCoeff data from '//trim(default_cloudcoeff_file)
525 IF ( local_load_aerosolcoeff )
THEN 527 default_aerosolcoeff_file, &
529 process_id = process_id , &
530 output_process_id = output_process_id )
531 IF ( err_stat /=
success )
THEN 532 msg =
'Error loading AerosolCoeff data from '//trim(default_aerosolcoeff_file)
541 infrared_sensor:
IF ( any(spccoeff_isinfraredsensor(
sc)) )
THEN 544 default_irlandcoeff_file, &
546 process_id = process_id , &
547 output_process_id = output_process_id )
548 IF ( err_stat /=
success )
THEN 549 msg =
'Error loading IRlandCoeff data from '//trim(default_irlandcoeff_file)
555 default_irwatercoeff_file, &
557 process_id = process_id , &
558 output_process_id = output_process_id )
559 IF ( err_stat /=
success )
THEN 560 msg =
'Error loading IRwaterCoeff data from '//trim(default_irwatercoeff_file)
566 default_irsnowcoeff_file, &
568 process_id = process_id , &
569 output_process_id = output_process_id )
570 IF ( err_stat /=
success )
THEN 571 msg =
'Error loading IRsnowCoeff data from '//trim(default_irsnowcoeff_file)
577 default_iricecoeff_file, &
579 process_id = process_id , &
580 output_process_id = output_process_id )
581 IF ( err_stat /=
success )
THEN 582 msg =
'Error loading IRiceCoeff data from '//trim(default_iricecoeff_file)
586 END IF infrared_sensor
589 visible_sensor:
IF ( any(spccoeff_isvisiblesensor(
sc)) )
THEN 592 default_vislandcoeff_file, &
594 process_id = process_id , &
595 output_process_id = output_process_id )
596 IF ( err_stat /=
success )
THEN 597 msg =
'Error loading VISlandCoeff data from '//trim(default_vislandcoeff_file)
603 default_viswatercoeff_file, &
605 process_id = process_id , &
606 output_process_id = output_process_id )
607 IF ( err_stat /=
success )
THEN 608 msg =
'Error loading VISwaterCoeff data from '//trim(default_viswatercoeff_file)
614 default_vissnowcoeff_file, &
616 process_id = process_id , &
617 output_process_id = output_process_id )
618 IF ( err_stat /=
success )
THEN 619 msg =
'Error loading VISsnowCoeff data from '//trim(default_vissnowcoeff_file)
625 default_visicecoeff_file, &
627 process_id = process_id , &
628 output_process_id = output_process_id )
629 IF ( err_stat /=
success )
THEN 630 msg =
'Error loading VISiceCoeff data from '//trim(default_visicecoeff_file)
634 END IF visible_sensor
637 microwave_sensor:
IF ( any(spccoeff_ismicrowavesensor(
sc)) )
THEN 640 default_mwwatercoeff_file, &
642 process_id = process_id , &
643 output_process_id = output_process_id )
644 IF ( err_stat /=
success )
THEN 645 msg =
'Error loading MWwaterCoeff data from '//trim(default_mwwatercoeff_file)
649 END IF microwave_sensor
658 msg =
'ChannelInfo allocation failed for '//trim(sensor_id(n))//
' sensor' 663 channelinfo(n)%Sensor_Index = n
664 channelinfo(n)%Channel_Index = (/(l, l=1,
sc(n)%n_Channels)/)
665 channelinfo(n)%Sensor_ID =
sc(n)%Sensor_Id
666 channelinfo(n)%Sensor_Type =
sc(n)%Sensor_Type
667 channelinfo(n)%WMO_Satellite_ID =
sc(n)%WMO_Satellite_ID
668 channelinfo(n)%WMO_Sensor_ID =
sc(n)%WMO_Sensor_ID
669 channelinfo(n)%Sensor_Channel =
sc(n)%Sensor_Channel
728 ChannelInfo, & ! Output
733 INTEGER,
OPTIONAL,
INTENT(IN) :: process_id
737 CHARACTER(*),
PARAMETER :: routine_name =
'CRTM_Destroy' 739 CHARACTER(ML) :: msg, pid_msg
740 INTEGER :: destroy_status
745 IF (
PRESENT(process_id) )
THEN 746 WRITE( pid_msg,
'("; Process ID: ",i0)' ) process_id
756 msg =
'Error deallocating ChannelInfo structure(s)' 763 IF ( destroy_status /=
success )
THEN 764 err_stat = destroy_status
765 msg =
'Error deallocating shared VISiceCoeff data structure'//trim(pid_msg)
770 IF ( destroy_status /=
success )
THEN 771 err_stat = destroy_status
772 msg =
'Error deallocating shared VISsnowCoeff data structure'//trim(pid_msg)
777 IF ( destroy_status /=
success )
THEN 778 err_stat = destroy_status
779 msg =
'Error deallocating shared VISwaterCoeff data structure'//trim(pid_msg)
784 IF ( destroy_status /=
success )
THEN 785 err_stat = destroy_status
786 msg =
'Error deallocating shared VISlandCoeff data structure'//trim(pid_msg)
791 IF ( destroy_status /=
success )
THEN 792 err_stat = destroy_status
793 msg =
'Error deallocating shared IRiceCoeff data structure'//trim(pid_msg)
798 IF ( destroy_status /=
success )
THEN 799 err_stat = destroy_status
800 msg =
'Error deallocating shared IRsnowCoeff data structure'//trim(pid_msg)
805 IF ( destroy_status /=
success )
THEN 806 err_stat = destroy_status
807 msg =
'Error deallocating shared IRwaterCoeff data structure'//trim(pid_msg)
812 IF ( destroy_status /=
success )
THEN 813 err_stat = destroy_status
814 msg =
'Error deallocating shared IRlandCoeff data structure'//trim(pid_msg)
819 IF ( destroy_status /=
success )
THEN 820 err_stat = destroy_status
821 msg =
'Error deallocating shared AerosolCoeff data structure'//trim(pid_msg)
826 IF ( destroy_status /=
success )
THEN 827 err_stat = destroy_status
828 msg =
'Error deallocating shared CloudCoeff data structure'//trim(pid_msg)
833 IF ( destroy_status /=
success )
THEN 834 err_stat = destroy_status
835 msg =
'Error deallocating shared TauCoeff data structure(s)'//trim(pid_msg)
840 IF ( destroy_status /=
success )
THEN 841 err_stat = destroy_status
842 msg =
'Error deallocating shared SpcCoeff data structure(s)'//trim(pid_msg)
847 IF ( destroy_status /=
success )
THEN 848 err_stat = destroy_status
849 msg =
'Error deallocating shared MWwaterCoeff data structure'//trim(pid_msg)
918 CHARACTER(*),
INTENT(OUT) :: id
integer function, public crtm_vislandcoeff_destroy(Process_ID)
integer function, public crtm_spccoeff_destroy(Process_ID)
integer function, public crtm_mwwatercoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
integer, parameter, public failure
subroutine, public crtm_lifecycleversion(Id)
elemental subroutine, public crtm_channelinfo_destroy(ChannelInfo)
integer function, public crtm_visicecoeff_destroy(Process_ID)
integer function, public crtm_aerosolcoeff_destroy(Process_ID)
integer function, public crtm_iricecoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
integer function, public crtm_irwatercoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
integer function, public crtm_vislandcoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
integer function, public crtm_init(Sensor_ID, ChannelInfo, CloudCoeff_File, AerosolCoeff_File, EmisCoeff_File, IRwaterCoeff_File, IRlandCoeff_File, IRsnowCoeff_File, IRiceCoeff_File, VISwaterCoeff_File, VISlandCoeff_File, VISsnowCoeff_File, VISiceCoeff_File, MWwaterCoeff_File, File_Path, Load_CloudCoeff, Load_AerosolCoeff, Quiet, Process_ID, Output_Process_ID)
elemental logical function, public crtm_channelinfo_associated(ChannelInfo)
integer function, public crtm_viswatercoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
elemental subroutine, public crtm_channelinfo_create(ChannelInfo, n_Channels)
character(*), parameter module_version_id
integer function, public crtm_vissnowcoeff_destroy(Process_ID)
integer function, public crtm_irsnowcoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
recursive subroutine, public display_message(Routine_Name, Message, Error_State, Message_Log)
integer function, public crtm_cloudcoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
integer function, public crtm_aerosolcoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
integer function, public crtm_cloudcoeff_destroy(Process_ID)
integer function, public crtm_destroy(ChannelInfo, Process_ID)
integer function, public crtm_spccoeff_load(Sensor_ID, File_Path, Quiet, Process_ID, Output_Process_ID)
integer function, public crtm_irlandcoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
type(spccoeff_type), dimension(:), allocatable, save, public sc
integer function, public crtm_iricecoeff_destroy(Process_ID)
integer function, public crtm_irlandcoeff_destroy(Process_ID)
integer function, public crtm_load_taucoeff(Sensor_ID, File_Path, Quiet, Process_ID, Output_Process_ID, Message_Log)
logical function, public crtm_isinitialized(ChannelInfo)
integer function, public crtm_mwwatercoeff_destroy(Process_ID)
integer function, public crtm_vissnowcoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
integer, parameter, public success
integer function, public crtm_destroy_taucoeff(Process_ID, Message_Log)
integer function, public crtm_viswatercoeff_destroy(Process_ID)
integer function, public crtm_visicecoeff_load(Filename, File_Path, Quiet, Process_ID, Output_Process_ID)
integer function, public crtm_irsnowcoeff_destroy(Process_ID)
integer function, public crtm_irwatercoeff_destroy(Process_ID)