Changeset 907
- Timestamp:
- Mar 22, 2013, 10:45:24 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/dyn3d/dynetat0.F
r841 r907 57 57 INTEGER ierr, nid, nvarid 58 58 59 character(len=12) :: start_file_type="earth" ! default start file type 59 60 INTEGER idecal 60 61 … … 86 87 if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then 87 88 write(lunout,*)'dynetat0 : Planeto-like start file' 89 start_file_type="planeto" 88 90 idecal = 4 89 91 annee_ref = 2000 … … 98 100 jm = tab_cntrl(2) 99 101 lllm = tab_cntrl(3) 100 day_ref = tab_cntrl(4) 102 if (start_file_type.eq."earth") then 103 day_ref = tab_cntrl(4) 104 else 105 day_ini = tab_cntrl(4) 106 day_ref=0 107 endif 101 108 rad = tab_cntrl(idecal+1) 102 109 omeg = tab_cntrl(idecal+2) … … 131 138 ENDIF 132 139 133 day_ini = tab_cntrl(30) 134 itau_dyn = tab_cntrl(31) 135 start_time = tab_cntrl(32) 140 if (start_file_type.eq."earth") then 141 day_ini = tab_cntrl(30) 142 itau_dyn = tab_cntrl(31) 143 start_time = tab_cntrl(32) 144 else 145 day_ini=tab_cntrl(4) 146 itau_dyn=0 147 start_time=0 148 endif 136 149 c ................................................................. 137 150 c -
trunk/LMDZ.COMMON/libf/dyn3d/dynredem.F
r776 r907 9 9 USE infotrac 10 10 use netcdf95, only: NF95_PUT_VAR 11 11 use control_mod, only : planet_type 12 12 13 IMPLICIT NONE 13 14 c======================================================================= … … 58 59 character*30 unites 59 60 61 character(len=12) :: start_file_type="earth" ! default start file type 62 INTEGER idecal 60 63 61 64 c----------------------------------------------------------------------- … … 71 74 jjour0=1 72 75 #endif 76 77 !!! AS: idecal is a hack to be able to read planeto starts... 78 !!! .... while keeping everything OK for LMDZ EARTH 79 if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then 80 write(lunout,*) trim(modname),' : Planeto-like start file' 81 start_file_type="planeto" 82 idecal = 4 83 else 84 write(lunout,*) trim(modname),' : Earth-like start file' 85 idecal = 5 86 endif 73 87 74 88 DO l=1,length … … 78 92 tab_cntrl(2) = REAL(jjm) 79 93 tab_cntrl(3) = REAL(llm) 80 tab_cntrl(4) = REAL(day_ref) 94 if (start_file_type.eq."earth") then 95 tab_cntrl(4)=REAL(day_ref) 96 else 97 tab_cntrl(4)=REAL(day_end) 98 endif 81 99 tab_cntrl(5) = REAL(annee_ref) 82 tab_cntrl( 6) = rad83 tab_cntrl( 7) = omeg84 tab_cntrl( 8) = g85 tab_cntrl( 9) = cpp86 tab_cntrl( 10) = kappa87 tab_cntrl( 11) = daysec88 tab_cntrl( 12) = dtvr89 tab_cntrl( 13) = etot090 tab_cntrl( 14) = ptot091 tab_cntrl( 15) = ztot092 tab_cntrl( 16) = stot093 tab_cntrl( 17) = ang094 tab_cntrl( 18) = pa95 tab_cntrl( 19) = preff100 tab_cntrl(idecal+1) = rad 101 tab_cntrl(idecal+2) = omeg 102 tab_cntrl(idecal+3) = g 103 tab_cntrl(idecal+4) = cpp 104 tab_cntrl(idecal+5) = kappa 105 tab_cntrl(idecal+6) = daysec 106 tab_cntrl(idecal+7) = dtvr 107 tab_cntrl(idecal+8) = etot0 108 tab_cntrl(idecal+9) = ptot0 109 tab_cntrl(idecal+10) = ztot0 110 tab_cntrl(idecal+11) = stot0 111 tab_cntrl(idecal+12) = ang0 112 tab_cntrl(idecal+13) = pa 113 tab_cntrl(idecal+14) = preff 96 114 c 97 115 c ..... parametres pour le zoom ...... 98 116 99 tab_cntrl( 20) = clon100 tab_cntrl( 21) = clat101 tab_cntrl( 22) = grossismx102 tab_cntrl( 23) = grossismy117 tab_cntrl(idecal+15) = clon 118 tab_cntrl(idecal+16) = clat 119 tab_cntrl(idecal+17) = grossismx 120 tab_cntrl(idecal+18) = grossismy 103 121 c 104 122 IF ( fxyhypb ) THEN 105 tab_cntrl( 24) = 1.106 tab_cntrl( 25) = dzoomx107 tab_cntrl( 26) = dzoomy108 tab_cntrl( 27) = 0.109 tab_cntrl( 28) = taux110 tab_cntrl( 29) = tauy123 tab_cntrl(idecal+19) = 1. 124 tab_cntrl(idecal+20) = dzoomx 125 tab_cntrl(idecal+21) = dzoomy 126 tab_cntrl(idecal+22) = 0. 127 tab_cntrl(idecal+23) = taux 128 tab_cntrl(idecal+24) = tauy 111 129 ELSE 112 tab_cntrl(24) = 0. 113 tab_cntrl(25) = dzoomx 114 tab_cntrl(26) = dzoomy 115 tab_cntrl(27) = 0. 116 tab_cntrl(28) = 0. 117 tab_cntrl(29) = 0. 118 IF( ysinus ) tab_cntrl(27) = 1. 119 ENDIF 120 121 tab_cntrl(30) = REAL(iday_end) 122 tab_cntrl(31) = REAL(itau_dyn + itaufin) 130 tab_cntrl(idecal+19) = 0. 131 tab_cntrl(idecal+20) = dzoomx 132 tab_cntrl(idecal+21) = dzoomy 133 tab_cntrl(idecal+22) = 0. 134 tab_cntrl(idecal+23) = 0. 135 tab_cntrl(idecal+24) = 0. 136 IF( ysinus ) tab_cntrl(idecal+22) = 1. 137 ENDIF 138 139 if (start_file_type.eq."earth") then 140 tab_cntrl(idecal+25) = REAL(iday_end) 141 tab_cntrl(idecal+26) = REAL(itau_dyn + itaufin) 123 142 c start_time: start_time of simulation (not necessarily 0.) 124 tab_cntrl(32) = start_time 143 tab_cntrl(idecal+27) = start_time 144 endif 125 145 c 126 146 c ......................................................... … … 143 163 c Definir les dimensions du fichiers: 144 164 c 145 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 146 ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 147 ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu) 148 ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv) 149 ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 150 ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s) 151 ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig) 152 ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim) 165 if (start_file_type.eq."earth") then 166 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 167 ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 168 ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu) 169 ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv) 170 ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 171 ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s) 172 ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig) 173 ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim) 174 else 175 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 176 ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 177 ierr = NF_DEF_DIM (nid, "latitude", jjp1, idim_rlatu) 178 ierr = NF_DEF_DIM (nid, "longitude", iip1, idim_rlonv) 179 ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 180 ierr = NF_DEF_DIM (nid, "altitude", llm, idim_s) 181 ierr = NF_DEF_DIM (nid, "interlayer", llmp1, idim_sig) 182 ierr = NF_DEF_DIM (nid, "Time", NF_UNLIMITED, idim_tim) 183 endif 153 184 c 154 185 ierr = NF_ENDDEF(nid) ! sortir du mode de definition … … 221 252 call NF95_PUT_VAR(nid,nvarid,rlatv) 222 253 c 223 ierr = NF_REDEF (nid) 224 cIM 220306 BEG 225 #ifdef NC_DOUBLE 226 ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid) 227 #else 228 ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid) 229 #endif 230 cIM 220306 END 231 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28, 254 if (start_file_type.eq."earth") then 255 ierr = NF_REDEF (nid) 256 cIM 220306 BEG 257 #ifdef NC_DOUBLE 258 ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid) 259 #else 260 ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid) 261 #endif 262 cIM 220306 END 263 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28, 232 264 . "Numero naturel des couches s") 233 ierr = NF_ENDDEF(nid)234 call NF95_PUT_VAR(nid,nvarid,nivsigs)235 c 236 ierr = NF_REDEF (nid)237 cIM 220306 BEG 238 #ifdef NC_DOUBLE 239 ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid)240 #else 241 ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid)242 #endif 243 cIM 220306 END 244 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32,265 ierr = NF_ENDDEF(nid) 266 call NF95_PUT_VAR(nid,nvarid,nivsigs) 267 c 268 ierr = NF_REDEF (nid) 269 cIM 220306 BEG 270 #ifdef NC_DOUBLE 271 ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid) 272 #else 273 ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid) 274 #endif 275 cIM 220306 END 276 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32, 245 277 . "Numero naturel des couches sigma") 246 ierr = NF_ENDDEF(nid) 247 call NF95_PUT_VAR(nid,nvarid,nivsig) 278 ierr = NF_ENDDEF(nid) 279 call NF95_PUT_VAR(nid,nvarid,nivsig) 280 endif ! of if (start_file_type.eq."earth") 248 281 c 249 282 ierr = NF_REDEF (nid) … … 273 306 call NF95_PUT_VAR(nid,nvarid,bp) 274 307 c 308 if (start_file_type.ne."earth") then 309 ierr = NF_REDEF (nid) 310 cIM 220306 BEG 311 #ifdef NC_DOUBLE 312 ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1,idim_s,nvarid) 313 #else 314 ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1,idim_s,nvarid) 315 #endif 316 cIM 220306 END 317 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 37, 318 . "Coef AS: hybrid pressure at midlayers") 319 ierr = NF_ENDDEF(nid) 320 call NF95_PUT_VAR(nid,nvarid,aps) 321 c 322 ierr = NF_REDEF (nid) 323 cIM 220306 BEG 324 #ifdef NC_DOUBLE 325 ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1,idim_s,nvarid) 326 #else 327 ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1,idim_s,nvarid) 328 #endif 329 cIM 220306 END 330 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 34, 331 . "Coef BS: hybrid sigma at midlayers") 332 ierr = NF_ENDDEF(nid) 333 call NF95_PUT_VAR(nid,nvarid,bps) 334 endif ! of if (start_file_type.ne."earth") 335 c 275 336 ierr = NF_REDEF (nid) 276 337 cIM 220306 BEG … … 283 344 ierr = NF_ENDDEF(nid) 284 345 call NF95_PUT_VAR(nid,nvarid,presnivs) 346 c 347 if (start_file_type.ne."earth") then 348 ierr = NF_REDEF (nid) 349 #ifdef NC_DOUBLE 350 ierr = NF_DEF_VAR(nid,"latitude",NF_DOUBLE,1,idim_rlatu,nvarid) 351 #else 352 ierr = NF_DEF_VAR(nid,"latitude",NF_FLOAT,1,idim_rlatu,nvarid) 353 #endif 354 ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north") 355 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, 356 . "North latitude") 357 ierr = NF_ENDDEF(nid) 358 call NF95_PUT_VAR(nid,nvarid,rlatu*180/pi) 359 c 360 ierr = NF_REDEF (nid) 361 #ifdef NC_DOUBLE 362 ierr=NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1,idim_rlonv,nvarid) 363 #else 364 ierr=NF_DEF_VAR(nid,"longitude",NF_FLOAT,1,idim_rlonv,nvarid) 365 #endif 366 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, 367 . "East longitude") 368 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east") 369 ierr = NF_ENDDEF(nid) 370 call NF95_PUT_VAR(nid,nvarid,rlonv*180/pi) 371 c 372 ierr = NF_REDEF (nid) 373 #ifdef NC_DOUBLE 374 ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1, 375 . idim_s,nvarid) 376 #else 377 ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1, 378 . idim_s,nvarid) 379 #endif 380 ierr = NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt") 381 ierr = NF_PUT_ATT_TEXT (nid,nvarid,'units',2,"km") 382 ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',2,"up") 383 ierr = NF_ENDDEF(nid) 384 call NF95_PUT_VAR(nid,nvarid,pseudoalt) 385 endif ! of if (start_file_type.ne."earth") 285 386 c 286 387 c Coefficients de passage cov. <-> contra. <--> naturel … … 354 455 ierr = NF_REDEF (nid) ! entrer dans le mode de definition 355 456 c 356 cIM 220306 BEG 357 #ifdef NC_DOUBLE 358 ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid) 359 #else 360 ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid) 361 #endif 362 cIM 220306 END 457 if (start_file_type.eq."earth") then 458 cIM 220306 BEG 459 #ifdef NC_DOUBLE 460 ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid) 461 #else 462 ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid) 463 #endif 464 cIM 220306 END 465 else ! start_file_type=="planeto" 466 #ifdef NC_DOUBLE 467 ierr = NF_DEF_VAR (nid,"Time",NF_DOUBLE,1,idim_tim,nvarid) 468 #else 469 ierr = NF_DEF_VAR (nid,"Time",NF_FLOAT,1,idim_tim,nvarid) 470 #endif 471 endif ! of if (start_file_type.eq."earth") 363 472 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19, 364 473 . "Temps de simulation") … … 465 574 RETURN 466 575 END 576 577 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 578 467 579 SUBROUTINE dynredem1(fichnom,time, 468 580 . vcov,ucov,teta,q,masse,ps) 469 581 USE infotrac 470 USE control_mod 582 USE control_mod, only : planet_type 471 583 use netcdf, only: NF90_get_VAR 472 584 use netcdf95, only: NF95_PUT_VAR … … 501 613 PARAMETER (length = 100) 502 614 REAL tab_cntrl(length) ! tableau des parametres du run 503 character *20 modname615 character(len=*),parameter :: modname='dynredem1' 504 616 character*80 abort_message 505 617 c … … 507 619 SAVE nb 508 620 DATA nb / 0 / 509 510 modname = 'dynredem1' 621 character(len=12) :: start_file_type="earth" ! default start file type 622 623 if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then 624 write(lunout,*) trim(modname),' : Planeto-like start file' 625 start_file_type="planeto" 626 else 627 write(lunout,*) trim(modname),' : Earth-like start file' 628 endif 629 511 630 ierr = NF_OPEN(fichnom, NF_WRITE, nid) 512 631 IF (ierr .NE. NF_NOERR) THEN 513 write(lunout,*)"dynredem1: Pb. d ouverture "//trim(fichnom)632 PRINT*, "dynredem1: Pb. d ouverture "//trim(fichnom) 514 633 CALL abort 515 634 ENDIF … … 518 637 519 638 nb = nb + 1 520 ierr = NF_INQ_VARID(nid, "temps", nvarid) 521 IF (ierr .NE. NF_NOERR) THEN 522 write(lunout,*) NF_STRERROR(ierr) 523 abort_message='Variable temps n est pas definie' 524 CALL abort_gcm(modname,abort_message,ierr) 525 ENDIF 639 if (start_file_type.eq."earth") then 640 ierr = NF_INQ_VARID(nid, "temps", nvarid) 641 IF (ierr .NE. NF_NOERR) THEN 642 write(lunout,*) NF_STRERROR(ierr) 643 abort_message='Variable temps n est pas definie' 644 CALL abort_gcm(modname,abort_message,ierr) 645 ENDIF 646 else 647 ierr = NF_INQ_VARID(nid,"Time", nvarid) 648 IF (ierr .NE. NF_NOERR) THEN 649 write(lunout,*) NF_STRERROR(ierr) 650 abort_message='Variable Time not found' 651 CALL abort_gcm(modname,abort_message,ierr) 652 ENDIF 653 endif ! of if (start_file_type.eq."earth") 526 654 call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/)) 527 655 write(lunout,*) "dynredem1: Enregistrement pour ", nb, time … … 537 665 ENDIF 538 666 ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl) 539 tab_cntrl(31) = REAL(itau_dyn + itaufin) 667 if (start_file_type=="earth") then 668 tab_cntrl(31) = REAL(itau_dyn + itaufin) 669 else 670 tab_cntrl(31) = 0 671 endif 540 672 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 541 673 -
trunk/LMDZ.COMMON/libf/dyn3d/integrd.F
r776 r907 107 107 write(lunout,*) " lon = ",rlonv(i)*180./pi, " deg", 108 108 & " lat = ",rlatu(j)*180./pi, " deg" 109 write(lunout,*) " psm1(ij)=",psm1(ij)," dt=",dt, 110 & " dp(ij)=",dp(ij) 109 111 stop 110 112 ENDIF -
trunk/LMDZ.COMMON/libf/dyn3dpar/dynetat0.F
r841 r907 57 57 INTEGER ierr, nid, nvarid 58 58 59 character(len=12) :: start_file_type="earth" ! default start file type 59 60 INTEGER idecal 60 61 … … 86 87 if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then 87 88 write(lunout,*)'dynetat0 : Planeto-like start file' 89 start_file_type="planeto" 88 90 idecal = 4 89 91 annee_ref = 2000 … … 98 100 jm = tab_cntrl(2) 99 101 lllm = tab_cntrl(3) 100 day_ref = tab_cntrl(4) 102 if (start_file_type.eq."earth") then 103 day_ref = tab_cntrl(4) 104 else 105 day_ini = tab_cntrl(4) 106 day_ref=0 107 endif 101 108 rad = tab_cntrl(idecal+1) 102 109 omeg = tab_cntrl(idecal+2) … … 131 138 ENDIF 132 139 133 day_ini = tab_cntrl(30) 134 itau_dyn = tab_cntrl(31) 135 start_time = tab_cntrl(32) 140 if (start_file_type.eq."earth") then 141 day_ini = tab_cntrl(30) 142 itau_dyn = tab_cntrl(31) 143 start_time = tab_cntrl(32) 144 else 145 day_ini=tab_cntrl(4) 146 itau_dyn=0 147 start_time=0 148 endif 136 149 c ................................................................. 137 150 c -
trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem.F
r776 r907 9 9 USE infotrac 10 10 use netcdf95, only: NF95_PUT_VAR 11 11 use control_mod, only : planet_type 12 12 13 IMPLICIT NONE 13 14 c======================================================================= … … 58 59 character*30 unites 59 60 61 character(len=12) :: start_file_type="earth" ! default start file type 62 INTEGER idecal 60 63 61 64 c----------------------------------------------------------------------- … … 71 74 jjour0=1 72 75 #endif 76 77 !!! AS: idecal is a hack to be able to read planeto starts... 78 !!! .... while keeping everything OK for LMDZ EARTH 79 if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then 80 write(lunout,*) trim(modname),' : Planeto-like start file' 81 start_file_type="planeto" 82 idecal = 4 83 else 84 write(lunout,*) trim(modname),' : Earth-like start file' 85 idecal = 5 86 endif 73 87 74 88 DO l=1,length … … 78 92 tab_cntrl(2) = REAL(jjm) 79 93 tab_cntrl(3) = REAL(llm) 80 tab_cntrl(4) = REAL(day_ref) 94 if (start_file_type.eq."earth") then 95 tab_cntrl(4)=REAL(day_ref) 96 else 97 tab_cntrl(4)=REAL(day_end) 98 endif 81 99 tab_cntrl(5) = REAL(annee_ref) 82 tab_cntrl( 6) = rad83 tab_cntrl( 7) = omeg84 tab_cntrl( 8) = g85 tab_cntrl( 9) = cpp86 tab_cntrl( 10) = kappa87 tab_cntrl( 11) = daysec88 tab_cntrl( 12) = dtvr89 tab_cntrl( 13) = etot090 tab_cntrl( 14) = ptot091 tab_cntrl( 15) = ztot092 tab_cntrl( 16) = stot093 tab_cntrl( 17) = ang094 tab_cntrl( 18) = pa95 tab_cntrl( 19) = preff100 tab_cntrl(idecal+1) = rad 101 tab_cntrl(idecal+2) = omeg 102 tab_cntrl(idecal+3) = g 103 tab_cntrl(idecal+4) = cpp 104 tab_cntrl(idecal+5) = kappa 105 tab_cntrl(idecal+6) = daysec 106 tab_cntrl(idecal+7) = dtvr 107 tab_cntrl(idecal+8) = etot0 108 tab_cntrl(idecal+9) = ptot0 109 tab_cntrl(idecal+10) = ztot0 110 tab_cntrl(idecal+11) = stot0 111 tab_cntrl(idecal+12) = ang0 112 tab_cntrl(idecal+13) = pa 113 tab_cntrl(idecal+14) = preff 96 114 c 97 115 c ..... parametres pour le zoom ...... 98 116 99 tab_cntrl( 20) = clon100 tab_cntrl( 21) = clat101 tab_cntrl( 22) = grossismx102 tab_cntrl( 23) = grossismy117 tab_cntrl(idecal+15) = clon 118 tab_cntrl(idecal+16) = clat 119 tab_cntrl(idecal+17) = grossismx 120 tab_cntrl(idecal+18) = grossismy 103 121 c 104 122 IF ( fxyhypb ) THEN 105 tab_cntrl( 24) = 1.106 tab_cntrl( 25) = dzoomx107 tab_cntrl( 26) = dzoomy108 tab_cntrl( 27) = 0.109 tab_cntrl( 28) = taux110 tab_cntrl( 29) = tauy123 tab_cntrl(idecal+19) = 1. 124 tab_cntrl(idecal+20) = dzoomx 125 tab_cntrl(idecal+21) = dzoomy 126 tab_cntrl(idecal+22) = 0. 127 tab_cntrl(idecal+23) = taux 128 tab_cntrl(idecal+24) = tauy 111 129 ELSE 112 tab_cntrl(24) = 0. 113 tab_cntrl(25) = dzoomx 114 tab_cntrl(26) = dzoomy 115 tab_cntrl(27) = 0. 116 tab_cntrl(28) = 0. 117 tab_cntrl(29) = 0. 118 IF( ysinus ) tab_cntrl(27) = 1. 119 ENDIF 120 121 tab_cntrl(30) = REAL(iday_end) 122 tab_cntrl(31) = REAL(itau_dyn + itaufin) 130 tab_cntrl(idecal+19) = 0. 131 tab_cntrl(idecal+20) = dzoomx 132 tab_cntrl(idecal+21) = dzoomy 133 tab_cntrl(idecal+22) = 0. 134 tab_cntrl(idecal+23) = 0. 135 tab_cntrl(idecal+24) = 0. 136 IF( ysinus ) tab_cntrl(idecal+22) = 1. 137 ENDIF 138 139 if (start_file_type.eq."earth") then 140 tab_cntrl(idecal+25) = REAL(iday_end) 141 tab_cntrl(idecal+26) = REAL(itau_dyn + itaufin) 123 142 c start_time: start_time of simulation (not necessarily 0.) 124 tab_cntrl(32) = start_time 143 tab_cntrl(idecal+27) = start_time 144 endif 125 145 c 126 146 c ......................................................... … … 143 163 c Definir les dimensions du fichiers: 144 164 c 145 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 146 ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 147 ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu) 148 ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv) 149 ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 150 ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s) 151 ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig) 152 ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim) 165 if (start_file_type.eq."earth") then 166 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 167 ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 168 ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu) 169 ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv) 170 ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 171 ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s) 172 ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig) 173 ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim) 174 else 175 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 176 ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 177 ierr = NF_DEF_DIM (nid, "latitude", jjp1, idim_rlatu) 178 ierr = NF_DEF_DIM (nid, "longitude", iip1, idim_rlonv) 179 ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 180 ierr = NF_DEF_DIM (nid, "altitude", llm, idim_s) 181 ierr = NF_DEF_DIM (nid, "interlayer", llmp1, idim_sig) 182 ierr = NF_DEF_DIM (nid, "Time", NF_UNLIMITED, idim_tim) 183 endif 153 184 c 154 185 ierr = NF_ENDDEF(nid) ! sortir du mode de definition … … 221 252 call NF95_PUT_VAR(nid,nvarid,rlatv) 222 253 c 223 ierr = NF_REDEF (nid) 224 cIM 220306 BEG 225 #ifdef NC_DOUBLE 226 ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid) 227 #else 228 ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid) 229 #endif 230 cIM 220306 END 231 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28, 254 if (start_file_type.eq."earth") then 255 ierr = NF_REDEF (nid) 256 cIM 220306 BEG 257 #ifdef NC_DOUBLE 258 ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid) 259 #else 260 ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid) 261 #endif 262 cIM 220306 END 263 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28, 232 264 . "Numero naturel des couches s") 233 ierr = NF_ENDDEF(nid)234 call NF95_PUT_VAR(nid,nvarid,nivsigs)235 c 236 ierr = NF_REDEF (nid)237 cIM 220306 BEG 238 #ifdef NC_DOUBLE 239 ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid)240 #else 241 ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid)242 #endif 243 cIM 220306 END 244 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32,265 ierr = NF_ENDDEF(nid) 266 call NF95_PUT_VAR(nid,nvarid,nivsigs) 267 c 268 ierr = NF_REDEF (nid) 269 cIM 220306 BEG 270 #ifdef NC_DOUBLE 271 ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid) 272 #else 273 ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid) 274 #endif 275 cIM 220306 END 276 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32, 245 277 . "Numero naturel des couches sigma") 246 ierr = NF_ENDDEF(nid) 247 call NF95_PUT_VAR(nid,nvarid,nivsig) 278 ierr = NF_ENDDEF(nid) 279 call NF95_PUT_VAR(nid,nvarid,nivsig) 280 endif ! of if (start_file_type.eq."earth") 248 281 c 249 282 ierr = NF_REDEF (nid) … … 273 306 call NF95_PUT_VAR(nid,nvarid,bp) 274 307 c 308 if (start_file_type.ne."earth") then 309 ierr = NF_REDEF (nid) 310 cIM 220306 BEG 311 #ifdef NC_DOUBLE 312 ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1,idim_s,nvarid) 313 #else 314 ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1,idim_s,nvarid) 315 #endif 316 cIM 220306 END 317 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 37, 318 . "Coef AS: hybrid pressure at midlayers") 319 ierr = NF_ENDDEF(nid) 320 call NF95_PUT_VAR(nid,nvarid,aps) 321 c 322 ierr = NF_REDEF (nid) 323 cIM 220306 BEG 324 #ifdef NC_DOUBLE 325 ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1,idim_s,nvarid) 326 #else 327 ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1,idim_s,nvarid) 328 #endif 329 cIM 220306 END 330 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 34, 331 . "Coef BS: hybrid sigma at midlayers") 332 ierr = NF_ENDDEF(nid) 333 call NF95_PUT_VAR(nid,nvarid,bps) 334 endif ! of if (start_file_type.ne."earth") 335 c 275 336 ierr = NF_REDEF (nid) 276 337 cIM 220306 BEG … … 283 344 ierr = NF_ENDDEF(nid) 284 345 call NF95_PUT_VAR(nid,nvarid,presnivs) 346 c 347 if (start_file_type.ne."earth") then 348 ierr = NF_REDEF (nid) 349 #ifdef NC_DOUBLE 350 ierr = NF_DEF_VAR(nid,"latitude",NF_DOUBLE,1,idim_rlatu,nvarid) 351 #else 352 ierr = NF_DEF_VAR(nid,"latitude",NF_FLOAT,1,idim_rlatu,nvarid) 353 #endif 354 ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north") 355 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, 356 . "North latitude") 357 ierr = NF_ENDDEF(nid) 358 call NF95_PUT_VAR(nid,nvarid,rlatu*180/pi) 359 c 360 ierr = NF_REDEF (nid) 361 #ifdef NC_DOUBLE 362 ierr=NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1,idim_rlonv,nvarid) 363 #else 364 ierr=NF_DEF_VAR(nid,"longitude",NF_FLOAT,1,idim_rlonv,nvarid) 365 #endif 366 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, 367 . "East longitude") 368 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east") 369 ierr = NF_ENDDEF(nid) 370 call NF95_PUT_VAR(nid,nvarid,rlonv*180/pi) 371 c 372 ierr = NF_REDEF (nid) 373 #ifdef NC_DOUBLE 374 ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1, 375 . idim_s,nvarid) 376 #else 377 ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1, 378 . idim_s,nvarid) 379 #endif 380 ierr = NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt") 381 ierr = NF_PUT_ATT_TEXT (nid,nvarid,'units',2,"km") 382 ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',2,"up") 383 ierr = NF_ENDDEF(nid) 384 call NF95_PUT_VAR(nid,nvarid,pseudoalt) 385 endif ! of if (start_file_type.ne."earth") 285 386 c 286 387 c Coefficients de passage cov. <-> contra. <--> naturel … … 354 455 ierr = NF_REDEF (nid) ! entrer dans le mode de definition 355 456 c 356 cIM 220306 BEG 357 #ifdef NC_DOUBLE 358 ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid) 359 #else 360 ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid) 361 #endif 362 cIM 220306 END 457 if (start_file_type.eq."earth") then 458 cIM 220306 BEG 459 #ifdef NC_DOUBLE 460 ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid) 461 #else 462 ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid) 463 #endif 464 cIM 220306 END 465 else ! start_file_type=="planeto" 466 #ifdef NC_DOUBLE 467 ierr = NF_DEF_VAR (nid,"Time",NF_DOUBLE,1,idim_tim,nvarid) 468 #else 469 ierr = NF_DEF_VAR (nid,"Time",NF_FLOAT,1,idim_tim,nvarid) 470 #endif 471 endif ! of if (start_file_type.eq."earth") 363 472 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19, 364 473 . "Temps de simulation") … … 465 574 RETURN 466 575 END 576 577 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 578 467 579 SUBROUTINE dynredem1(fichnom,time, 468 580 . vcov,ucov,teta,q,masse,ps) 469 581 USE infotrac 470 USE control_mod 582 USE control_mod, only : planet_type 471 583 use netcdf, only: NF90_get_VAR 472 584 use netcdf95, only: NF95_PUT_VAR … … 501 613 PARAMETER (length = 100) 502 614 REAL tab_cntrl(length) ! tableau des parametres du run 503 character *20 modname615 character(len=*),parameter :: modname='dynredem1' 504 616 character*80 abort_message 505 617 c … … 507 619 SAVE nb 508 620 DATA nb / 0 / 509 510 modname = 'dynredem1' 621 character(len=12) :: start_file_type="earth" ! default start file type 622 623 if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then 624 write(lunout,*) trim(modname),' : Planeto-like start file' 625 start_file_type="planeto" 626 else 627 write(lunout,*) trim(modname),' : Earth-like start file' 628 endif 629 511 630 ierr = NF_OPEN(fichnom, NF_WRITE, nid) 512 631 IF (ierr .NE. NF_NOERR) THEN 513 write(lunout,*)"dynredem1: Pb. d ouverture "//trim(fichnom)632 PRINT*, "dynredem1: Pb. d ouverture "//trim(fichnom) 514 633 CALL abort 515 634 ENDIF … … 518 637 519 638 nb = nb + 1 520 ierr = NF_INQ_VARID(nid, "temps", nvarid) 521 IF (ierr .NE. NF_NOERR) THEN 522 write(lunout,*) NF_STRERROR(ierr) 523 abort_message='Variable temps n est pas definie' 524 CALL abort_gcm(modname,abort_message,ierr) 525 ENDIF 639 if (start_file_type.eq."earth") then 640 ierr = NF_INQ_VARID(nid, "temps", nvarid) 641 IF (ierr .NE. NF_NOERR) THEN 642 write(lunout,*) NF_STRERROR(ierr) 643 abort_message='Variable temps n est pas definie' 644 CALL abort_gcm(modname,abort_message,ierr) 645 ENDIF 646 else 647 ierr = NF_INQ_VARID(nid,"Time", nvarid) 648 IF (ierr .NE. NF_NOERR) THEN 649 write(lunout,*) NF_STRERROR(ierr) 650 abort_message='Variable Time not found' 651 CALL abort_gcm(modname,abort_message,ierr) 652 ENDIF 653 endif ! of if (start_file_type.eq."earth") 526 654 call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/)) 527 655 write(lunout,*) "dynredem1: Enregistrement pour ", nb, time … … 537 665 ENDIF 538 666 ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl) 539 tab_cntrl(31) = REAL(itau_dyn + itaufin) 667 if (start_file_type=="earth") then 668 tab_cntrl(31) = REAL(itau_dyn + itaufin) 669 else 670 tab_cntrl(31) = 0 671 endif 540 672 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 541 673 -
trunk/LMDZ.COMMON/libf/dyn3dpar/dynredem_p.F
r776 r907 10 10 USE infotrac 11 11 use netcdf95, only: NF95_PUT_VAR 12 12 use control_mod, only : planet_type 13 13 14 IMPLICIT NONE 14 15 c======================================================================= … … 28 29 #include "description.h" 29 30 #include "serre.h" 31 #include "iniprint.h" 30 32 31 33 c Arguments: … … 58 60 character*30 unites 59 61 62 character(len=12) :: start_file_type="earth" ! default start file type 63 INTEGER idecal 60 64 61 65 c----------------------------------------------------------------------- … … 73 77 jjour0=1 74 78 #endif 79 80 !!! AS: idecal is a hack to be able to read planeto starts... 81 !!! .... while keeping everything OK for LMDZ EARTH 82 if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then 83 write(lunout,*) trim(modname),' : Planeto-like start file' 84 start_file_type="planeto" 85 idecal = 4 86 else 87 write(lunout,*) trim(modname),' : Earth-like start file' 88 idecal = 5 89 endif 75 90 76 91 DO l=1,length … … 80 95 tab_cntrl(2) = REAL(jjm) 81 96 tab_cntrl(3) = REAL(llm) 82 tab_cntrl(4) = REAL(day_ref) 97 if (start_file_type.eq."earth") then 98 tab_cntrl(4)=REAL(day_ref) 99 else 100 tab_cntrl(4)=REAL(day_end) 101 endif 83 102 tab_cntrl(5) = REAL(annee_ref) 84 tab_cntrl( 6) = rad85 tab_cntrl( 7) = omeg86 tab_cntrl( 8) = g87 tab_cntrl( 9) = cpp88 tab_cntrl( 10) = kappa89 tab_cntrl( 11) = daysec90 tab_cntrl( 12) = dtvr91 tab_cntrl( 13) = etot092 tab_cntrl( 14) = ptot093 tab_cntrl( 15) = ztot094 tab_cntrl( 16) = stot095 tab_cntrl( 17) = ang096 tab_cntrl( 18) = pa97 tab_cntrl( 19) = preff103 tab_cntrl(idecal+1) = rad 104 tab_cntrl(idecal+2) = omeg 105 tab_cntrl(idecal+3) = g 106 tab_cntrl(idecal+4) = cpp 107 tab_cntrl(idecal+5) = kappa 108 tab_cntrl(idecal+6) = daysec 109 tab_cntrl(idecal+7) = dtvr 110 tab_cntrl(idecal+8) = etot0 111 tab_cntrl(idecal+9) = ptot0 112 tab_cntrl(idecal+10) = ztot0 113 tab_cntrl(idecal+11) = stot0 114 tab_cntrl(idecal+12) = ang0 115 tab_cntrl(idecal+13) = pa 116 tab_cntrl(idecal+14) = preff 98 117 c 99 118 c ..... parametres pour le zoom ...... 100 119 101 tab_cntrl( 20) = clon102 tab_cntrl( 21) = clat103 tab_cntrl( 22) = grossismx104 tab_cntrl( 23) = grossismy120 tab_cntrl(idecal+15) = clon 121 tab_cntrl(idecal+16) = clat 122 tab_cntrl(idecal+17) = grossismx 123 tab_cntrl(idecal+18) = grossismy 105 124 c 106 125 IF ( fxyhypb ) THEN 107 tab_cntrl( 24) = 1.108 tab_cntrl( 25) = dzoomx109 tab_cntrl( 26) = dzoomy110 tab_cntrl( 27) = 0.111 tab_cntrl( 28) = taux112 tab_cntrl( 29) = tauy126 tab_cntrl(idecal+19) = 1. 127 tab_cntrl(idecal+20) = dzoomx 128 tab_cntrl(idecal+21) = dzoomy 129 tab_cntrl(idecal+22) = 0. 130 tab_cntrl(idecal+23) = taux 131 tab_cntrl(idecal+24) = tauy 113 132 ELSE 114 tab_cntrl( 24) = 0.115 tab_cntrl( 25) = dzoomx116 tab_cntrl( 26) = dzoomy117 tab_cntrl( 27) = 0.118 tab_cntrl( 28) = 0.119 tab_cntrl( 29) = 0.120 IF( ysinus ) tab_cntrl( 27) = 1.133 tab_cntrl(idecal+19) = 0. 134 tab_cntrl(idecal+20) = dzoomx 135 tab_cntrl(idecal+21) = dzoomy 136 tab_cntrl(idecal+22) = 0. 137 tab_cntrl(idecal+23) = 0. 138 tab_cntrl(idecal+24) = 0. 139 IF( ysinus ) tab_cntrl(idecal+22) = 1. 121 140 ENDIF 122 141 123 tab_cntrl(30) = REAL(iday_end) 124 tab_cntrl(31) = REAL(itau_dyn + itaufin) 142 if (start_file_type.eq."earth") then 143 tab_cntrl(idecal+25) = REAL(iday_end) 144 tab_cntrl(idecal+26) = REAL(itau_dyn + itaufin) 125 145 c start_time: start_time of simulation (not necessarily 0.) 126 tab_cntrl(32) = start_time 146 tab_cntrl(idecal+27) = start_time 147 endif 127 148 c 128 149 c ......................................................... … … 144 165 c Definir les dimensions du fichiers: 145 166 c 146 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 147 ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 148 ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu) 149 ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv) 150 ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 151 ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s) 152 ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig) 153 ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim) 167 if (start_file_type.eq."earth") then 168 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 169 ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 170 ierr = NF_DEF_DIM (nid, "rlatu", jjp1, idim_rlatu) 171 ierr = NF_DEF_DIM (nid, "rlonv", iip1, idim_rlonv) 172 ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 173 ierr = NF_DEF_DIM (nid, "sigs", llm, idim_s) 174 ierr = NF_DEF_DIM (nid, "sig", llmp1, idim_sig) 175 ierr = NF_DEF_DIM (nid, "temps", NF_UNLIMITED, idim_tim) 176 else 177 ierr = NF_DEF_DIM (nid, "index", length, idim_index) 178 ierr = NF_DEF_DIM (nid, "rlonu", iip1, idim_rlonu) 179 ierr = NF_DEF_DIM (nid, "latitude", jjp1, idim_rlatu) 180 ierr = NF_DEF_DIM (nid, "longitude", iip1, idim_rlonv) 181 ierr = NF_DEF_DIM (nid, "rlatv", jjm, idim_rlatv) 182 ierr = NF_DEF_DIM (nid, "altitude", llm, idim_s) 183 ierr = NF_DEF_DIM (nid, "interlayer", llmp1, idim_sig) 184 ierr = NF_DEF_DIM (nid, "Time", NF_UNLIMITED, idim_tim) 185 endif 154 186 c 155 187 ierr = NF_ENDDEF(nid) ! sortir du mode de definition … … 222 254 call NF95_PUT_VAR(nid,nvarid,rlatv) 223 255 c 224 ierr = NF_REDEF (nid) 225 cIM 220306 BEG 226 #ifdef NC_DOUBLE 227 ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid) 228 #else 229 ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid) 230 #endif 231 cIM 220306 END 232 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28, 256 if (start_file_type.eq."earth") then 257 ierr = NF_REDEF (nid) 258 cIM 220306 BEG 259 #ifdef NC_DOUBLE 260 ierr = NF_DEF_VAR (nid,"nivsigs",NF_DOUBLE,1,idim_s,nvarid) 261 #else 262 ierr = NF_DEF_VAR (nid,"nivsigs",NF_FLOAT,1,idim_s,nvarid) 263 #endif 264 cIM 220306 END 265 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 28, 233 266 . "Numero naturel des couches s") 234 ierr = NF_ENDDEF(nid)235 call NF95_PUT_VAR(nid,nvarid,nivsigs)236 c 237 ierr = NF_REDEF (nid)238 cIM 220306 BEG 239 #ifdef NC_DOUBLE 240 ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid)241 #else 242 ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid)243 #endif 244 cIM 220306 END 245 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32,267 ierr = NF_ENDDEF(nid) 268 call NF95_PUT_VAR(nid,nvarid,nivsigs) 269 c 270 ierr = NF_REDEF (nid) 271 cIM 220306 BEG 272 #ifdef NC_DOUBLE 273 ierr = NF_DEF_VAR (nid,"nivsig",NF_DOUBLE,1,idim_sig,nvarid) 274 #else 275 ierr = NF_DEF_VAR (nid,"nivsig",NF_FLOAT,1,idim_sig,nvarid) 276 #endif 277 cIM 220306 END 278 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32, 246 279 . "Numero naturel des couches sigma") 247 ierr = NF_ENDDEF(nid) 248 call NF95_PUT_VAR(nid,nvarid,nivsig) 280 ierr = NF_ENDDEF(nid) 281 call NF95_PUT_VAR(nid,nvarid,nivsig) 282 endif ! of if (start_file_type.eq."earth") 249 283 c 250 284 ierr = NF_REDEF (nid) … … 274 308 call NF95_PUT_VAR(nid,nvarid,bp) 275 309 c 310 if (start_file_type.ne."earth") then 311 ierr = NF_REDEF (nid) 312 cIM 220306 BEG 313 #ifdef NC_DOUBLE 314 ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1,idim_s,nvarid) 315 #else 316 ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1,idim_s,nvarid) 317 #endif 318 cIM 220306 END 319 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 37, 320 . "Coef AS: hybrid pressure at midlayers") 321 ierr = NF_ENDDEF(nid) 322 call NF95_PUT_VAR(nid,nvarid,aps) 323 c 324 ierr = NF_REDEF (nid) 325 cIM 220306 BEG 326 #ifdef NC_DOUBLE 327 ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1,idim_s,nvarid) 328 #else 329 ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1,idim_s,nvarid) 330 #endif 331 cIM 220306 END 332 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 34, 333 . "Coef BS: hybrid sigma at midlayers") 334 ierr = NF_ENDDEF(nid) 335 call NF95_PUT_VAR(nid,nvarid,bps) 336 endif ! of if (start_file_type.ne."earth") 337 c 276 338 ierr = NF_REDEF (nid) 277 339 cIM 220306 BEG … … 284 346 ierr = NF_ENDDEF(nid) 285 347 call NF95_PUT_VAR(nid,nvarid,presnivs) 348 c 349 if (start_file_type.ne."earth") then 350 ierr = NF_REDEF (nid) 351 #ifdef NC_DOUBLE 352 ierr = NF_DEF_VAR(nid,"latitude",NF_DOUBLE,1,idim_rlatu,nvarid) 353 #else 354 ierr = NF_DEF_VAR(nid,"latitude",NF_FLOAT,1,idim_rlatu,nvarid) 355 #endif 356 ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north") 357 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, 358 . "North latitude") 359 ierr = NF_ENDDEF(nid) 360 call NF95_PUT_VAR(nid,nvarid,rlatu*180/pi) 361 c 362 ierr = NF_REDEF (nid) 363 #ifdef NC_DOUBLE 364 ierr=NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1,idim_rlonv,nvarid) 365 #else 366 ierr=NF_DEF_VAR(nid,"longitude",NF_FLOAT,1,idim_rlonv,nvarid) 367 #endif 368 ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, 369 . "East longitude") 370 ierr = NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east") 371 ierr = NF_ENDDEF(nid) 372 call NF95_PUT_VAR(nid,nvarid,rlonv*180/pi) 373 c 374 ierr = NF_REDEF (nid) 375 #ifdef NC_DOUBLE 376 ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1, 377 . idim_s,nvarid) 378 #else 379 ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1, 380 . idim_s,nvarid) 381 #endif 382 ierr = NF_PUT_ATT_TEXT(nid,nvarid,"long_name",10,"pseudo-alt") 383 ierr = NF_PUT_ATT_TEXT (nid,nvarid,'units',2,"km") 384 ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',2,"up") 385 ierr = NF_ENDDEF(nid) 386 call NF95_PUT_VAR(nid,nvarid,pseudoalt) 387 endif ! of if (start_file_type.ne."earth") 286 388 c 287 389 c Coefficients de passage cov. <-> contra. <--> naturel … … 355 457 ierr = NF_REDEF (nid) ! entrer dans le mode de definition 356 458 c 357 cIM 220306 BEG 358 #ifdef NC_DOUBLE 359 ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid) 360 #else 361 ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid) 362 #endif 363 cIM 220306 END 459 if (start_file_type.eq."earth") then 460 cIM 220306 BEG 461 #ifdef NC_DOUBLE 462 ierr = NF_DEF_VAR (nid,"temps",NF_DOUBLE,1,idim_tim,nvarid) 463 #else 464 ierr = NF_DEF_VAR (nid,"temps",NF_FLOAT,1,idim_tim,nvarid) 465 #endif 466 cIM 220306 END 467 else ! start_file_type=="planeto" 468 #ifdef NC_DOUBLE 469 ierr = NF_DEF_VAR (nid,"Time",NF_DOUBLE,1,idim_tim,nvarid) 470 #else 471 ierr = NF_DEF_VAR (nid,"Time",NF_FLOAT,1,idim_tim,nvarid) 472 #endif 473 endif ! of if (start_file_type.eq."earth") 364 474 ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19, 365 475 . "Temps de simulation") … … 465 575 RETURN 466 576 END 577 578 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 579 467 580 SUBROUTINE dynredem1_p(fichnom,time, 468 581 . vcov,ucov,teta,q,masse,ps) 469 582 USE parallel 470 583 USE infotrac 471 USE control_mod 584 USE control_mod, only : planet_type 472 585 use netcdf, only: NF90_get_VAR 473 586 use netcdf95, only: NF95_PUT_VAR 474 587 475 588 IMPLICIT NONE 476 589 c================================================================= … … 484 597 #include "comgeom.h" 485 598 #include "temps.h" 486 599 #include "iniprint.h" 487 600 488 601 INTEGER l … … 501 614 PARAMETER (length = 100) 502 615 REAL tab_cntrl(length) ! tableau des parametres du run 503 character *20 modname616 character(len=*),parameter :: modname='dynredem1' 504 617 character*80 abort_message 505 618 c … … 509 622 510 623 logical exist_file 624 character(len=12) :: start_file_type="earth" ! default start file type 625 626 if ((planet_type.eq."generic").or.(planet_type.eq."mars")) then 627 write(lunout,*) trim(modname),' : Planeto-like start file' 628 start_file_type="planeto" 629 else 630 write(lunout,*) trim(modname),' : Earth-like start file' 631 endif 511 632 512 633 call Gather_Field(ucov,ip1jmp1,llm,0) … … 523 644 if (mpi_rank==0) then 524 645 525 modname = 'dynredem1'526 646 ierr = NF_OPEN(fichnom, NF_WRITE, nid) 527 647 IF (ierr .NE. NF_NOERR) THEN 528 PRINT*, " Pb. d ouverture "//fichnom648 PRINT*, "dynredem1: Pb. d ouverture "//trim(fichnom) 529 649 CALL abort 530 650 ENDIF … … 533 653 534 654 nb = nb + 1 535 ierr = NF_INQ_VARID(nid, "temps", nvarid) 536 IF (ierr .NE. NF_NOERR) THEN 537 print *, NF_STRERROR(ierr) 538 abort_message='Variable temps n est pas definie' 539 CALL abort_gcm(modname,abort_message,ierr) 540 ENDIF 655 if (start_file_type.eq."earth") then 656 ierr = NF_INQ_VARID(nid, "temps", nvarid) 657 IF (ierr .NE. NF_NOERR) THEN 658 write(lunout,*) NF_STRERROR(ierr) 659 abort_message='Variable temps n est pas definie' 660 CALL abort_gcm(modname,abort_message,ierr) 661 ENDIF 662 else 663 ierr = NF_INQ_VARID(nid,"Time", nvarid) 664 IF (ierr .NE. NF_NOERR) THEN 665 write(lunout,*) NF_STRERROR(ierr) 666 abort_message='Variable Time not found' 667 CALL abort_gcm(modname,abort_message,ierr) 668 ENDIF 669 endif ! of if (start_file_type.eq."earth") 541 670 call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/)) 542 671 PRINT*, "Enregistrement pour ", nb, time … … 552 681 ENDIF 553 682 ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl) 554 tab_cntrl(31) = REAL(itau_dyn + itaufin) 683 if (start_file_type=="earth") then 684 tab_cntrl(31) = REAL(itau_dyn + itaufin) 685 else 686 tab_cntrl(31) = 0 687 endif 555 688 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 556 689 -
trunk/LMDZ.COMMON/libf/dyn3dpar/integrd_p.F
r776 r907 145 145 write(lunout,*) " lon = ",rlonv(i)*180./pi, " deg", 146 146 & " lat = ",rlatu(j)*180./pi, " deg" 147 write(lunout,*) " psm1(ij)=",psm1(stop_it)," dt=",dt, 148 & " dp(ij)=",dp(stop_it) 147 149 ENDIF 148 150 -
trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
r903 r907 1585 1585 1586 1586 write(*,*)'PHYSIQ: for physdem ztime_fin =',ztime_fin 1587 #ifdef CPP_PARA 1588 ! for now in parallel we use a different routine to write restartfi.nc 1589 call phyredem(ngrid,"restartfi.nc", & 1590 ptimestep,pday,ztime_fin,tsurf,tsoil,emis,q2,qsurf_hist, & 1591 cloudfrac,totcloudfrac,hice) 1592 #else 1587 1593 call physdem1(ngrid,"restartfi.nc",long,lati,nsoilmx,nq, & 1588 1594 ptimestep,pday,ztime_fin,tsurf,tsoil,emis,q2,qsurf_hist, & 1589 1595 area,albedodat,inertiedat,zmea,zstd,zsig,zgam,zthe, & 1590 1596 cloudfrac,totcloudfrac,hice,noms) 1597 #endif 1591 1598 endif 1592 1599
Note: See TracChangeset
for help on using the changeset viewer.