Modifications to scoring and graphics production for the final version of code for the C-LAMP paper in GCB.
1 ;********************************************************
2 ; landfrac applied to area only.
3 ; using model biome class
5 ; required command line input parameters:
6 ; ncl 'model_name="10cn" model_grid="T42" dirm="/.../ film="..."' 01.npp.ncl
8 ; histogram normalized by rain and compute correleration
9 ;**************************************************************
10 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
11 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
12 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
13 ;**************************************************************
14 procedure set_line(lines:string,nline:integer,newlines:string)
16 ; add line to ascci/html file
18 nnewlines = dimsizes(newlines)
19 if(nline+nnewlines-1.ge.dimsizes(lines))
20 print("set_line: bad index, not setting anything.")
23 lines(nline:nline+nnewlines-1) = newlines
24 ; print ("lines = " + lines(nline:nline+nnewlines-1))
25 nline = nline + nnewlines
28 ;**************************************************************
31 ;--------------------------------------------------
32 ; edit table.html of current model for movel1_vs_model2
34 if (isvar("compare")) then
35 html_name2 = compare+"/table.html"
36 html_new2 = html_name2 +".new"
39 ;-------------------------------------
40 ; edit table.html for current model
42 html_name = model_name+"/table.html"
43 html_new = html_name +".new"
45 ;---------------------------------------------------
46 ; add total score and update metric table
50 if (isfilepresent("M_save.npp")) then
51 M_save = M_save + asciiread("M_save.npp",(/1/),"float")
54 if (isfilepresent("M_save.lai")) then
55 M_save = M_save + asciiread("M_save.lai",(/1/),"float")
58 if (film3 .ne. "") then
59 if (isfilepresent("M_save.co2")) then
60 M_save = M_save + asciiread("M_save.co2",(/1/),"float")
64 if (isfilepresent("M_save.biomass")) then
65 M_save = M_save + asciiread("M_save.biomass",(/1/),"float")
68 if (isfilepresent("M_save.fluxnet")) then
69 M_save = M_save + asciiread("M_save.fluxnet",(/1/),"float")
72 if (isfilepresent("M_save.beta")) then
73 M_save = M_save + asciiread("M_save.beta",(/1/),"float")
76 if (isfilepresent("M_save.fire")) then
77 M_save = M_save + asciiread("M_save.fire",(/1/),"float")
80 if (isfilepresent("M_save.ameriflux")) then
81 M_save = M_save + asciiread("M_save.ameriflux",(/1/),"float")
84 M_total = sprintf("%.2f", M_save)
86 if (isvar("compare")) then
87 system("sed -e '1,/M_total/s/M_total/"+M_total+"/' "+html_name2+" > "+html_new2+";"+ \
88 "mv -f "+html_new2+" "+html_name2)
91 system("sed s#M_total#"+M_total+"# "+html_name+" > "+html_new+";"+ \
92 "mv -f "+html_new+" "+html_name+";"+ \