! +-======-+ ! Copyright (c) 2003-2018 United States Government as represented by ! the Admistrator of the National Aeronautics and Space Administration. ! All Rights Reserved. ! ! THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, ! REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN ! COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS ! REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). ! THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN ! INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR ! REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, ! DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED ! HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE ! RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT. ! ! Government Agency: National Aeronautics and Space Administration ! Government Agency Original Software Designation: GSC-15354-1 ! Government Agency Original Software Title: GEOS-5 GCM Modeling Software ! User Registration Requested. Please Visit http://opensource.gsfc.nasa.gov ! Government Agency Point of Contact for Original Software: ! Dale Hithon, SRA Assistant, (301) 286-2691 ! ! +-======-+ ! ! NOTES: ! 1. REYNOLDS & NSIDC file name format changes-- cannot be hardcoded! ! ....................................................................... ! SUBROUTINE read_input_quart(inputFile, iDebug, today, tomrw, & fileName, NLAT, NLON, & iERR, max_diff_SST, max_diff_ICE) !--------------------------------------------------------------------------- IMPLICIT NONE CHARACTER (LEN = *), INTENT(IN) :: inputFile INTEGER, INTENT(IN) :: iDebug CHARACTER (LEN = *), INTENT(OUT) :: today, tomrw CHARACTER (LEN = *), INTENT(OUT) :: fileName(2) INTEGER, INTENT(OUT) :: NLAT, NLON INTEGER, INTENT(OUT) :: iERR REAL, INTENT(OUT) :: max_diff_SST REAL, INTENT(OUT) :: max_diff_ICE CHARACTER (LEN = 8) :: tmp_today CHARACTER (LEN = 60) :: tmp_char !--------------------------------------------------------------------------- ! READ *, inputFileName OPEN (UNIT = 21, FILE = inputFile, STATUS = 'old') ! Read multi-line input READ (21, '(A)') today READ (21, '(A)') tomrw READ (21, '(A)') fileName(1) ! Reynolds file READ (21, '(A)') fileName(2) ! OSTIA file READ (21, '(I4)') NLAT READ (21, '(I4)') NLON READ (21, '(F8.4)') max_diff_SST ! max allowed diff in SST between Reynolds and OSTIA READ (21, '(F8.4)') max_diff_ICE ! max allowed diff in SIC between Reynolds and OSTIA CLOSE(21) ! ....................................................................... ! CHECK USER INPUT. Die if not correct ! All other checks must be done here. ! ....................................................................... iERR = 0 IF( today == tomrw) THEN iERR = 1 PRINT *, 'Processing Start date: ', today PRINT *, 'is SAME as End date: ', tomrw PRINT *, 'End date must be AFTER Start date' END IF ! CHECK OSTIA FILE NAME WITH DATE if path of file is NOT input ! tmp_char = fileName(4) ! tmp_today = tmp_char(1:8) ! IF ( tmp_today /= today) THEN ! iERR = 1 ! PRINT *, 'OSTIA file: ', tmp_char ! PRINT *, 'is NOT for the Start date: ', today ! PRINT *, '1st eight char of file name should be START date' ! END IF ! ....................................................................... IF ( (max_diff_SST < 0.) .or. (max_diff_SST > 2.)) THEN PRINT *, 'Value of max_diff_SST is set to ', max_diff_SST PRINT *, 'Reynolds and OSTIA SSTs is out of bounds' END IF IF ( (max_diff_ICE < 1.e-6) .or. (max_diff_ICE > 1.)) THEN PRINT *, 'Value of max_diff_ICE is set to ', max_diff_ICE PRINT *, 'Reynolds and OSTIA Ice concentrations is out of bounds' END IF ! ....................................................................... IF( iDebug /= 0 ) THEN PRINT *, '---------------------------------------' PRINT *, 'From read_input: ' PRINT *, 'Today: ', today PRINT *, 'Tomorrow: ', tomrw PRINT *, 'Reynolds file: ', fileName(1) PRINT *, 'OSTIA file: ', fileName(2) PRINT *, 'NLAT & NLON: ', NLAT, NLON PRINT *, '---------------------------------------' END IF !--------------------------------------------------------------------------- END SUBROUTINE read_input_quart !