- Timestamp:
- 2018-03-06T13:35:36+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/NERC/dev_r5518_GO6_CO2_cmip/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90
r8280 r9374 44 44 !! ** Method : - Read the namcfc namelist and check the parameter values 45 45 !!---------------------------------------------------------------------- 46 INTEGER :: ji, jj, jn, jl, jm, js, io, i err46 INTEGER :: ji, jj, jn, jl, jm, js, io, iostatus, ierr 47 47 INTEGER :: iskip = 7 ! number of 1st descriptor lines 48 48 REAL(wp) :: zyy, zyd … … 57 57 58 58 CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 59 REWIND(inum)60 59 61 60 ! compute the number of year in the file 62 61 ! file starts in 1931 do jn represent the year in the century 62 iostatus = 0 63 63 jn = 31 64 DO 65 READ(inum,'(1x)', END=100)64 DO WHILE ( iostatus == 0 ) 65 READ(inum,'(1x)', IOSTAT=iostatus, END=100) 66 66 jn = jn + 1 67 END DO 67 ENDDO 68 IF( iostatus .NE. 0 ) THEN 69 !! Error while reading CFC input file 70 CALL ctl_stop('trc_ini_cfc: & 71 & Error on the 1st reading of cfc1112sf6.atm') 72 RETURN 73 ENDIF 68 74 100 jpyear = jn - 1 - iskip 69 75 IF ( lwp) WRITE(numout,*) ' ', jpyear ,' years read' … … 72 78 ALLOCATE( p_cfc(jpyear,jphem,3), STAT=ierr ) 73 79 IF( ierr > 0 ) THEN 74 CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' ) ; RETURN 80 CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' ) 81 RETURN 75 82 ENDIF 76 83 IF( trc_sms_cfc_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'trc_ini_cfc: unable to allocate CFC arrays' ) … … 101 108 ! file starts in 1931 do jn represent the year in the century.jhh 102 109 ! Read file till the end 103 jn = 31 104 DO 105 READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), & 110 DO jn = 31, jpyear 111 READ(inum, '( F6.1, 6F7.2)', IOSTAT=io) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), & 106 112 & p_cfc(jn,1,3), p_cfc(jn,2,1), & 107 113 & p_cfc(jn,2,2), p_cfc(jn,2,3) 108 IF( io < 0 ) exit 109 jn = jn + 1 114 IF( io .NE.0 ) THEN 115 !! Error while reading CFC input file 116 CALL ctl_stop('trc_ini_cfc: & 117 & Error on the 2nd reading of cfc1112sf6.atm') 118 RETURN 119 ENDIF 110 120 END DO 111 121
Note: See TracChangeset
for help on using the changeset viewer.