SUBROUTINE ld_solspec(success) c============================================================================ c PROCEDURE NAME: ld_solspec c PROCEDURE TYPE: fortran subroutine c VERSION DATE: July 1998 c c PURPOSE: c Load the extraterrestrial solar spectral irradiance values into c the common block /solspec/. c c CALLING PARAMETERS: c Name Type i/o units Description c -------- ---- --- ----- -------------- c success l o Successful completion flag c c EXTERNAL ROUTINES REQUIRED: c c NOTES & CAVEATS: c c REVISION HISTORY: c c============================================================================ IMPLICIT NONE c---------------------------------------------------------------------------- c Compile parameters c c---------------------------------------------------------------------------- c Calling parameters c LOGICAL success c---------------------------------------------------------------------------- c Common blocks c INCLUDE "solspec.cmn" c---------------------------------------------------------------------------- c Local variables c INTEGER*4 lun, i REAL*4 wvl CHARACTER*1 adum c============================================================================ CALL get_lun(lun) OPEN(UNIT=lun, & FILE='solspec.dat', & FORM='formatted', & STATUS='old', & ERR=900) READ(lun,1) adum DO i= 0, 2098 READ(lun,*,ERR=901, END=902) wvl, solspec(i) END DO CLOSE(lun) CALL unget_lun(lun) success=.TRUE. RETURN 900 CONTINUE WRITE(6,*) 'Could not open the solar spectrum file.' success=.FALSE. RETURN 901 CONTINUE WRITE(6,*) 'Error while reading the solar spectrum file.' success= .FALSE. CALL unget_lun(lun) RETURN 902 CONTINUE WRITE(6,*) 'Unexpected EOF while reading the solar spectrum file.' success= .FALSE. CALL unget_lun(lun) RETURN 1 FORMAT(A) END