source: trunk/procs/meshes/mesh_pcmdi.pro @ 41

Last change on this file since 41 was 41, checked in by ericg, 16 years ago

Misc modifs, incl. read_from_grid in yfx, debug_w prints, removal of mesh_lmdz and small bug corrections

File size: 2.5 KB
Line 
1PRO mesh_pcmdi, model, NO_SHIFT = no_shift, WHOLE_ARRAYS = whole_arrays
2@common
3@com_eg
4;
5; init grid, sf, masks for grids with regular grid IPCC netCDF standard
6;
7   IF debug_w THEN print, ' '
8   IF debug_w THEN print, '   ENTER mesh_pcmdi / model =', model
9 
10   print,'   Model inits for ', model
11   IF debug_w THEN print,  '     varexp at start of mesh_pcmdi:', varexp
12
13   varexpp =  varexp
14
15 ; use key_shiftg if grid and data file are not organized the same
16 ; key_shiftg(0) = longitude shift
17 ; key_shiftg(1) = -1 if latitude reversing needed
18 ; key_shiftg = [0, 0]
19 ; avoid using key_shiftg(0) and keyshiftg in general
20 ; otherwise it gets much more complicated with initncdf
21   key_shift = 0
22
23 ; initialisation of character variables used in the execution of initncdf
24 ; (and computegrid as a consequence)
25   shift_txt =  ''
26   plain_txt =  ''
27
28   sm_file = hom_idl+'grids/grids_'+model+'.nc'
29   res = find(sm_file)
30   
31   IF keyword_set(NO_SHIFT) THEN BEGIN
32      shift_txt = ', SHIFT = 0'
33   ENDIF
34   IF keyword_set(WHOLE_ARRAYS) THEN BEGIN
35      plain_txt = ', PLAIN = 1'
36      ;; Force YREVERSE = 0, ZREVERSE = 0, PERIODIC = 0, SHIFT = 0, STRIDE = [1, 1, 1] and
37      ;; suppress the automatic redefinition of the domain in case of x periodicity overlap,
38      ;; y periodicity overlap (ORCA type only) and mask border to 0.
39   ENDIF
40
41   IF debug_w THEN print, '      key_yreverse = ', key_yreverse     
42   
43   IF res NE 'NOT FOUND' THEN BEGIN
44     
45      cmd_grid = 'initncdf, sm_file, GLAMBOUNDARY = glamboundary_box'+plain_txt+shift_txt
46      res_grid =  execute(cmd_grid)                 
47     
48      IF debug_w THEN print, '      Found mask from ',sm_file
49     
50      tmask = byte(read_ncdf('sftlf', 0, 0, /timestep, file = sm_file, /nostruct))
51     
52      idx = where(tmask EQ valmask)         
53      IF idx(0) NE -1 THEN tmask(idx) = 0.
54     
55      idx =  where(tmask LE 50.)
56      tmask(idx) = 0.
57      tmask =  tmask < 1     
58      tmask =  1-tmask
59     
60   ENDIF
61   
62   IF debug_w THEN print, '      key_shift = ', key_shift
63   IF debug_w THEN print, '      key_yreverse = ', key_yreverse   
64   
65   masked_data = 0
66   mesh_type =  'atm'
67   
68   key_offset = [0, 0, 0]
69;
70; indice i pour grille j moyenne zonale
71;
72   diaznl_idx = 1
73
74   varexp =  varexpp
75   
76   print,'    End of initialisation for pcmdi grid:', model
77   IF debug_w THEN print,  '     varexp at end of mesh_pcmdi:', varexp
78   IF debug_w THEN print, '   ...EXIT mesh_pcmdi'
79   IF debug_w THEN print,  '  '
80   
81   return
82END
83
Note: See TracBrowser for help on using the repository browser.