Changeset 1669 for LMDZ5/branches/testing/libf/dyn3dpar/dynredem_p.F
- Timestamp:
- Oct 16, 2012, 2:41:50 PM (12 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 1629-1633,1635,1637-1659,1666-1668
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/libf/dyn3dpar/dynredem_p.F
r1665 r1669 9 9 USE parallel 10 10 USE infotrac 11 use netcdf95, only: NF95_PUT_VAR 12 11 13 IMPLICIT NONE 12 14 c======================================================================= … … 19 21 #include "comconst.h" 20 22 #include "comvert.h" 21 #include "comgeom .h"23 #include "comgeom2.h" 22 24 #include "temps.h" 23 25 #include "ener.h" … … 30 32 c ---------- 31 33 INTEGER iday_end 32 REAL phis(i p1jmp1)34 REAL phis(iip1, jjp1) 33 35 CHARACTER*(*) fichnom 34 36 … … 56 58 character*30 unites 57 59 60 58 61 c----------------------------------------------------------------------- 59 62 if (mpi_rank==0) then … … 69 72 mmois0=1 70 73 jjour0=1 71 #endif 74 #endif 72 75 73 76 DO l=1,length 74 77 tab_cntrl(l) = 0. 75 78 ENDDO 76 tab_cntrl(1) = 77 tab_cntrl(2) = 78 tab_cntrl(3) = 79 tab_cntrl(4) = 80 tab_cntrl(5) = 79 tab_cntrl(1) = REAL(iim) 80 tab_cntrl(2) = REAL(jjm) 81 tab_cntrl(3) = REAL(llm) 82 tab_cntrl(4) = REAL(day_ref) 83 tab_cntrl(5) = REAL(annee_ref) 81 84 tab_cntrl(6) = rad 82 85 tab_cntrl(7) = omeg … … 118 121 ENDIF 119 122 120 tab_cntrl(30) = 121 tab_cntrl(31) = 123 tab_cntrl(30) = REAL(iday_end) 124 tab_cntrl(31) = REAL(itau_dyn + itaufin) 122 125 c start_time: start_time of simulation (not necessarily 0.) 123 126 tab_cntrl(32) = start_time … … 165 168 . "Parametres de controle") 166 169 ierr = NF_ENDDEF(nid) 167 #ifdef NC_DOUBLE 168 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 169 #else 170 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 171 #endif 170 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 172 171 c 173 172 ierr = NF_REDEF (nid) … … 182 181 . "Longitudes des points U") 183 182 ierr = NF_ENDDEF(nid) 184 #ifdef NC_DOUBLE 185 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonu) 186 #else 187 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonu) 188 #endif 183 call NF95_PUT_VAR(nid,nvarid,rlonu) 189 184 c 190 185 ierr = NF_REDEF (nid) … … 199 194 . "Latitudes des points U") 200 195 ierr = NF_ENDDEF(nid) 201 #ifdef NC_DOUBLE 202 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu) 203 #else 204 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu) 205 #endif 196 call NF95_PUT_VAR (nid,nvarid,rlatu) 206 197 c 207 198 ierr = NF_REDEF (nid) … … 216 207 . "Longitudes des points V") 217 208 ierr = NF_ENDDEF(nid) 218 #ifdef NC_DOUBLE 219 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv) 220 #else 221 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv) 222 #endif 209 call NF95_PUT_VAR(nid,nvarid,rlonv) 223 210 c 224 211 ierr = NF_REDEF (nid) … … 233 220 . "Latitudes des points V") 234 221 ierr = NF_ENDDEF(nid) 235 #ifdef NC_DOUBLE 236 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatv) 237 #else 238 ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatv) 239 #endif 222 call NF95_PUT_VAR(nid,nvarid,rlatv) 240 223 c 241 224 ierr = NF_REDEF (nid) … … 250 233 . "Numero naturel des couches s") 251 234 ierr = NF_ENDDEF(nid) 252 #ifdef NC_DOUBLE 253 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsigs) 254 #else 255 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsigs) 256 #endif 235 call NF95_PUT_VAR(nid,nvarid,nivsigs) 257 236 c 258 237 ierr = NF_REDEF (nid) … … 267 246 . "Numero naturel des couches sigma") 268 247 ierr = NF_ENDDEF(nid) 269 #ifdef NC_DOUBLE 270 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,nivsig) 271 #else 272 ierr = NF_PUT_VAR_REAL (nid,nvarid,nivsig) 273 #endif 248 call NF95_PUT_VAR(nid,nvarid,nivsig) 274 249 c 275 250 ierr = NF_REDEF (nid) … … 284 259 . "Coefficient A pour hybride") 285 260 ierr = NF_ENDDEF(nid) 286 #ifdef NC_DOUBLE 287 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ap) 288 #else 289 ierr = NF_PUT_VAR_REAL (nid,nvarid,ap) 290 #endif 261 call NF95_PUT_VAR(nid,nvarid,ap) 291 262 c 292 263 ierr = NF_REDEF (nid) … … 301 272 . "Coefficient B pour hybride") 302 273 ierr = NF_ENDDEF(nid) 303 #ifdef NC_DOUBLE 304 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bp) 305 #else 306 ierr = NF_PUT_VAR_REAL (nid,nvarid,bp) 307 #endif 274 call NF95_PUT_VAR(nid,nvarid,bp) 308 275 c 309 276 ierr = NF_REDEF (nid) … … 316 283 cIM 220306 END 317 284 ierr = NF_ENDDEF(nid) 318 #ifdef NC_DOUBLE 319 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,presnivs) 320 #else 321 ierr = NF_PUT_VAR_REAL (nid,nvarid,presnivs) 322 #endif 285 call NF95_PUT_VAR(nid,nvarid,presnivs) 323 286 c 324 287 c Coefficients de passage cov. <-> contra. <--> naturel … … 337 300 . "Coefficient de passage pour U") 338 301 ierr = NF_ENDDEF(nid) 339 #ifdef NC_DOUBLE 340 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu) 341 #else 342 ierr = NF_PUT_VAR_REAL (nid,nvarid,cu) 343 #endif 302 call NF95_PUT_VAR(nid,nvarid,cu) 344 303 c 345 304 ierr = NF_REDEF (nid) … … 356 315 . "Coefficient de passage pour V") 357 316 ierr = NF_ENDDEF(nid) 358 #ifdef NC_DOUBLE 359 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv) 360 #else 361 ierr = NF_PUT_VAR_REAL (nid,nvarid,cv) 362 #endif 317 call NF95_PUT_VAR(nid,nvarid,cv) 363 318 c 364 319 c Aire de chaque maille: … … 377 332 . "Aires de chaque maille") 378 333 ierr = NF_ENDDEF(nid) 379 #ifdef NC_DOUBLE 380 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire) 381 #else 382 ierr = NF_PUT_VAR_REAL (nid,nvarid,aire) 383 #endif 334 call NF95_PUT_VAR(nid,nvarid,aire) 384 335 c 385 336 c Geopentiel au sol: … … 398 349 . "Geopotentiel au sol") 399 350 ierr = NF_ENDDEF(nid) 400 #ifdef NC_DOUBLE 401 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis) 402 #else 403 ierr = NF_PUT_VAR_REAL (nid,nvarid,phis) 404 #endif 351 call NF95_PUT_VAR(nid,nvarid,phis) 405 352 c 406 353 c Definir les variables pour pouvoir les enregistrer plus tard: … … 510 457 ierr = NF_ENDDEF(nid) ! sortir du mode de definition 511 458 ierr = NF_CLOSE(nid) ! fermer le fichier 512 513 459 514 460 PRINT*,'iim,jjm,llm,iday_end',iim,jjm,llm,iday_end … … 524 470 USE infotrac 525 471 USE control_mod 472 use netcdf, only: NF90_get_VAR 473 use netcdf95, only: NF95_PUT_VAR 474 526 475 IMPLICIT NONE 527 476 c================================================================= … … 536 485 #include "temps.h" 537 486 487 538 488 INTEGER l 539 REAL vcov(i p1jm,llm),ucov(ip1jmp1,llm)540 REAL teta(i p1jmp1,llm)541 REAL ps(i p1jmp1),masse(ip1jmp1,llm)542 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) 543 493 CHARACTER*(*) fichnom 544 494 … … 546 496 INTEGER nid, nvarid, nid_trac, nvarid_trac 547 497 REAL trac_tmp(ip1jmp1,llm) 548 INTEGER ierr, ierr_file 498 INTEGER ierr, ierr_file 549 499 INTEGER iq 550 500 INTEGER length … … 567 517 568 518 do iq=1,nqtot 569 call Gather_Field(q( 1,1,iq),ip1jmp1,llm,0)519 call Gather_Field(q(:,:,:,iq),ip1jmp1,llm,0) 570 520 enddo 571 521 … … 589 539 CALL abort_gcm(modname,abort_message,ierr) 590 540 ENDIF 591 #ifdef NC_DOUBLE 592 ierr = NF_PUT_VAR1_DOUBLE (nid,nvarid,nb,time) 593 #else 594 ierr = NF_PUT_VAR1_REAL (nid,nvarid,nb,time) 595 #endif 541 call NF95_PUT_VAR(nid,nvarid,time,start=(/nb/)) 596 542 PRINT*, "Enregistrement pour ", nb, time 597 543 … … 605 551 CALL abort_gcm(modname,abort_message,ierr) 606 552 ENDIF 607 #ifdef NC_DOUBLE 608 ierr = NF_GET_VAR_DOUBLE(nid, nvarid, tab_cntrl) 609 #else 610 ierr = NF_GET_VAR_REAL(nid, nvarid, tab_cntrl) 611 #endif 612 tab_cntrl(31) = REAL(itau_dyn + itaufin) 613 #ifdef NC_DOUBLE 614 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) 615 #else 616 ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) 617 #endif 553 ierr = NF90_GET_VAR(nid, nvarid, tab_cntrl) 554 tab_cntrl(31) = REAL(itau_dyn + itaufin) 555 call NF95_PUT_VAR(nid,nvarid,tab_cntrl) 618 556 619 557 c Ecriture des champs … … 624 562 CALL abort 625 563 ENDIF 626 #ifdef NC_DOUBLE 627 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ucov) 628 #else 629 ierr = NF_PUT_VAR_REAL (nid,nvarid,ucov) 630 #endif 564 call NF95_PUT_VAR(nid,nvarid,ucov) 631 565 632 566 ierr = NF_INQ_VARID(nid, "vcov", nvarid) … … 635 569 CALL abort 636 570 ENDIF 637 #ifdef NC_DOUBLE 638 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,vcov) 639 #else 640 ierr = NF_PUT_VAR_REAL (nid,nvarid,vcov) 641 #endif 571 call NF95_PUT_VAR(nid,nvarid,vcov) 642 572 643 573 ierr = NF_INQ_VARID(nid, "teta", nvarid) … … 646 576 CALL abort 647 577 ENDIF 648 #ifdef NC_DOUBLE 649 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,teta) 650 #else 651 ierr = NF_PUT_VAR_REAL (nid,nvarid,teta) 652 #endif 578 call NF95_PUT_VAR(nid,nvarid,teta) 653 579 654 580 IF (type_trac == 'inca') THEN … … 675 601 CALL abort 676 602 ENDIF 677 #ifdef NC_DOUBLE 678 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 679 #else 680 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 681 #endif 603 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 682 604 ELSE ! type_trac = inca 683 605 ! lecture de la valeur du traceur dans start_trac.nc … … 691 613 CALL abort 692 614 ENDIF 693 #ifdef NC_DOUBLE 694 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 695 #else 696 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 697 #endif 615 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 698 616 699 617 ELSE 700 618 PRINT*, tname(iq), "est present dans start_trac.nc" 701 #ifdef NC_DOUBLE 702 ierr = NF_GET_VAR_DOUBLE(nid_trac, nvarid_trac, trac_tmp) 703 #else 704 ierr = NF_GET_VAR_REAL(nid_trac, nvarid_trac, trac_tmp) 705 #endif 619 ierr = NF90_GET_VAR(nid_trac, nvarid_trac, trac_tmp) 706 620 IF (ierr .NE. NF_NOERR) THEN 707 621 PRINT*, "Lecture echouee pour", tname(iq) … … 713 627 CALL abort 714 628 ENDIF 715 #ifdef NC_DOUBLE 716 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,trac_tmp) 717 #else 718 ierr = NF_PUT_VAR_REAL (nid,nvarid,trac_tmp) 719 #endif 629 call NF95_PUT_VAR(nid, nvarid, trac_tmp) 720 630 721 631 ENDIF ! IF (ierr .NE. NF_NOERR) … … 728 638 CALL abort 729 639 ENDIF 730 #ifdef NC_DOUBLE 731 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,q(1,1,iq)) 732 #else 733 ierr = NF_PUT_VAR_REAL (nid,nvarid,q(1,1,iq)) 734 #endif 640 call NF95_PUT_VAR(nid,nvarid,q(:,:,:,iq)) 735 641 ENDIF ! (ierr_file .ne. 2) 736 END IF ! 642 END IF !type_trac 737 643 738 644 ENDDO … … 746 652 CALL abort 747 653 ENDIF 748 #ifdef NC_DOUBLE 749 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,masse) 750 #else 751 ierr = NF_PUT_VAR_REAL (nid,nvarid,masse) 752 #endif 654 call NF95_PUT_VAR(nid,nvarid,masse) 753 655 c 754 656 ierr = NF_INQ_VARID(nid, "ps", nvarid) … … 757 659 CALL abort 758 660 ENDIF 759 #ifdef NC_DOUBLE 760 ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ps) 761 #else 762 ierr = NF_PUT_VAR_REAL (nid,nvarid,ps) 763 #endif 661 call NF95_PUT_VAR(nid,nvarid,ps) 764 662 765 663 ierr = NF_CLOSE(nid)
Note: See TracChangeset
for help on using the changeset viewer.