- Timestamp:
- 2011-08-09T10:29:53+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2011/dev_r2787_LOCEAN3_TRA_TRP/NEMOGCM/NEMO/TOP_SRC/CFC/trcini_cfc.F90
r2715 r2819 4 4 !! TOP : initialisation of the CFC tracers 5 5 !!====================================================================== 6 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) from trcini.cfc.h906 !! History : 2.0 ! 2007-12 (C. Ethe, G. Madec) 7 7 !!---------------------------------------------------------------------- 8 8 #if defined key_cfc … … 43 43 !! ** Method : - Read the namcfc namelist and check the parameter values 44 44 !!---------------------------------------------------------------------- 45 INTEGER :: ji, jj, jn, jl, jm, js 45 INTEGER :: ji, jj, jn, jl, jm, js, io, ierr 46 INTEGER :: iskip = 6 ! number of 1st descriptor lines 46 47 REAL(wp) :: zyy, zyd 47 48 !!---------------------------------------------------------------------- … … 51 52 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' 52 53 54 55 IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112atm' 56 57 CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 58 REWIND(inum) 59 60 ! compute the number of year in the file 61 ! file starts in 1931 do jn represent the year in the century 62 jn = 31 63 DO 64 READ(inum,'(1x)',END=100) 65 jn = jn + 1 66 END DO 67 100 jpyear = jn - 1 - iskip 68 IF ( lwp) WRITE(numout,*) ' ', jpyear ,' years read' 53 69 ! ! Allocate CFC arrays 70 71 ALLOCATE( p_cfc(jpyear,jphem,2), STAT=ierr ) 72 IF( ierr > 0 ) THEN 73 CALL ctl_stop( 'trc_ini_cfc: unable to allocate p_cfc array' ) ; RETURN 74 ENDIF 54 75 IF( trc_sms_cfc_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'trc_ini_cfc: unable to allocate CFC arrays' ) 55 76 … … 75 96 ENDIF 76 97 77 78 ! READ CFC partial pressure atmospheric value :79 ! p11(year,nt) = PCFC11 in northern (1) and southern (2) hemisphere80 ! p12(year,nt) = PCFC12 in northern (1) and southern (2) hemisphere81 !--------------------------------------------------------------------82 83 IF(lwp) WRITE(numout,*) 'read of formatted file cfc1112atm'84 85 CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. )86 98 REWIND(inum) 87 99 88 DO jm = 1, 6! Skip over 1st six descriptor lines100 DO jm = 1, iskip ! Skip over 1st six descriptor lines 89 101 READ(inum,'(1x)') 90 102 END DO 91 92 103 ! file starts in 1931 do jn represent the year in the century.jhh 93 104 ! Read file till the end 94 105 jn = 31 95 DO WHILE ( 1 /= 2 ) 96 READ(inum,*,END=100) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 97 IF ( lwp) THEN 98 WRITE(numout,'(f7.2, 4f8.2)' ) & 99 & zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 100 ENDIF 101 jn = jn + 1 106 DO 107 READ(inum,*, IOSTAT=io) zyy, p_cfc(jn,1,1), p_cfc(jn,1,2), p_cfc(jn,2,1), p_cfc(jn,2,2) 108 IF( io < 0 ) exit 109 jn = jn + 1 102 110 END DO 103 100 npyear = jn - 1104 IF ( lwp) WRITE(numout,*) ' ', npyear ,' years read'105 111 106 112 p_cfc(32,1:2,1) = 5.e-4 ! modify the values of the first years … … 116 122 WRITE(numout,*) 117 123 WRITE(numout,*) ' Year p11HN p11HS p12HN p12HS ' 118 DO jn = 30, 100124 DO jn = 30, jpyear 119 125 WRITE(numout, '( 1I4, 4F9.2)') jn, p_cfc(jn,1,1), p_cfc(jn,2,1), p_cfc(jn,1,2), p_cfc(jn,2,2) 120 126 END DO
Note: See TracChangeset
for help on using the changeset viewer.