Changeset 638
- Timestamp:
- May 19, 2005, 10:25:08 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/branches/IPSL-CM4_IPCC_branch/libf/phylmd/readsulfate.F
r524 r638 51 51 c ---------------- 52 52 INTEGER i, ig, k, it 53 INTEGER j, iday, ny, iyr 53 INTEGER j, iday, ny, iyr, iyr1, iyr2 54 54 parameter (ny=jjm+1) 55 55 56 56 INTEGER ismaller 57 INTEGER idec1, idec2 ! The two decadal data read ini57 CJLD INTEGER idec1, idec2 ! The two decadal data read ini 58 58 CHARACTER*4 cyear 59 59 … … 103 103 ENDDO 104 104 105 ! Read in data: 105 106 IF (iyr .lt. 1850) THEN 107 cyear='.nat' 108 WRITE(*,*) 'getso4 iyr=', iyr,' ',cyear 109 CALL getso4fromfile(cyear, so4_1) 110 ELSE IF (iyr .ge. 2100) THEN 111 cyear='2100' 112 WRITE(*,*) 'getso4 iyr=', iyr,' ',cyear 113 CALL getso4fromfile(cyear, so4_1) 114 ELSE 115 116 ! Read in data: 106 117 ! a) from actual 10-yr-period 107 118 108 idec1 = (iyr-1900)/10 109 IF (idec1.LT.10) THEN 110 cyear='19'//char(idec1+48)//'0' 111 ELSE 112 cyear='20'//char(idec1-10+48)//'0' 119 IF (iyr.LT.1900) THEN 120 iyr1 = 1850 121 iyr2 = 1900 122 ELSE IF (iyr.ge.1900.and.iyr.lt.1920) THEN 123 iyr1 = 1900 124 iyr2 = 1920 125 ELSE 126 iyr1 = INT(iyr/10)*10 127 iyr2 = INT(1+iyr/10)*10 113 128 ENDIF 129 WRITE(cyear,'(I4)') iyr1 130 WRITE(*,*) 'getso4 iyr=', iyr,' ',cyear 114 131 CALL getso4fromfile(cyear, so4_1) 115 132 … … 117 134 ! If to read two decades: 118 135 IF (.NOT.lonlyone) THEN 119 idec2=idec1+1120 136 121 137 ! b) from the next following one 122 IF (idec2.LT.10) THEN123 cyear='19'//char(idec2+48)//'0'124 ELSE125 cyear='20'//char(idec2-10+48)//'0' 138 WRITE(cyear,'(I4)') iyr2 139 WRITE(*,*) 'getso4 iyr=', iyr,' ',cyear 140 CALL getso4fromfile(cyear, so4_2) 141 126 142 ENDIF 127 CALL getso4fromfile(cyear, so4_2) 128 143 129 144 ! Interpolate linarily to the actual year: 130 145 DO it=1,12 … … 133 148 DO i=1,iim 134 149 so4_1(i,j,k,it)=so4_1(i,j,k,it) 135 . - FLOAT(iyr- 1900-10*idec1)/10.150 . - FLOAT(iyr-iyr1)/FLOAT(iyr2-iyr1) 136 151 . * (so4_1(i,j,k,it) - so4_2(i,j,k,it)) 137 152 ENDDO … … 226 241 227 242 228 ! The sulfate concentration [molec cm-3] is read in. 229 ! Convert it into mass [ug SO4/m3] 230 ! masse_so4 in [g/mol], n_avogadro in [molec/mol] 243 CJLD ! The sulfate concentration [molec cm-3] is read in. 244 CJLD ! Convert it into mass [ug SO4/m3] 245 CJLD ! masse_so4 in [g/mol], n_avogadro in [molec/mol] 246 ! The sulfate mass [ug SO4/m3] is read in. 231 247 DO k=1,klev 232 248 DO i=1,klon 233 sulfate(i,k) = sulfate(i,k)*masse_so4234 . /n_avogadro*1.e+12249 CJLD sulfate(i,k) = sulfate(i,k)*masse_so4 250 CJLD . /n_avogadro*1.e+12 235 251 so4_out(i,k) = sulfate(i,k) 236 252 IF (so4_out(i,k).LT.0) … … 443 459 444 460 445 ! The sulfate concentration [molec cm-3] is read in.446 ! Convert it into mass [ug SO4/m3]447 ! masse_so4 in [g/mol], n_avogadro in [molec/mol]461 CJLD ! The sulfate concentration [molec cm-3] is read in. 462 CJLD ! Convert it into mass [ug SO4/m3] 463 CJLD ! masse_so4 in [g/mol], n_avogadro in [molec/mol] 448 464 DO k=1,klev 449 465 DO i=1,klon 450 pi_sulfate(i,k) = pi_sulfate(i,k)*masse_so4451 . /n_avogadro*1.e+12466 CJLD pi_sulfate(i,k) = pi_sulfate(i,k)*masse_so4 467 CJLD . /n_avogadro*1.e+12 452 468 pi_so4_out(i,k) = pi_sulfate(i,k) 453 469 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.