
     Use NetCDF
     Integer, parameter :: Nlon=41, Nlat=36
     Real, allocatable  :: lon(:), lat(:), x(:,:)
     Real, parameter :: lon0=90.0, lat0=0.0, dxy=1.
     Real, parameter :: x0=90, x1=130, y10=5, y11=10, y20=25, y21=30
     Integer :: ilon,ilat, i
     Real :: tmp, Miss
     Logical :: L1, L2

     Miss=-99.0
  
     Allocate (lon(nlon),lat(nlat),x(nlon,nlat))
     Do ilon=1,Nlon
        lon(ilon)=lon0+(ilon-1)*dxy
        print*,ilon,lon(ilon)
     Enddo
     Do ilat=1,Nlat
        lat(ilat)=lat0+(ilat-1)*dxy
        print*,ilat,lat(ilat)
     Enddo
     
     i = 760013
     Do ilat=1,Nlat
        Do ilon=1,Nlon
           x(ilon,ilat)=ran(i); tmp=x(ilon,ilat)
           L1=lat(ilat)>=y10.AND.lat(ilat)<=y11
           L2=lat(ilat)>=y20.AND.lat(ilat)<=y21
           if (L1.OR.L2) then
               x(ilon,ilat)=tmp+1.5
           else
               x(ilon,ilat)=-2
           endif
        Enddo
     Enddo
     !Call wr_ncdf_2d ("4TC_paper.nc",lon,lat,nlon,nlat,x,"tc", &
     !                "Dummy data","-","lon","lat",Miss)

     ! Make TC freq for plot Fig34:
     Call Fig34

     !--------------------------------------------------------------
     CONTAINS
     !--------------------------------------------------------------
     Subroutine Fig34
       Integer, parameter :: Nper=2, Ngrp=3, Nscr=3
       Real, dimension(Nscr,Ngrp,Nper) :: FrqTC
       Character (Len=6) :: Src_nm(Nscr)=(/"UNISYS","JTWC","RMSC"/)
       Integer :: i,j,k
       Real :: xsrc(Nscr), xgrp(Ngrp), xper(Nper)

       Open (1,file="Fig34.txt",status="old")
       Do k=1,Nper
          read (1,*)
          Do j=1,Nscr
             read (1,*) (FrqTC(j,i,k),i=1,Ngrp)
          Enddo
       Enddo
       xsrc(1)=1; xsrc(2)=2; xsrc(3)=3
       xgrp(1)=1; xgrp(2)=2; xgrp(3)=3
       xper(1)=1; xper(2)=2
       Call wr_ncdf_3d ("Fig34.nc",xsrc,xgrp,xper,Nscr,Ngrp,Nper,FrqTC,"fre", &
             "years since 1975 ","TC Frequency","%","src","grp","per", Miss)
     End Subroutine Fig34
     !--------------------------------------------------------------
     Include "/home/tanpv/Mylibs/sub_wr_ncdf_Tan.F90"     
     END
