source: trunk/procs/densit_pltmap_read.pro @ 9

Last change on this file since 9 was 2, checked in by post_it, 17 years ago

Initial import from ~/POST_IT/

File size: 2.0 KB
Line 
1;
2;  Read/compute monthly density projection to build annual (Paul Williams)
3;
4
5      really_1m_st = 0
6      start_year = cmd.date1
7      end_year = cmd.spec
8      boxst = def_box(cmd.plt, dimplot, boxname, time_stride)
9      domdef, boxst
10      grille,mask,glam,gphi,gdep,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz
11      output = fltarr( nx, ny, (sig_max - sig_min)/sig_del + 1,  uint(cmd.spec)-uint(cmd.date1)+1)
12      FOR year_s = uint(cmd.date1), uint(cmd.spec) DO BEGIN
13         print,  'plt_map: Constructing annual mean from monthly means for year',  year_s
14         cmd.timave = '1m'
15         cumulative = 0.
16         FOR i = 1, 12 DO BEGIN
17            IF strlen(strmid(strcompress(string(year_s)),1)) eq 1 THEN year_s_string = '0'+strmid(strcompress(string(year_s)),1)
18            IF strlen(strmid(strcompress(string(year_s)),1)) GT 1 THEN year_s_string = strmid(strcompress(string(year_s)),1)
19            IF i LE 9 THEN BEGIN
20               cmd.date1 = year_s_string+'0'+strtrim(string(i), 2)
21            ENDIF ELSE BEGIN
22               cmd.date1 = year_s_string+strtrim(string(i), 2)
23            ENDELSE 
24            cmd.spec = cmd.date1
25            print,  'Date = ',  cmd.date1
26            pltcmd = 'fields = data_read(cmd,'''+hotyp+''','''+plttyp+''','+string(dimplot)+','+string(iover)+all_data_str+', ZMTYP = '''+cmd.plt+''')'
27            printf, nulhis, strcompress(pltcmd)
28            printf, nulhis, ' '
29            res = execute(pltcmd)
30            cumulative = cumulative + fields.data
31         ENDFOR
32         output(*, *, *,  year_s-uint(start_year)) = cumulative/12.
33      ENDFOR
34;   redefine cmd.* to be their initial values before the monthly loop
35      cmd.timave = '1y'
36      cmd.date1 = start_year
37      cmd.spec = end_year
38;   call to compute_time to redefine timearr (see data_read)
39      timearr = compute_time(cmd.timave, cmd.date1, cmd.spec)
40      jpt = timearr.count
41      time = timearr.scale
42      field = {name: fields.name, data: output, legend: fields.legend, units: fields.units, origin: fields.origin, dim: 2, direc: ''}
Note: See TracBrowser for help on using the repository browser.