[524] | 1 | ! |
---|
[1403] | 2 | ! $Id $ |
---|
[524] | 3 | ! |
---|
[1146] | 4 | SUBROUTINE dynetat0(fichnom,vcov,ucov, |
---|
[524] | 5 | . teta,q,masse,ps,phis,time) |
---|
[1146] | 6 | |
---|
| 7 | USE infotrac |
---|
[1669] | 8 | use netcdf, only: nf90_get_var |
---|
| 9 | |
---|
| 10 | use control_mod, only : planet_type |
---|
| 11 | |
---|
[524] | 12 | IMPLICIT NONE |
---|
| 13 | |
---|
| 14 | c======================================================================= |
---|
| 15 | c |
---|
| 16 | c Auteur: P. Le Van / L.Fairhead |
---|
| 17 | c ------- |
---|
| 18 | c |
---|
| 19 | c objet: |
---|
| 20 | c ------ |
---|
| 21 | c |
---|
| 22 | c Lecture de l'etat initial |
---|
| 23 | c |
---|
| 24 | c======================================================================= |
---|
| 25 | c----------------------------------------------------------------------- |
---|
| 26 | c Declarations: |
---|
| 27 | c ------------- |
---|
| 28 | |
---|
| 29 | #include "dimensions.h" |
---|
| 30 | #include "paramet.h" |
---|
| 31 | #include "temps.h" |
---|
| 32 | #include "comconst.h" |
---|
| 33 | #include "comvert.h" |
---|
[1669] | 34 | #include "comgeom2.h" |
---|
[524] | 35 | #include "ener.h" |
---|
| 36 | #include "netcdf.inc" |
---|
| 37 | #include "description.h" |
---|
| 38 | #include "serre.h" |
---|
| 39 | #include "logic.h" |
---|
[1403] | 40 | #include "iniprint.h" |
---|
[524] | 41 | |
---|
| 42 | c Arguments: |
---|
| 43 | c ---------- |
---|
| 44 | |
---|
| 45 | CHARACTER*(*) fichnom |
---|
[1669] | 46 | REAL vcov(iip1, jjm,llm),ucov(iip1, jjp1,llm),teta(iip1, jjp1,llm) |
---|
| 47 | REAL q(iip1,jjp1,llm,nqtot),masse(iip1, jjp1,llm) |
---|
| 48 | REAL ps(iip1, jjp1),phis(iip1, jjp1) |
---|
[524] | 49 | |
---|
| 50 | REAL time |
---|
| 51 | |
---|
| 52 | c Variables |
---|
| 53 | c |
---|
| 54 | INTEGER length,iq |
---|
| 55 | PARAMETER (length = 100) |
---|
| 56 | REAL tab_cntrl(length) ! tableau des parametres du run |
---|
| 57 | INTEGER ierr, nid, nvarid |
---|
| 58 | |
---|
[1669] | 59 | INTEGER idecal |
---|
| 60 | |
---|
[524] | 61 | c----------------------------------------------------------------------- |
---|
| 62 | |
---|
| 63 | c Ouverture NetCDF du fichier etat initial |
---|
| 64 | |
---|
| 65 | ierr = NF_OPEN (fichnom, NF_NOWRITE,nid) |
---|
| 66 | IF (ierr.NE.NF_NOERR) THEN |
---|
[1403] | 67 | write(lunout,*)'dynetat0: Pb d''ouverture du fichier start.nc' |
---|
| 68 | write(lunout,*)' ierr = ', ierr |
---|
[524] | 69 | CALL ABORT |
---|
| 70 | ENDIF |
---|
| 71 | |
---|
| 72 | c |
---|
| 73 | ierr = NF_INQ_VARID (nid, "controle", nvarid) |
---|
| 74 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 75 | write(lunout,*)"dynetat0: Le champ <controle> est absent" |
---|
[524] | 76 | CALL abort |
---|
| 77 | ENDIF |
---|
[1669] | 78 | ierr = nf90_get_var(nid, nvarid, tab_cntrl) |
---|
[524] | 79 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 80 | write(lunout,*)"dynetat0: Lecture echoue pour <controle>" |
---|
[524] | 81 | CALL abort |
---|
| 82 | ENDIF |
---|
| 83 | |
---|
[1669] | 84 | !!! AS: idecal is a hack to be able to read planeto starts... |
---|
| 85 | !!! .... while keeping everything OK for LMDZ EARTH |
---|
| 86 | if (planet_type.eq."generic") then |
---|
| 87 | print*,'NOTE NOTE NOTE : Planeto-like start files' |
---|
| 88 | idecal = 4 |
---|
| 89 | annee_ref = 2000 |
---|
| 90 | else |
---|
| 91 | print*,'NOTE NOTE NOTE : Earth-like start files' |
---|
| 92 | idecal = 5 |
---|
| 93 | annee_ref = tab_cntrl(5) |
---|
| 94 | endif |
---|
| 95 | |
---|
| 96 | |
---|
[524] | 97 | im = tab_cntrl(1) |
---|
| 98 | jm = tab_cntrl(2) |
---|
| 99 | lllm = tab_cntrl(3) |
---|
| 100 | day_ref = tab_cntrl(4) |
---|
[1669] | 101 | rad = tab_cntrl(idecal+1) |
---|
| 102 | omeg = tab_cntrl(idecal+2) |
---|
| 103 | g = tab_cntrl(idecal+3) |
---|
| 104 | cpp = tab_cntrl(idecal+4) |
---|
| 105 | kappa = tab_cntrl(idecal+5) |
---|
| 106 | daysec = tab_cntrl(idecal+6) |
---|
| 107 | dtvr = tab_cntrl(idecal+7) |
---|
| 108 | etot0 = tab_cntrl(idecal+8) |
---|
| 109 | ptot0 = tab_cntrl(idecal+9) |
---|
| 110 | ztot0 = tab_cntrl(idecal+10) |
---|
| 111 | stot0 = tab_cntrl(idecal+11) |
---|
| 112 | ang0 = tab_cntrl(idecal+12) |
---|
| 113 | pa = tab_cntrl(idecal+13) |
---|
| 114 | preff = tab_cntrl(idecal+14) |
---|
[524] | 115 | c |
---|
[1669] | 116 | clon = tab_cntrl(idecal+15) |
---|
| 117 | clat = tab_cntrl(idecal+16) |
---|
| 118 | grossismx = tab_cntrl(idecal+17) |
---|
| 119 | grossismy = tab_cntrl(idecal+18) |
---|
[524] | 120 | c |
---|
[1669] | 121 | IF ( tab_cntrl(idecal+19).EQ.1. ) THEN |
---|
[524] | 122 | fxyhypb = . TRUE . |
---|
[541] | 123 | c dzoomx = tab_cntrl(25) |
---|
| 124 | c dzoomy = tab_cntrl(26) |
---|
| 125 | c taux = tab_cntrl(28) |
---|
| 126 | c tauy = tab_cntrl(29) |
---|
[524] | 127 | ELSE |
---|
| 128 | fxyhypb = . FALSE . |
---|
| 129 | ysinus = . FALSE . |
---|
[1669] | 130 | IF( tab_cntrl(idecal+22).EQ.1. ) ysinus = . TRUE. |
---|
[524] | 131 | ENDIF |
---|
| 132 | |
---|
| 133 | day_ini = tab_cntrl(30) |
---|
| 134 | itau_dyn = tab_cntrl(31) |
---|
[1665] | 135 | start_time = tab_cntrl(32) |
---|
[524] | 136 | c ................................................................. |
---|
| 137 | c |
---|
| 138 | c |
---|
[1403] | 139 | write(lunout,*)'dynetat0: rad,omeg,g,cpp,kappa', |
---|
| 140 | & rad,omeg,g,cpp,kappa |
---|
[524] | 141 | |
---|
| 142 | IF( im.ne.iim ) THEN |
---|
| 143 | PRINT 1,im,iim |
---|
| 144 | STOP |
---|
| 145 | ELSE IF( jm.ne.jjm ) THEN |
---|
| 146 | PRINT 2,jm,jjm |
---|
| 147 | STOP |
---|
| 148 | ELSE IF( lllm.ne.llm ) THEN |
---|
| 149 | PRINT 3,lllm,llm |
---|
| 150 | STOP |
---|
| 151 | ENDIF |
---|
| 152 | |
---|
| 153 | ierr = NF_INQ_VARID (nid, "rlonu", nvarid) |
---|
| 154 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 155 | write(lunout,*)"dynetat0: Le champ <rlonu> est absent" |
---|
[524] | 156 | CALL abort |
---|
| 157 | ENDIF |
---|
[1669] | 158 | ierr = nf90_get_var(nid, nvarid, rlonu) |
---|
[524] | 159 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 160 | write(lunout,*)"dynetat0: Lecture echouee pour <rlonu>" |
---|
[524] | 161 | CALL abort |
---|
| 162 | ENDIF |
---|
| 163 | |
---|
| 164 | ierr = NF_INQ_VARID (nid, "rlatu", nvarid) |
---|
| 165 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 166 | write(lunout,*)"dynetat0: Le champ <rlatu> est absent" |
---|
[524] | 167 | CALL abort |
---|
| 168 | ENDIF |
---|
[1669] | 169 | ierr = nf90_get_var(nid, nvarid, rlatu) |
---|
[524] | 170 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 171 | write(lunout,*)"dynetat0: Lecture echouee pour <rlatu>" |
---|
[524] | 172 | CALL abort |
---|
| 173 | ENDIF |
---|
| 174 | |
---|
| 175 | ierr = NF_INQ_VARID (nid, "rlonv", nvarid) |
---|
| 176 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 177 | write(lunout,*)"dynetat0: Le champ <rlonv> est absent" |
---|
[524] | 178 | CALL abort |
---|
| 179 | ENDIF |
---|
[1669] | 180 | ierr = nf90_get_var(nid, nvarid, rlonv) |
---|
[524] | 181 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 182 | write(lunout,*)"dynetat0: Lecture echouee pour <rlonv>" |
---|
[524] | 183 | CALL abort |
---|
| 184 | ENDIF |
---|
| 185 | |
---|
| 186 | ierr = NF_INQ_VARID (nid, "rlatv", nvarid) |
---|
| 187 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 188 | write(lunout,*)"dynetat0: Le champ <rlatv> est absent" |
---|
[524] | 189 | CALL abort |
---|
| 190 | ENDIF |
---|
[1669] | 191 | ierr = nf90_get_var(nid, nvarid, rlatv) |
---|
[524] | 192 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 193 | write(lunout,*)"dynetat0: Lecture echouee pour rlatv" |
---|
[524] | 194 | CALL abort |
---|
| 195 | ENDIF |
---|
| 196 | |
---|
| 197 | ierr = NF_INQ_VARID (nid, "cu", nvarid) |
---|
| 198 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 199 | write(lunout,*)"dynetat0: Le champ <cu> est absent" |
---|
[524] | 200 | CALL abort |
---|
| 201 | ENDIF |
---|
[1669] | 202 | ierr = nf90_get_var(nid, nvarid, cu) |
---|
[524] | 203 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 204 | write(lunout,*)"dynetat0: Lecture echouee pour <cu>" |
---|
[524] | 205 | CALL abort |
---|
| 206 | ENDIF |
---|
| 207 | |
---|
| 208 | ierr = NF_INQ_VARID (nid, "cv", nvarid) |
---|
| 209 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 210 | write(lunout,*)"dynetat0: Le champ <cv> est absent" |
---|
[524] | 211 | CALL abort |
---|
| 212 | ENDIF |
---|
[1669] | 213 | ierr = nf90_get_var(nid, nvarid, cv) |
---|
[524] | 214 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 215 | write(lunout,*)"dynetat0: Lecture echouee pour <cv>" |
---|
[524] | 216 | CALL abort |
---|
| 217 | ENDIF |
---|
| 218 | |
---|
| 219 | ierr = NF_INQ_VARID (nid, "aire", nvarid) |
---|
| 220 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 221 | write(lunout,*)"dynetat0: Le champ <aire> est absent" |
---|
[524] | 222 | CALL abort |
---|
| 223 | ENDIF |
---|
[1669] | 224 | ierr = nf90_get_var(nid, nvarid, aire) |
---|
[524] | 225 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 226 | write(lunout,*)"dynetat0: Lecture echouee pour <aire>" |
---|
[524] | 227 | CALL abort |
---|
| 228 | ENDIF |
---|
| 229 | |
---|
| 230 | ierr = NF_INQ_VARID (nid, "phisinit", nvarid) |
---|
| 231 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 232 | write(lunout,*)"dynetat0: Le champ <phisinit> est absent" |
---|
[524] | 233 | CALL abort |
---|
| 234 | ENDIF |
---|
[1669] | 235 | ierr = nf90_get_var(nid, nvarid, phis) |
---|
[524] | 236 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 237 | write(lunout,*)"dynetat0: Lecture echouee pour <phisinit>" |
---|
[524] | 238 | CALL abort |
---|
| 239 | ENDIF |
---|
| 240 | |
---|
| 241 | ierr = NF_INQ_VARID (nid, "temps", nvarid) |
---|
| 242 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 243 | write(lunout,*)"dynetat0: Le champ <temps> est absent" |
---|
[1669] | 244 | write(lunout,*)"dynetat0: J essaie <Time>" |
---|
| 245 | ierr = NF_INQ_VARID (nid, "Time", nvarid) |
---|
| 246 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 247 | write(lunout,*)"dynetat0: Le champ <Time> est absent" |
---|
| 248 | CALL abort |
---|
| 249 | ENDIF |
---|
[524] | 250 | ENDIF |
---|
[1669] | 251 | ierr = nf90_get_var(nid, nvarid, time) |
---|
[524] | 252 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 253 | write(lunout,*)"dynetat0: Lecture echouee <temps>" |
---|
[524] | 254 | CALL abort |
---|
| 255 | ENDIF |
---|
| 256 | |
---|
| 257 | ierr = NF_INQ_VARID (nid, "ucov", nvarid) |
---|
| 258 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 259 | write(lunout,*)"dynetat0: Le champ <ucov> est absent" |
---|
[524] | 260 | CALL abort |
---|
| 261 | ENDIF |
---|
[1669] | 262 | ierr = nf90_get_var(nid, nvarid, ucov) |
---|
[524] | 263 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 264 | write(lunout,*)"dynetat0: Lecture echouee pour <ucov>" |
---|
[524] | 265 | CALL abort |
---|
| 266 | ENDIF |
---|
| 267 | |
---|
| 268 | ierr = NF_INQ_VARID (nid, "vcov", nvarid) |
---|
| 269 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 270 | write(lunout,*)"dynetat0: Le champ <vcov> est absent" |
---|
[524] | 271 | CALL abort |
---|
| 272 | ENDIF |
---|
[1669] | 273 | ierr = nf90_get_var(nid, nvarid, vcov) |
---|
[524] | 274 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 275 | write(lunout,*)"dynetat0: Lecture echouee pour <vcov>" |
---|
[524] | 276 | CALL abort |
---|
| 277 | ENDIF |
---|
| 278 | |
---|
| 279 | ierr = NF_INQ_VARID (nid, "teta", nvarid) |
---|
| 280 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 281 | write(lunout,*)"dynetat0: Le champ <teta> est absent" |
---|
[524] | 282 | CALL abort |
---|
| 283 | ENDIF |
---|
[1669] | 284 | ierr = nf90_get_var(nid, nvarid, teta) |
---|
[524] | 285 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 286 | write(lunout,*)"dynetat0: Lecture echouee pour <teta>" |
---|
[524] | 287 | CALL abort |
---|
| 288 | ENDIF |
---|
| 289 | |
---|
| 290 | |
---|
[1146] | 291 | IF(nqtot.GE.1) THEN |
---|
| 292 | DO iq=1,nqtot |
---|
[524] | 293 | ierr = NF_INQ_VARID (nid, tname(iq), nvarid) |
---|
| 294 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1421] | 295 | write(lunout,*)"dynetat0: Le traceur <"//trim(tname(iq))// |
---|
[1403] | 296 | & "> est absent" |
---|
| 297 | write(lunout,*)" Il est donc initialise a zero" |
---|
[1669] | 298 | q(:,:,:,iq)=0. |
---|
[524] | 299 | ELSE |
---|
[1669] | 300 | ierr = NF90_GET_VAR(nid, nvarid, q(:,:,:,iq)) |
---|
[524] | 301 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 302 | write(lunout,*)"dynetat0: Lecture echouee pour "//tname(iq) |
---|
| 303 | CALL abort |
---|
[524] | 304 | ENDIF |
---|
| 305 | ENDIF |
---|
| 306 | ENDDO |
---|
| 307 | ENDIF |
---|
| 308 | |
---|
| 309 | ierr = NF_INQ_VARID (nid, "masse", nvarid) |
---|
| 310 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 311 | write(lunout,*)"dynetat0: Le champ <masse> est absent" |
---|
[524] | 312 | CALL abort |
---|
| 313 | ENDIF |
---|
[1669] | 314 | ierr = nf90_get_var(nid, nvarid, masse) |
---|
[524] | 315 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 316 | write(lunout,*)"dynetat0: Lecture echouee pour <masse>" |
---|
[524] | 317 | CALL abort |
---|
| 318 | ENDIF |
---|
| 319 | |
---|
| 320 | ierr = NF_INQ_VARID (nid, "ps", nvarid) |
---|
| 321 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 322 | write(lunout,*)"dynetat0: Le champ <ps> est absent" |
---|
[524] | 323 | CALL abort |
---|
| 324 | ENDIF |
---|
[1669] | 325 | ierr = nf90_get_var(nid, nvarid, ps) |
---|
[524] | 326 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 327 | write(lunout,*)"dynetat0: Lecture echouee pour <ps>" |
---|
[524] | 328 | CALL abort |
---|
| 329 | ENDIF |
---|
| 330 | |
---|
| 331 | ierr = NF_CLOSE(nid) |
---|
| 332 | |
---|
| 333 | day_ini=day_ini+INT(time) |
---|
| 334 | time=time-INT(time) |
---|
| 335 | |
---|
| 336 | 1 FORMAT(//10x,'la valeur de im =',i4,2x,'lue sur le fichier de dem |
---|
| 337 | *arrage est differente de la valeur parametree iim =',i4//) |
---|
| 338 | 2 FORMAT(//10x,'la valeur de jm =',i4,2x,'lue sur le fichier de dem |
---|
| 339 | *arrage est differente de la valeur parametree jjm =',i4//) |
---|
| 340 | 3 FORMAT(//10x,'la valeur de lmax =',i4,2x,'lue sur le fichier dema |
---|
| 341 | *rrage est differente de la valeur parametree llm =',i4//) |
---|
| 342 | 4 FORMAT(//10x,'la valeur de dtrv =',i4,2x,'lue sur le fichier dema |
---|
| 343 | *rrage est differente de la valeur dtinteg =',i4//) |
---|
| 344 | |
---|
| 345 | RETURN |
---|
| 346 | END |
---|