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