all/02.lai.ncl
changeset 1 4be95183fbcd
parent 0 0c6405ab2ff4
equal deleted inserted replaced
0:089563e56066 1:88058c081736
    92   nclass_ob = 20
    92   nclass_ob = 20
    93 
    93 
    94 ;---------------------------------
    94 ;---------------------------------
    95 ; read lai data: observed
    95 ; read lai data: observed
    96 
    96 
    97   ;ob_name = "MODIS MOD 15A2 2000-2005"
    97   ;ob_name = "MODIS MOD15A2 (2000-2005)"
    98   ob_name = "MODIS MOD 15A2 2000-2004"
    98   ob_name = "MODIS MOD15A2 (2000-2004)"
    99 
    99 
   100   dir_l = diro + "lai/"
   100   dir_l = diro + "lai/"
   101   ;filo = "LAI_2000-2005_MONS_"+model_grid+".nc"
   101   ;filo = "LAI_2000-2005_MONS_"+model_grid+".nc"
   102   filo = "LAI_2000-2004_MONS_"+model_grid+".nc"
   102   filo = "LAI_2000-2004_MONS_"+model_grid+".nc"
   103   fo = addfile(dir_l+filo,"r")                
   103   fo = addfile(dir_l+filo,"r")                
   143 
   143 
   144   plot = gsn_csm_contour_map_ce(wks,classob,resg)   
   144   plot = gsn_csm_contour_map_ce(wks,classob,resg)   
   145 
   145 
   146   delete (wks)
   146   delete (wks)
   147 
   147 
   148   system("convert "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   148   system("convert -trim -density 100 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   149          "rm "+plot_name+"."+plot_type)
   149          "rm "+plot_name+"."+plot_type)
   150  
   150  
   151 ;************************************************
   151 ;************************************************
   152 ; plot global biome class: (2) model
   152 ; plot global biome class: (2) model
   153 ;************************************************
   153 ;************************************************
   165 
   165 
   166   plot = gsn_csm_contour_map_ce(wks,classmod,resg)   
   166   plot = gsn_csm_contour_map_ce(wks,classmod,resg)   
   167 
   167 
   168   delete (wks)
   168   delete (wks)
   169 
   169 
   170   system("convert "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   170   system("convert -trim -density 100 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   171          "rm "+plot_name+"."+plot_type)
   171          "rm "+plot_name+"."+plot_type)
   172  
   172  
   173 ;*******************************************************************
   173 ;*******************************************************************
   174 ; for html table : all 3 components (Mean, Max, Phase)
   174 ; for html table : all 3 components (Mean, Max, Phase)
   175 ;*******************************************************************
   175 ;*******************************************************************
   256 ; (A) Mean
   256 ; (A) Mean
   257  
   257  
   258   if (m .eq. 0) then
   258   if (m .eq. 0) then
   259      data_ob  = dim_avg_Wrap(laiob (lat|:,lon|:,time|:))
   259      data_ob  = dim_avg_Wrap(laiob (lat|:,lon|:,time|:))
   260      data_mod = dim_avg_Wrap(laimod(lat|:,lon|:,time|:))
   260      data_mod = dim_avg_Wrap(laimod(lat|:,lon|:,time|:))
       
   261      score_max = 4.0
   261   end if
   262   end if
   262 
   263 
   263 ; (B) Max
   264 ; (B) Max
   264 
   265 
   265   if (m .eq. 1) then
   266   if (m .eq. 1) then
   281      do j = 0,nlat-1
   282      do j = 0,nlat-1
   282      do i = 0,nlon-1
   283      do i = 0,nlon-1
   283         data_mod(j,i) = max(laimod(:,j,i))
   284         data_mod(j,i) = max(laimod(:,j,i))
   284      end do
   285      end do
   285      end do
   286      end do
       
   287 
       
   288      score_max = 5.0
   286           
   289           
   287   end if
   290   end if
   288 
   291 
   289 ; (C) phase
   292 ; (C) phase
   290 
   293 
   307      do j = 0,nlat-1
   310      do j = 0,nlat-1
   308      do i = 0,nlon-1 
   311      do i = 0,nlon-1 
   309         data_mod(j,i) = maxind(laimod(:,j,i)) + 1
   312         data_mod(j,i) = maxind(laimod(:,j,i)) + 1
   310      end do
   313      end do
   311      end do
   314      end do
       
   315 
       
   316      score_max = 6.0
   312         
   317         
   313   end if
   318   end if
   314 
   319 
   315 ;==============================
   320 ;==============================
   316 ; put data into bins
   321 ; put data into bins
   371 
   376 
   372 ;=====================================
   377 ;=====================================
   373 ; compute correlation coef and M score 
   378 ; compute correlation coef and M score 
   374 ;=====================================
   379 ;=====================================
   375 
   380 
   376   score_max = 5.0
   381   ; FMH: Max scores are depend on which component is being analyzed, so this
       
   382   ; is now set in each if statement above.
       
   383   ;score_max = 5.0
   377 
   384 
   378   u       = yvalues(0,:)
   385   u       = yvalues(0,:)
   379   v       = yvalues(1,:)
   386   v       = yvalues(1,:)
   380   u_count = count(0,:)
   387   u_count = count(0,:)
   381   v_count = count(1,:)
   388   v_count = count(1,:)
   487   plot = gsn_csm_contour_map_ce(wks,data_ob,resg)   
   494   plot = gsn_csm_contour_map_ce(wks,data_ob,resg)   
   488 
   495 
   489   delete (wks)
   496   delete (wks)
   490   delete (plot)
   497   delete (plot)
   491 
   498 
   492   system("convert "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   499   system("convert -trim -density 100 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   493          "rm "+plot_name+"."+plot_type)
   500          "rm "+plot_name+"."+plot_type)
       
   501   ;system("convert -trim -density 100 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new)
       
   502   
   494 
   503 
   495 ;============================
   504 ;============================
   496 ; global contour : model
   505 ; global contour : model
   497 ;============================
   506 ;============================
   498 
   507 
   499   plot_name = "global_"+component(m)+"_model"  
   508   plot_name = "global_"+component(m)+"_model"  
   500   title     = "Model " + model_name
   509   title     = "Model " + model_name + " (2000-2004)"
   501   resg@tiMainString  = title
   510   resg@tiMainString  = title
   502 
   511 
   503   wks = gsn_open_wks (plot_type,plot_name)
   512   wks = gsn_open_wks (plot_type,plot_name)
   504   gsn_define_colormap(wks,"gui_default")     
   513   gsn_define_colormap(wks,"gui_default")     
   505 
   514 
   506   plot = gsn_csm_contour_map_ce(wks,data_mod,resg)   
   515   plot = gsn_csm_contour_map_ce(wks,data_mod,resg)   
   507 
   516 
   508   delete (wks)
   517   delete (wks)
   509   delete (plot)
   518   delete (plot)
   510 
   519 
   511   system("convert "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   520   system("convert -trim -density 100 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   512          "rm "+plot_name+"."+plot_type)
   521          "rm "+plot_name+"."+plot_type)
       
   522   ;system("convert -trim -density 100 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new)
   513 
   523 
   514 ;================================
   524 ;================================
   515 ; global contour: model vs ob
   525 ; global contour: model vs ob
   516 ;================================
   526 ;================================
   517 
   527 
   542 
   552 
   543   plot(0) = gsn_csm_contour_map_ce(wks,data_ob,resg)       
   553   plot(0) = gsn_csm_contour_map_ce(wks,data_ob,resg)       
   544 
   554 
   545 ; plot model
   555 ; plot model
   546 
   556 
   547   title     = "Model "+ model_name
   557   title     = "Model "+ model_name + " (2000-2004)"
   548   resg@tiMainString  = title
   558   resg@tiMainString  = title
   549 
   559 
   550   plot(1) = gsn_csm_contour_map_ce(wks,data_mod,resg) 
   560   plot(1) = gsn_csm_contour_map_ce(wks,data_mod,resg) 
   551 
   561 
   552 ; plot model-ob
   562 ; plot model-ob
   569      resg@cnLevelSpacingF =  1.
   579      resg@cnLevelSpacingF =  1.
   570   end if
   580   end if
   571 
   581 
   572   zz = data_mod
   582   zz = data_mod
   573   zz = data_mod - data_ob
   583   zz = data_mod - data_ob
   574   title = "Model_"+model_name+" - Observed"
   584   title = "Model_"+model_name+" - MODIS MOD15A2"
   575   resg@tiMainString    = title
   585   resg@tiMainString    = title
   576 
   586 
   577   plot(2) = gsn_csm_contour_map_ce(wks,zz,resg) 
   587   plot(2) = gsn_csm_contour_map_ce(wks,zz,resg) 
   578 
   588 
   579 ; plot panel
   589 ; plot panel
   584   gsn_panel(wks,plot,(/3,1/),pres)              ; create panel plot
   594   gsn_panel(wks,plot,(/3,1/),pres)              ; create panel plot
   585 
   595 
   586   delete (wks)
   596   delete (wks)
   587   delete (plot)
   597   delete (plot)
   588 
   598 
   589   system("convert "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   599   system("convert -trim -density 150 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   590          "rm "+plot_name+"."+plot_type)
   600          "rm "+plot_name+"."+plot_type)
       
   601   ;system("convert -trim -density 150 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new)
   591 
   602 
   592   delete (data_ob)
   603   delete (data_ob)
   593   delete (data_mod)
   604   delete (data_mod)
   594 
   605 
   595   resg@gsnFrame             = True          ; Do advance frame 
   606   resg@gsnFrame             = True          ; Do advance frame 
   831      plot = gsn_csm_xy(wks,mon,plot_data,res)
   842      plot = gsn_csm_xy(wks,mon,plot_data,res)
   832 
   843 
   833      delete (wks)
   844      delete (wks)
   834      delete (plot)
   845      delete (plot)
   835 
   846 
   836      system("convert "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   847      system("convert -trim -density 100 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   837             "rm "+plot_name+"."+plot_type)
   848             "rm "+plot_name+"."+plot_type)
   838   end do
   849   end do
   839 
   850 
   840 ;--------------------------------------------
   851 ;--------------------------------------------
   841 ; time series plot: all biome
   852 ; time series plot: all biome
   855      plot = gsn_csm_xy(wks,mon,plot_data,res)
   866      plot = gsn_csm_xy(wks,mon,plot_data,res)
   856 
   867 
   857      delete (wks)
   868      delete (wks)
   858      delete (plot)
   869      delete (plot)
   859 
   870 
   860      system("convert "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   871      system("convert -trim -density 100 "+plot_name+"."+plot_type+" "+plot_name+"."+plot_type_new+";"+ \
   861             "rm "+plot_name+"."+plot_type)
   872             "rm "+plot_name+"."+plot_type)
   862 
   873 
   863   delete (plot_data)
   874   delete (plot_data)
   864 
   875 
   865 ;***************************************************************************
   876 ;***************************************************************************