[630] | 1 | ! |
---|
[1403] | 2 | ! $Id $ |
---|
[630] | 3 | ! |
---|
[1146] | 4 | SUBROUTINE dynetat0(fichnom,vcov,ucov, |
---|
[630] | 5 | . teta,q,masse,ps,phis,time) |
---|
[1403] | 6 | |
---|
[1146] | 7 | USE infotrac |
---|
[1635] | 8 | use netcdf, only: nf90_get_var |
---|
[1654] | 9 | |
---|
| 10 | use control_mod, only : planet_type |
---|
| 11 | |
---|
[630] | 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" |
---|
[1635] | 34 | #include "comgeom2.h" |
---|
[630] | 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" |
---|
[630] | 41 | |
---|
| 42 | c Arguments: |
---|
| 43 | c ---------- |
---|
| 44 | |
---|
| 45 | CHARACTER*(*) fichnom |
---|
[1635] | 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) |
---|
[630] | 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 | |
---|
[1654] | 59 | INTEGER idecal |
---|
| 60 | |
---|
[630] | 61 | c----------------------------------------------------------------------- |
---|
[1403] | 62 | |
---|
[630] | 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 |
---|
[630] | 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" |
---|
[630] | 76 | CALL abort |
---|
| 77 | ENDIF |
---|
[1635] | 78 | ierr = nf90_get_var(nid, nvarid, tab_cntrl) |
---|
[630] | 79 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 80 | write(lunout,*)"dynetat0: Lecture echoue pour <controle>" |
---|
[630] | 81 | CALL abort |
---|
| 82 | ENDIF |
---|
| 83 | |
---|
[1654] | 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 | |
---|
[630] | 97 | im = tab_cntrl(1) |
---|
| 98 | jm = tab_cntrl(2) |
---|
| 99 | lllm = tab_cntrl(3) |
---|
| 100 | day_ref = tab_cntrl(4) |
---|
[1654] | 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) |
---|
[630] | 115 | c |
---|
[1654] | 116 | clon = tab_cntrl(idecal+15) |
---|
| 117 | clat = tab_cntrl(idecal+16) |
---|
| 118 | grossismx = tab_cntrl(idecal+17) |
---|
| 119 | grossismy = tab_cntrl(idecal+18) |
---|
[630] | 120 | c |
---|
[1654] | 121 | IF ( tab_cntrl(idecal+19).EQ.1. ) THEN |
---|
[630] | 122 | fxyhypb = . TRUE . |
---|
| 123 | c dzoomx = tab_cntrl(25) |
---|
| 124 | c dzoomy = tab_cntrl(26) |
---|
| 125 | c taux = tab_cntrl(28) |
---|
| 126 | c tauy = tab_cntrl(29) |
---|
| 127 | ELSE |
---|
| 128 | fxyhypb = . FALSE . |
---|
| 129 | ysinus = . FALSE . |
---|
[1654] | 130 | IF( tab_cntrl(idecal+22).EQ.1. ) ysinus = . TRUE. |
---|
[630] | 131 | ENDIF |
---|
| 132 | |
---|
| 133 | day_ini = tab_cntrl(30) |
---|
| 134 | itau_dyn = tab_cntrl(31) |
---|
[1577] | 135 | start_time = tab_cntrl(32) |
---|
[630] | 136 | c ................................................................. |
---|
| 137 | c |
---|
| 138 | c |
---|
[1403] | 139 | write(lunout,*)'dynetat0: rad,omeg,g,cpp,kappa', |
---|
| 140 | & rad,omeg,g,cpp,kappa |
---|
[630] | 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" |
---|
[630] | 156 | CALL abort |
---|
| 157 | ENDIF |
---|
[1635] | 158 | ierr = nf90_get_var(nid, nvarid, rlonu) |
---|
[630] | 159 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 160 | write(lunout,*)"dynetat0: Lecture echouee pour <rlonu>" |
---|
[630] | 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" |
---|
[630] | 167 | CALL abort |
---|
| 168 | ENDIF |
---|
[1635] | 169 | ierr = nf90_get_var(nid, nvarid, rlatu) |
---|
[630] | 170 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 171 | write(lunout,*)"dynetat0: Lecture echouee pour <rlatu>" |
---|
[630] | 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" |
---|
[630] | 178 | CALL abort |
---|
| 179 | ENDIF |
---|
[1635] | 180 | ierr = nf90_get_var(nid, nvarid, rlonv) |
---|
[630] | 181 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 182 | write(lunout,*)"dynetat0: Lecture echouee pour <rlonv>" |
---|
[630] | 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" |
---|
[630] | 189 | CALL abort |
---|
| 190 | ENDIF |
---|
[1635] | 191 | ierr = nf90_get_var(nid, nvarid, rlatv) |
---|
[630] | 192 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 193 | write(lunout,*)"dynetat0: Lecture echouee pour rlatv" |
---|
[630] | 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" |
---|
[630] | 200 | CALL abort |
---|
| 201 | ENDIF |
---|
[1635] | 202 | ierr = nf90_get_var(nid, nvarid, cu) |
---|
[630] | 203 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 204 | write(lunout,*)"dynetat0: Lecture echouee pour <cu>" |
---|
[630] | 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" |
---|
[630] | 211 | CALL abort |
---|
| 212 | ENDIF |
---|
[1635] | 213 | ierr = nf90_get_var(nid, nvarid, cv) |
---|
[630] | 214 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 215 | write(lunout,*)"dynetat0: Lecture echouee pour <cv>" |
---|
[630] | 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" |
---|
[630] | 222 | CALL abort |
---|
| 223 | ENDIF |
---|
[1635] | 224 | ierr = nf90_get_var(nid, nvarid, aire) |
---|
[630] | 225 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 226 | write(lunout,*)"dynetat0: Lecture echouee pour <aire>" |
---|
[630] | 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" |
---|
[630] | 233 | CALL abort |
---|
| 234 | ENDIF |
---|
[1635] | 235 | ierr = nf90_get_var(nid, nvarid, phis) |
---|
[630] | 236 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 237 | write(lunout,*)"dynetat0: Lecture echouee pour <phisinit>" |
---|
[630] | 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" |
---|
[1654] | 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 |
---|
[630] | 250 | ENDIF |
---|
[1635] | 251 | ierr = nf90_get_var(nid, nvarid, time) |
---|
[630] | 252 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 253 | write(lunout,*)"dynetat0: Lecture echouee <temps>" |
---|
[630] | 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" |
---|
[630] | 260 | CALL abort |
---|
| 261 | ENDIF |
---|
[1635] | 262 | ierr = nf90_get_var(nid, nvarid, ucov) |
---|
[630] | 263 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 264 | write(lunout,*)"dynetat0: Lecture echouee pour <ucov>" |
---|
[630] | 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" |
---|
[630] | 271 | CALL abort |
---|
| 272 | ENDIF |
---|
[1635] | 273 | ierr = nf90_get_var(nid, nvarid, vcov) |
---|
[630] | 274 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 275 | write(lunout,*)"dynetat0: Lecture echouee pour <vcov>" |
---|
[630] | 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" |
---|
[630] | 282 | CALL abort |
---|
| 283 | ENDIF |
---|
[1635] | 284 | ierr = nf90_get_var(nid, nvarid, teta) |
---|
[630] | 285 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 286 | write(lunout,*)"dynetat0: Lecture echouee pour <teta>" |
---|
[630] | 287 | CALL abort |
---|
| 288 | ENDIF |
---|
| 289 | |
---|
| 290 | |
---|
[1403] | 291 | IF(nqtot.GE.1) THEN |
---|
[1146] | 292 | DO iq=1,nqtot |
---|
[630] | 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" |
---|
[1635] | 298 | q(:,:,:,iq)=0. |
---|
[630] | 299 | ELSE |
---|
[1635] | 300 | ierr = NF90_GET_VAR(nid, nvarid, q(:,:,:,iq)) |
---|
[630] | 301 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 302 | write(lunout,*)"dynetat0: Lecture echouee pour "//tname(iq) |
---|
| 303 | CALL abort |
---|
[630] | 304 | ENDIF |
---|
| 305 | ENDIF |
---|
| 306 | ENDDO |
---|
[1403] | 307 | ENDIF |
---|
[630] | 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" |
---|
[630] | 312 | CALL abort |
---|
| 313 | ENDIF |
---|
[1635] | 314 | ierr = nf90_get_var(nid, nvarid, masse) |
---|
[630] | 315 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 316 | write(lunout,*)"dynetat0: Lecture echouee pour <masse>" |
---|
[630] | 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" |
---|
[630] | 323 | CALL abort |
---|
| 324 | ENDIF |
---|
[1635] | 325 | ierr = nf90_get_var(nid, nvarid, ps) |
---|
[630] | 326 | IF (ierr .NE. NF_NOERR) THEN |
---|
[1403] | 327 | write(lunout,*)"dynetat0: Lecture echouee pour <ps>" |
---|
[630] | 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 |
---|