Changeset 2025
- Timestamp:
- Apr 25, 2014, 7:58:33 PM (11 years ago)
- Location:
- LMDZ5/trunk/libf
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk/libf/dyn3d/guide_mod.F90
r2021 r2025 437 437 ! Sauvegarde du guidage? 438 438 f_out=((MOD(itau,iguide_sav).EQ.0).AND.guide_sav) 439 IF (f_out) CALL guide_out("S ",jjp1,1,ps)439 IF (f_out) CALL guide_out("SP",jjp1,1,ps) 440 440 441 441 if (guide_u) then … … 447 447 if (guide_zon) CALL guide_zonave(1,jjp1,llm,f_add) 448 448 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_u) 449 IF (f_out) CALL guide_out("U",jjp1,llm,f_add/factt) 449 IF (f_out) CALL guide_out("ua",jjp1,llm,(1.-tau)*ugui1+tau*ugui2) 450 IF (f_out) CALL guide_out("u",jjp1,llm,ucov) 451 IF (f_out) CALL guide_out("ucov",jjp1,llm,f_add/factt) 450 452 ucov=ucov+f_add 451 453 endif … … 459 461 if (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 460 462 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_T) 461 IF (f_out) CALL guide_out(" T",jjp1,llm,f_add/factt)463 IF (f_out) CALL guide_out("teta",jjp1,llm,f_add/factt) 462 464 teta=teta+f_add 463 465 endif … … 471 473 if (guide_zon) CALL guide_zonave(2,jjp1,1,f_add(1:ip1jmp1,1)) 472 474 CALL guide_addfield(ip1jmp1,1,f_add(1:ip1jmp1,1),alpha_P) 473 IF (f_out) CALL guide_out(" P",jjp1,1,f_add(1:ip1jmp1,1)/factt)475 IF (f_out) CALL guide_out("ps",jjp1,1,f_add(1:ip1jmp1,1)/factt) 474 476 ps=ps+f_add(1:ip1jmp1,1) 475 477 CALL pression(ip1jmp1,ap,bp,ps,p) … … 485 487 if (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 486 488 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_Q) 487 IF (f_out) CALL guide_out(" Q",jjp1,llm,f_add/factt)489 IF (f_out) CALL guide_out("q",jjp1,llm,f_add/factt) 488 490 q=q+f_add 489 491 endif … … 497 499 if (guide_zon) CALL guide_zonave(2,jjm,llm,f_add(1:ip1jm,:)) 498 500 CALL guide_addfield(ip1jm,llm,f_add(1:ip1jm,:),alpha_v) 499 IF (f_out) CALL guide_out("V",jjm,llm,f_add(1:ip1jm,:)/factt) 501 IF (f_out) CALL guide_out("v",jjm,llm,vcov) 502 IF (f_out) CALL guide_out("va",jjm,llm,(1.-tau)*vgui1+tau*vgui2) 503 IF (f_out) CALL guide_out("vcov",jjm,llm,f_add(1:ip1jm,:)/factt) 500 504 vcov=vcov+f_add(1:ip1jm,:) 501 505 endif … … 1508 1512 1509 1513 ! Variables entree 1510 CHARACTER , INTENT(IN) :: varname1514 CHARACTER*(*), INTENT(IN) :: varname 1511 1515 INTEGER, INTENT (IN) :: hsize,vsize 1512 1516 REAL, DIMENSION (iip1,hsize,vsize), INTENT(IN) :: field … … 1517 1521 INTEGER :: nid, id_lonu, id_lonv, id_latu, id_latv, id_tim, id_lev 1518 1522 INTEGER :: vid_lonu,vid_lonv,vid_latu,vid_latv,vid_cu,vid_cv,vid_lev 1523 INTEGER :: vid_au,vid_av 1519 1524 INTEGER, DIMENSION (3) :: dim3 1520 1525 INTEGER, DIMENSION (4) :: dim4,count,start 1521 INTEGER :: ierr, varid 1526 INTEGER :: ierr, varid,l 1527 REAL, DIMENSION (iip1,hsize,vsize) :: field2 1522 1528 1523 1529 print *,'Guide: output timestep',timestep,'var ',varname … … 1543 1549 ierr=NF_DEF_VAR(nid,"LEVEL",NF_FLOAT,1,id_lev,vid_lev) 1544 1550 ierr=NF_DEF_VAR(nid,"cu",NF_FLOAT,2,(/id_lonu,id_latu/),vid_cu) 1551 ierr=NF_DEF_VAR(nid,"au",NF_FLOAT,2,(/id_lonu,id_latu/),vid_au) 1545 1552 ierr=NF_DEF_VAR(nid,"cv",NF_FLOAT,2,(/id_lonv,id_latv/),vid_cv) 1553 ierr=NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av) 1546 1554 1547 1555 ierr=NF_ENDDEF(nid) … … 1556 1564 ierr = NF_PUT_VAR_DOUBLE(nid,vid_cu,cu) 1557 1565 ierr = NF_PUT_VAR_DOUBLE(nid,vid_cv,cv) 1566 ierr = NF_PUT_VAR_DOUBLE(nid,vid_au,alpha_u) 1567 ierr = NF_PUT_VAR_DOUBLE(nid,vid_av,alpha_v) 1558 1568 #else 1559 1569 ierr = NF_PUT_VAR_REAL(nid,vid_lonu,rlonu*180./pi) … … 1564 1574 ierr = NF_PUT_VAR_REAL(nid,vid_cu,cu) 1565 1575 ierr = NF_PUT_VAR_REAL(nid,vid_cv,cv) 1576 ierr = NF_PUT_VAR_REAL(nid,vid_au,alpha_u) 1577 ierr = NF_PUT_VAR_REAL(nid,vid_av,alpha_v) 1566 1578 #endif 1567 1579 ! -------------------------------------------------------------------- … … 1580 1592 IF (guide_u) THEN 1581 1593 dim4=(/id_lonu,id_latu,id_lev,id_tim/) 1594 ierr = NF_DEF_VAR(nid,"u",NF_FLOAT,4,dim4,varid) 1595 ierr = NF_DEF_VAR(nid,"ua",NF_FLOAT,4,dim4,varid) 1582 1596 ierr = NF_DEF_VAR(nid,"ucov",NF_FLOAT,4,dim4,varid) 1583 1597 ENDIF … … 1585 1599 IF (guide_v) THEN 1586 1600 dim4=(/id_lonv,id_latv,id_lev,id_tim/) 1601 ierr = NF_DEF_VAR(nid,"v",NF_FLOAT,4,dim4,varid) 1602 ierr = NF_DEF_VAR(nid,"va",NF_FLOAT,4,dim4,varid) 1587 1603 ierr = NF_DEF_VAR(nid,"vcov",NF_FLOAT,4,dim4,varid) 1588 1604 ENDIF … … 1607 1623 ierr=NF_OPEN("guide_ins.nc",NF_WRITE,nid) 1608 1624 1625 IF (varname=="SP") timestep=timestep+1 1626 1627 ierr = NF_INQ_VARID(nid,varname,varid) 1609 1628 SELECT CASE (varname) 1610 CASE ("S") 1611 timestep=timestep+1 1612 ierr = NF_INQ_VARID(nid,"SP",varid) 1629 CASE ("SP","ps") 1613 1630 start=(/1,1,timestep,0/) 1614 1631 count=(/iip1,jjp1,1,0/) 1615 #ifdef NC_DOUBLE 1616 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1617 #else 1618 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1619 #endif 1620 CASE ("P") 1621 ierr = NF_INQ_VARID(nid,"ps",varid) 1622 start=(/1,1,timestep,0/) 1623 count=(/iip1,jjp1,1,0/) 1624 #ifdef NC_DOUBLE 1625 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1626 #else 1627 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1628 #endif 1629 CASE ("U") 1630 ierr = NF_INQ_VARID(nid,"ucov",varid) 1632 CASE ("v","va","vcov") 1633 start=(/1,1,1,timestep/) 1634 count=(/iip1,jjm,llm,1/) 1635 CASE DEFAULT 1631 1636 start=(/1,1,1,timestep/) 1632 1637 count=(/iip1,jjp1,llm,1/) 1638 END SELECT 1639 1640 SELECT CASE (varname) 1641 CASE("u","ua") 1642 DO l=1,llm ; field2(:,2:jjm,l)=field(:,2:jjm,l)/cu(:,2:jjm) ; ENDDO 1643 field2(:,1,:)=0. ; field2(:,jjp1,:)=0. 1644 CASE("v","va") 1645 DO l=1,llm ; field2(:,:,l)=field(:,:,l)/cv(:,:) ; ENDDO 1646 CASE DEFAULT 1647 field2=field 1648 END SELECT 1649 1650 1633 1651 #ifdef NC_DOUBLE 1634 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field)1652 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field2) 1635 1653 #else 1636 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field)1654 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field2) 1637 1655 #endif 1638 CASE ("V") 1639 ierr = NF_INQ_VARID(nid,"vcov",varid) 1640 start=(/1,1,1,timestep/) 1641 count=(/iip1,jjm,llm,1/) 1642 #ifdef NC_DOUBLE 1643 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1644 #else 1645 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1646 #endif 1647 CASE ("T") 1648 ierr = NF_INQ_VARID(nid,"teta",varid) 1649 start=(/1,1,1,timestep/) 1650 count=(/iip1,jjp1,llm,1/) 1651 #ifdef NC_DOUBLE 1652 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1653 #else 1654 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1655 #endif 1656 CASE ("Q") 1657 ierr = NF_INQ_VARID(nid,"q",varid) 1658 start=(/1,1,1,timestep/) 1659 count=(/iip1,jjp1,llm,1/) 1660 #ifdef NC_DOUBLE 1661 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1662 #else 1663 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1664 #endif 1665 END SELECT 1666 1656 1667 1657 ierr = NF_CLOSE(nid) 1668 1658 -
LMDZ5/trunk/libf/dyn3dpar/guide_p_mod.F90
r2021 r2025 492 492 IF (f_out) THEN 493 493 ! Calcul niveaux pression milieu de couches 494 495 494 CALL pression_p( ip1jmp1, ap, bp, ps, p ) 495 if (pressure_exner) then 496 496 CALL exner_hyb_p(ip1jmp1,ps,p,pks,pk) 497 497 else 498 498 CALL exner_milieu_p(ip1jmp1,ps,p,pks,pk) 499 499 endif 500 500 unskap=1./kappa 501 502 503 504 505 506 507 508 CALL guide_out(" P",jjp1,llm,p(1:ip1jmp1,1:llm),1.)501 DO l = 1, llm 502 DO j=jjb_u,jje_u 503 DO i =1, iip1 504 p(i+(j-1)*iip1,l) = preff * ( pk(i,j,l)/cpp) ** unskap 505 ENDDO 506 ENDDO 507 ENDDO 508 CALL guide_out("SP",jjp1,llm,p(1:ip1jmp1,1:llm),1.) 509 509 ENDIF 510 510 … … 518 518 if (guide_zon) CALL guide_zonave(1,jjp1,llm,f_add) 519 519 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_u) 520 IF (f_out) CALL guide_out("U",jjp1,llm,f_add(:,:),factt) 520 IF (f_out) CALL guide_out("u",jjp1,llm,ucov,factt) 521 IF (f_out) CALL guide_out("ua",jjp1,llm,(1.-tau)*ugui1(:,:)+tau*ugui2(:,:),factt) 522 IF (f_out) CALL guide_out("ucov",jjp1,llm,f_add(:,:)/factt,factt) 521 523 ucov(ijb_u:ije_u,:)=ucov(ijb_u:ije_u,:)+f_add(ijb_u:ije_u,:) 522 524 endif … … 530 532 if (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 531 533 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_T) 532 IF (f_out) CALL guide_out(" T",jjp1,llm,f_add(:,:),factt)534 IF (f_out) CALL guide_out("teta",jjp1,llm,f_add(:,:)/factt,factt) 533 535 teta(ijb_u:ije_u,:)=teta(ijb_u:ije_u,:)+f_add(ijb_u:ije_u,:) 534 536 endif … … 542 544 if (guide_zon) CALL guide_zonave(2,jjp1,1,f_add(1:ip1jmp1,1)) 543 545 CALL guide_addfield(ip1jmp1,1,f_add(1:ip1jmp1,1),alpha_P) 544 IF (f_out) CALL guide_out(" SP",jjp1,1,f_add(1:ip1jmp1,1),factt)546 IF (f_out) CALL guide_out("ps",jjp1,1,f_add(1:ip1jmp1,1)/factt,factt) 545 547 ps(ijb_u:ije_u)=ps(ijb_u:ije_u)+f_add(ijb_u:ije_u,1) 546 548 CALL pression_p(ip1jmp1,ap,bp,ps,p) … … 556 558 if (guide_zon) CALL guide_zonave(2,jjp1,llm,f_add) 557 559 CALL guide_addfield(ip1jmp1,llm,f_add,alpha_Q) 558 IF (f_out) CALL guide_out(" Q",jjp1,llm,f_add(:,:),factt)560 IF (f_out) CALL guide_out("q",jjp1,llm,f_add(:,:)/factt,factt) 559 561 q(ijb_u:ije_u,:)=q(ijb_u:ije_u,:)+f_add(ijb_u:ije_u,:) 560 562 endif … … 569 571 if (guide_zon) CALL guide_zonave(2,jjm,llm,f_add(1:ip1jm,:)) 570 572 CALL guide_addfield(ip1jm,llm,f_add(1:ip1jm,:),alpha_v) 571 IF (f_out) CALL guide_out("V",jjm,llm,f_add(1:ip1jm,:),factt) 573 IF (f_out) CALL guide_out("v",jjm,llm,vcov(1:ip1jm,:),factt) 574 IF (f_out) CALL guide_out("va",jjm,llm,(1.-tau)*vgui1(:,:)+tau*vgui2(:,:),factt) 575 IF (f_out) CALL guide_out("vcov",jjm,llm,f_add(1:ip1jm,:)/factt,factt) 572 576 vcov(ijb_v:ije_v,:)=vcov(ijb_v:ije_v,:)+f_add(ijb_v:ije_v,:) 573 577 endif … … 786 790 IF (guide_plevs.EQ.1) THEN 787 791 DO l=1,llm 788 789 792 DO j=jjb_u,jje_u 793 DO i =1, iip1 790 794 pls(i,j,l)=(ap(l)+ap(l+1))/2.+psi(i,j)*(bp(l)+bp(l+1))/2. 791 792 795 ENDDO 796 ENDDO 793 797 ENDDO 794 798 ELSE 795 796 799 CALL pression_p( ip1jmp1, ap, bp, psi, p ) 800 if (pressure_exner) then 797 801 CALL exner_hyb_p(ip1jmp1,psi,p,pks,pk) 798 802 else 799 803 CALL exner_milieu_p(ip1jmp1,psi,p,pks,pk) 800 804 endif 801 802 803 804 805 806 807 808 805 unskap=1./kappa 806 DO l = 1, llm 807 DO j=jjb_u,jje_u 808 DO i =1, iip1 809 pls(i,j,l) = preff * ( pk(i,j,l)/cpp) ** unskap 810 ENDDO 811 ENDDO 812 ENDDO 809 813 ENDIF 810 814 … … 1026 1030 ! Calcul des nouvelles valeurs des niveaux de pression du guidage 1027 1031 IF (guide_plevs.EQ.1) THEN 1028 1029 1030 1031 1032 1033 1032 CALL Register_SwapFieldHallo(psnat1,psnat1,ip1jmp1,1,jj_Nb_caldyn,1,2,Req) 1033 CALL SendRequest(Req) 1034 CALL WaitRequest(Req) 1035 CALL Register_SwapFieldHallo(psnat2,psnat2,ip1jmp1,1,jj_Nb_caldyn,1,2,Req) 1036 CALL SendRequest(Req) 1037 CALL WaitRequest(Req) 1034 1038 DO l=1,nlevnc 1035 1039 DO j=jjb_v,jje_v … … 1043 1047 ENDDO 1044 1048 ELSE IF (guide_plevs.EQ.2) THEN 1045 1046 1047 1048 1049 1050 1049 CALL Register_SwapFieldHallo(pnat1,pnat1,ip1jmp1,llm,jj_Nb_caldyn,1,2,Req) 1050 CALL SendRequest(Req) 1051 CALL WaitRequest(Req) 1052 CALL Register_SwapFieldHallo(pnat2,pnat2,ip1jmp1,llm,jj_Nb_caldyn,1,2,Req) 1053 CALL SendRequest(Req) 1054 CALL WaitRequest(Req) 1051 1055 DO l=1,nlevnc 1052 1056 DO j=jjb_v,jje_v … … 1809 1813 1810 1814 ! Variables entree 1811 CHARACTER , INTENT(IN) :: varname1815 CHARACTER*(*), INTENT(IN) :: varname 1812 1816 INTEGER, INTENT (IN) :: hsize,vsize 1813 1817 REAL, DIMENSION (iip1,hsize,vsize), INTENT(IN) :: field … … 1819 1823 INTEGER :: nid, id_lonu, id_lonv, id_latu, id_latv, id_tim, id_lev 1820 1824 INTEGER :: vid_lonu,vid_lonv,vid_latu,vid_latv,vid_cu,vid_cv,vid_lev 1825 INTEGER :: vid_au,vid_av 1826 INTEGER :: l 1821 1827 INTEGER, DIMENSION (3) :: dim3 1822 1828 INTEGER, DIMENSION (4) :: dim4,count,start 1823 1829 INTEGER :: ierr, varid 1830 REAL, DIMENSION (iip1,hsize,vsize) :: field2 1824 1831 1825 1832 CALL gather_field(field,iip1*hsize,vsize,0) … … 1836 1843 ! Definition des dimensions 1837 1844 ierr=NF_DEF_DIM(nid,"LONU",iip1,id_lonu) 1845 print*,'id_lonu 1 ',id_lonu 1838 1846 ierr=NF_DEF_DIM(nid,"LONV",iip1,id_lonv) 1839 1847 ierr=NF_DEF_DIM(nid,"LATU",jjp1,id_latu) … … 1844 1852 ! Creation des variables dimensions 1845 1853 ierr=NF_DEF_VAR(nid,"LONU",NF_FLOAT,1,id_lonu,vid_lonu) 1854 print*,'id_lonu 2 ',id_lonu 1846 1855 ierr=NF_DEF_VAR(nid,"LONV",NF_FLOAT,1,id_lonv,vid_lonv) 1847 1856 ierr=NF_DEF_VAR(nid,"LATU",NF_FLOAT,1,id_latu,vid_latu) … … 1850 1859 ierr=NF_DEF_VAR(nid,"cu",NF_FLOAT,2,(/id_lonu,id_latu/),vid_cu) 1851 1860 ierr=NF_DEF_VAR(nid,"cv",NF_FLOAT,2,(/id_lonv,id_latv/),vid_cv) 1861 ierr=NF_DEF_VAR(nid,"au",NF_FLOAT,2,(/id_lonu,id_latu/),vid_au) 1862 ierr=NF_DEF_VAR(nid,"av",NF_FLOAT,2,(/id_lonv,id_latv/),vid_av) 1852 1863 1853 1864 ierr=NF_ENDDEF(nid) … … 1855 1866 ! Enregistrement des variables dimensions 1856 1867 #ifdef NC_DOUBLE 1868 print*,'id_lonu DOUBLE ',id_lonu,rlonu*180./pi 1857 1869 ierr = NF_PUT_VAR_DOUBLE(nid,vid_lonu,rlonu*180./pi) 1858 1870 ierr = NF_PUT_VAR_DOUBLE(nid,vid_lonv,rlonv*180./pi) … … 1862 1874 ierr = NF_PUT_VAR_DOUBLE(nid,vid_cu,cu) 1863 1875 ierr = NF_PUT_VAR_DOUBLE(nid,vid_cv,cv) 1876 ierr = NF_PUT_VAR_DOUBLE(nid,vid_au,alpha_u) 1877 ierr = NF_PUT_VAR_DOUBLE(nid,vid_av,alpha_v) 1864 1878 #else 1879 print*,'id_lonu 3 ',id_lonu,rlonu*180./pi 1865 1880 ierr = NF_PUT_VAR_REAL(nid,vid_lonu,rlonu*180./pi) 1866 1881 ierr = NF_PUT_VAR_REAL(nid,vid_lonv,rlonv*180./pi) … … 1870 1885 ierr = NF_PUT_VAR_REAL(nid,vid_cu,cu) 1871 1886 ierr = NF_PUT_VAR_REAL(nid,vid_cv,cv) 1887 ierr = NF_PUT_VAR_REAL(nid,vid_au,alpha_u) 1888 ierr = NF_PUT_VAR_REAL(nid,vid_av,alpha_v) 1872 1889 #endif 1873 1890 ! -------------------------------------------------------------------- … … 1877 1894 ! Pressure (GCM) 1878 1895 dim4=(/id_lonv,id_latu,id_lev,id_tim/) 1879 ierr = NF_DEF_VAR(nid," P",NF_FLOAT,4,dim4,varid)1896 ierr = NF_DEF_VAR(nid,"SP",NF_FLOAT,4,dim4,varid) 1880 1897 ! Surface pressure (guidage) 1881 1898 IF (guide_P) THEN … … 1885 1902 ! Zonal wind 1886 1903 IF (guide_u) THEN 1904 print*,'id_lonu 4 ',id_lonu,varname 1887 1905 dim4=(/id_lonu,id_latu,id_lev,id_tim/) 1906 ierr = NF_DEF_VAR(nid,"u",NF_FLOAT,4,dim4,varid) 1907 ierr = NF_DEF_VAR(nid,"ua",NF_FLOAT,4,dim4,varid) 1888 1908 ierr = NF_DEF_VAR(nid,"ucov",NF_FLOAT,4,dim4,varid) 1889 1909 ENDIF … … 1891 1911 IF (guide_v) THEN 1892 1912 dim4=(/id_lonv,id_latv,id_lev,id_tim/) 1913 ierr = NF_DEF_VAR(nid,"v",NF_FLOAT,4,dim4,varid) 1914 ierr = NF_DEF_VAR(nid,"va",NF_FLOAT,4,dim4,varid) 1893 1915 ierr = NF_DEF_VAR(nid,"vcov",NF_FLOAT,4,dim4,varid) 1894 1916 ENDIF … … 1914 1936 ierr=NF_OPEN("guide_ins.nc",NF_WRITE,nid) 1915 1937 1938 IF (varname=="SP") timestep=timestep+1 1939 1940 IF (varname=="SP") THEN 1941 print*,'varname=SP=',varname 1942 ELSE 1943 print*,'varname diff SP=',varname 1944 ENDIF 1945 1946 1947 ierr = NF_INQ_VARID(nid,varname,varid) 1916 1948 SELECT CASE (varname) 1917 CASE ("P") 1918 timestep=timestep+1 1919 ierr = NF_INQ_VARID(nid,"P",varid) 1949 CASE ("SP","ps") 1920 1950 start=(/1,1,1,timestep/) 1921 1951 count=(/iip1,jjp1,llm,1/) 1922 #ifdef NC_DOUBLE 1923 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field) 1924 #else 1925 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field) 1926 #endif 1927 CASE ("SP") 1928 ierr = NF_INQ_VARID(nid,"ps",varid) 1929 start=(/1,1,timestep,0/) 1930 count=(/iip1,jjp1,1,0/) 1931 #ifdef NC_DOUBLE 1932 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt) 1933 #else 1934 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt) 1935 #endif 1936 CASE ("U") 1937 ierr = NF_INQ_VARID(nid,"ucov",varid) 1952 CASE ("v","va","vcov") 1953 start=(/1,1,1,timestep/) 1954 count=(/iip1,jjm,llm,1/) 1955 CASE DEFAULT 1938 1956 start=(/1,1,1,timestep/) 1939 1957 count=(/iip1,jjp1,llm,1/) 1958 END SELECT 1959 1960 SELECT CASE (varname) 1961 CASE("u","ua") 1962 DO l=1,llm ; field2(:,2:jjm,l)=field(:,2:jjm,l)/cu(:,2:jjm) ; ENDDO 1963 field2(:,1,:)=0. ; field2(:,jjp1,:)=0. 1964 CASE("v","va") 1965 DO l=1,llm ; field2(:,:,l)=field(:,:,l)/cv(:,:) ; ENDDO 1966 CASE DEFAULT 1967 field2=field 1968 END SELECT 1969 1940 1970 #ifdef NC_DOUBLE 1941 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt)1971 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field2) 1942 1972 #else 1943 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt)1973 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field2) 1944 1974 #endif 1945 CASE ("V")1946 ierr = NF_INQ_VARID(nid,"vcov",varid)1947 start=(/1,1,1,timestep/)1948 count=(/iip1,jjm,llm,1/)1949 #ifdef NC_DOUBLE1950 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt)1951 #else1952 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt)1953 #endif1954 CASE ("T")1955 ierr = NF_INQ_VARID(nid,"teta",varid)1956 start=(/1,1,1,timestep/)1957 count=(/iip1,jjp1,llm,1/)1958 #ifdef NC_DOUBLE1959 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt)1960 #else1961 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt)1962 #endif1963 CASE ("Q")1964 ierr = NF_INQ_VARID(nid,"q",varid)1965 start=(/1,1,1,timestep/)1966 count=(/iip1,jjp1,llm,1/)1967 #ifdef NC_DOUBLE1968 ierr = NF_PUT_VARA_DOUBLE(nid,varid,start,count,field/factt)1969 #else1970 ierr = NF_PUT_VARA_REAL(nid,varid,start,count,field/factt)1971 #endif1972 END SELECT1973 1975 1974 1976 ierr = NF_CLOSE(nid)
Note: See TracChangeset
for help on using the changeset viewer.