[2630] | 1 | SUBROUTINE condsurfc(jour,lmt_bcff,lmt_bcbb, |
---|
| 2 | . lmt_bcbbl,lmt_bcbbh,lmt_bc_penner, |
---|
| 3 | . lmt_omff,lmt_ombb,lmt_ombbl,lmt_ombbh, |
---|
| 4 | . lmt_omnat) |
---|
| 5 | USE dimphy |
---|
| 6 | IMPLICIT none |
---|
| 7 | ! |
---|
| 8 | ! Lire les conditions aux limites du modele pour la chimie. |
---|
| 9 | ! -------------------------------------------------------- |
---|
| 10 | ! |
---|
| 11 | #include "dimensions.h" |
---|
| 12 | #include "netcdf.inc" |
---|
| 13 | REAL lmt_bcff(klon), lmt_bcbb(klon),lmt_bc_penner(klon) |
---|
| 14 | REAL lmt_omff(klon), lmt_ombb(klon) |
---|
| 15 | REAL lmt_bcbbl(klon), lmt_bcbbh(klon) |
---|
| 16 | REAL lmt_ombbl(klon), lmt_ombbh(klon) |
---|
| 17 | REAL lmt_omnat(klon) |
---|
| 18 | REAL lmt_terp(klon) |
---|
| 19 | ! |
---|
| 20 | INTEGER jour, i |
---|
| 21 | INTEGER ierr |
---|
| 22 | INTEGER nid1,nvarid |
---|
| 23 | INTEGER debut(2),epais(2) |
---|
| 24 | ! |
---|
| 25 | IF (jour.LT.0 .OR. jour.GT.(360-1)) THEN |
---|
| 26 | IF (jour.GT.(360-1).AND.jour.LE.367) THEN |
---|
| 27 | jour=360-1 |
---|
| 28 | print *,'JE: jour changed to jour= ',jour |
---|
| 29 | ELSE |
---|
| 30 | PRINT*,'Le jour demande n est pas correcte:', jour |
---|
| 31 | CALL ABORT |
---|
| 32 | ENDIF |
---|
| 33 | ENDIF |
---|
| 34 | ! |
---|
| 35 | ierr = NF_OPEN ("limitcarbon.nc", NF_NOWRITE, nid1) |
---|
| 36 | if (ierr.ne.NF_NOERR) then |
---|
| 37 | write(6,*)' Pb d''ouverture du fichier limitbc.nc' |
---|
| 38 | write(6,*)' ierr = ', ierr |
---|
| 39 | call exit(1) |
---|
| 40 | endif |
---|
| 41 | ! |
---|
| 42 | ! Tranche a lire: |
---|
| 43 | debut(1) = 1 |
---|
| 44 | debut(2) = jour+1 |
---|
| 45 | epais(1) = klon |
---|
| 46 | epais(2) = 1 |
---|
| 47 | ! |
---|
| 48 | ! |
---|
| 49 | ierr = NF_INQ_VARID (nid1, "BCFF", nvarid) |
---|
| 50 | !nhl #ifdef NC_DOUBLE |
---|
| 51 | ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcff) |
---|
| 52 | ! print *,'IERR = ',ierr |
---|
| 53 | ! print *,'NF_NOERR = ',NF_NOERR |
---|
| 54 | ! print *,'debut = ',debut |
---|
| 55 | ! print *,'epais = ',epais |
---|
| 56 | !nhl #else |
---|
| 57 | !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcff) |
---|
| 58 | !nhl #endif |
---|
| 59 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 60 | PRINT*, 'Pb de lecture pour les sources BC' |
---|
| 61 | CALL exit(1) |
---|
| 62 | ENDIF |
---|
| 63 | ! |
---|
| 64 | ! |
---|
| 65 | ierr = NF_INQ_VARID (nid1, "BCBB", nvarid) |
---|
| 66 | !nhl #ifdef NC_DOUBLE |
---|
| 67 | ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcbb) |
---|
| 68 | !nhl #else |
---|
| 69 | !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcbb) |
---|
| 70 | !nhl #endif |
---|
| 71 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 72 | PRINT*, 'Pb de lecture pour les sources BC-biomass' |
---|
| 73 | CALL exit(1) |
---|
| 74 | ENDIF |
---|
| 75 | ! |
---|
| 76 | ! |
---|
| 77 | ierr = NF_INQ_VARID (nid1, "BCBL", nvarid) |
---|
| 78 | !nhl #ifdef NC_DOUBLE |
---|
| 79 | ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcbbl) |
---|
| 80 | !nhl #else |
---|
| 81 | !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcbbl) |
---|
| 82 | !nhl #endif |
---|
| 83 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 84 | PRINT*, 'Pb de lecture pour les sources BC low' |
---|
| 85 | CALL exit(1) |
---|
| 86 | ENDIF |
---|
| 87 | ! |
---|
| 88 | ! |
---|
| 89 | ierr = NF_INQ_VARID (nid1, "BCBH", nvarid) |
---|
| 90 | !nhl #ifdef NC_DOUBLE |
---|
| 91 | ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_bcbbh) |
---|
| 92 | !nhl #else |
---|
| 93 | !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_bcbbh) |
---|
| 94 | !nhl #endif |
---|
| 95 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 96 | PRINT*, 'Pb de lecture pour les sources BC high' |
---|
| 97 | CALL exit(1) |
---|
| 98 | ENDIF |
---|
| 99 | ! |
---|
| 100 | ierr = NF_INQ_VARID (nid1, "TERP", nvarid) |
---|
| 101 | !nhl #ifdef NC_DOUBLE |
---|
| 102 | ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_terp) |
---|
| 103 | !nhl #else |
---|
| 104 | !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_terp) |
---|
| 105 | !nhl #endif |
---|
| 106 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 107 | PRINT*, 'Pb de lecture pour les sources Terpene' |
---|
| 108 | CALL exit(1) |
---|
| 109 | ENDIF |
---|
| 110 | ! |
---|
| 111 | ! |
---|
| 112 | ierr = NF_INQ_VARID (nid1, "BC_penner", nvarid) |
---|
| 113 | !nhl #ifdef NC_DOUBLE |
---|
| 114 | ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, |
---|
| 115 | . epais, lmt_bc_penner) |
---|
| 116 | !nhl #else |
---|
| 117 | !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, |
---|
| 118 | !nhl . lmt_bc_penner) |
---|
| 119 | !nhl #endif |
---|
| 120 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 121 | PRINT*, 'Pb de lecture pour les sources BC Penner' |
---|
| 122 | CALL exit(1) |
---|
| 123 | ENDIF |
---|
| 124 | ! |
---|
| 125 | ! |
---|
| 126 | ierr = NF_INQ_VARID (nid1, "OMFF", nvarid) |
---|
| 127 | !nhl #ifdef NC_DOUBLE |
---|
| 128 | ierr = NF_GET_VARA_DOUBLE (nid1, nvarid, debut, epais, lmt_omff) |
---|
| 129 | !nhl #else |
---|
| 130 | !nhl ierr = NF_GET_VARA_REAL (nid1, nvarid, debut, epais, lmt_omff) |
---|
| 131 | !nhl #endif |
---|
| 132 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 133 | PRINT*, 'Pb de lecture pour les sources om-ifossil' |
---|
| 134 | CALL exit(1) |
---|
| 135 | ENDIF |
---|
| 136 | ! |
---|
| 137 | DO i=1,klon |
---|
| 138 | lmt_ombb(i) = lmt_bcbb(i)*7.0*1.6 !OC/BC=7.0;OM/OC=1.6 |
---|
| 139 | lmt_ombbl(i) = lmt_bcbbl(i)*7.0*1.6 |
---|
| 140 | lmt_ombbh(i) = lmt_bcbbh(i)*7.0*1.6 |
---|
| 141 | lmt_omff(i) = lmt_omff(i)*1.4 !--OM/OC=1.4 |
---|
| 142 | lmt_omnat(i) = lmt_terp(i)*0.11*1.4 !-- 11% Terpene is OC |
---|
| 143 | ENDDO |
---|
| 144 | ! |
---|
| 145 | ierr = NF_CLOSE(nid1) |
---|
| 146 | PRINT*, 'Carbon sources lues pour jour: ', jour |
---|
| 147 | ! |
---|
| 148 | RETURN |
---|
| 149 | END |
---|