[5246] | 1 | SUBROUTINE condsurfs(jour, edgar, flag_dms, & |
---|
| 2 | lmt_so2h, lmt_so2b, lmt_so2bb, lmt_so2ba, & |
---|
| 3 | lmt_so2volc, lmt_altvolc, & |
---|
| 4 | lmt_dmsbio, lmt_h2sbio, lmt_dms, lmt_dmsconc) |
---|
| 5 | USE dimphy |
---|
[5270] | 6 | USE netcdf, ONLY: nf90_close, nf90_noerr, nf90_inq_varid, nf90_open, & |
---|
| 7 | nf90_nowrite, nf90_get_var |
---|
[5271] | 8 | IMPLICIT none |
---|
[5246] | 9 | ! |
---|
| 10 | ! Lire les conditions aux limites du modele pour la chimie. |
---|
| 11 | ! -------------------------------------------------------- |
---|
| 12 | ! |
---|
[5271] | 13 | |
---|
[5246] | 14 | ! |
---|
| 15 | REAL :: lmt_so2h(klon), lmt_so2b(klon), lmt_so2bb(klon) |
---|
| 16 | REAL :: lmt_dmsbio(klon), lmt_h2sbio(klon), lmt_so2ba(klon) |
---|
| 17 | REAL :: lmt_so2volc(klon), lmt_altvolc(klon) |
---|
| 18 | REAL :: lmt_dms(klon), lmt_dmsconc(klon) |
---|
| 19 | LOGICAL :: edgar |
---|
| 20 | INTEGER :: flag_dms |
---|
| 21 | ! |
---|
| 22 | INTEGER :: jour, i |
---|
| 23 | INTEGER :: ierr |
---|
| 24 | INTEGER :: nid,nvarid |
---|
| 25 | INTEGER :: debut(2),epais(2) |
---|
| 26 | ! |
---|
| 27 | IF (jour.LT.0 .OR. jour.GT.(360-1)) THEN |
---|
| 28 | IF ((jour.GT.(360-1)) .AND. (jour.LE.367)) THEN |
---|
| 29 | jour=360-1 |
---|
| 30 | print *,'JE: jour changed to jour= ',jour |
---|
| 31 | ELSE |
---|
| 32 | PRINT*,'Le jour demande n est pas correcte:', jour |
---|
| 33 | CALL ABORT |
---|
| 34 | ENDIF |
---|
| 35 | ENDIF |
---|
| 36 | ! |
---|
[5270] | 37 | ierr = nf90_open ("limitsoufre.nc", nf90_nowrite, nid) |
---|
| 38 | if (ierr.ne.nf90_noerr) then |
---|
[5246] | 39 | write(6,*)' Pb d''ouverture du fichier limitsoufre.nc' |
---|
| 40 | write(6,*)' ierr = ', ierr |
---|
| 41 | call exit(1) |
---|
| 42 | endif |
---|
| 43 | ! |
---|
| 44 | ! Tranche a lire: |
---|
| 45 | debut(1) = 1 |
---|
| 46 | debut(2) = jour+1 |
---|
| 47 | epais(1) = klon |
---|
| 48 | epais(2) = 1 |
---|
| 49 | ! |
---|
[5270] | 50 | ierr = nf90_inq_varid(nid, "VOLC", nvarid) |
---|
[5246] | 51 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 52 | ierr = nf90_get_var(nid, nvarid, lmt_so2volc, debut, epais) |
---|
[5246] | 53 | !nhl #else |
---|
[5270] | 54 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2volc, debut, epais) |
---|
[5246] | 55 | !nhl #endif |
---|
[5270] | 56 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 57 | PRINT*, 'Pb de lecture pour les sources so2 volcan' |
---|
| 58 | CALL exit(1) |
---|
| 59 | ENDIF |
---|
| 60 | ! |
---|
[5270] | 61 | ierr = nf90_inq_varid(nid, "ALTI", nvarid) |
---|
[5246] | 62 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 63 | ierr = nf90_get_var(nid, nvarid, lmt_altvolc, debut, epais) |
---|
[5246] | 64 | !nhl #else |
---|
[5270] | 65 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_altvolc, debut, epais) |
---|
[5246] | 66 | !nhl #endif |
---|
[5270] | 67 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 68 | PRINT*, 'Pb de lecture pour les altitudes volcan' |
---|
| 69 | CALL exit(1) |
---|
| 70 | ENDIF |
---|
| 71 | ! |
---|
| 72 | IF (edgar) THEN !--EDGAR w/o ship and biomass burning |
---|
| 73 | ! |
---|
[5270] | 74 | ierr = nf90_inq_varid(nid, "SO2ED95L", nvarid) |
---|
[5246] | 75 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 76 | ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) |
---|
[5246] | 77 | !nhl #else |
---|
[5270] | 78 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) |
---|
[5246] | 79 | !nhl #endif |
---|
[5270] | 80 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 81 | PRINT*, 'Pb de lecture pour les sources so2 edgar low' |
---|
| 82 | CALL exit(1) |
---|
| 83 | ENDIF |
---|
| 84 | ! |
---|
[5270] | 85 | ierr = nf90_inq_varid(nid, "SO2ED95H", nvarid) |
---|
[5246] | 86 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 87 | ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) |
---|
[5246] | 88 | !nhl #else |
---|
[5270] | 89 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) |
---|
[5246] | 90 | !nhl #endif |
---|
[5270] | 91 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 92 | PRINT*, 'Pb de lecture pour les sources so2 edgar high' |
---|
| 93 | CALL exit(1) |
---|
| 94 | ENDIF |
---|
| 95 | ! |
---|
| 96 | ELSE !--GEIA |
---|
| 97 | ! |
---|
[5270] | 98 | ierr = nf90_inq_varid(nid, "SO2H", nvarid) |
---|
[5246] | 99 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 100 | ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) |
---|
[5246] | 101 | !nhl #else |
---|
[5270] | 102 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais) |
---|
[5246] | 103 | !nhl #endif |
---|
[5270] | 104 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 105 | PRINT*, 'Pb de lecture pour les sources so2 haut' |
---|
| 106 | CALL exit(1) |
---|
| 107 | ENDIF |
---|
| 108 | ! |
---|
[5270] | 109 | ierr = nf90_inq_varid(nid, "SO2B", nvarid) |
---|
[5246] | 110 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 111 | ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) |
---|
[5246] | 112 | !nhl #else |
---|
[5270] | 113 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais) |
---|
[5246] | 114 | !nhl #endif |
---|
[5270] | 115 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 116 | PRINT*, 'Pb de lecture pour les sources so2 bas' |
---|
| 117 | CALL exit(1) |
---|
| 118 | ENDIF |
---|
| 119 | ! |
---|
| 120 | ENDIF !--edgar |
---|
| 121 | ! |
---|
[5270] | 122 | ierr = nf90_inq_varid(nid, "SO2BB", nvarid) |
---|
[5246] | 123 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 124 | ierr = nf90_get_var(nid, nvarid, lmt_so2bb, debut, epais) |
---|
[5246] | 125 | !nhl #else |
---|
[5270] | 126 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2bb, debut, epais) |
---|
[5246] | 127 | !nhl #endif |
---|
[5270] | 128 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 129 | PRINT*, 'Pb de lecture pour les sources so2 bb' |
---|
| 130 | CALL exit(1) |
---|
| 131 | ENDIF |
---|
| 132 | ! |
---|
[5270] | 133 | ierr = nf90_inq_varid(nid, "SO2BA", nvarid) |
---|
[5246] | 134 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 135 | ierr = nf90_get_var(nid, nvarid, lmt_so2ba, debut, epais) |
---|
[5246] | 136 | !nhl #else |
---|
[5270] | 137 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_so2ba, debut, epais) |
---|
[5246] | 138 | !nhl #endif |
---|
[5270] | 139 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 140 | PRINT*, 'Pb de lecture pour les sources so2 bateau' |
---|
| 141 | CALL exit(1) |
---|
| 142 | ENDIF |
---|
| 143 | ! |
---|
[5270] | 144 | ierr = nf90_inq_varid(nid, "DMSB", nvarid) |
---|
[5246] | 145 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 146 | ierr = nf90_get_var(nid, nvarid, lmt_dmsbio, debut, epais) |
---|
[5246] | 147 | !nhl #else |
---|
[5270] | 148 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsbio, debut, epais) |
---|
[5246] | 149 | !nhl #endif |
---|
[5270] | 150 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 151 | PRINT*, 'Pb de lecture pour les sources dms bio' |
---|
| 152 | CALL exit(1) |
---|
| 153 | ENDIF |
---|
| 154 | ! |
---|
[5270] | 155 | ierr = nf90_inq_varid(nid, "H2SB", nvarid) |
---|
[5246] | 156 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 157 | ierr = nf90_get_var(nid, nvarid, lmt_h2sbio, debut, epais) |
---|
[5246] | 158 | !nhl #else |
---|
[5270] | 159 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_h2sbio, debut, epais) |
---|
[5246] | 160 | !nhl #endif |
---|
[5270] | 161 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 162 | PRINT*, 'Pb de lecture pour les sources h2s bio' |
---|
| 163 | CALL exit(1) |
---|
| 164 | ENDIF |
---|
| 165 | ! |
---|
| 166 | IF (flag_dms.EQ.1) THEN |
---|
| 167 | ! |
---|
[5270] | 168 | ierr = nf90_inq_varid(nid, "DMSL", nvarid) |
---|
[5246] | 169 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 170 | ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) |
---|
[5246] | 171 | !nhl #else |
---|
[5270] | 172 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) |
---|
[5246] | 173 | !nhl #endif |
---|
[5270] | 174 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 175 | PRINT*, 'Pb de lecture pour les sources dms liss' |
---|
| 176 | CALL exit(1) |
---|
| 177 | ENDIF |
---|
| 178 | ! |
---|
| 179 | ELSEIF (flag_dms.EQ.2) THEN |
---|
| 180 | ! |
---|
[5270] | 181 | ierr = nf90_inq_varid(nid, "DMSW", nvarid) |
---|
[5246] | 182 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 183 | ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) |
---|
[5246] | 184 | !nhl #else |
---|
[5270] | 185 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais) |
---|
[5246] | 186 | !nhl #endif |
---|
[5270] | 187 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 188 | PRINT*, 'Pb de lecture pour les sources dms wann' |
---|
| 189 | CALL exit(1) |
---|
| 190 | ENDIF |
---|
| 191 | ! |
---|
| 192 | ELSEIF (flag_dms.EQ.3) THEN |
---|
| 193 | ! |
---|
[5270] | 194 | ierr = nf90_inq_varid(nid, "DMSC1", nvarid) |
---|
[5246] | 195 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 196 | ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) |
---|
[5246] | 197 | !nhl #else |
---|
[5270] | 198 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) |
---|
[5246] | 199 | !nhl #endif |
---|
[5270] | 200 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 201 | PRINT*, 'Pb de lecture pour les sources dmsconc old' |
---|
| 202 | CALL exit(1) |
---|
| 203 | ENDIF |
---|
| 204 | ! |
---|
| 205 | ELSEIF (flag_dms.EQ.4) THEN |
---|
| 206 | ! |
---|
[5270] | 207 | ierr = nf90_inq_varid(nid, "DMSC2", nvarid) |
---|
[5246] | 208 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 209 | ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) |
---|
[5246] | 210 | !nhl #else |
---|
[5270] | 211 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) |
---|
[5246] | 212 | !nhl #endif |
---|
[5270] | 213 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 214 | PRINT*, 'Pb de lecture pour les sources dms conc 2' |
---|
| 215 | CALL exit(1) |
---|
| 216 | ENDIF |
---|
| 217 | ! |
---|
| 218 | ELSEIF (flag_dms.EQ.5) THEN |
---|
| 219 | ! |
---|
[5270] | 220 | ierr = nf90_inq_varid(nid, "DMSC3", nvarid) |
---|
[5246] | 221 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 222 | ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) |
---|
[5246] | 223 | !nhl #else |
---|
[5270] | 224 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) |
---|
[5246] | 225 | !nhl #endif |
---|
[5270] | 226 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 227 | PRINT*, 'Pb de lecture pour les sources dms conc 3' |
---|
| 228 | CALL exit(1) |
---|
| 229 | ENDIF |
---|
| 230 | ! |
---|
| 231 | ELSEIF (flag_dms.EQ.6) THEN |
---|
| 232 | ! |
---|
[5270] | 233 | ierr = nf90_inq_varid(nid, "DMSC4", nvarid) |
---|
[5246] | 234 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 235 | ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) |
---|
[5246] | 236 | !nhl #else |
---|
[5270] | 237 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) |
---|
[5246] | 238 | !nhl #endif |
---|
[5270] | 239 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 240 | PRINT*, 'Pb de lecture pour les sources dms conc 4' |
---|
| 241 | CALL exit(1) |
---|
| 242 | ENDIF |
---|
| 243 | ! |
---|
| 244 | ELSEIF (flag_dms.EQ.7) THEN |
---|
| 245 | ! |
---|
[5270] | 246 | ierr = nf90_inq_varid(nid, "DMSC5", nvarid) |
---|
[5246] | 247 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 248 | ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) |
---|
[5246] | 249 | !nhl #else |
---|
[5270] | 250 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) |
---|
[5246] | 251 | !nhl #endif |
---|
[5270] | 252 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 253 | PRINT*, 'Pb de lecture pour les sources dms conc 5' |
---|
| 254 | CALL exit(1) |
---|
| 255 | ENDIF |
---|
| 256 | ! |
---|
| 257 | ELSEIF (flag_dms.EQ.8) THEN |
---|
| 258 | ! |
---|
[5270] | 259 | ierr = nf90_inq_varid(nid, "DMSC6", nvarid) |
---|
[5246] | 260 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 261 | ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) |
---|
[5246] | 262 | !nhl #else |
---|
[5270] | 263 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) |
---|
[5246] | 264 | !nhl #endif |
---|
[5270] | 265 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 266 | PRINT*, 'Pb de lecture pour les sources dms conc 6' |
---|
| 267 | CALL exit(1) |
---|
| 268 | ENDIF |
---|
| 269 | ! |
---|
| 270 | ELSEIF (flag_dms.EQ.9) THEN |
---|
| 271 | ! |
---|
[5270] | 272 | ierr = nf90_inq_varid(nid, "DMSC7", nvarid) |
---|
[5246] | 273 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 274 | ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) |
---|
[5246] | 275 | !nhl #else |
---|
[5270] | 276 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) |
---|
[5246] | 277 | !nhl #endif |
---|
[5270] | 278 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 279 | PRINT*, 'Pb de lecture pour les sources dms conc 7' |
---|
| 280 | CALL exit(1) |
---|
| 281 | ENDIF |
---|
| 282 | ! |
---|
| 283 | ELSEIF (flag_dms.EQ.10) THEN |
---|
| 284 | ! |
---|
[5270] | 285 | ierr = nf90_inq_varid(nid, "DMSC8", nvarid) |
---|
[5246] | 286 | !nhl #ifdef NC_DOUBLE |
---|
[5270] | 287 | ierr = nf90_get_var(nid, nvarid,lmt_dmsconc, debut,epais) |
---|
[5246] | 288 | !nhl #else |
---|
[5270] | 289 | !nhl ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais) |
---|
[5246] | 290 | !nhl #endif |
---|
[5270] | 291 | IF (ierr .NE. nf90_noerr) THEN |
---|
[5246] | 292 | PRINT*, 'Pb de lecture pour les sources dms conc 8' |
---|
| 293 | CALL exit(1) |
---|
| 294 | ENDIF |
---|
| 295 | ! |
---|
| 296 | ELSE |
---|
| 297 | ! |
---|
| 298 | PRINT *,'choix non possible pour flag_dms' |
---|
| 299 | STOP |
---|
| 300 | ! |
---|
| 301 | ENDIF |
---|
| 302 | ! |
---|
[5270] | 303 | ierr = nf90_close(nid) |
---|
[5246] | 304 | ! |
---|
| 305 | IF (flag_dms.LE.2) THEN |
---|
| 306 | DO i=1, klon |
---|
| 307 | lmt_dmsconc(i)=0.0 |
---|
| 308 | ENDDO |
---|
| 309 | ELSE |
---|
| 310 | DO i=1, klon |
---|
| 311 | lmt_dms(i)=0.0 |
---|
| 312 | ENDDO |
---|
| 313 | ENDIF |
---|
| 314 | ! |
---|
| 315 | PRINT*, 'Sources SOUFRE lues pour jour: ', jour |
---|
| 316 | ! |
---|
| 317 | RETURN |
---|
| 318 | END SUBROUTINE condsurfs |
---|