Changeset 1635 for LMDZ5/trunk/libf/dyn3d/dynredem.F
- Timestamp:
- Jul 12, 2012, 1:37:16 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/dyn3d/dynredem.F
r1577 r1635 8 8 #endif 9 9 USE infotrac 10 use netcdf95, only: NF95_PUT_VAR 10 11 11 12 IMPLICIT NONE … … 19 20 #include "comconst.h" 20 21 #include "comvert.h" 21 #include "comgeom .h"22 #include "comgeom2.h" 22 23 #include "temps.h" 23 24 #include "ener.h" … … 31 32 c ---------- 32 33 INTEGER iday_end 33 REAL phis(i p1jmp1)34 REAL phis(iip1, jjp1) 34 35 CHARACTER*(*) fichnom 35 36 … … 166 167 . "Parametres de controle") 167 168 ierr = NF_ENDDEF(nid) 168 #ifdef NC_DOUBLE 169 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 170 #else 171 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 172 #endif 169 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 173 170 c 174 171 ierr = NF_REDEF (nid) … … 183 180 . "Longitudes des points U") 184 181 ierr = NF_ENDDEF(nid) 185 #ifdef NC_DOUBLE 186 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonu) 187 #else 188 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonu) 189 #endif 182 call NF95_PUT_VAR(nid,nvarid,rlonu) 190 183 c 191 184 ierr = NF_REDEF (nid) … … 200 193 . "Latitudes des points U") 201 194 ierr = NF_ENDDEF(nid) 202 #ifdef NC_DOUBLE 203 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu) 204 #else 205 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu) 206 #endif 195 call NF95_PUT_VAR (nid,nvarid,rlatu) 207 196 c 208 197 ierr = NF_REDEF (nid) … … 217 206 . "Longitudes des points V") 218 207 ierr = NF_ENDDEF(nid) 219 #ifdef NC_DOUBLE 220 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv) 221 #else 222 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv) 223 #endif 208 call NF95_PUT_VAR(nid,nvarid,rlonv) 224 209 c 225 210 ierr = NF_REDEF (nid) … … 234 219 . "Latitudes des points V") 235 220 ierr = NF_ENDDEF(nid) 236 #ifdef NC_DOUBLE 237 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatv) 238 #else 239 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatv) 240 #endif 221 call NF95_PUT_VAR(nid,nvarid,rlatv) 241 222 c 242 223 ierr = NF_REDEF (nid) … … 251 232 . "Numero naturel des couches s") 252 233 ierr = NF_ENDDEF(nid) 253 #ifdef NC_DOUBLE 254 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsigs) 255 #else 256 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsigs) 257 #endif 234 call NF95_PUT_VAR(nid,nvarid,nivsigs) 258 235 c 259 236 ierr = NF_REDEF (nid) … … 268 245 . "Numero naturel des couches sigma") 269 246 ierr = NF_ENDDEF(nid) 270 #ifdef NC_DOUBLE 271 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsig) 272 #else 273 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsig) 274 #endif 247 call NF95_PUT_VAR(nid,nvarid,nivsig) 275 248 c 276 249 ierr = NF_REDEF (nid) … … 285 258 . "Coefficient A pour hybride") 286 259 ierr = NF_ENDDEF(nid) 287 #ifdef NC_DOUBLE 288 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ap) 289 #else 290 ierr = NF_PUT_VAR_REAL (nid,nvarid,ap) 291 #endif 260 call NF95_PUT_VAR(nid,nvarid,ap) 292 261 c 293 262 ierr = NF_REDEF (nid) … … 302 271 . "Coefficient B pour hybride") 303 272 ierr = NF_ENDDEF(nid) 304 #ifdef NC_DOUBLE 305 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bp) 306 #else 307 ierr = NF_PUT_VAR_REAL (nid,nvarid,bp) 308 #endif 273 call NF95_PUT_VAR(nid,nvarid,bp) 309 274 c 310 275 ierr = NF_REDEF (nid) … … 317 282 cIM 220306 END 318 283 ierr = NF_ENDDEF(nid) 319 #ifdef NC_DOUBLE 320 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,presnivs) 321 #else 322 ierr = NF_PUT_VAR_REAL (nid,nvarid,presnivs) 323 #endif 284 call NF95_PUT_VAR(nid,nvarid,presnivs) 324 285 c 325 286 c Coefficients de passage cov. <-> contra. <--> naturel … … 338 299 . "Coefficient de passage pour U") 339 300 ierr = NF_ENDDEF(nid) 340 #ifdef NC_DOUBLE 341 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu) 342 #else 343 ierr = NF_PUT_VAR_REAL (nid,nvarid,cu) 344 #endif 301 call NF95_PUT_VAR(nid,nvarid,cu) 345 302 c 346 303 ierr = NF_REDEF (nid) … … 357 314 . "Coefficient de passage pour V") 358 315 ierr = NF_ENDDEF(nid) 359 #ifdef NC_DOUBLE 360 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv) 361 #else 362 ierr = NF_PUT_VAR_REAL (nid,nvarid,cv) 363 #endif 316 call NF95_PUT_VAR(nid,nvarid,cv) 364 317 c 365 318 c Aire de chaque maille: … … 378 331 . "Aires de chaque maille") 379 332 ierr = NF_ENDDEF(nid) 380 #ifdef NC_DOUBLE 381 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire) 382 #else 383 ierr = NF_PUT_VAR_REAL (nid,nvarid,aire) 384 #endif 333 call NF95_PUT_VAR(nid,nvarid,aire) 385 334 c 386 335 c Geopentiel au sol: … … 399 348 . "Geopotentiel au sol") 400 349 ierr = NF_ENDDEF(nid) 401 #ifdef NC_DOUBLE 402 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis) 403 #else 404 ierr = NF_PUT_VAR_REAL (nid,nvarid,phis) 405 #endif 350 call NF95_PUT_VAR(nid,nvarid,phis) 406 351 c 407 352 c Definir les variables pour pouvoir les enregistrer plus tard: … … 524 469 USE infotrac 525 470 USE control_mod 471 use netcdf, only: NF90_get_VAR 472 use netcdf95, only: NF95_PUT_VAR 526 473 527 474 IMPLICIT NONE … … 540 487 541 488 INTEGER l 542 REAL vcov(i p1jm,llm),ucov(ip1jmp1,llm)543 REAL teta(i p1jmp1,llm)544 REAL ps(i p1jmp1),masse(ip1jmp1,llm)545 REAL q(i p1jmp1,llm,nqtot)489 REAL vcov(iip1,jjm,llm),ucov(iip1, jjp1,llm) 490 REAL teta(iip1, jjp1,llm) 491 REAL ps(iip1, jjp1),masse(iip1, jjp1,llm) 492 REAL q(iip1, jjp1, llm, nqtot) 546 493 CHARACTER*(*) fichnom 547 494 … … 577 524 CALL abort_gcm(modname,abort_message,ierr) 578 525 ENDIF 579 #ifdef NC_DOUBLE 580 ierr = NF_PUT_VAR1_DOUBLE (nid,nvarid,nb,time) 581 #else 582 ierr = NF_PUT_VAR1_REAL (nid,nvarid,nb,time) 583 #endif 526 call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/)) 584 527 write(lunout,*) "dynredem1: Enregistrement pour ", nb, time 585 528 … … 593 536 CALL abort_gcm(modname,abort_message,ierr) 594 537 ENDIF 595 #ifdef NC_DOUBLE 596 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tab_cntrl) 597 #else 598 ierr = NF_GET_VAR_REAL(nid, nvarid, tab_cntrl) 599 #endif 538 ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl) 600 539 tab_cntrl(31) = REAL(itau_dyn + itaufin) 601 #ifdef NC_DOUBLE 602 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 603 #else 604 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 605 #endif 540 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 606 541 607 542 c Ecriture des champs … … 613 548 CALL abort_gcm(modname,abort_message,ierr) 614 549 ENDIF 615 #ifdef NC_DOUBLE 616 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ucov) 617 #else 618 ierr = NF_PUT_VAR_REAL (nid,nvarid,ucov) 619 #endif 550 call NF95_PUT_VAR(nid,nvarid,ucov) 620 551 621 552 ierr = NF_INQ_VARID(nid, "vcov", nvarid) … … 625 556 CALL abort_gcm(modname,abort_message,ierr) 626 557 ENDIF 627 #ifdef NC_DOUBLE 628 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,vcov) 629 #else 630 ierr = NF_PUT_VAR_REAL (nid,nvarid,vcov) 631 #endif 558 call NF95_PUT_VAR(nid,nvarid,vcov) 632 559 633 560 ierr = NF_INQ_VARID(nid, "teta", nvarid) … … 637 564 CALL abort_gcm(modname,abort_message,ierr) 638 565 ENDIF 639 #ifdef NC_DOUBLE 640 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,teta) 641 #else 642 ierr = NF_PUT_VAR_REAL (nid,nvarid,teta) 643 #endif 566 call NF95_PUT_VAR(nid,nvarid,teta) 644 567 645 568 IF (type_trac == 'inca') THEN … … 663 586 CALL abort_gcm(modname,abort_message,ierr) 664 587 ENDIF 665 #ifdef NC_DOUBLE 666 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 667 #else 668 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 669 #endif 588 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 670 589 ELSE ! type_trac = inca 671 590 ! lecture de la valeur du traceur dans start_trac.nc … … 682 601 CALL abort_gcm(modname,abort_message,ierr) 683 602 ENDIF 684 #ifdef NC_DOUBLE 685 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 686 #else 687 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 688 #endif 603 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 689 604 690 605 ELSE 691 606 write(lunout,*) "dynredem1: ",trim(tname(iq)), 692 607 & " est present dans start_trac.nc" 693 #ifdef NC_DOUBLE 694 ierr = NF_GET_VAR_DOUBLE(nid_trac, nvarid_trac, trac_tmp) 695 #else 696 ierr = NF_GET_VAR_REAL(nid_trac, nvarid_trac, trac_tmp) 697 #endif 608 ierr = NF90_GET_VAR(nid_trac, nvarid_trac, trac_tmp) 698 609 IF (ierr .NE. NF_NOERR) THEN 699 610 abort_message="dynredem1: Lecture echouee pour"// … … 709 620 CALL abort_gcm(modname,abort_message,ierr) 710 621 ENDIF 711 #ifdef NC_DOUBLE 712 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,trac_tmp) 713 #else 714 ierr = NF_PUT_VAR_REAL (nid,nvarid,trac_tmp) 715 #endif 622 call NF95_PUT_VAR(nid, nvarid, trac_tmp) 716 623 717 624 ENDIF ! IF (ierr .NE. NF_NOERR) … … 726 633 CALL abort_gcm(modname,abort_message,ierr) 727 634 ENDIF 728 #ifdef NC_DOUBLE 729 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 730 #else 731 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 732 #endif 635 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 733 636 ENDIF ! (ierr_file .ne. 2) 734 637 END IF !type_trac … … 743 646 CALL abort_gcm(modname,abort_message,ierr) 744 647 ENDIF 745 #ifdef NC_DOUBLE 746 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,masse) 747 #else 748 ierr = NF_PUT_VAR_REAL (nid,nvarid,masse) 749 #endif 648 call NF95_PUT_VAR(nid,nvarid,masse) 750 649 c 751 650 ierr = NF_INQ_VARID(nid, "ps", nvarid) … … 755 654 CALL abort_gcm(modname,abort_message,ierr) 756 655 ENDIF 757 #ifdef NC_DOUBLE 758 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ps) 759 #else 760 ierr = NF_PUT_VAR_REAL (nid,nvarid,ps) 761 #endif 656 call NF95_PUT_VAR(nid,nvarid,ps) 762 657 763 658 ierr = NF_CLOSE(nid)
Note: See TracChangeset
for help on using the changeset viewer.