- Timestamp:
- 02/16/07 12:56:55 (17 years ago)
- Location:
- trunk/SRC
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/idldoc_assistant_output/Grid/computegrid.html
r210 r214 699 699 <h3>Version history</h3> 700 700 701 <h4>Version</h4> $Id: computegrid.pro 2 09 2007-02-08 10:01:49Z smasson $701 <h4>Version</h4> $Id: computegrid.pro 213 2007-02-16 11:29:17Z smasson $ 702 702 703 703 <h4>History</h4> Sebastien Masson (smasson@lodyc.jussieu.fr) -
trunk/SRC/Documentation/idldoc_assistant_output/Grid/ncdf_meshread.html
r200 r214 274 274 <h3>Version history</h3> 275 275 276 <h4>Version</h4> $Id: ncdf_meshread.pro 172 2006-09-11 07:11:26Z smasson $276 <h4>Version</h4> $Id: ncdf_meshread.pro 212 2007-02-14 10:47:10Z smasson $ 277 277 278 278 <h4>History</h4> Sebastien Masson (smasson@lodyc.jussieu.fr) -
trunk/SRC/Documentation/idldoc_assistant_output/Grid/ncdf_meshroms.html
r200 r214 275 275 <h3>Version history</h3> 276 276 277 <h4>Version</h4> $Id: ncdf_meshroms.pro 173 2006-09-11 07:53:02Z smasson $277 <h4>Version</h4> $Id: ncdf_meshroms.pro 212 2007-02-14 10:47:10Z smasson $ 278 278 279 279 <h4>History</h4> Sebastien Masson (smasson@lodyc.jussieu.fr) September 2006 -
trunk/SRC/Documentation/idldoc_assistant_output/ToBeReviewed/LECTURE/read_ncdf.html
r210 r214 407 407 408 408 <h4>Version</h4> 409 $Id: read_ncdf.pro 2 09 2007-02-08 10:01:49Z smasson $409 $Id: read_ncdf.pro 212 2007-02-14 10:47:10Z smasson $ 410 410 <h4>History</h4> 411 411 Sebastien Masson (smasson@lodyc.jussieu.fr) -
trunk/SRC/Documentation/idldoc_assistant_output/ToBeReviewed/PLOTS/reinitplt.html
r200 r214 183 183 184 184 Invert the logic. Clear all unselected variables. 185 Therefore " clearplt,/all,/invert" does nothing.185 Therefore "reinitplt,/all,/invert" does nothing. 186 186 187 187 … … 192 192 193 193 <h4>Version</h4> 194 $Id: reinitplt.pro 163 2006-08-29 12:59:46Z navarro$194 $Id: reinitplt.pro 213 2007-02-16 11:29:17Z smasson $ 195 195 196 196 <h4>History</h4> -
trunk/SRC/Documentation/idldoc_assistant_output/ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html
r200 r214 74 74 </font></h2> 75 75 76 <p><font face="Courier">loadgrid<i>, <a href="#_loadgrid_keyword_meshfile in">meshfilein</a></i>, <a href="#_loadgrid_keyword__extra">_extra</a>=<i>_extra</i></font></p>76 <p><font face="Courier">loadgrid<i>, <a href="#_loadgrid_keyword_meshfiletxtin">meshfiletxtin</a></i>, <a href="#_loadgrid_keyword__extra">_extra</a>=<i>_extra</i></font></p> 77 77 78 78 … … 86 86 87 87 88 <a name="#_loadgrid_keyword_meshfile in"></a>89 <h4>meshfile in 88 <a name="#_loadgrid_keyword_meshfiletxtin"></a> 89 <h4>meshfiletxtin 90 90 91 91 … … 99 99 100 100 101 102 103 101 104 102 … … 132 130 133 131 <h4>Version</h4> 134 $Id: loadgrid.pro 192 2006-09-22 09:37:08Z smasson $132 $Id: loadgrid.pro 213 2007-02-16 11:29:17Z smasson $ 135 133 136 134 <h4>History</h4> -
trunk/SRC/Documentation/idldoc_assistant_output/ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.html
r203 r214 129 129 130 130 <h4>Version</h4> 131 $Id: selectfile.pro 2 02 2007-01-12 11:00:06Z smasson $131 $Id: selectfile.pro 213 2007-02-16 11:29:17Z smasson $ 132 132 133 133 <h4>History</h4> … … 256 256 257 257 <h4>Version</h4> 258 $Id: selectfile.pro 2 02 2007-01-12 11:00:06Z smasson $258 $Id: selectfile.pro 213 2007-02-16 11:29:17Z smasson $ 259 259 260 260 <h4>History</h4> -
trunk/SRC/Documentation/idldoc_html_output/Grid/computegrid.html
r210 r214 700 700 <h3>Version history</h3> 701 701 702 <h4>Version</h4><div class="preformat"> $Id: computegrid.pro 2 09 2007-02-08 10:01:49Z smasson $702 <h4>Version</h4><div class="preformat"> $Id: computegrid.pro 213 2007-02-16 11:29:17Z smasson $ 703 703 </div> 704 704 <h4>History</h4><div class="preformat"> Sebastien Masson (smasson@lodyc.jussieu.fr) -
trunk/SRC/Documentation/idldoc_html_output/Grid/ncdf_meshread.html
r200 r214 300 300 <h3>Version history</h3> 301 301 302 <h4>Version</h4><div class="preformat"> $Id: ncdf_meshread.pro 172 2006-09-11 07:11:26Z smasson $302 <h4>Version</h4><div class="preformat"> $Id: ncdf_meshread.pro 212 2007-02-14 10:47:10Z smasson $ 303 303 </div> 304 304 <h4>History</h4><div class="preformat"> Sebastien Masson (smasson@lodyc.jussieu.fr) -
trunk/SRC/Documentation/idldoc_html_output/Grid/ncdf_meshroms.html
r200 r214 301 301 <h3>Version history</h3> 302 302 303 <h4>Version</h4><div class="preformat"> $Id: ncdf_meshroms.pro 173 2006-09-11 07:53:02Z smasson $303 <h4>Version</h4><div class="preformat"> $Id: ncdf_meshroms.pro 212 2007-02-14 10:47:10Z smasson $ 304 304 </div> 305 305 <h4>History</h4><div class="preformat"> Sebastien Masson (smasson@lodyc.jussieu.fr) September 2006 -
trunk/SRC/Documentation/idldoc_html_output/ToBeReviewed/LECTURE/read_ncdf.html
r210 r214 422 422 423 423 <h4>Version</h4><div class="preformat"> 424 $Id: read_ncdf.pro 2 09 2007-02-08 10:01:49Z smasson $ </div>424 $Id: read_ncdf.pro 212 2007-02-14 10:47:10Z smasson $ </div> 425 425 <h4>History</h4><div class="preformat"> 426 426 Sebastien Masson (smasson@lodyc.jussieu.fr) … … 449 449 <h3>Statistics</h3> 450 450 <table class="statistics"> 451 <tr><td>McCabe cyclic</td><td> 13 8</td></tr>451 <tr><td>McCabe cyclic</td><td> 135</td></tr> 452 452 <tr><td>McCabe essential</td><td> 1</td></tr> 453 453 <tr><td>McCabe modular design</td><td> 1</td></tr> -
trunk/SRC/Documentation/idldoc_html_output/ToBeReviewed/PLOTS/reinitplt.html
r200 r214 212 212 <div class="comments"> 213 213 Invert the logic. Clear all unselected variables. 214 Therefore " clearplt,/all,/invert" does nothing.214 Therefore "reinitplt,/all,/invert" does nothing. 215 215 </div> 216 216 … … 221 221 222 222 <h4>Version</h4><div class="preformat"> 223 $Id: reinitplt.pro 163 2006-08-29 12:59:46Z navarro$223 $Id: reinitplt.pro 213 2007-02-16 11:29:17Z smasson $ 224 224 </div> 225 225 <h4>History</h4><div class="preformat"> -
trunk/SRC/Documentation/idldoc_html_output/ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html
r200 r214 109 109 110 110 <p class="header"> 111 loadgrid<span class="result">, <a href="#_loadgrid_param_meshfile in">meshfilein</a></span>, <a href="#_loadgrid_keyword__extra">_extra</a>=<span class="result">_extra</span></p>111 loadgrid<span class="result">, <a href="#_loadgrid_param_meshfiletxtin">meshfiletxtin</a></span>, <a href="#_loadgrid_keyword__extra">_extra</a>=<span class="result">_extra</span></p> 112 112 113 113 <div class="comments"></div> … … 121 121 122 122 123 <h4 id="_loadgrid_param_meshfile in">meshfilein 123 <h4 id="_loadgrid_param_meshfiletxtin">meshfiletxtin 124 124 125 125 … … 132 132 </h4> 133 133 134 <div class="comments"> 135 136 </div> 134 <div class="comments"></div> 137 135 138 136 … … 166 164 167 165 <h4>Version</h4><div class="preformat"> 168 $Id: loadgrid.pro 192 2006-09-22 09:37:08Z smasson $166 $Id: loadgrid.pro 213 2007-02-16 11:29:17Z smasson $ 169 167 </div> 170 168 <h4>History</h4><div class="preformat"> … … 195 193 <h3>Statistics</h3> 196 194 <table class="statistics"> 197 <tr><td>McCabe cyclic</td><td> 11</td></tr>195 <tr><td>McCabe cyclic</td><td> 8</td></tr> 198 196 <tr><td>McCabe essential</td><td> 1</td></tr> 199 197 <tr><td>McCabe modular design</td><td> 1</td></tr> -
trunk/SRC/Documentation/idldoc_html_output/ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.html
r203 r214 164 164 165 165 <h4>Version</h4><div class="preformat"> 166 $Id: selectfile.pro 2 02 2007-01-12 11:00:06Z smasson $166 $Id: selectfile.pro 213 2007-02-16 11:29:17Z smasson $ 167 167 </div> 168 168 <h4>History</h4><div class="preformat"> … … 192 192 <h3>Statistics</h3> 193 193 <table class="statistics"> 194 <tr><td>McCabe cyclic</td><td> 29</td></tr>194 <tr><td>McCabe cyclic</td><td> 30</td></tr> 195 195 <tr><td>McCabe essential</td><td> 1</td></tr> 196 196 <tr><td>McCabe modular design</td><td> 1</td></tr> … … 295 295 296 296 <h4>Version</h4><div class="preformat"> 297 $Id: selectfile.pro 2 02 2007-01-12 11:00:06Z smasson $297 $Id: selectfile.pro 213 2007-02-16 11:29:17Z smasson $ 298 298 </div> 299 299 <h4>History</h4><div class="preformat"> -
trunk/SRC/Documentation/idldoc_html_output/idldoc-index-GH.html
r210 r214 388 388 table.variables td.image { width: 64px; } 389 389 390 div#file_comments { white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; 390 div#file_comments { white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; white-space: pre; 391 391 margin: 2em; 392 392 font-size: 80%; -
trunk/SRC/Documentation/idldoc_html_output/idldoc-index-M.html
r203 r214 457 457 <dd>a file from the directory ./ToBeReviewed/PLOTS/DIVERS</dd> 458 458 459 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html#_loadgrid">meshfile in</a></dt>459 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html#_loadgrid">meshfiletxtin</a></dt> 460 460 <dd>a parameter from the routine ./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid</dd> 461 461 -
trunk/SRC/Documentation/idldoc_html_output/idldoc-warnings.html
r210 r214 1388 1388 </tr> 1389 1389 1390 </table><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html">./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.pro</a> 1391 <table> 1392 1393 <tr> 1394 <td class="docroutine"><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html#_loadgrid">loadgrid</a></td> 1395 <td class="docstat partialdoc">partially documented</td> 1396 </tr> 1397 1390 1398 </table><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.html">./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_bgroup.pro</a> 1391 1399 <table> … … 2702 2710 <tr> 2703 2711 <td class="statroutine"><a href="./ToBeReviewed/LECTURE/read_ncdf.html#_read_ncdf">read_ncdf</a></td> 2704 <td class="stat warning"> 13 8</td>2712 <td class="stat warning"> 135</td> 2705 2713 </tr> 2706 2714 … … 3335 3343 <tr> 3336 3344 <td class="statroutine"><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html#_loadgrid">loadgrid</a></td> 3337 <td class="stat warning"> 11</td>3345 <td class="stat caution"> 8</td> 3338 3346 </tr> 3339 3347 … … 3359 3367 <tr> 3360 3368 <td class="statroutine"><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.html#_selectfile_event">selectfile_event</a></td> 3361 <td class="stat warning"> 29</td>3369 <td class="stat warning"> 30</td> 3362 3370 </tr> 3363 3371 -
trunk/SRC/Documentation/idldoc_html_output/overview.html
r210 r214 382 382 <tr> 383 383 <td>Lines of code</td> 384 <td class="value"> 644 89</td>384 <td class="value"> 64490</td> 385 385 </tr> 386 386 </table> -
trunk/SRC/Documentation/idldoc_html_output/search.js
r210 r214 35 35 a[33] = new Array("./Grid/changemsk.html", "changemsk.pro", "", " file_comments add land points on a 2D land sea mask categories Grid param TAB in required a 2D land sea mask with 1 on sea and 0 on land keyword CELLSIZE size in pixel of the square representing one point of the mask returns newmsk the new 2D land sea mask examples IDL a changemsk tmask 0 to add ocean points IDL a 1 changemsk 1 tmask 0 history Sebastien Masson smasson lodyc jussieu fr June 2006 version Id: changemsk pro 163 2006 08 29 12:59:46Z navarro function changemsk tab CELLSIZE cellsize compile_opt idl2 strictarrsubs newmsk 1 taille size tab if taille 0 NE 2 then return newmsk newmsk byte tab if keyword_set cellsize THEN cellsize long cellsize ELSE cellsize long 2 window xsize taille 1 cellsize ysize taille 2 cellsize tvscl congrid newmsk taille 1 cellsize taille 2 cellsize if NOT keyword_set nouseinfos then begin print left button : use it twice to define the diagonal of the rectangle to be set to 0 land print middle button: put 0 land on the clicked point print right button : quit endif cursor x1 y1 device up while mouse button ne 4 do begin case mouse button of 0:return newmsk 1:BEGIN cursor x2 y2 device up x x1 x2 x x sort x x round x cellsize y y1 y2 y y sort y y round y cellsize newmsk x 0 :x 1 y 0 :y 1 0 tvscl replicate 0 x 1 x 0 1 cellsize y 1 y 0 1 cellsize x 0 cellsize y 0 cellsize end 2:BEGIN x1 round x1 cellsize y1 round y1 cellsize newmsk x1 y1 0 tvscl replicate 0 cellsize cellsize x1 cellsize y1 cellsize END ELSE: endcase cursor x1 y1 device up endwhile return newmsk end "); 36 36 a[34] = new Array("./Grid/checkperio.html", "checkperio.pro", "", " file_comments check ORCA2 and ORCA05 periodicity east west and noth fold for files related to the T GRID ONLY categories Grid param file in required type scalar string A string giving the name of the NetCdf file keyword WRITE default 0 type scalar: 0 or 1 Define to 1 to write the good periodicity in the file By default print only mesage of periodicity errors restrictions Works only for grid T points if the WRITE keyword is activated we need the writing access on the file examples IDL checkperio Users smasson OPA modipsl bin runoff_1m_nomask nc checkperio Users smasson OPA modipsl bin runoff_1m_nomask nc nav_lon bad y periodicity 1 nav_lon bad y periodicity 2 nav_lon bad x periodicity 1 nav_lon bad x periodicity 2 nav_lat bad y periodicity 1 nav_lat bad y periodicity 2 nav_lat bad x periodicity 1 nav_lat bad x periodicity 2 socoefr bad y periodicity 1 socoefr bad x periodicity 1 socoefr bad x periodicity 2 sorunoff bad x periodicity 1 sorunoff bad x periodicity 2 IDL checkperio Users smasson OPA modipsl bin runoff_1m_nomask nc WRITE IDL checkperio Users smasson OPA modipsl bin runoff_1m_nomask nc history October 2006: Sebastien Masson smasson locean ipsl upmc fr version Id: checkperio pro 197 2006 10 26 10:45:17Z smasson PRO checkperio file WRITE write IF file_test file EQ 0 THEN BEGIN print file file not found RETURN ENDIF cdfid ncdf_open file WRITE write finq ncdf_inquire cdfid dimsz lonarr finq ndims FOR did 0 finq ndims 1 DO BEGIN ncdf_diminq cdfid did name size dimsz did size ENDFOR FOR vid 0 finq nvars 1 DO BEGIN vinq ncdf_varinq cdfid vid IF vinq ndims GE 2 THEN BEGIN vdimsz dimsz vinq dim jpi vdimsz 0 jpj vdimsz 1 CASE vinq ndims OF 2D VAR 2:BEGIN y periodicity 1 CASE 1 OF array_equal 182 149 vdimsz 0:1 :BEGIN ORCA2 ncdf_varget cdfid vid part1 count jpi 2 1 offset 1 jpj 1 ncdf_varget cdfid vid part2 count jpi 2 1 offset 1 jpj 3 part2 reverse shift part2 1 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad y periodicity 1 IF keyword_set write THEN ncdf_varput cdfid vid part2 count jpi 2 1 offset 1 jpj 1 ENDIF END array_equal 722 511 vdimsz 0:1 :BEGIN ORCA05 ncdf_varget cdfid vid part1 count jpi 2 1 offset 1 jpj 1 ncdf_varget cdfid vid part2 count jpi 2 1 offset 1 jpj 2 part2 reverse part2 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad y periodicity 1 IF keyword_set write THEN ncdf_varput cdfid vid part2 count jpi 2 1 offset 1 jpj 1 ENDIF END ELSE:print vinq name nothing to check ENDCASE y periodicity 2 CASE 1 OF array_equal 182 149 vdimsz 0:1 :BEGIN ORCA2 ncdf_varget cdfid vid part1 count jpi 1 2 2 1 1 offset jpi 1 2 2 jpj 2 ncdf_varget cdfid vid part2 count jpi 1 2 2 1 1 offset 2 jpj 2 part2 reverse part2 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad y periodicity 2 IF keyword_set write THEN ncdf_varput cdfid vid part2 count jpi 1 2 2 1 1 offset jpi 1 2 2 jpj 2 ENDIF END array_equal 722 511 vdimsz 0:1 :BEGIN ORCA05 END ELSE:print vinq name nothing to check ENDCASE x periodicity 1 ncdf_varget cdfid vid part1 count 1 jpj offset 0 0 ncdf_varget cdfid vid part2 count 1 jpj offset jpi 2 0 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad x periodicity 1 IF keyword_set write THEN ncdf_varput cdfid vid part2 count 1 jpj offset 0 0 ENDIF x periodicity 2 ncdf_varget cdfid vid part1 count 1 jpj offset jpi 1 0 ncdf_varget cdfid vid part2 count 1 jpj offset 1 0 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad x periodicity 2 IF keyword_set write THEN ncdf_varput cdfid vid part2 count 1 jpj offset jpi 1 0 ENDIF END 3D VAR 3:BEGIN jpk vdimsz 2 y periodicity 1 CASE 1 OF array_equal 182 149 vdimsz 0:1 :BEGIN ORCA2 ncdf_varget cdfid vid part1 count jpi 2 1 jpk offset 1 jpj 1 0 ncdf_varget cdfid vid part2 count jpi 2 1 jpk offset 1 jpj 3 0 IF jpk EQ 1 THEN part2 reform part2 jpi 2 1 jpk over part2 reverse shift part2 1 0 0 1 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad y periodicity 1 IF keyword_set write THEN ncdf_varput cdfid vid part2 count jpi 2 1 jpk offset 1 jpj 1 0 ENDIF END array_equal 722 511 vdimsz 0:1 :BEGIN ORCA05 ncdf_varget cdfid vid part1 count jpi 2 1 jpk offset 1 jpj 1 0 ncdf_varget cdfid vid part2 count jpi 2 1 jpk offset 1 jpj 2 0 IF jpk EQ 1 THEN part2 reform part2 jpi 2 1 jpk over part2 reverse part2 1 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad y periodicity 1 IF keyword_set write THEN ncdf_varput cdfid vid part2 count jpi 2 1 jpk offset 1 jpj 1 0 ENDIF END ELSE:print vinq name nothing to check ENDCASE y periodicity 2 CASE 1 OF array_equal 182 149 vdimsz 0:1 :BEGIN ORCA2 ncdf_varget cdfid vid part1 count jpi 1 2 2 1 1 jpk offset jpi 1 2 2 jpj 2 0 ncdf_varget cdfid vid part2 count jpi 1 2 2 1 1 jpk offset 2 jpj 2 0 part2 reverse part2 1 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad y periodicity 2 IF keyword_set write THEN ncdf_varput cdfid vid part2 count jpi 1 2 2 1 1 jpk offset jpi 1 2 2 jpj 2 0 ENDIF END array_equal 722 511 vdimsz 0:1 :BEGIN ORCA05 END ELSE:print vinq name nothing to check ENDCASE x periodicity 1 ncdf_varget cdfid vid part1 count 1 jpj jpk offset 0 0 0 ncdf_varget cdfid vid part2 count 1 jpj jpk offset jpi 2 0 0 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad x periodicity 1 IF keyword_set write THEN ncdf_varput cdfid vid part2 count 1 jpj jpk offset 0 0 0 ENDIF x periodicity 2 ncdf_varget cdfid vid part1 count 1 jpj jpk offset jpi 1 0 0 ncdf_varget cdfid vid part2 count 1 jpj jpk offset 1 0 0 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad x periodicity 2 IF keyword_set write THEN ncdf_varput cdfid vid part2 count 1 jpj jpk offset jpi 1 0 0 ENDIF END 4D VAR 4:BEGIN jpk vdimsz 2 jpt vdimsz 3 y periodicity 1 CASE 1 OF array_equal 182 149 vdimsz 0:1 :BEGIN ORCA2 ncdf_varget cdfid vid part1 count jpi 2 1 jpk jpt offset 1 jpj 1 0 0 ncdf_varget cdfid vid part2 count jpi 2 1 jpk jpt offset 1 jpj 3 0 0 IF jpt EQ 1 THEN part2 reform part2 jpi 2 1 jpk jpt over part2 reverse shift part2 1 0 0 0 1 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad y periodicity 1 IF keyword_set write THEN ncdf_varput cdfid vid part2 count jpi 2 1 jpk jpt offset 1 jpj 1 0 0 ENDIF END array_equal 722 511 vdimsz 0:1 :BEGIN ORCA05 ncdf_varget cdfid vid part1 count jpi 2 1 jpk jpt offset 1 jpj 1 0 0 ncdf_varget cdfid vid part2 count jpi 2 1 jpk jpt offset 1 jpj 2 0 0 IF jpt EQ 1 THEN part2 reform part2 jpi 2 1 jpk jpt over part2 reverse part2 1 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad y periodicity 1 IF keyword_set write THEN ncdf_varput cdfid vid part2 count jpi 2 1 jpk jpt offset 1 jpj 1 0 0 ENDIF END ELSE:print vinq name nothing to check ENDCASE y periodicity 2 CASE 1 OF array_equal 182 149 vdimsz 0:1 :BEGIN ORCA2 ncdf_varget cdfid vid part1 count jpi 1 2 2 1 1 jpk jpt offset jpi 1 2 2 jpj 2 0 0 ncdf_varget cdfid vid part2 count jpi 1 2 2 1 1 jpk jpt offset 2 jpj 2 0 0 part2 reverse part2 1 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad y periodicity 2 IF keyword_set write THEN ncdf_varput cdfid vid part2 count jpi 1 2 2 1 1 jpk jpt offset jpi 1 2 2 jpj 2 0 0 ENDIF END array_equal 722 511 vdimsz 0:1 :BEGIN ORCA05 END ELSE:print vinq name nothing to check ENDCASE x periodicity 1 ncdf_varget cdfid vid part1 count 1 jpj jpk jpt offset 0 0 0 0 ncdf_varget cdfid vid part2 count 1 jpj jpk jpt offset jpi 2 0 0 0 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad x periodicity 1 IF keyword_set write THEN ncdf_varput cdfid vid part2 count 1 jpj jpk jpt offset 0 0 0 0 ENDIF x periodicity 2 ncdf_varget cdfid vid part1 count 1 jpj jpk jpt offset jpi 1 0 0 0 ncdf_varget cdfid vid part2 count 1 jpj jpk jpt offset 1 0 0 0 IF array_equal part1 part2 NE 1 THEN BEGIN print vinq name bad x periodicity 2 IF keyword_set write THEN ncdf_varput cdfid vid part2 count 1 jpj jpk jpt offset jpi 1 0 0 0 ENDIF END ELSE:print vinq name nothing to check ENDCASE ENDIF ENDFOR ncdf_close cdfid RETURN END"); 37 a[35] = new Array("./Grid/computegrid.html", "computegrid.pro", "", " file_comments compute the grid parameters cm_4mesh common domains sizes: jpi jpj jpk jpiglo jpjglo jpkglo jpidta jpjdta jpkdta domains positions regarding to the original grid: ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh ixmindta ixmaxdta iymindta iymaxdta izmindta izmaxdta horizontal parameters: glamt glamf gphit gphit e1t e2t additional horizontal parameters if FULLCGRID keyword is defined: glamu glamv gphiu gphiv e1u e1v e1f e2u e2v e2f verticals parameters: gdept gdepw e3t e3w masks: tmask additional masks if FULLCGRID keyword is defined: umaskred vmaskred fmaskredx fmaskredy triangles_list: triangulation key_ variables: key_onearth key_periodic key_shift key_stride key_partialstep key_yreverse key_zreverse key_gridtype xxx related variables: ccmeshparameters ccreadparameters categories Grid param startx in optional type scalar x starting point optional if XY AXIS keyword is used param starty in optional type scalar y starting point optional if XY AXIS keyword is used param stepxin in optional type scalar or vector x direction step optional if XY AXIS keyword is used must be 0 if stepxin is a vector nx is not used param stepyin in optional type scalar or vector y direction step optional if XY AXIS keyword is used could be 0 south to north or lon1 lon2 lon1 le 360 By default the common cm_4mesh variable key_shift will be automatically defined according to GLAMBOUNDARY keyword MASK default array of 1 type 2D or 3D array Specify the land 0 sea 1 mask keyword ONEARTH default 1 type scalar: 0 or 1 Force the manual definition of data localization on the earth or not 0 if the data are not on the earth 1 if the data are on earth in that case we can for example use the labels longitude latitude in plots The resulting value will be stored in the common cm_4mesh variable key_onearth ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword PERIODIC default computed by using the first line of glamt type scalar: 0 or 1 Force the manual definition of the grid zonal periodicity The resulting value will be stored in the common cm_4mesh variable key_periodic PERIODIC 0 forces SHIFT 0 keyword PLAIN default 0 type scalar: 0 or 1 Force PERIODIC 0 SHIFT 0 STRIDE 1 1 1 and suppress the automatic redefinition of the domain in case of x periodicity overlap y periodicity overlap ORCA type only and mask border to 0 keyword SHIFT default computed according to glamboundary type scalar Force the manual definition of the zonal shift that must be apply to the data The resulting value will be stored in the common cm_4mesh variable key_shift Note that if key_periodic 0 then in any case key_shift 0 keyword STRCALLING type string a string containing the calling command used to call computegrid this is used by xxx pro keyword STRIDE default 1 1 1 type 3 elements vector Specify the stride in x y and z direction The resulting value will be stored in the common cm_4mesh variable key_stride keyword XAXIS type 1D or 2D array Specify longitudes in this case startx stepx and nx are not used but could be necessary if the y axis is not defined with yaxis It must be possible to sort the first line of xaxis in the increasing order by shifting its elements keyword YAXIS type 1D or 2D array Specify latitudes in this case starty stepy and ny are not used but starty and stepy could be necessary if the x axis is not defined with xaxis It must be sorted in the increasing or deceasing order along each column if 2d array keyword XYINDEX activate to specify that the horizontal grid should be simply defined by using the index of the points xaxis findgen nx and yaxis findgen ny using this keyword forces key_onearth 0 keyword XMINMESH default 0L type scalar Define common cm_4mesh variables ixminmesh used to define the localization of the first point of the grid along the x direction in a zoom of the original grid keyword YMINMESH default 0L type scalar Define common cm_4mesh variables iyminmesh used to define the localization of the first point of the grid along the y direction in a zoom of the original grid keyword ZMINMESH default 0L type scalar Define common cm_4mesh variables izminmesh used to define the localization of the first point of the grid along the z direction in a zoom of the original grid keyword XMAXMESH default jpiglo 1 type scalar Define common cm_4mesh variables ixmaxmesh used to define the localization of the last point of the grid along the x direction in a zoom of the original grid Note that if XMAXMESH we are back to a C grid based on T point as for OPA model Note that in that case key_gridtype c_f and not c used in read_ncdf Note that activate FBASE2TBASE forces FULLCGRID 1 keyword UBASE2TBASE Activate when the model is a C grid based on a U point with a U point at the bottom left corner and a T point at the upper right corner In this case we ignore if the grid is not x periodic the first column of F and U points if the grid is not x periodic the last column of T and V points we are back to a C grid based on T point as for OPA model Note that in that case key_gridtype c_u and not c used in read_ncdf Note that activate UBASE2TBASE forces FULLCGRID 1 keyword VBASE2TBASE Activate when the model is a C grid based on a V point with a V point at the bottom left corner and a T point at the upper right corner In this case we ignore the first line of F and V points the last line of T and U points we are back to a C grid based on T point as for OPA model Note that in that case key_gridtype c_v and not c used in read_ncdf Note that activate VBASE2TBASE forces FULLCGRID 1 keyword ROMSH type 2D array This array is the final bathymetry at RHO points It is stored in the common variable cm_4mesh romszinfos h Used when the model is a ROMS C grid with one more point in longitude for T and V grid and one more point in latitude for T and U grid In this case we ignore the last line of T and U points the last column of T and V points we are back to a C grid based on T point as for OPA model Note that activate ROMSH forces FULLCGRID 1 keyword STRCALLING type scalar string Used by xxx keyword ZAXIS type 1D Specify the vertical axis Must be sorted in the increasing or deceasing order keyword _EXTRA not used in the present case uses cm_4mesh cm_4data cm_4cal restrictions if the grid has x y periodicity orverlap and or if the mask has 0 everywhere at the border like a close sea and if we did not activate plain and xminmesh xmaxmesh yminmesh ymaxmesh keywords are defined to their default values we redefine xminmesh xmaxmesh yminmesh ymaxmesh in order to reove the overlapping part and or to open the domain avoid ti be forced to use cell_fill 1 restrictions FUV points definition is not exact if the grid is irregular history Sebastien Masson smasson lodyc jussieu fr 2000 04 20 Sept 2004 several bug fixs to suit C grid type Aug 2005 rewritte almost everything version Id: computegrid pro 2 09 2007 02 08 10:01:49Z smasson PRO computegrid startx starty stepxin stepyin nxin nyin XAXIS xaxis YAXIS yaxis ZAXIS zaxis MASK mask GLAMBOUNDARY glamboundary XMINMESH xminmesh XMAXMESH xmaxmesh YMINMESH yminmesh YMAXMESH ymaxmesh ZMINMESH zminmesh ZMAXMESH zmaxmesh ONEARTH onearth PERIODIC periodic PLAIN plain SHIFT shift STRIDE stride FULLCGRID fullcgrid XYINDEX xyindex UBASE2TBASE ubase2tbase VBASE2TBASE vbase2tbase FBASE2TBASE fbase2tbase STRCALLING strcalling ROMSH romsh _extra ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF time1 systime 1 for key_performance Check input parameters xaxis related parameters if n_elements xaxis NE 0 then BEGIN CASE size xaxis 0 OF 0:nx 1L 1:nx size xaxis 1 2:nx size xaxis 1 ENDCASE ENDIF ELSE BEGIN IF n_elements startx EQ 0 THEN BEGIN dummy report If xaxis is not given startx must be defined return ENDIF CASE n_elements stepxin OF 0:BEGIN dummy report If xaxis is not given stepxin must be defined return END 1:BEGIN IF n_elements nxin EQ 0 THEN BEGIN dummy report If xaxis is not given and stepxin has only one element nx must be defined return ENDIF ELSE nx nxin END ELSE:nx n_elements stepxin ENDCASE ENDELSE yaxis related parameters if n_elements yaxis NE 0 then BEGIN CASE size yaxis 0 OF 0:ny 1L 1:ny size yaxis 1 2:ny size yaxis 2 ENDCASE ENDIF ELSE BEGIN IF n_elements starty EQ 0 THEN BEGIN dummy report If yaxis is not given starty must be defined return ENDIF CASE n_elements stepyin OF 0:BEGIN dummy report If yaxis is not given stepyin must be defined return END 1:BEGIN IF n_elements nyin EQ 0 THEN BEGIN dummy report If yaxis is not given and stepyin has only one element ny must be defined return ENDIF ELSE ny nyin END ELSE:ny n_elements stepyin ENDCASE ENDELSE zaxis related parameters if n_elements zaxis NE 0 then BEGIN CASE size zaxis 0 OF 0:nz 1L 1:nz size zaxis 1 ELSE:BEGIN print not coded stop END ENDCASE ENDIF ELSE nz 1L Others automatic definitions jpiglo long nx jpjglo long ny jpkglo long nz IF keyword_set romsh THEN BEGIN jpiglo jpiglo 1 jpjglo jpjglo 1 fullcgrid 1 ENDIF impact of plain keyword: IF keyword_set plain THEN BEGIN periodic 0 shift 0 stride 1 1 1 ENDIF IF n_elements xminmesh NE 0 THEN ixminmesh long xminmesh 0 ELSE ixminmesh 0l IF n_elements xmaxmesh NE 0 THEN ixmaxmesh long xmaxmesh 0 ELSE ixmaxmesh jpiglo 1 IF n_elements yminmesh NE 0 THEN iyminmesh long yminmesh 0 ELSE iyminmesh 0l IF n_elements ymaxmesh NE 0 THEN iymaxmesh long ymaxmesh 0 ELSE iymaxmesh jpjglo 1 IF n_elements zminmesh NE 0 THEN izminmesh long zminmesh 0 ELSE izminmesh 0l IF n_elements zmaxmesh NE 0 THEN izmaxmesh long zmaxmesh 0 ELSE izmaxmesh jpkglo 1 CASE 1 OF keyword_set fbase2tbase :key_gridtype c_f keyword_set ubase2tbase :key_gridtype c_u keyword_set vbase2tbase :key_gridtype c_v else:key_gridtype c ENDCASE IF key_gridtype EQ c_v OR key_gridtype EQ c_f THEN BEGIN iymaxmesh iymaxmesh 1 ENDIF IF strlen key_gridtype EQ 3 THEN fullcgrid 1 IF ixmaxmesh LT 0 THEN ixmaxmesh jpiglo 1 ixmaxmesh IF iymaxmesh LT 0 THEN iymaxmesh jpjglo 1 iymaxmesh IF izmaxmesh LT 0 THEN izmaxmesh jpkglo 1 izmaxmesh avoid basics errors ixmaxmesh 0 ixmaxmesh ixminmesh iymaxmesh iyminmesh izmaxmesh izminmesh temporary glamf gphif temporary glamu gphiu temporary glamv gphiv gdept stepz 2 ENDIF ELSE BEGIN stepz 1 gdepw gdept ENDELSE IF keyword_set romsh THEN gdepw gdept e3 tw : e3t stepz IF n_elements stepz GT 1 THEN BEGIN e3w 0 5 stepz shift stepz 1 e3w 0 0 5 e3t 0 ENDIF ELSE e3w e3t Mask default mask eq 1 if NOT keyword_set mask then tmask 1 ELSE tmask mask IF keyword_set romsh AND tmask 0 NE 1 THEN tmask tmask 0:jpiglo 1 0:jpjglo 1 IF n_elements mask EQ jpiglo jpjglo AND jpkglo GT 1 THEN BEGIN tmask tmask replicate 1 jpkglo tmask reform tmask jpiglo jpjglo jpkglo overwrite ENDIF IF jpiglo EQ 1 OR jpjglo EQ 1 THEN tmask reform tmask jpiglo jpjglo jpkglo overwrite if tmask 0 NE 1 then BEGIN tmask byte tmask ixminmesh:ixmaxmesh iyminmesh:iymaxmesh izminmesh:izmaxmesh tmask reform tmask jpi jpj jpk over if key_shift NE 0 then tmask shift tmask key_shift 0 0 because tmask reverse tmask 2 is not working if the 3rd dimension of tmask 1 we call reform IF jpk EQ 1 THEN tmask reform tmask over IF key_yreverse EQ 1 THEN tmask reverse tmask 2 IF jpk EQ 1 THEN tmask reform tmask jpi jpj jpk over IF key_zreverse EQ 1 THEN tmask reverse tmask 3 IF jpk EQ 1 THEN tmask reform tmask jpi jpj jpk over IF keyword_set fullcgrid THEN BEGIN IF keyword_set key_periodic THEN BEGIN msk tmask shift tmask 1 0 0 umaskred msk jpi 1 ENDIF ELSE umaskred tmask jpi 1 vmaskred tmask jpj 1 fmaskredy tmask jpi 1 fmaskredx tmask jpj 1 ENDIF ENDIF ELSE BEGIN tmask replicate 1b jpi jpj jpk IF keyword_set fullcgrid THEN BEGIN umaskred replicate 1b jpj jpk vmaskred replicate 1b jpi jpk fmaskredy replicate 1b jpj jpk fmaskredx replicate 1b jpi jpk ENDIF ENDELSE IF jpi GT 2 AND jpj GT 2 AND NOT keyword_set plain AND ixminmesh EQ 0l AND ixmaxmesh eq jpiglo 1 AND iyminmesh EQ 0l AND iymaxmesh eq jpjglo 1 AND total tmask 0 EQ 0 AND total tmask jpj 1 EQ 0 AND total tmask 0 EQ 0 AND total tmask jpi 1 EQ 0 THEN BEGIN xminmesh 1 xmaxmesh 1 yminmesh 1 ymaxmesh 1 computegrid XAXIS glamt YAXIS gphit ZAXIS zaxis MASK mask GLAMBOUNDARY glamboundary XMINMESH xminmesh XMAXMESH xmaxmesh YMINMESH yminmesh YMAXMESH ymaxmesh ZMINMESH zminmesh ZMAXMESH zmaxmesh ONEARTH onearth PERIODIC periodic PLAIN plain SHIFT shift STRIDE stride FULLCGRID fullcgrid XYINDEX xyindexFBASE2TBASE fbase2tbase STRCALLING strcalling ROMSH romsh _extra ex return ENDIF IF NOT keyword_set fullcgrid THEN BEGIN umaskred values f_nan vmaskred values f_nan fmaskredy values f_nan fmaskredx values f_nan ENDIF stride IF total key_stride GT 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 glamt temporary glamt 0: :stride 0 0: :stride 1 gphit temporary gphit 0: :stride 0 0: :stride 1 e1t temporary e1t 0: :stride 0 0: :stride 1 e2t temporary e2t 0: :stride 0 0: :stride 1 tmask temporary tmask 0: :stride 0 0: :stride 1 0: :stride 2 gdept gdept 0: :stride 2 gdepw gdepw 0: :stride 2 e3t e3t 0: :stride 2 e3w e3w 0: :stride 2 we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over ENDIF IF keyword_set fullcgrid THEN BEGIN glamu temporary glamu 0: :stride 0 0: :stride 1 gphiu temporary gphiu 0: :stride 0 0: :stride 1 e1u temporary e1u 0: :stride 0 0: :stride 1 e2u temporary e2u 0: :stride 0 0: :stride 1 glamv temporary glamv 0: :stride 0 0: :stride 1 gphiv temporary gphiv 0: :stride 0 0: :stride 1 e1v temporary e1v 0: :stride 0 0: :stride 1 e2v temporary e2v 0: :stride 0 0: :stride 1 e1f temporary e1f 0: :stride 0 0: :stride 1 e2f temporary e2f 0: :stride 0 0: :stride 1 umaskred temporary umaskred 0 0: :stride 1 0: :stride 2 vmaskred temporary vmaskred 0: :stride 0 0 0: :stride 2 fmaskredy temporary fmaskredy 0 0: :stride 1 0: :stride 2 fmaskredx temporary fmaskredx 0: :stride 0 0 0: :stride 2 IF jpj EQ 1 THEN BEGIN glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over ENDIF ENDIF ENDIF apply all the grid parameters updateold domdef Triangulation IF total tmask EQ jpi jpj jpk AND NOT keyword_set key_irregular THEN triangles_list 1 ELSE BEGIN are we using ORCA2 IF jpiglo EQ 182 AND jpi EQ 181 AND jpjglo EQ 149 AND jpj EQ 148 THEN triangles_list triangule ELSE triangles_list triangule keep_cont ENDELSE time axis default definition IF n_elements time EQ 0 OR n_elements jpt EQ 0 THEN BEGIN jpt 1 time 0 ENDIF IF NOT keyword_set key_forgetold THEN BEGIN updateold ENDIF grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling computegrid ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE IF keyword_set romsh THEN romszinfos h:romsh ixminmesh:ixmaxmesh iyminmesh:iymaxmesh zeta:replicate 0 jpi jpj theta_s: 1 theta_b: 1 hc: 1 ELSE romszinfos h: 1 zeta: 1 theta_s: 1 theta_b: 1 hc: 1 ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth ccreadparameters funclec_name: read_ncdf jpidta:jpidta jpjdta:jpjdta jpkdta:jpkdta ixmindta:ixmindta ixmaxdta:ixmaxdta iymindta:iymindta iymaxdta:iymaxdta izmindta:izmindta izmaxdta:izmaxdta IF keyword_set key_performance EQ 1 THEN print time computegrid systime 1 time1 return end");37 a[35] = new Array("./Grid/computegrid.html", "computegrid.pro", "", " file_comments compute the grid parameters cm_4mesh common domains sizes: jpi jpj jpk jpiglo jpjglo jpkglo jpidta jpjdta jpkdta domains positions regarding to the original grid: ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh ixmindta ixmaxdta iymindta iymaxdta izmindta izmaxdta horizontal parameters: glamt glamf gphit gphit e1t e2t additional horizontal parameters if FULLCGRID keyword is defined: glamu glamv gphiu gphiv e1u e1v e1f e2u e2v e2f verticals parameters: gdept gdepw e3t e3w masks: tmask additional masks if FULLCGRID keyword is defined: umaskred vmaskred fmaskredx fmaskredy triangles_list: triangulation key_ variables: key_onearth key_periodic key_shift key_stride key_partialstep key_yreverse key_zreverse key_gridtype xxx related variables: ccmeshparameters ccreadparameters categories Grid param startx in optional type scalar x starting point optional if XY AXIS keyword is used param starty in optional type scalar y starting point optional if XY AXIS keyword is used param stepxin in optional type scalar or vector x direction step optional if XY AXIS keyword is used must be 0 if stepxin is a vector nx is not used param stepyin in optional type scalar or vector y direction step optional if XY AXIS keyword is used could be 0 south to north or lon1 lon2 lon1 le 360 By default the common cm_4mesh variable key_shift will be automatically defined according to GLAMBOUNDARY keyword MASK default array of 1 type 2D or 3D array Specify the land 0 sea 1 mask keyword ONEARTH default 1 type scalar: 0 or 1 Force the manual definition of data localization on the earth or not 0 if the data are not on the earth 1 if the data are on earth in that case we can for example use the labels longitude latitude in plots The resulting value will be stored in the common cm_4mesh variable key_onearth ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword PERIODIC default computed by using the first line of glamt type scalar: 0 or 1 Force the manual definition of the grid zonal periodicity The resulting value will be stored in the common cm_4mesh variable key_periodic PERIODIC 0 forces SHIFT 0 keyword PLAIN default 0 type scalar: 0 or 1 Force PERIODIC 0 SHIFT 0 STRIDE 1 1 1 and suppress the automatic redefinition of the domain in case of x periodicity overlap y periodicity overlap ORCA type only and mask border to 0 keyword SHIFT default computed according to glamboundary type scalar Force the manual definition of the zonal shift that must be apply to the data The resulting value will be stored in the common cm_4mesh variable key_shift Note that if key_periodic 0 then in any case key_shift 0 keyword STRCALLING type string a string containing the calling command used to call computegrid this is used by xxx pro keyword STRIDE default 1 1 1 type 3 elements vector Specify the stride in x y and z direction The resulting value will be stored in the common cm_4mesh variable key_stride keyword XAXIS type 1D or 2D array Specify longitudes in this case startx stepx and nx are not used but could be necessary if the y axis is not defined with yaxis It must be possible to sort the first line of xaxis in the increasing order by shifting its elements keyword YAXIS type 1D or 2D array Specify latitudes in this case starty stepy and ny are not used but starty and stepy could be necessary if the x axis is not defined with xaxis It must be sorted in the increasing or deceasing order along each column if 2d array keyword XYINDEX activate to specify that the horizontal grid should be simply defined by using the index of the points xaxis findgen nx and yaxis findgen ny using this keyword forces key_onearth 0 keyword XMINMESH default 0L type scalar Define common cm_4mesh variables ixminmesh used to define the localization of the first point of the grid along the x direction in a zoom of the original grid keyword YMINMESH default 0L type scalar Define common cm_4mesh variables iyminmesh used to define the localization of the first point of the grid along the y direction in a zoom of the original grid keyword ZMINMESH default 0L type scalar Define common cm_4mesh variables izminmesh used to define the localization of the first point of the grid along the z direction in a zoom of the original grid keyword XMAXMESH default jpiglo 1 type scalar Define common cm_4mesh variables ixmaxmesh used to define the localization of the last point of the grid along the x direction in a zoom of the original grid Note that if XMAXMESH we are back to a C grid based on T point as for OPA model Note that in that case key_gridtype c_f and not c used in read_ncdf Note that activate FBASE2TBASE forces FULLCGRID 1 keyword UBASE2TBASE Activate when the model is a C grid based on a U point with a U point at the bottom left corner and a T point at the upper right corner In this case we ignore if the grid is not x periodic the first column of F and U points if the grid is not x periodic the last column of T and V points we are back to a C grid based on T point as for OPA model Note that in that case key_gridtype c_u and not c used in read_ncdf Note that activate UBASE2TBASE forces FULLCGRID 1 keyword VBASE2TBASE Activate when the model is a C grid based on a V point with a V point at the bottom left corner and a T point at the upper right corner In this case we ignore the first line of F and V points the last line of T and U points we are back to a C grid based on T point as for OPA model Note that in that case key_gridtype c_v and not c used in read_ncdf Note that activate VBASE2TBASE forces FULLCGRID 1 keyword ROMSH type 2D array This array is the final bathymetry at RHO points It is stored in the common variable cm_4mesh romszinfos h Used when the model is a ROMS C grid with one more point in longitude for T and V grid and one more point in latitude for T and U grid In this case we ignore the last line of T and U points the last column of T and V points we are back to a C grid based on T point as for OPA model Note that activate ROMSH forces FULLCGRID 1 keyword STRCALLING type scalar string Used by xxx keyword ZAXIS type 1D Specify the vertical axis Must be sorted in the increasing or deceasing order keyword _EXTRA not used in the present case uses cm_4mesh cm_4data cm_4cal restrictions if the grid has x y periodicity orverlap and or if the mask has 0 everywhere at the border like a close sea and if we did not activate plain and xminmesh xmaxmesh yminmesh ymaxmesh keywords are defined to their default values we redefine xminmesh xmaxmesh yminmesh ymaxmesh in order to reove the overlapping part and or to open the domain avoid ti be forced to use cell_fill 1 restrictions FUV points definition is not exact if the grid is irregular history Sebastien Masson smasson lodyc jussieu fr 2000 04 20 Sept 2004 several bug fixs to suit C grid type Aug 2005 rewritte almost everything version Id: computegrid pro 213 2007 02 16 11:29:17Z smasson PRO computegrid startx starty stepxin stepyin nxin nyin XAXIS xaxis YAXIS yaxis ZAXIS zaxis MASK mask GLAMBOUNDARY glamboundary XMINMESH xminmesh XMAXMESH xmaxmesh YMINMESH yminmesh YMAXMESH ymaxmesh ZMINMESH zminmesh ZMAXMESH zmaxmesh ONEARTH onearth PERIODIC periodic PLAIN plain SHIFT shift STRIDE stride FULLCGRID fullcgrid XYINDEX xyindex UBASE2TBASE ubase2tbase VBASE2TBASE vbase2tbase FBASE2TBASE fbase2tbase STRCALLING strcalling ROMSH romsh _extra ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF time1 systime 1 for key_performance Check input parameters xaxis related parameters if n_elements xaxis NE 0 then BEGIN CASE size xaxis 0 OF 0:nx 1L 1:nx size xaxis 1 2:nx size xaxis 1 ENDCASE ENDIF ELSE BEGIN IF n_elements startx EQ 0 THEN BEGIN dummy report If xaxis is not given startx must be defined return ENDIF CASE n_elements stepxin OF 0:BEGIN dummy report If xaxis is not given stepxin must be defined return END 1:BEGIN IF n_elements nxin EQ 0 THEN BEGIN dummy report If xaxis is not given and stepxin has only one element nx must be defined return ENDIF ELSE nx nxin END ELSE:nx n_elements stepxin ENDCASE ENDELSE yaxis related parameters if n_elements yaxis NE 0 then BEGIN CASE size yaxis 0 OF 0:ny 1L 1:ny size yaxis 1 2:ny size yaxis 2 ENDCASE ENDIF ELSE BEGIN IF n_elements starty EQ 0 THEN BEGIN dummy report If yaxis is not given starty must be defined return ENDIF CASE n_elements stepyin OF 0:BEGIN dummy report If yaxis is not given stepyin must be defined return END 1:BEGIN IF n_elements nyin EQ 0 THEN BEGIN dummy report If yaxis is not given and stepyin has only one element ny must be defined return ENDIF ELSE ny nyin END ELSE:ny n_elements stepyin ENDCASE ENDELSE zaxis related parameters if n_elements zaxis NE 0 then BEGIN CASE size zaxis 0 OF 0:nz 1L 1:nz size zaxis 1 ELSE:BEGIN print not coded stop END ENDCASE ENDIF ELSE nz 1L Others automatic definitions jpiglo long nx jpjglo long ny jpkglo long nz IF keyword_set romsh THEN BEGIN jpiglo jpiglo 1 jpjglo jpjglo 1 fullcgrid 1 ENDIF impact of plain keyword: IF keyword_set plain THEN BEGIN periodic 0 shift 0 stride 1 1 1 ENDIF IF n_elements xminmesh NE 0 THEN ixminmesh long xminmesh 0 ELSE ixminmesh 0l IF n_elements xmaxmesh NE 0 THEN ixmaxmesh long xmaxmesh 0 ELSE ixmaxmesh jpiglo 1 IF n_elements yminmesh NE 0 THEN iyminmesh long yminmesh 0 ELSE iyminmesh 0l IF n_elements ymaxmesh NE 0 THEN iymaxmesh long ymaxmesh 0 ELSE iymaxmesh jpjglo 1 IF n_elements zminmesh NE 0 THEN izminmesh long zminmesh 0 ELSE izminmesh 0l IF n_elements zmaxmesh NE 0 THEN izmaxmesh long zmaxmesh 0 ELSE izmaxmesh jpkglo 1 CASE 1 OF keyword_set fbase2tbase :key_gridtype c_f keyword_set ubase2tbase :key_gridtype c_u keyword_set vbase2tbase :key_gridtype c_v else:key_gridtype c ENDCASE IF key_gridtype EQ c_v OR key_gridtype EQ c_f THEN BEGIN iymaxmesh iymaxmesh 1 ENDIF IF strlen key_gridtype EQ 3 THEN fullcgrid 1 IF ixmaxmesh LT 0 THEN ixmaxmesh jpiglo 1 ixmaxmesh IF iymaxmesh LT 0 THEN iymaxmesh jpjglo 1 iymaxmesh IF izmaxmesh LT 0 THEN izmaxmesh jpkglo 1 izmaxmesh avoid basics errors ixmaxmesh 0 ixmaxmesh ixminmesh iymaxmesh iyminmesh izmaxmesh izminmesh temporary glamf gphif temporary glamu gphiu temporary glamv gphiv gdept stepz 2 ENDIF ELSE BEGIN stepz 1 gdepw gdept ENDELSE IF keyword_set romsh THEN gdepw gdept e3 tw : e3t stepz IF n_elements stepz GT 1 THEN BEGIN e3w 0 5 stepz shift stepz 1 e3w 0 0 5 e3t 0 ENDIF ELSE e3w e3t Mask default mask eq 1 if NOT keyword_set mask then tmask 1 ELSE tmask mask IF keyword_set romsh AND tmask 0 NE 1 THEN tmask tmask 0:jpiglo 1 0:jpjglo 1 IF n_elements mask EQ jpiglo jpjglo AND jpkglo GT 1 THEN BEGIN tmask tmask replicate 1 jpkglo tmask reform tmask jpiglo jpjglo jpkglo overwrite ENDIF IF jpiglo EQ 1 OR jpjglo EQ 1 THEN tmask reform tmask jpiglo jpjglo jpkglo overwrite if tmask 0 NE 1 then BEGIN tmask byte tmask ixminmesh:ixmaxmesh iyminmesh:iymaxmesh izminmesh:izmaxmesh tmask reform tmask jpi jpj jpk over if key_shift NE 0 then tmask shift tmask key_shift 0 0 because tmask reverse tmask 2 is not working if the 3rd dimension of tmask 1 we call reform IF jpk EQ 1 THEN tmask reform tmask over IF key_yreverse EQ 1 THEN tmask reverse tmask 2 IF jpk EQ 1 THEN tmask reform tmask jpi jpj jpk over IF key_zreverse EQ 1 THEN tmask reverse tmask 3 IF jpk EQ 1 THEN tmask reform tmask jpi jpj jpk over IF keyword_set fullcgrid THEN BEGIN IF keyword_set key_periodic THEN BEGIN msk tmask shift tmask 1 0 0 umaskred msk jpi 1 ENDIF ELSE umaskred tmask jpi 1 vmaskred tmask jpj 1 fmaskredy tmask jpi 1 fmaskredx tmask jpj 1 ENDIF ENDIF ELSE BEGIN tmask replicate 1b jpi jpj jpk IF keyword_set fullcgrid THEN BEGIN umaskred replicate 1b jpj jpk vmaskred replicate 1b jpi jpk fmaskredy replicate 1b jpj jpk fmaskredx replicate 1b jpi jpk ENDIF ENDELSE IF jpi GT 2 AND jpj GT 2 AND NOT keyword_set plain AND ixminmesh EQ 0l AND ixmaxmesh eq jpiglo 1 AND iyminmesh EQ 0l AND iymaxmesh eq jpjglo 1 AND total tmask 0 EQ 0 AND total tmask jpj 1 EQ 0 AND total tmask 0 EQ 0 AND total tmask jpi 1 EQ 0 THEN BEGIN xminmesh 1 xmaxmesh 1 yminmesh 1 ymaxmesh 1 computegrid XAXIS glamt YAXIS gphit ZAXIS zaxis MASK mask GLAMBOUNDARY glamboundary XMINMESH xminmesh XMAXMESH xmaxmesh YMINMESH yminmesh YMAXMESH ymaxmesh ZMINMESH zminmesh ZMAXMESH zmaxmesh ONEARTH onearth PERIODIC periodic PLAIN plain SHIFT shift STRIDE stride FULLCGRID fullcgrid XYINDEX xyindex UBASE2TBASE ubase2tbase VBASE2TBASE vbase2tbase FBASE2TBASE fbase2tbase STRCALLING strcalling ROMSH romsh _extra ex return ENDIF IF NOT keyword_set fullcgrid THEN BEGIN umaskred values f_nan vmaskred values f_nan fmaskredy values f_nan fmaskredx values f_nan ENDIF stride IF total key_stride GT 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 glamt temporary glamt 0: :stride 0 0: :stride 1 gphit temporary gphit 0: :stride 0 0: :stride 1 e1t temporary e1t 0: :stride 0 0: :stride 1 e2t temporary e2t 0: :stride 0 0: :stride 1 tmask temporary tmask 0: :stride 0 0: :stride 1 0: :stride 2 gdept gdept 0: :stride 2 gdepw gdepw 0: :stride 2 e3t e3t 0: :stride 2 e3w e3w 0: :stride 2 we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over ENDIF IF keyword_set fullcgrid THEN BEGIN glamu temporary glamu 0: :stride 0 0: :stride 1 gphiu temporary gphiu 0: :stride 0 0: :stride 1 e1u temporary e1u 0: :stride 0 0: :stride 1 e2u temporary e2u 0: :stride 0 0: :stride 1 glamv temporary glamv 0: :stride 0 0: :stride 1 gphiv temporary gphiv 0: :stride 0 0: :stride 1 e1v temporary e1v 0: :stride 0 0: :stride 1 e2v temporary e2v 0: :stride 0 0: :stride 1 e1f temporary e1f 0: :stride 0 0: :stride 1 e2f temporary e2f 0: :stride 0 0: :stride 1 umaskred temporary umaskred 0 0: :stride 1 0: :stride 2 vmaskred temporary vmaskred 0: :stride 0 0 0: :stride 2 fmaskredy temporary fmaskredy 0 0: :stride 1 0: :stride 2 fmaskredx temporary fmaskredx 0: :stride 0 0 0: :stride 2 IF jpj EQ 1 THEN BEGIN glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over ENDIF ENDIF ENDIF apply all the grid parameters updateold domdef Triangulation IF total tmask EQ jpi jpj jpk AND NOT keyword_set key_irregular THEN triangles_list 1 ELSE BEGIN are we using ORCA2 IF jpiglo EQ 182 AND jpi EQ 181 AND jpjglo EQ 149 AND jpj EQ 148 THEN triangles_list triangule ELSE triangles_list triangule keep_cont ENDELSE time axis default definition IF n_elements time EQ 0 OR n_elements jpt EQ 0 THEN BEGIN jpt 1 time 0 ENDIF IF NOT keyword_set key_forgetold THEN BEGIN updateold ENDIF grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling computegrid ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE IF keyword_set romsh THEN romszinfos h:romsh ixminmesh:ixmaxmesh iyminmesh:iymaxmesh zeta:replicate 0 jpi jpj theta_s: 1 theta_b: 1 hc: 1 ELSE romszinfos h: 1 zeta: 1 theta_s: 1 theta_b: 1 hc: 1 ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth ccreadparameters funclec_name: read_ncdf jpidta:jpidta jpjdta:jpjdta jpkdta:jpkdta ixmindta:ixmindta ixmaxdta:ixmaxdta iymindta:iymindta iymaxdta:iymaxdta izmindta:izmindta izmaxdta:izmaxdta IF keyword_set key_performance EQ 1 THEN print time computegrid systime 1 time1 return end"); 38 38 a[36] = new Array("./Grid/micromeshmask.html", "micromeshmask.pro", "", " file_comments Reduce the size of the NetCDF meshmask created by OPA by using bit and not byte format for the masks and the float format for the other fields categories For OPA param inid in required param outid in required param inname in required param outname in optional history July 2004 Sebastien Masson smasson lodyc jussieu fr version Id: micromeshmask pro 157 2006 08 21 09:01:50Z navarro PRO ncdf_transfer inid outid inname outname compile_opt idl2 strictarrsubs IF n_elements outname EQ 0 THEN outname inname ncdf_varget inid inname zzz ncdf_varput outid outname float reform zzz over RETURN END param ncfilein in required 1 the name of the meshmask file to be reduced In that case there is only one meshmask file OR 2 the xxx part in the names: xxx mesh_hgr nc xxx mesh_zgr nc xxx mask nc In that case the meshmask is split into 3 files param ncfileout in optional the name of the uniq reduced meshmask file default definition is micromeshmask nc keyword IODIR to define the files path examples IDL meshdir d1fes2 raid2 smasson DATA ORCA05 IDL micromeshmask meshmask_ORCA_R05 nc iodir meshdir PRO micromeshmask ncfilein ncfileout IODIR iodir compile_opt idl2 strictarrsubs filein isafile FILE ncfilein IODIR iodir NEW test findfile filein 0 IF test EQ THEN BEGIN filein_hgr findfile filein mesh_hgr nc 0 filein_zgr findfile filein mesh_zgr nc 0 filein_msk findfile filein mask nc 0 IF filein_hgr EQ OR filein_zgr EQ OR filein_msk EQ THEN BEGIN print meshmask file s not found print filein does not exist print filein mesh_hgr nc does not exist print filein mesh_zgr nc does not exist print filein mask nc does not exist return ENDIF ENDIF ELSE filein test get the horizontal dimensions IF n_elements filein_hgr NE 0 THEN cdfid ncdf_open filein_hgr ELSE cdfid ncdf_open filein ncdf_diminq cdfid x name jpi ncdf_diminq cdfid y name jpj for the mask we use its byte representation its y dimension will be extended to be a multiple of 8 then it will be divided by 8 if jpj mod 8 eq 0 the jpj_m jpi 8 else jpj_m jpi 8 1 jpj_m jpj 7 8 get the vertical dimensions IF n_elements filein_zgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_zgr ENDIF listdims strlowcase ncdf_listdims cdfid IF where listdims EQ z 0 NE 1 THEN ncdf_diminq cdfid z name jpk ELSE BEGIN dimid where strmid listdims 0 5 EQ depth 0 IF dimid NE 1 THEN ncdf_diminq cdfid dimid name jpk ELSE BEGIN dummy report We could not find the vertical dimension its name must be z or start with depth return ENDELSE ENDELSE get the variables list related to the partial steps varlist_ps ncdf_listvars cdfid varlist_ps strtrim strlowcase varlist_ps 2 define the output file IF n_elements ncfileout EQ 0 THEN ncfileout micromeshmask nc cdfidout ncdf_create isafile FILE ncfileout IODIR iodir NEW clobber ncdf_control cdfidout nofill dimension dimidx ncdf_dimdef cdfidout x jpi dimidy ncdf_dimdef cdfidout y jpj dimidy_m ncdf_dimdef cdfidout y_m jpj_m dimidz ncdf_dimdef cdfidout z jpk global attributs ncdf_attput cdfidout IDL_Program_Name micromeshmask pro GLOBAL ncdf_attput cdfidout Creation_Date systime GLOBAL declaration des variables varid lonarr 20 horizontal variables hgrlist glamt glamu glamv glamf gphit gphiu gphiv gphif e1t e1u e1v e1f e2t e2u e2v e2f FOR h 0 n_elements hgrlist 1 DO varid h ncdf_vardef cdfidout hgrlist h dimidx dimidy float vertical variables zgrlist e3t e3w gdept gdepw FOR z 0 n_elements zgrlist 1 DO varid 16 z ncdf_vardef cdfidout zgrlist z dimidz float variables related to the partial steps IF where varlist_ps EQ hdept 0 NE 1 THEN varid varid ncdf_vardef cdfidout hdept dimidx dimidy float IF where varlist_ps EQ hdepw 0 NE 1 THEN varid varid ncdf_vardef cdfidout hdepw dimidx dimidy float old variable name keep for compatibility with old run Change e3tp to e3t_ps IF where varlist_ps EQ e3tp 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3t_ps dimidx dimidy float old variable name keep for compatibility with old run Change e3wp to e3w_ps IF where varlist_ps EQ e3wp 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3w_ps dimidx dimidy float IF where varlist_ps EQ e3t_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3t_ps dimidx dimidy float IF where varlist_ps EQ e3w_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3w_ps dimidx dimidy float IF where varlist_ps EQ e3u_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3u_ps dimidx dimidy float IF where varlist_ps EQ e3v_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3v_ps dimidx dimidy float mask variable msklist tmask umask vmask fmask FOR m 0 n_elements msklist 1 DO BEGIN varid varid ncdf_vardef cdfidout msklist m dimidx dimidy_m dimidz byte ncdf_attput cdfidout varid n_elements varid 1 Comment the mask is stored as bit You must use the binary representation of the byte to get back the data ENDFOR ncdf_control cdfidout endef get the horizontal variables IF n_elements filein_hgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_hgr ENDIF FOR h 0 n_elements hgrlist 1 DO ncdf_transfer cdfid cdfidout hgrlist h get the vertical variables IF n_elements filein_zgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_zgr ENDIF FOR z 0 n_elements zgrlist 1 DO ncdf_transfer cdfid cdfidout zgrlist z partial step variables IF where varlist_ps EQ hdept 0 NE 1 THEN ncdf_transfer cdfid cdfidout hdept IF where varlist_ps EQ hdepw 0 NE 1 THEN ncdf_transfer cdfid cdfidout hdepw IF where varlist_ps EQ e3tp 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3tp e3t_ps IF where varlist_ps EQ e3wp 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3wp e3w_ps IF where varlist_ps EQ e3t_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3t_ps IF where varlist_ps EQ e3w_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3w_ps IF where varlist_ps EQ e3u_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3u_ps IF where varlist_ps EQ e3v_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3v_ps mask IF n_elements filein_msk NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_msk ENDIF loop on the vertical levels to limit the memory use FOR k 0 jpk 1 DO BEGIN FOR m 0 3 DO BEGIN CASE ncdf_varinq cdfid msklist m ndims OF 3:ncdf_varget cdfid msklist m zzz offset 0 0 k count jpi jpj 1 4:ncdf_varget cdfid msklist m zzz offset 0 0 k 0 count jpi jpj 1 1 ENDCASE zzz byte temporary zzz zzz must contain only 0 or 1 zzz temporary zzz MOD 2 we transpose zzz because we need to work with the y dimension as the first dimension zzz transpose temporary zzz extend jpj to be a multiple of 8 jpjadd jpj_m 8 jpj IF jpjadd NE 0 THEN zzz temporary zzz bytarr jpjadd jpi reform zzz to look like output of binary pro zzz reform zzz 8 1 jpj_m jpi over convert into its byte form zzz inverse_binary temporary zzz ncdf_varput cdfidout msklist m transpose temporary zzz offset 0 0 k count jpi jpj_m 1 ENDFOR ENDFOR ncdf_close cdfid ncdf_close cdfidout RETURN END"); 39 39 a[37] = new Array("./Grid/n128gaussian.html", "n128gaussian.pro", "", " file_comments compute the latitudes of the n128 gaussian grid See: http: www ecmwf int products data technical gaussian n128FIS html categories Grid examples IDL lat n128gaussian returns a 1d array history Sebastien Masson smasson lodyc jussieu fr June 2004 version Id: n128gaussian pro 157 2006 08 21 09:01:50Z navarro FUNCTION n128gaussian compile_opt idl2 strictarrsubs latitude reduced regular latitude number points points n128 1 18 512 89 46282 2 25 512 88 76695 3 36 512 88 06697 4 40 512 87 36606 5 45 512 86 66480 6 50 512 85 96337 7 60 512 85 26184 8 64 512 84 56026 9 72 512 83 85863 10 72 512 83 15698 11 80 512 82 45531 12 90 512 81 75363 13 90 512 81 05194 14 100 512 80 35023 15 108 512 79 64852 16 120 512 78 94681 17 120 512 78 24509 18 125 512 77 54336 19 128 512 76 84163 20 144 512 76 13990 21 144 512 75 43817 22 150 512 74 73644 23 160 512 74 03470 24 160 512 73 33296 25 180 512 72 63123 26 180 512 71 92949 27 180 512 71 22774 28 192 512 70 52600 29 192 512 69 82426 30 200 512 69 12252 31 216 512 68 42077 32 216 512 67 71903 33 216 512 67 01728 34 225 512 66 31554 35 240 512 65 61379 36 240 512 64 91204 37 240 512 64 21030 38 250 512 63 50855 39 250 512 62 80680 40 256 512 62 10505 41 270 512 61 40330 42 270 512 60 70156 43 288 512 59 99981 44 288 512 59 29806 45 288 512 58 59631 46 300 512 57 89456 47 300 512 57 19281 48 320 512 56 49106 49 320 512 55 78931 50 320 512 55 08756 51 320 512 54 38581 52 324 512 53 68406 53 360 512 52 98231 54 360 512 52 28056 55 360 512 51 57881 56 360 512 50 87705 57 360 512 50 17530 58 360 512 49 47355 59 360 512 48 77180 60 375 512 48 07005 61 375 512 47 36830 62 375 512 46 66655 63 375 512 45 96479 64 384 512 45 26304 65 384 512 44 56129 66 400 512 43 85954 67 400 512 43 15779 68 400 512 42 45604 69 400 512 41 75428 70 405 512 41 05253 71 432 512 40 35078 72 432 512 39 64903 73 432 512 38 94728 74 432 512 38 24552 75 432 512 37 54377 76 432 512 36 84202 77 432 512 36 14027 78 450 512 35 43851 79 450 512 34 73676 80 450 512 34 03501 n128 n128 81 450 512 33 33326 82 450 512 32 63150 83 480 512 31 92975 84 480 512 31 22800 85 480 512 30 52625 86 480 512 29 82449 87 480 512 29 12274 88 480 512 28 42099 89 480 512 27 71924 90 480 512 27 01748 91 480 512 26 31573 92 480 512 25 61398 93 486 512 24 91223 94 486 512 24 21047 95 486 512 23 50872 96 500 512 22 80697 97 500 512 22 10521 98 500 512 21 40346 99 500 512 20 70171 100 500 512 19 99996 101 500 512 19 29820 102 500 512 18 59645 103 512 512 17 89470 104 512 512 17 19294 105 512 512 16 49119 106 512 512 15 78944 107 512 512 15 08768 108 512 512 14 38593 109 512 512 13 68418 110 512 512 12 98243 111 512 512 12 28067 112 512 512 11 57892 113 512 512 10 87717 114 512 512 10 17541 115 512 512 9 47366 116 512 512 8 77191 117 512 512 8 07016 118 512 512 7 36840 119 512 512 6 66665 120 512 512 5 96490 121 512 512 5 26314 122 512 512 4 56139 123 512 512 3 85964 124 512 512 3 15788 125 512 512 2 45613 126 512 512 1 75438 127 512 512 1 05262 128 512 512 0 35087 n128 reform n128 4 128 over n128 reform n128 3 over n128 n128 reverse n128 return n128 end"); … … 42 42 a[40] = new Array("./Grid/n48gaussian.html", "n48gaussian.pro", "", " file_comments compute the latitudes of the n48 gaussian grid See: http: www ecmwf int products data technical gaussian n48FIS html categories Grid examples IDL lat n48gaussian returns a 1d array history Sebastien Masson smasson lodyc jussieu fr June 2004 version Id: n48gaussian pro 157 2006 08 21 09:01:50Z navarro FUNCTION n48gaussian compile_opt idl2 strictarrsubs latitude reduced regular latitude number points points n48 1 20 192 88 57216 2 25 192 86 72253 3 36 192 84 86197 4 40 192 82 99894 5 45 192 81 13497 6 50 192 79 27055 7 60 192 77 40588 8 60 192 75 54106 9 72 192 73 67613 10 75 192 71 81113 11 80 192 69 94608 12 90 192 68 08099 13 96 192 66 21587 14 100 192 64 35073 15 108 192 62 48557 16 120 192 60 62039 17 120 192 58 75520 18 120 192 56 89001 19 128 192 55 02480 20 135 192 53 15959 21 144 192 51 29437 22 144 192 49 42915 23 160 192 47 56392 24 160 192 45 69869 25 160 192 43 83345 26 160 192 41 96822 27 160 192 40 10297 28 180 192 38 23773 29 180 192 36 37249 30 180 192 34 50724 31 180 192 32 64199 32 180 192 30 77674 33 192 192 28 91149 34 192 192 27 04623 35 192 192 25 18098 36 192 192 23 31573 37 192 192 21 45047 38 192 192 19 58521 39 192 192 17 71996 40 192 192 15 85470 41 192 192 13 98944 42 192 192 12 12418 43 192 192 10 25892 44 192 192 8 39366 45 192 192 6 52840 46 192 192 4 66314 47 192 192 2 79788 48 192 192 0 93262 n48 reform n48 4 48 over n48 reform n48 3 over n48 n48 reverse n48 return n48 end"); 43 43 a[41] = new Array("./Grid/n80gaussian.html", "n80gaussian.pro", "", " file_comments compute the latitudes of the n80 gaussian grid See: http: www ecmwf int products data technical gaussian n80FIS html categories Grid examples IDL lat n80gaussian returns a 1d array history Sebastien Masson smasson lodyc jussieu fr June 2004 version Id: n80gaussian pro 157 2006 08 21 09:01:50Z navarro FUNCTION n80gaussian compile_opt idl2 strictarrsubs latitude reduced regular latitude number points points n80 1 18 320 89 14152 2 25 320 88 02943 3 36 320 86 91077 4 40 320 85 79063 5 45 320 84 66992 6 54 320 83 54895 7 60 320 82 42782 8 64 320 81 30659 9 72 320 80 18531 10 72 320 79 06398 11 80 320 77 94262 12 90 320 76 82124 13 96 320 75 69984 14 100 320 74 57843 15 108 320 73 45701 16 120 320 72 33558 17 120 320 71 21414 18 128 320 70 09269 19 135 320 68 97124 20 144 320 67 84978 21 144 320 66 72833 22 150 320 65 60686 23 160 320 64 48540 24 160 320 63 36393 25 180 320 62 24246 26 180 320 61 12099 27 180 320 59 99952 28 192 320 58 87804 29 192 320 57 75657 30 200 320 56 63509 31 200 320 55 51361 32 216 320 54 39214 33 216 320 53 27066 34 216 320 52 14917 35 225 320 51 02769 36 225 320 49 90621 37 240 320 48 78473 38 240 320 47 66325 39 240 320 46 54176 40 256 320 45 42028 41 256 320 44 29879 42 256 320 43 17731 43 256 320 42 05582 44 288 320 40 93434 45 288 320 39 81285 46 288 320 38 69137 47 288 320 37 56988 48 288 320 36 44839 49 288 320 35 32691 50 288 320 34 20542 51 288 320 33 08393 52 288 320 31 96244 53 300 320 30 84096 54 300 320 29 71947 55 300 320 28 59798 56 300 320 27 47649 57 320 320 26 35500 58 320 320 25 23351 59 320 320 24 11203 60 320 320 22 99054 61 320 320 21 86905 62 320 320 20 74756 63 320 320 19 62607 64 320 320 18 50458 65 320 320 17 38309 66 320 320 16 26160 67 320 320 15 14011 68 320 320 14 01862 69 320 320 12 89713 70 320 320 11 77564 71 320 320 10 65415 72 320 320 9 53266 73 320 320 8 41117 74 320 320 7 28968 75 320 320 6 16819 76 320 320 5 04670 77 320 320 3 92521 78 320 320 2 80372 79 320 320 1 68223 80 320 320 0 56074 n80 reform n80 4 80 over n80 reform n80 3 over n80 n80 reverse n80 return n80 end"); 44 a[42] = new Array("./Grid/ncdf_meshread.html", "ncdf_meshread.pro", "", " file_comments read NetCDF meshmask file created by OPA categories Grid examples IDL ncdf_meshread filename param filename in optional default meshmask nc type scalar string Name of the meshmask file to read If this name does not contain any and if iodirectory keyword is not specify then the common variable iodir will be use to define the mesh file path keyword GLAMBOUNDARY default those defined in the file type 2 elements vector Longitude boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 le 360 By default the common cm_4mesh variable key_shift will be automatically defined according to GLAMBOUNDARY keyword CHECKDAT Suppressed Use micromeshmask pro to create an appropriate meshmask keyword ONEARTH default 1 type scalar: 0 or 1 Force the manual definition of data localization on the earth or not 0 if the data are not on the earth 1 if the data are on earth in that case we can for example use the labels longitude latitude in plots The resulting value will be stored in the common cm_4mesh variable key_onearth ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword GETDIMENSIONS default 0 type scalar: 0 or 1 Activate this keywords if you only want to know the dimension of the domain stored in the mesh file This dimensions will be defined in jpiglo jpjglo jpkglo cm_4mesh common variables keyword PERIODIC default computed by using the first line of glamt type scalar: 0 or 1 Force the manual definition of the grid zonal periodicity The resulting value will be stored in the common cm_4mesh variable key_periodic PERIODIC 0 forces SHIFT 0 keyword SHIFT default computed according to glamboundary type scalar Force the manual definition of the zonal shift that must be apply to the data The resulting value will be stored in the common cm_4mesh variable key_shift Note that if key_periodic 0 then in any case key_shift 0 keyword STRCALLING type scalar string the calling command used to call computegrid this is used by xxx pro keyword STRIDE default 1 1 1 type 3 elements vector Specify the stride in x y and z direction The resulting value will be stored in the common cm_4mesh variable key_stride keyword _EXTRA used to pass isafile keywords uses cm_4mesh cm_4data cm_4cal restrictions ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh must be defined before calling ncdf_meshread if some of those value are equal to 1 they will be automatically defined history Sebastien Masson smasson lodyc jussieu fr 12 1999 July 2004 Sebastien Masson: Several modifications micromeshmask clean partial steps clean use of key_stride automatic definition of key_shift Oct 2004 Sebastien Masson: add PERIODIC and SHIFT Aug 2005 Sebastien Masson: some cleaning english version Id: ncdf_meshread pro 172 2006 09 11 07:11:26Z smasson PRO ncdf_meshread filename GLAMBOUNDARY glamboundary CHECKDAT checkdat ONEARTH onearth GETDIMENSIONS getdimensions PERIODIC periodic SHIFT shift STRIDE stride STRCALLING strcalling _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 for key_performance IF keyword_set CHECKDAT THEN BEGIN print The keyword CHECKDAT has been suppressed it could create bugs print Remove it from the call of ncdf_meshread print Please use smallmeshmask pro or micromeshmask pro to create a print meshmask that has manageable size return ENDIF find meshfile name and open it def of filename by default IF n_params EQ 0 then filename meshmask nc meshname isafile file filename iodirectory iodir _EXTRA ex meshname meshname 0 noticebase xnotice Reading file C meshname C if the meshmask is on tape archive get it back IF version OS_FAMILY EQ unix THEN spawn file meshname dev null cdfid ncdf_open meshname contient ncdf_inquire cdfid dimensions ncdf_diminq cdfid x name jpiglo ncdf_diminq cdfid y name jpjglo listdims strlowcase ncdf_listdims cdfid IF where listdims EQ z 0 NE 1 THEN ncdf_diminq cdfid z name jpkglo ELSE BEGIN dimid where strmid listdims 0 5 EQ depth 0 IF dimid NE 1 THEN ncdf_diminq cdfid dimid name jpkglo ELSE BEGIN dummy report We could not find the vertical dimension its name must be z or start with depth stop ENDELSE ENDELSE if keyword_set getdimensions then begin widget_control noticebase bad_id nothing destroy ncdf_close cdfid return endif check that all i xyz min ax mesh are well defined if n_elements ixminmesh EQ 0 THEN ixminmesh 0 if n_elements ixmaxmesh EQ 0 then ixmaxmesh jpiglo 1 if ixminmesh EQ 1 THEN ixminmesh 0 IF ixmaxmesh EQ 1 then ixmaxmesh jpiglo 1 if n_elements iyminmesh EQ 0 THEN iyminmesh 0 IF n_elements iymaxmesh EQ 0 then iymaxmesh jpjglo 1 if iyminmesh EQ 1 THEN iyminmesh 0 IF iymaxmesh EQ 1 then iymaxmesh jpjglo 1 if n_elements izminmesh EQ 0 THEN izminmesh 0 IF n_elements izmaxmesh EQ 0 then izmaxmesh jpkglo 1 if izminmesh EQ 1 THEN izminmesh 0 IF izmaxmesh EQ 1 then izmaxmesh jpkglo 1 definition of jpi jpj jpj jpi long ixmaxmesh ixminmesh 1 jpj long iymaxmesh iyminmesh 1 jpk long izmaxmesh izminmesh 1 check onearth and its consequences IF n_elements onearth EQ 0 THEN key_onearth 1 ELSE key_onearth keyword_set onearth IF NOT key_onearth THEN BEGIN periodic 0 shift 0 ENDIF automatic definition of key_periodic IF n_elements periodic EQ 0 THEN BEGIN IF jpi GT 1 THEN BEGIN varinq ncdf_varinq cdfid glamt CASE varinq ndims OF 2:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh count jpi 1 3:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 count jpi 1 1 4:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 0 count jpi 1 1 1 ENDCASE xaxis xaxis 720 MOD 360 xaxis xaxis sort xaxis key_periodic xaxis jpi 1 2 xaxis jpi 1 xaxis jpi 2 GE xaxis 0 360 ENDIF ELSE key_periodic 0 ENDIF ELSE key_periodic keyword_set periodic automatic definition of key_shift IF n_elements shift EQ 0 THEN BEGIN key_shift long testvar var key_shift key_shift will be defined according to the first line of glamt if keyword_set glamboundary AND jpi GT 1 AND key_periodic EQ 1 THEN BEGIN varinq ncdf_varinq cdfid glamt CASE varinq ndims OF 2:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh count jpi 1 3:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 count jpi 1 1 4:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 0 count jpi 1 1 1 ENDCASE xaxis between glamboundary 0 and glamboundary 1 xaxis xaxis MOD 360 smaller where xaxis LT glamboundary 0 if smaller 0 NE 1 then xaxis smaller xaxis smaller 360 bigger where xaxis GE glamboundary 1 if bigger 0 NE 1 then xaxis bigger xaxis bigger 360 key_shift where xaxis EQ min xaxis 0 IF key_shift NE 0 THEN BEGIN key_shift jpi key_shift xaxis shift xaxis key_shift ENDIF IF array_equal sort xaxis lindgen jpi NE 1 THEN BEGIN print the x axis 1st line of glamt is not sorted in the inceasing order after the automatic definition of key_shift print please use the keyword shift and periodic to suppress the automatic definition of key_shift and key_periodic and define by hand a more suitable value widget_control noticebase bad_id nothing destroy return ENDIF ENDIF ELSE key_shift 0 ENDIF ELSE key_shift long shift key_periodic EQ 1 check key_stride and related things if n_elements stride eq 3 then key_stride stride if n_elements key_stride LE 2 then key_stride 1 1 1 key_stride 1l long key_stride IF total key_stride NE 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 ENDIF default definitions to be able to use read_ncdf_varget default definitions to be able to use read_ncdf_varget ixmindtasauve testvar var ixmindta iymindtasauve testvar var iymindta izmindtasauve testvar var izmindta ixmindta 0l iymindta 0l izmindta 0l jpt 1 time 1 firsttps 0 firstx 0 lastx jpi 1 firsty 0 lasty jpj 1 firstz 0 lastz jpk 1 nx jpi ny jpj nz 1 izminmeshsauve izminmesh izminmesh 0 2d arrays: list the 2d variables that must be read namevar glamt glamu glamv glamf gphit gphiu gphiv gphif e1t e1u e1v e1f e2t e2u e2v e2f for the variables related to the partial steps allvarname ncdf_listvars cdfid IF where allvarname EQ hdept 0 NE 1 THEN BEGIN key_partialstep 1 namevar namevar hdept hdepw ENDIF ELSE BEGIN key_partialstep 0 hdept 1 hdepw 1 ENDELSE for compatibility with old versions of meshmask partial steps IF where allvarname EQ e3tp 0 NE 1 THEN namevar namevar e3tp e3wp ELSE BEGIN e3t_ps 1 e3w_ps 1 ENDELSE IF where allvarname EQ e3t_ps 0 NE 1 THEN namevar namevar e3t_ps e3w_ps ELSE BEGIN e3t_ps 1 e3w_ps 1 ENDELSE IF where allvarname EQ e3u_ps 0 NE 1 THEN namevar namevar e3u_ps e3v_ps ELSE BEGIN e3u_ps 1 e3v_ps 1 ENDELSE read all the 2d variables for i 0 n_elements namevar 1 do begin varcontient ncdf_varinq cdfid namevar i name varcontient name read_ncdf_varget command namevar i float temporary res nothing execute command ENDFOR for compatibility with old versions of meshmask partial steps change e3 tw p to e3 tw _ps IF n_elements e3tp NE 0 THEN e3t_ps temporary e3tp IF n_elements e3wp NE 0 THEN e3w_ps temporary e3wp in the case of key_stride ne 1 1 1 redefine f points coordinates: they must be in the middle of 3 T points if key_stride 0 NE 1 OR key_stride 1 NE 1 then BEGIN we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 ENDIF 3d arrays: nz jpk izminmesh izminmeshsauve listdims ncdf_listdims cdfid micromask where listdims EQ y_m 0 varcontient ncdf_varinq cdfid tmask name varcontient name IF micromask NE 1 THEN BEGIN keep original values iyminmeshtrue iyminmesh key_stridetrue key_stride yyy1 firsty key_stridetrue 1 iyminmeshtrue yyy2 lasty key_stridetrue 1 iyminmeshtrue the mask is stored as the bit values of the byte array along the y dimension see micromeshmask pro we must modify several parameters iyminmesh 0L firsty yyy1 8 lasty yyy2 8 ny lasty firsty 1 key_stride key_stride 0 1 key_stride 2 read_ncdf_varget tmask bytarr jpi jpj jpk now we must get back the mask loop on the level to save memory the loop is short and thus should be fast enough FOR k 0 jpk 1 DO BEGIN zzz transpose res k zzz reform binary zzz 8 ny nx over zzz transpose temporary zzz zzz zzz yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN BEGIN IF float strmid version release 0 3 LT 5 6 THEN BEGIN nnny size zzz 2 yind key_stridetrue 1 lindgen nnny 1 key_stridetrue 1 1 tmask k temporary zzz yind ENDIF ELSE tmask k temporary zzz 0: :key_stridetrue 1 ENDIF ELSE tmask k temporary zzz ENDFOR ENDIF ELSE BEGIN read_ncdf_varget tmask byte res ENDELSE boudary conditions used to compute umask varcontient ncdf_varinq cdfid umask name varcontient name nx 1L firstx jpi 1 lastx jpi 1 IF micromask NE 1 THEN BEGIN read_ncdf_varget umaskred reform binary res 8 ny jpk over umaskred umaskred yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN umaskred temporary umaskred yind ENDIF ELSE BEGIN read_ncdf_varget umaskred reform byte res over ENDELSE boudary conditions used to compute fmask 1 varcontient ncdf_varinq cdfid fmask name varcontient name IF micromask NE 1 THEN BEGIN read_ncdf_varget fmaskredy reform binary res 8 ny jpk over fmaskredy fmaskredy yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN fmaskredy temporary fmaskredy yind ENDIF ELSE BEGIN read_ncdf_varget fmaskredy reform byte res over fmaskredy temporary fmaskredy MOD 2 ENDELSE boudary conditions used to compute vmask varcontient ncdf_varinq cdfid vmask name varcontient name nx jpi firstx 0L lastx jpi 1L ny 1L firsty jpj 1 lasty jpj 1 IF micromask NE 1 THEN BEGIN yyy1 firsty key_stridetrue 1 iyminmeshtrue yyy2 lasty key_stridetrue 1 iyminmeshtrue iyminmesh 0L firsty yyy1 8 lasty yyy2 8 ny lasty firsty 1 read_ncdf_varget IF jpk EQ 1 THEN res reform res jpi 1 jpk over vmaskred transpose temporary res 1 0 2 vmaskred reform binary vmaskred 8 ny nx nz over vmaskred transpose temporary vmaskred 1 0 2 vmaskred reform vmaskred yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 ENDIF ELSE BEGIN read_ncdf_varget vmaskred reform byte res over ENDELSE boudary conditions used to compute fmask 2 varcontient ncdf_varinq cdfid fmask name varcontient name IF micromask NE 1 THEN BEGIN read_ncdf_varget IF jpk EQ 1 THEN res reform res jpi 1 jpk over fmaskredx transpose temporary res 1 0 2 fmaskredx reform binary fmaskredx 8 ny nx nz over fmaskredx transpose temporary fmaskredx 1 0 2 fmaskredx reform fmaskredx yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 iyminmesh iyminmeshtrue key_stride key_stridetrue ENDIF ELSE BEGIN read_ncdf_varget fmaskredx reform byte res over fmaskredx fmaskredx MOD 2 ENDELSE 1d arrays namevar e3t e3w gdept gdepw for i 0 n_elements namevar 1 do begin varcontient ncdf_varinq cdfid namevar i CASE n_elements varcontient dim OF 4:BEGIN command ncdf_varget cdfid namevar i namevar i offset 0 0 izminmesh 0 count 1 1 jpk 1 if key_stride 2 NE 1 then command command stride 1 1 key_stride 2 1 END 2:BEGIN command ncdf_varget cdfid namevar i namevar i offset izminmesh 0 count jpk 1 if key_stride 2 NE 1 then command command stride key_stride 2 END 1:BEGIN command ncdf_varget cdfid namevar i namevar i offset izminmesh count jpk if key_stride 2 NE 1 then command command stride key_stride 2 END ENDCASE nothing execute command command namevar i float namevar i nothing execute command command if size namevar i n_dimension gt 0 then namevar i reform namevar i over nothing execute command ENDFOR ncdf_close cdfid Apply Glamboudary if keyword_set glamboundary AND key_onearth then BEGIN if glamboundary 0 NE glamboundary 1 then BEGIN glamt temporary glamt MOD 360 smaller where glamt LT glamboundary 0 if smaller 0 NE 1 then glamt smaller glamt smaller 360 bigger where glamt GE glamboundary 1 if bigger 0 NE 1 then glamt bigger glamt bigger 360 glamu temporary glamu MOD 360 smaller where glamu LT glamboundary 0 if smaller 0 NE 1 then glamu smaller glamu smaller 360 bigger where glamu GE glamboundary 1 if bigger 0 NE 1 then glamu bigger glamu bigger 360 glamv temporary glamv MOD 360 smaller where glamv LT glamboundary 0 if smaller 0 NE 1 then glamv smaller glamv smaller 360 bigger where glamv GE glamboundary 1 if bigger 0 NE 1 then glamv bigger glamv bigger 360 glamf temporary glamf MOD 360 smaller where glamf LT glamboundary 0 if smaller 0 NE 1 then glamf smaller glamf smaller 360 bigger where glamf GE glamboundary 1 if bigger 0 NE 1 then glamf bigger glamf bigger 360 toosmall where glamu EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamu toosmall glamu toosmall 360 toosmall where glamf EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamf toosmall glamf toosmall 360 endif endif make sure we do have 2d arrays when jpj eq 1 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over IF keyword_set key_partialstep THEN BEGIN hdept reform hdept jpi jpj over hdepw reform hdepw jpi jpj over e3t_ps reform e3t_ps jpi jpj over e3w_ps reform e3w_ps jpi jpj over ENDIF ENDIF ixmindta ixmindtasauve iymindta iymindtasauve izmindta izmindtasauve widget_control noticebase bad_id nothing destroy key_yreverse 0 key_zreverse 0key_gridtype c grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling ncdf_meshread ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE romszinfos h: 1 zeta: 1 theta_s: 1 theta_b: 1 hc: 1 ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth if keyword_set key_performance THEN print time ncdf_meshread systime 1 tempsun updateold return end");45 a[43] = new Array("./Grid/ncdf_meshroms.html", "ncdf_meshroms.pro", "", " file_comments read NetCDF grid file created by ROMS categories Grid examples IDL ncdf_meshroms filename param filename in optional default roms_grd nc type scalar string Name of the meshmask file to read If this name does not contain any and if iodirectory keyword is not specify then the common variable iodir will be use to define the mesh file path keyword GLAMBOUNDARY default those defined in the file type 2 elements vector Longitude boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 le 360 By default the common cm_4mesh variable key_shift will be automatically defined according to GLAMBOUNDARY keyword ONEARTH default 1 type scalar: 0 or 1 Force the manual definition of data localization on the earth or not 0 if the data are not on the earth 1 if the data are on earth in that case we can for example use the labels longitude latitude in plots The resulting value will be stored in the common cm_4mesh variable key_onearth ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword GETDIMENSIONS default 0 type scalar: 0 or 1 Activate this keywords if you only want to know the dimension of the domain stored in the mesh file This dimensions will be defined in jpiglo jpjglo jpkglo cm_4mesh common variables keyword PERIODIC default computed by using the first line of glamt type scalar: 0 or 1 Force the manual definition of the grid zonal periodicity The resulting value will be stored in the common cm_4mesh variable key_periodic PERIODIC 0 forces SHIFT 0 keyword NRHO default 1 type scalar Specify the number of rho level that contain the data we want to explore This is mainly useful when using xxx to get access to the depper levers and vertical sections keyword SHIFT default computed according to glamboundary type scalar Force the manual definition of the zonal shift that must be apply to the data The resulting value will be stored in the common cm_4mesh variable key_shift Note that if key_periodic 0 then in any case key_shift 0 keyword STRCALLING type scalar string the calling command used to call computegrid this is used by xxx pro keyword STRIDE default 1 1 1 type 3 elements vector Specify the stride in x y and z direction The resulting value will be stored in the common cm_4mesh variable key_stride keyword _EXTRA used to pass isafile keywords uses cm_4mesh cm_4data cm_4cal restrictions ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh must be defined before calling ncdf_meshread if some of those value are equal to 1 they will be automatically defined In the original ROMS grid if F grid has jpi jpj points then T grid will have jpi 1 jpj 1 points U grid will have jpi jpj 1 points and V grid will have jpi 1 jpj points By default C grid used in this package needs the same number of points for T U V and F grid with a T point at the bottom left corner of the grid We therefore ignore the last column of T and V points and the last line of T and U points Scale factors are compuited using the distance between the points which is not the exact definition for irregulare grid history Sebastien Masson smasson lodyc jussieu fr September 2006 version Id: ncdf_meshroms pro 173 2006 09 11 07:53:02Z smasson PRO ncdf_meshroms filename NRHO nrho GLAMBOUNDARY glamboundary ONEARTH onearth GETDIMENSIONS getdimensions PERIODIC periodic SHIFT shift STRIDE stride STRCALLING strcalling _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 for key_performance find meshfile name and open it def of filename by default IF n_params EQ 0 then filename roms_grd nc meshname isafile file filename iodirectory iodir _EXTRA ex meshname meshname 0 noticebase xnotice Reading file C meshname C if the meshmask is on tape archive get it back IF version OS_FAMILY EQ unix THEN spawn file meshname dev null cdfid ncdf_open meshname contient ncdf_inquire cdfid dimensions ncdf_diminq cdfid xi_rho name jpiglo ncdf_diminq cdfid eta_rho name jpjglo IF n_elements nrho NE 0 THEN jpkglo long nrho 0 ELSE jpkglo 1L if keyword_set getdimensions then begin widget_control noticebase bad_id nothing destroy ncdf_close cdfid return endif check that all i xyz min ax mesh are well defined if n_elements ixminmesh EQ 0 THEN ixminmesh 0 if n_elements ixmaxmesh EQ 0 then ixmaxmesh jpiglo 1 if ixminmesh EQ 1 THEN ixminmesh 0 IF ixmaxmesh EQ 1 then ixmaxmesh jpiglo 1 if n_elements iyminmesh EQ 0 THEN iyminmesh 0 IF n_elements iymaxmesh EQ 0 then iymaxmesh jpjglo 1 if iyminmesh EQ 1 THEN iyminmesh 0 IF iymaxmesh EQ 1 then iymaxmesh jpjglo 1 if n_elements izminmesh EQ 0 THEN izminmesh 0 IF n_elements izmaxmesh EQ 0 then izmaxmesh jpkglo 1 if izminmesh EQ 1 THEN izminmesh 0 IF izmaxmesh EQ 1 then izmaxmesh jpkglo 1 definition of jpi jpj jpj jpi long ixmaxmesh ixminmesh 1 jpj long iymaxmesh iyminmesh 1 jpk long izmaxmesh izminmesh 1 check onearth and its consequences IF n_elements onearth EQ 0 THEN key_onearth 1 ELSE key_onearth keyword_set onearth IF NOT key_onearth THEN BEGIN periodic 0 shift 0 ENDIF automatic definition of key_periodic IF n_elements periodic EQ 0 THEN BEGIN IF jpi GT 1 THEN BEGIN ncdf_varget cdfid lon_rho xaxis offset ixminmesh iyminmesh count jpi 1 xaxis xaxis 720 MOD 360 xaxis xaxis sort xaxis key_periodic xaxis jpi 1 2 xaxis jpi 1 xaxis jpi 2 GE xaxis 0 360 ENDIF ELSE key_periodic 0 ENDIF ELSE key_periodic keyword_set periodic automatic definition of key_shift IF n_elements shift EQ 0 THEN BEGIN key_shift long testvar var key_shift key_shift will be defined according to the first line of glamt if keyword_set glamboundary AND jpi GT 1 AND key_periodic EQ 1 THEN BEGIN ncdf_varget cdfid lon_rho xaxis offset ixminmesh iyminmesh count jpi 1 xaxis between glamboundary 0 and glamboundary 1 xaxis xaxis MOD 360 smaller where xaxis LT glamboundary 0 if smaller 0 NE 1 then xaxis smaller xaxis smaller 360 bigger where xaxis GE glamboundary 1 if bigger 0 NE 1 then xaxis bigger xaxis bigger 360 key_shift where xaxis EQ min xaxis 0 IF key_shift NE 0 THEN BEGIN key_shift jpi key_shift xaxis shift xaxis key_shift ENDIF IF array_equal sort xaxis lindgen jpi NE 1 THEN BEGIN print the x axis 1st line of glamt is not sorted in the inceasing order after the automatic definition of key_shift print please use the keyword shift and periodic to suppress the automatic definition of key_shift and key_periodic and define by hand a more suitable value widget_control noticebase bad_id nothing destroy return ENDIF ENDIF ELSE key_shift 0 ENDIF ELSE key_shift long shift key_periodic EQ 1 check key_stride and related things if n_elements stride eq 3 then key_stride stride if n_elements key_stride LE 2 then key_stride 1 1 1 key_stride 1l long key_stride IF total key_stride NE 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 ENDIF for the variables related to the partial steps key_partialstep 0 hdept 1 hdepw 1 default definitions to be able to use read_ncdf_varget default definitions to be able to use read_ncdf_varget ixmindtasauve testvar var ixmindta iymindtasauve testvar var iymindta izmindtasauve testvar var izmindta ixmindta 0l iymindta 0l izmindta 0l jpt 1 time 1 firsttps 0 firstx 0 lastx jpi 1 firsty 0 lasty jpj 1 firstz 0 lastz jpk 1 nx jpi ny jpj nz 1 izminmeshsauve izminmesh izminmesh 0 2d arrays: list the 2d variables that must be read namebase lon_ lat_ mask_ x_ y_ namebase2 glam gphi mask d1 d2 read all grid T variables for i 0 n_elements namebase 1 do begin varcontient ncdf_varinq cdfid namebase i rho name varcontient name read_ncdf_varget command namebase2 i t float temporary res nothing execute command ENDFOR d1t 1 e3 shift d1t 1 0 d1t d2t 1 e3 shift d2t 0 1 d2t for i 0 n_elements namebase2 1 do begin command namebase2 i t namebase2 i t 0:jpi 2 0:jpj 2 nothing execute command ENDFOR tmask byte temporary maskt IF jpk GT 1 THEN tmask reform tmask replicate 1b jpk jpi 1 jpj 1 jpk overwrite e1u temporary d1t e2v temporary d2t h: Final bathymetry at RHO points varcontient ncdf_varinq cdfid h name varcontient name read_ncdf_varget hroms float temporary res hroms hroms 0:jpi 2 0:jpj 2 read all grid U variables jpiglo jpiglo 1 jpi jpi 1 ixmaxmesh ixmaxmesh 1 firstx 0 lastx jpi 1 nx jpi for i 0 n_elements namebase 1 do begin varcontient ncdf_varinq cdfid namebase i u name varcontient name read_ncdf_varget command namebase2 i u float temporary res nothing execute command ENDFOR tmpsave 2 1 e3 d1u 0 0:jpj 2 d1u 1 e3 shift d1u 1 0 d1u d2u 1 e3 shift d2u 0 1 d2u for i 0 n_elements namebase2 1 do begin command namebase2 i u namebase2 i u 0:jpj 2 nothing execute command ENDFOR umaskred byte temporary masku jpi 1 IF jpk GT 1 THEN umaskred reform umaskred replicate 1b jpk 1 jpj 1 jpk overwrite e1t temporary d1u e1t shift temporary e1t 1 0 e1t 0 temporary tmpsave e2f temporary d2u read all grid V variables jpiglo jpiglo 1 jpi jpi 1 ixmaxmesh ixmaxmesh 1 firstx 0 lastx jpi 1 nx jpi jpjglo jpjglo 1 jpj jpj 1 iymaxmesh iymaxmesh 1 firsty 0 lasty jpj 1 ny jpj for i 0 n_elements namebase 1 do begin varcontient ncdf_varinq cdfid namebase i v name varcontient name read_ncdf_varget command namebase2 i v float temporary res nothing execute command ENDFOR d1v 1 e3 shift d1v 1 0 d1v tmpsave 2 1 e3 d2v 0:jpi 2 0 d2v 1 e3 shift d2v 0 1 d2v for i 0 n_elements namebase2 1 do begin command namebase2 i v namebase2 i v 0:jpi 2 nothing execute command ENDFOR vmaskred byte temporary maskv jpj 1 IF jpk GT 1 THEN vmaskred reform vmaskred replicate 1b jpk jpi 1 1 jpk overwrite e1f temporary d1v e2t temporary d2v e2t shift temporary e2t 0 1 e2t 0 temporary tmpsave read all grid F variables jpiglo jpiglo 1 jpi jpi 1 ixmaxmesh ixmaxmesh 1 firstx 0 lastx jpi 1 nx jpi for i 0 n_elements namebase 1 do begin varcontient ncdf_varinq cdfid namebase i psi name varcontient name read_ncdf_varget command namebase2 i f float temporary res nothing execute command ENDFOR tmpsave1 2 1 e3 d1f 0 d1f 1 e3 shift d1f 1 0 d1f tmpsave2 2 1 e3 d2f 0 d2f 1 e3 shift d2f 0 1 d2f fmaskredy byte maskf jpi 1 IF jpk GT 1 THEN fmaskredy reform fmaskredy replicate 1b jpk 1 jpj jpk overwrite fmaskredx byte temporary maskf jpj 1 IF jpk GT 1 THEN fmaskredx reform fmaskredx replicate 1b jpk jpi 1 jpk overwrite e1v temporary d1f e1v shift temporary e1v 1 0 e1v 0 temporary tmpsave1 e2u temporary d2f e2u shift temporary e2u 0 1 e2u 0 temporary tmpsave2 in the case of key_stride ne 1 1 1 redefine f points coordinates: they must be in the middle of 3 T points if key_stride 0 NE 1 OR key_stride 1 NE 1 then BEGIN we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 ENDIF 1d arrays gdept findgen jpk gdepw findgen jpk e3t replicate 1 jpk e3w replicate 1 jpk ncdf_close cdfid Apply Glamboudary if keyword_set glamboundary AND key_onearth then BEGIN if glamboundary 0 NE glamboundary 1 then BEGIN glamt temporary glamt MOD 360 smaller where glamt LT glamboundary 0 if smaller 0 NE 1 then glamt smaller glamt smaller 360 bigger where glamt GE glamboundary 1 if bigger 0 NE 1 then glamt bigger glamt bigger 360 glamu temporary glamu MOD 360 smaller where glamu LT glamboundary 0 if smaller 0 NE 1 then glamu smaller glamu smaller 360 bigger where glamu GE glamboundary 1 if bigger 0 NE 1 then glamu bigger glamu bigger 360 glamv temporary glamv MOD 360 smaller where glamv LT glamboundary 0 if smaller 0 NE 1 then glamv smaller glamv smaller 360 bigger where glamv GE glamboundary 1 if bigger 0 NE 1 then glamv bigger glamv bigger 360 glamf temporary glamf MOD 360 smaller where glamf LT glamboundary 0 if smaller 0 NE 1 then glamf smaller glamf smaller 360 bigger where glamf GE glamboundary 1 if bigger 0 NE 1 then glamf bigger glamf bigger 360 toosmall where glamu EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamu toosmall glamu toosmall 360 toosmall where glamf EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamf toosmall glamf toosmall 360 endif endif make sure we do have 2d arrays when jpj eq 1 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over ENDIF ixmindta ixmindtasauve iymindta iymindtasauve izmindta izmindtasauve widget_control noticebase bad_id nothing destroy key_yreverse 0 key_zreverse 1key_gridtype c grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling ncdf_meshroms ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE romszinfos h:hroms zeta:replicate 0 jpi jpj theta_s: 1 theta_b: 1 hc: 1 ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth if keyword_set key_performance THEN print time ncdf_meshread systime 1 tempsun updateold return end");44 a[42] = new Array("./Grid/ncdf_meshread.html", "ncdf_meshread.pro", "", " file_comments read NetCDF meshmask file created by OPA categories Grid examples IDL ncdf_meshread filename param filename in optional default meshmask nc type scalar string Name of the meshmask file to read If this name does not contain any and if iodirectory keyword is not specify then the common variable iodir will be use to define the mesh file path keyword GLAMBOUNDARY default those defined in the file type 2 elements vector Longitude boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 le 360 By default the common cm_4mesh variable key_shift will be automatically defined according to GLAMBOUNDARY keyword CHECKDAT Suppressed Use micromeshmask pro to create an appropriate meshmask keyword ONEARTH default 1 type scalar: 0 or 1 Force the manual definition of data localization on the earth or not 0 if the data are not on the earth 1 if the data are on earth in that case we can for example use the labels longitude latitude in plots The resulting value will be stored in the common cm_4mesh variable key_onearth ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword GETDIMENSIONS default 0 type scalar: 0 or 1 Activate this keywords if you only want to know the dimension of the domain stored in the mesh file This dimensions will be defined in jpiglo jpjglo jpkglo cm_4mesh common variables keyword PERIODIC default computed by using the first line of glamt type scalar: 0 or 1 Force the manual definition of the grid zonal periodicity The resulting value will be stored in the common cm_4mesh variable key_periodic PERIODIC 0 forces SHIFT 0 keyword SHIFT default computed according to glamboundary type scalar Force the manual definition of the zonal shift that must be apply to the data The resulting value will be stored in the common cm_4mesh variable key_shift Note that if key_periodic 0 then in any case key_shift 0 keyword STRCALLING type scalar string the calling command used to call computegrid this is used by xxx pro keyword STRIDE default 1 1 1 type 3 elements vector Specify the stride in x y and z direction The resulting value will be stored in the common cm_4mesh variable key_stride keyword _EXTRA used to pass isafile keywords uses cm_4mesh cm_4data cm_4cal restrictions ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh must be defined before calling ncdf_meshread if some of those value are equal to 1 they will be automatically defined history Sebastien Masson smasson lodyc jussieu fr 12 1999 July 2004 Sebastien Masson: Several modifications micromeshmask clean partial steps clean use of key_stride automatic definition of key_shift Oct 2004 Sebastien Masson: add PERIODIC and SHIFT Aug 2005 Sebastien Masson: some cleaning english version Id: ncdf_meshread pro 212 2007 02 14 10:47:10Z smasson PRO ncdf_meshread filename GLAMBOUNDARY glamboundary CHECKDAT checkdat ONEARTH onearth GETDIMENSIONS getdimensions PERIODIC periodic SHIFT shift STRIDE stride STRCALLING strcalling _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 for key_performance IF keyword_set CHECKDAT THEN BEGIN print The keyword CHECKDAT has been suppressed it could create bugs print Remove it from the call of ncdf_meshread print Please use smallmeshmask pro or micromeshmask pro to create a print meshmask that has manageable size return ENDIF find meshfile name and open it def of filename by default IF n_params EQ 0 then filename meshmask nc meshname isafile file filename iodirectory iodir _EXTRA ex meshname meshname 0 noticebase xnotice Reading file C meshname C if the meshmask is on tape archive get it back IF version OS_FAMILY EQ unix THEN spawn file meshname dev null cdfid ncdf_open meshname contient ncdf_inquire cdfid dimensions ncdf_diminq cdfid x name jpiglo ncdf_diminq cdfid y name jpjglo listdims strlowcase ncdf_listdims cdfid IF where listdims EQ z 0 NE 1 THEN ncdf_diminq cdfid z name jpkglo ELSE BEGIN dimid where strmid listdims 0 5 EQ depth 0 IF dimid NE 1 THEN ncdf_diminq cdfid dimid name jpkglo ELSE BEGIN dummy report We could not find the vertical dimension its name must be z or start with depth stop ENDELSE ENDELSE if keyword_set getdimensions then begin widget_control noticebase bad_id nothing destroy ncdf_close cdfid return endif check that all i xyz min ax mesh are well defined if n_elements ixminmesh EQ 0 THEN ixminmesh 0 if n_elements ixmaxmesh EQ 0 then ixmaxmesh jpiglo 1 if ixminmesh EQ 1 THEN ixminmesh 0 IF ixmaxmesh EQ 1 then ixmaxmesh jpiglo 1 if n_elements iyminmesh EQ 0 THEN iyminmesh 0 IF n_elements iymaxmesh EQ 0 then iymaxmesh jpjglo 1 if iyminmesh EQ 1 THEN iyminmesh 0 IF iymaxmesh EQ 1 then iymaxmesh jpjglo 1 if n_elements izminmesh EQ 0 THEN izminmesh 0 IF n_elements izmaxmesh EQ 0 then izmaxmesh jpkglo 1 if izminmesh EQ 1 THEN izminmesh 0 IF izmaxmesh EQ 1 then izmaxmesh jpkglo 1 definition of jpi jpj jpj jpi long ixmaxmesh ixminmesh 1 jpj long iymaxmesh iyminmesh 1 jpk long izmaxmesh izminmesh 1 check onearth and its consequences IF n_elements onearth EQ 0 THEN key_onearth 1 ELSE key_onearth keyword_set onearth IF NOT key_onearth THEN BEGIN periodic 0 shift 0 ENDIF automatic definition of key_periodic IF n_elements periodic EQ 0 THEN BEGIN IF jpi GT 1 THEN BEGIN varinq ncdf_varinq cdfid glamt CASE varinq ndims OF 2:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh count jpi 1 3:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 count jpi 1 1 4:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 0 count jpi 1 1 1 ENDCASE xaxis xaxis 720 MOD 360 xaxis xaxis sort xaxis key_periodic xaxis jpi 1 2 xaxis jpi 1 xaxis jpi 2 GE xaxis 0 360 ENDIF ELSE key_periodic 0 ENDIF ELSE key_periodic keyword_set periodic automatic definition of key_shift IF n_elements shift EQ 0 THEN BEGIN key_shift long testvar var key_shift key_shift will be defined according to the first line of glamt if keyword_set glamboundary AND jpi GT 1 AND key_periodic EQ 1 THEN BEGIN varinq ncdf_varinq cdfid glamt CASE varinq ndims OF 2:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh count jpi 1 3:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 count jpi 1 1 4:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 0 count jpi 1 1 1 ENDCASE xaxis between glamboundary 0 and glamboundary 1 xaxis xaxis MOD 360 smaller where xaxis LT glamboundary 0 if smaller 0 NE 1 then xaxis smaller xaxis smaller 360 bigger where xaxis GE glamboundary 1 if bigger 0 NE 1 then xaxis bigger xaxis bigger 360 key_shift where xaxis EQ min xaxis 0 IF key_shift NE 0 THEN BEGIN key_shift jpi key_shift xaxis shift xaxis key_shift ENDIF IF array_equal sort xaxis lindgen jpi NE 1 THEN BEGIN print the x axis 1st line of glamt is not sorted in the inceasing order after the automatic definition of key_shift print please use the keyword shift and periodic to suppress the automatic definition of key_shift and key_periodic and define by hand a more suitable value widget_control noticebase bad_id nothing destroy return ENDIF ENDIF ELSE key_shift 0 ENDIF ELSE key_shift long shift key_periodic EQ 1 check key_stride and related things if n_elements stride eq 3 then key_stride stride if n_elements key_stride LE 2 then key_stride 1 1 1 key_stride 1l long key_stride IF total key_stride NE 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 ENDIF default definitions to be able to use read_ncdf_varget default definitions to be able to use read_ncdf_varget ixmindtasauve testvar var ixmindta iymindtasauve testvar var iymindta izmindtasauve testvar var izmindta ixmindta 0l iymindta 0l izmindta 0l jpt 1 time 1 firsttps 0 firstx 0 lastx jpi 1 firsty 0 lasty jpj 1 firstz 0 lastz jpk 1 nx jpi ny jpj nz 1 izminmeshsauve izminmesh izminmesh 0 key_yreverse 0 key_zreverse 0 2d arrays: list the 2d variables that must be read namevar glamt glamu glamv glamf gphit gphiu gphiv gphif e1t e1u e1v e1f e2t e2u e2v e2f for the variables related to the partial steps allvarname ncdf_listvars cdfid IF where allvarname EQ hdept 0 NE 1 THEN BEGIN key_partialstep 1 namevar namevar hdept hdepw ENDIF ELSE BEGIN key_partialstep 0 hdept 1 hdepw 1 ENDELSE for compatibility with old versions of meshmask partial steps IF where allvarname EQ e3tp 0 NE 1 THEN namevar namevar e3tp e3wp ELSE BEGIN e3t_ps 1 e3w_ps 1 ENDELSE IF where allvarname EQ e3t_ps 0 NE 1 THEN namevar namevar e3t_ps e3w_ps ELSE BEGIN e3t_ps 1 e3w_ps 1 ENDELSE IF where allvarname EQ e3u_ps 0 NE 1 THEN namevar namevar e3u_ps e3v_ps ELSE BEGIN e3u_ps 1 e3v_ps 1 ENDELSE read all the 2d variables for i 0 n_elements namevar 1 do begin varcontient ncdf_varinq cdfid namevar i name varcontient name read_ncdf_varget command namevar i float temporary res nothing execute command ENDFOR for compatibility with old versions of meshmask partial steps change e3 tw p to e3 tw _ps IF n_elements e3tp NE 0 THEN e3t_ps temporary e3tp IF n_elements e3wp NE 0 THEN e3w_ps temporary e3wp in the case of key_stride ne 1 1 1 redefine f points coordinates: they must be in the middle of 3 T points if key_stride 0 NE 1 OR key_stride 1 NE 1 then BEGIN we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 ENDIF 3d arrays: nz jpk izminmesh izminmeshsauve listdims ncdf_listdims cdfid micromask where listdims EQ y_m 0 varcontient ncdf_varinq cdfid tmask name varcontient name IF micromask NE 1 THEN BEGIN keep original values iyminmeshtrue iyminmesh key_stridetrue key_stride yyy1 firsty key_stridetrue 1 iyminmeshtrue yyy2 lasty key_stridetrue 1 iyminmeshtrue the mask is stored as the bit values of the byte array along the y dimension see micromeshmask pro we must modify several parameters iyminmesh 0L firsty yyy1 8 lasty yyy2 8 ny lasty firsty 1 key_stride key_stride 0 1 key_stride 2 read_ncdf_varget tmask bytarr jpi jpj jpk now we must get back the mask loop on the level to save memory the loop is short and thus should be fast enough FOR k 0 jpk 1 DO BEGIN zzz transpose res k zzz reform binary zzz 8 ny nx over zzz transpose temporary zzz zzz zzz yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN BEGIN IF float strmid version release 0 3 LT 5 6 THEN BEGIN nnny size zzz 2 yind key_stridetrue 1 lindgen nnny 1 key_stridetrue 1 1 tmask k temporary zzz yind ENDIF ELSE tmask k temporary zzz 0: :key_stridetrue 1 ENDIF ELSE tmask k temporary zzz ENDFOR ENDIF ELSE BEGIN read_ncdf_varget tmask byte res ENDELSE boudary conditions used to compute umask varcontient ncdf_varinq cdfid umask name varcontient name nx 1L firstx jpi 1 lastx jpi 1 IF micromask NE 1 THEN BEGIN read_ncdf_varget umaskred reform binary res 8 ny jpk over umaskred umaskred yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN umaskred temporary umaskred yind ENDIF ELSE BEGIN read_ncdf_varget umaskred reform byte res over ENDELSE boudary conditions used to compute fmask 1 varcontient ncdf_varinq cdfid fmask name varcontient name IF micromask NE 1 THEN BEGIN read_ncdf_varget fmaskredy reform binary res 8 ny jpk over fmaskredy fmaskredy yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN fmaskredy temporary fmaskredy yind ENDIF ELSE BEGIN read_ncdf_varget fmaskredy reform byte res over fmaskredy temporary fmaskredy MOD 2 ENDELSE boudary conditions used to compute vmask varcontient ncdf_varinq cdfid vmask name varcontient name nx jpi firstx 0L lastx jpi 1L ny 1L firsty jpj 1 lasty jpj 1 IF micromask NE 1 THEN BEGIN yyy1 firsty key_stridetrue 1 iyminmeshtrue yyy2 lasty key_stridetrue 1 iyminmeshtrue iyminmesh 0L firsty yyy1 8 lasty yyy2 8 ny lasty firsty 1 read_ncdf_varget IF jpk EQ 1 THEN res reform res jpi 1 jpk over vmaskred transpose temporary res 1 0 2 vmaskred reform binary vmaskred 8 ny nx nz over vmaskred transpose temporary vmaskred 1 0 2 vmaskred reform vmaskred yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 ENDIF ELSE BEGIN read_ncdf_varget vmaskred reform byte res over ENDELSE boudary conditions used to compute fmask 2 varcontient ncdf_varinq cdfid fmask name varcontient name IF micromask NE 1 THEN BEGIN read_ncdf_varget IF jpk EQ 1 THEN res reform res jpi 1 jpk over fmaskredx transpose temporary res 1 0 2 fmaskredx reform binary fmaskredx 8 ny nx nz over fmaskredx transpose temporary fmaskredx 1 0 2 fmaskredx reform fmaskredx yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 iyminmesh iyminmeshtrue key_stride key_stridetrue ENDIF ELSE BEGIN read_ncdf_varget fmaskredx reform byte res over fmaskredx fmaskredx MOD 2 ENDELSE 1d arrays namevar e3t e3w gdept gdepw for i 0 n_elements namevar 1 do begin varcontient ncdf_varinq cdfid namevar i CASE n_elements varcontient dim OF 4:BEGIN command ncdf_varget cdfid namevar i namevar i offset 0 0 izminmesh 0 count 1 1 jpk 1 if key_stride 2 NE 1 then command command stride 1 1 key_stride 2 1 END 2:BEGIN command ncdf_varget cdfid namevar i namevar i offset izminmesh 0 count jpk 1 if key_stride 2 NE 1 then command command stride key_stride 2 END 1:BEGIN command ncdf_varget cdfid namevar i namevar i offset izminmesh count jpk if key_stride 2 NE 1 then command command stride key_stride 2 END ENDCASE nothing execute command command namevar i float namevar i nothing execute command command if size namevar i n_dimension gt 0 then namevar i reform namevar i over nothing execute command ENDFOR ncdf_close cdfid Apply Glamboudary if keyword_set glamboundary AND key_onearth then BEGIN if glamboundary 0 NE glamboundary 1 then BEGIN glamt temporary glamt MOD 360 smaller where glamt LT glamboundary 0 if smaller 0 NE 1 then glamt smaller glamt smaller 360 bigger where glamt GE glamboundary 1 if bigger 0 NE 1 then glamt bigger glamt bigger 360 glamu temporary glamu MOD 360 smaller where glamu LT glamboundary 0 if smaller 0 NE 1 then glamu smaller glamu smaller 360 bigger where glamu GE glamboundary 1 if bigger 0 NE 1 then glamu bigger glamu bigger 360 glamv temporary glamv MOD 360 smaller where glamv LT glamboundary 0 if smaller 0 NE 1 then glamv smaller glamv smaller 360 bigger where glamv GE glamboundary 1 if bigger 0 NE 1 then glamv bigger glamv bigger 360 glamf temporary glamf MOD 360 smaller where glamf LT glamboundary 0 if smaller 0 NE 1 then glamf smaller glamf smaller 360 bigger where glamf GE glamboundary 1 if bigger 0 NE 1 then glamf bigger glamf bigger 360 toosmall where glamu EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamu toosmall glamu toosmall 360 toosmall where glamf EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamf toosmall glamf toosmall 360 endif endif make sure we do have 2d arrays when jpj eq 1 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over IF keyword_set key_partialstep THEN BEGIN hdept reform hdept jpi jpj over hdepw reform hdepw jpi jpj over e3t_ps reform e3t_ps jpi jpj over e3w_ps reform e3w_ps jpi jpj over ENDIF ENDIF ixmindta ixmindtasauve iymindta iymindtasauve izmindta izmindtasauve widget_control noticebase bad_id nothing destroy key_gridtype c grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling ncdf_meshread ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE romszinfos h: 1 zeta: 1 theta_s: 1 theta_b: 1 hc: 1 ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth if keyword_set key_performance THEN print time ncdf_meshread systime 1 tempsun updateold return end"); 45 a[43] = new Array("./Grid/ncdf_meshroms.html", "ncdf_meshroms.pro", "", " file_comments read NetCDF grid file created by ROMS categories Grid examples IDL ncdf_meshroms filename param filename in optional default roms_grd nc type scalar string Name of the meshmask file to read If this name does not contain any and if iodirectory keyword is not specify then the common variable iodir will be use to define the mesh file path keyword GLAMBOUNDARY default those defined in the file type 2 elements vector Longitude boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 le 360 By default the common cm_4mesh variable key_shift will be automatically defined according to GLAMBOUNDARY keyword ONEARTH default 1 type scalar: 0 or 1 Force the manual definition of data localization on the earth or not 0 if the data are not on the earth 1 if the data are on earth in that case we can for example use the labels longitude latitude in plots The resulting value will be stored in the common cm_4mesh variable key_onearth ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword GETDIMENSIONS default 0 type scalar: 0 or 1 Activate this keywords if you only want to know the dimension of the domain stored in the mesh file This dimensions will be defined in jpiglo jpjglo jpkglo cm_4mesh common variables keyword PERIODIC default computed by using the first line of glamt type scalar: 0 or 1 Force the manual definition of the grid zonal periodicity The resulting value will be stored in the common cm_4mesh variable key_periodic PERIODIC 0 forces SHIFT 0 keyword NRHO default 1 type scalar Specify the number of rho level that contain the data we want to explore This is mainly useful when using xxx to get access to the depper levers and vertical sections keyword SHIFT default computed according to glamboundary type scalar Force the manual definition of the zonal shift that must be apply to the data The resulting value will be stored in the common cm_4mesh variable key_shift Note that if key_periodic 0 then in any case key_shift 0 keyword STRCALLING type scalar string the calling command used to call computegrid this is used by xxx pro keyword STRIDE default 1 1 1 type 3 elements vector Specify the stride in x y and z direction The resulting value will be stored in the common cm_4mesh variable key_stride keyword _EXTRA used to pass isafile keywords uses cm_4mesh cm_4data cm_4cal restrictions ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh must be defined before calling ncdf_meshread if some of those value are equal to 1 they will be automatically defined In the original ROMS grid if F grid has jpi jpj points then T grid will have jpi 1 jpj 1 points U grid will have jpi jpj 1 points and V grid will have jpi 1 jpj points By default C grid used in this package needs the same number of points for T U V and F grid with a T point at the bottom left corner of the grid We therefore ignore the last column of T and V points and the last line of T and U points Scale factors are compuited using the distance between the points which is not the exact definition for irregulare grid history Sebastien Masson smasson lodyc jussieu fr September 2006 version Id: ncdf_meshroms pro 212 2007 02 14 10:47:10Z smasson PRO ncdf_meshroms filename NRHO nrho GLAMBOUNDARY glamboundary ONEARTH onearth GETDIMENSIONS getdimensions PERIODIC periodic SHIFT shift STRIDE stride STRCALLING strcalling _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 for key_performance find meshfile name and open it def of filename by default IF n_params EQ 0 then filename roms_grd nc meshname isafile file filename iodirectory iodir _EXTRA ex meshname meshname 0 noticebase xnotice Reading file C meshname C if the meshmask is on tape archive get it back IF version OS_FAMILY EQ unix THEN spawn file meshname dev null cdfid ncdf_open meshname contient ncdf_inquire cdfid dimensions ncdf_diminq cdfid xi_rho name jpiglo ncdf_diminq cdfid eta_rho name jpjglo IF n_elements nrho NE 0 THEN jpkglo long nrho 0 ELSE jpkglo 1L if keyword_set getdimensions then begin widget_control noticebase bad_id nothing destroy ncdf_close cdfid return endif check that all i xyz min ax mesh are well defined if n_elements ixminmesh EQ 0 THEN ixminmesh 0 if n_elements ixmaxmesh EQ 0 then ixmaxmesh jpiglo 1 if ixminmesh EQ 1 THEN ixminmesh 0 IF ixmaxmesh EQ 1 then ixmaxmesh jpiglo 1 if n_elements iyminmesh EQ 0 THEN iyminmesh 0 IF n_elements iymaxmesh EQ 0 then iymaxmesh jpjglo 1 if iyminmesh EQ 1 THEN iyminmesh 0 IF iymaxmesh EQ 1 then iymaxmesh jpjglo 1 if n_elements izminmesh EQ 0 THEN izminmesh 0 IF n_elements izmaxmesh EQ 0 then izmaxmesh jpkglo 1 if izminmesh EQ 1 THEN izminmesh 0 IF izmaxmesh EQ 1 then izmaxmesh jpkglo 1 definition of jpi jpj jpj jpi long ixmaxmesh ixminmesh 1 jpj long iymaxmesh iyminmesh 1 jpk long izmaxmesh izminmesh 1 check onearth and its consequences IF n_elements onearth EQ 0 THEN key_onearth 1 ELSE key_onearth keyword_set onearth IF NOT key_onearth THEN BEGIN periodic 0 shift 0 ENDIF automatic definition of key_periodic IF n_elements periodic EQ 0 THEN BEGIN IF jpi GT 1 THEN BEGIN ncdf_varget cdfid lon_rho xaxis offset ixminmesh iyminmesh count jpi 1 xaxis xaxis 720 MOD 360 xaxis xaxis sort xaxis key_periodic xaxis jpi 1 2 xaxis jpi 1 xaxis jpi 2 GE xaxis 0 360 ENDIF ELSE key_periodic 0 ENDIF ELSE key_periodic keyword_set periodic automatic definition of key_shift IF n_elements shift EQ 0 THEN BEGIN key_shift long testvar var key_shift key_shift will be defined according to the first line of glamt if keyword_set glamboundary AND jpi GT 1 AND key_periodic EQ 1 THEN BEGIN ncdf_varget cdfid lon_rho xaxis offset ixminmesh iyminmesh count jpi 1 xaxis between glamboundary 0 and glamboundary 1 xaxis xaxis MOD 360 smaller where xaxis LT glamboundary 0 if smaller 0 NE 1 then xaxis smaller xaxis smaller 360 bigger where xaxis GE glamboundary 1 if bigger 0 NE 1 then xaxis bigger xaxis bigger 360 key_shift where xaxis EQ min xaxis 0 IF key_shift NE 0 THEN BEGIN key_shift jpi key_shift xaxis shift xaxis key_shift ENDIF IF array_equal sort xaxis lindgen jpi NE 1 THEN BEGIN print the x axis 1st line of glamt is not sorted in the inceasing order after the automatic definition of key_shift print please use the keyword shift and periodic to suppress the automatic definition of key_shift and key_periodic and define by hand a more suitable value widget_control noticebase bad_id nothing destroy return ENDIF ENDIF ELSE key_shift 0 ENDIF ELSE key_shift long shift key_periodic EQ 1 check key_stride and related things if n_elements stride eq 3 then key_stride stride if n_elements key_stride LE 2 then key_stride 1 1 1 key_stride 1l long key_stride IF total key_stride NE 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 ENDIF for the variables related to the partial steps key_partialstep 0 hdept 1 hdepw 1 default definitions to be able to use read_ncdf_varget default definitions to be able to use read_ncdf_varget ixmindtasauve testvar var ixmindta iymindtasauve testvar var iymindta izmindtasauve testvar var izmindta ixmindta 0l iymindta 0l izmindta 0l jpt 1 time 1 firsttps 0 firstx 0 lastx jpi 1 firsty 0 lasty jpj 1 firstz 0 lastz jpk 1 nx jpi ny jpj nz 1 izminmeshsauve izminmesh izminmesh 0 key_yreverse 0 key_zreverse 1 2d arrays: list the 2d variables that must be read namebase lon_ lat_ mask_ x_ y_ namebase2 glam gphi mask d1 d2 read all grid T variables for i 0 n_elements namebase 1 do begin varcontient ncdf_varinq cdfid namebase i rho name varcontient name read_ncdf_varget command namebase2 i t float temporary res nothing execute command ENDFOR d1t 1 e3 shift d1t 1 0 d1t d2t 1 e3 shift d2t 0 1 d2t for i 0 n_elements namebase2 1 do begin command namebase2 i t namebase2 i t 0:jpi 2 0:jpj 2 nothing execute command ENDFOR tmask byte temporary maskt IF jpk GT 1 THEN tmask reform tmask replicate 1b jpk jpi 1 jpj 1 jpk overwrite e1u temporary d1t e2v temporary d2t h: Final bathymetry at RHO points varcontient ncdf_varinq cdfid h name varcontient name read_ncdf_varget hroms float temporary res hroms hroms 0:jpi 2 0:jpj 2 read all grid U variables jpiglo jpiglo 1 jpi jpi 1 ixmaxmesh ixmaxmesh 1 firstx 0 lastx jpi 1 nx jpi for i 0 n_elements namebase 1 do begin varcontient ncdf_varinq cdfid namebase i u name varcontient name read_ncdf_varget command namebase2 i u float temporary res nothing execute command ENDFOR tmpsave 2 1 e3 d1u 0 0:jpj 2 d1u 1 e3 shift d1u 1 0 d1u d2u 1 e3 shift d2u 0 1 d2u for i 0 n_elements namebase2 1 do begin command namebase2 i u namebase2 i u 0:jpj 2 nothing execute command ENDFOR umaskred byte temporary masku jpi 1 IF jpk GT 1 THEN umaskred reform umaskred replicate 1b jpk 1 jpj 1 jpk overwrite e1t temporary d1u e1t shift temporary e1t 1 0 e1t 0 temporary tmpsave e2f temporary d2u read all grid V variables jpiglo jpiglo 1 jpi jpi 1 ixmaxmesh ixmaxmesh 1 firstx 0 lastx jpi 1 nx jpi jpjglo jpjglo 1 jpj jpj 1 iymaxmesh iymaxmesh 1 firsty 0 lasty jpj 1 ny jpj for i 0 n_elements namebase 1 do begin varcontient ncdf_varinq cdfid namebase i v name varcontient name read_ncdf_varget command namebase2 i v float temporary res nothing execute command ENDFOR d1v 1 e3 shift d1v 1 0 d1v tmpsave 2 1 e3 d2v 0:jpi 2 0 d2v 1 e3 shift d2v 0 1 d2v for i 0 n_elements namebase2 1 do begin command namebase2 i v namebase2 i v 0:jpi 2 nothing execute command ENDFOR vmaskred byte temporary maskv jpj 1 IF jpk GT 1 THEN vmaskred reform vmaskred replicate 1b jpk jpi 1 1 jpk overwrite e1f temporary d1v e2t temporary d2v e2t shift temporary e2t 0 1 e2t 0 temporary tmpsave read all grid F variables jpiglo jpiglo 1 jpi jpi 1 ixmaxmesh ixmaxmesh 1 firstx 0 lastx jpi 1 nx jpi for i 0 n_elements namebase 1 do begin varcontient ncdf_varinq cdfid namebase i psi name varcontient name read_ncdf_varget command namebase2 i f float temporary res nothing execute command ENDFOR tmpsave1 2 1 e3 d1f 0 d1f 1 e3 shift d1f 1 0 d1f tmpsave2 2 1 e3 d2f 0 d2f 1 e3 shift d2f 0 1 d2f fmaskredy byte maskf jpi 1 IF jpk GT 1 THEN fmaskredy reform fmaskredy replicate 1b jpk 1 jpj jpk overwrite fmaskredx byte temporary maskf jpj 1 IF jpk GT 1 THEN fmaskredx reform fmaskredx replicate 1b jpk jpi 1 jpk overwrite e1v temporary d1f e1v shift temporary e1v 1 0 e1v 0 temporary tmpsave1 e2u temporary d2f e2u shift temporary e2u 0 1 e2u 0 temporary tmpsave2 in the case of key_stride ne 1 1 1 redefine f points coordinates: they must be in the middle of 3 T points if key_stride 0 NE 1 OR key_stride 1 NE 1 then BEGIN we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 ENDIF 1d arrays gdept findgen jpk gdepw findgen jpk e3t replicate 1 jpk e3w replicate 1 jpk ncdf_close cdfid Apply Glamboudary if keyword_set glamboundary AND key_onearth then BEGIN if glamboundary 0 NE glamboundary 1 then BEGIN glamt temporary glamt MOD 360 smaller where glamt LT glamboundary 0 if smaller 0 NE 1 then glamt smaller glamt smaller 360 bigger where glamt GE glamboundary 1 if bigger 0 NE 1 then glamt bigger glamt bigger 360 glamu temporary glamu MOD 360 smaller where glamu LT glamboundary 0 if smaller 0 NE 1 then glamu smaller glamu smaller 360 bigger where glamu GE glamboundary 1 if bigger 0 NE 1 then glamu bigger glamu bigger 360 glamv temporary glamv MOD 360 smaller where glamv LT glamboundary 0 if smaller 0 NE 1 then glamv smaller glamv smaller 360 bigger where glamv GE glamboundary 1 if bigger 0 NE 1 then glamv bigger glamv bigger 360 glamf temporary glamf MOD 360 smaller where glamf LT glamboundary 0 if smaller 0 NE 1 then glamf smaller glamf smaller 360 bigger where glamf GE glamboundary 1 if bigger 0 NE 1 then glamf bigger glamf bigger 360 toosmall where glamu EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamu toosmall glamu toosmall 360 toosmall where glamf EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamf toosmall glamf toosmall 360 endif endif make sure we do have 2d arrays when jpj eq 1 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over ENDIF ixmindta ixmindtasauve iymindta iymindtasauve izmindta izmindtasauve widget_control noticebase bad_id nothing destroy key_gridtype c grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling ncdf_meshroms ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE romszinfos h:hroms zeta:replicate 0 jpi jpj theta_s: 1 theta_b: 1 hc: 1 ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth if keyword_set key_performance THEN print time ncdf_meshread systime 1 tempsun updateold return end"); 46 46 a[44] = new Array("./Grid/numbisland.html", "numbisland.pro", "", " hidden file_comments recursive function for one given point on an island check if its neighbourgs are on the same island param msk in required type 2D array of 0 and 1 land sea mask with 0 on the land and 1 on the ocean param nx in required type scalar x size of the mask param ny in required type scalar y size of the mask param indin in required type 1D array index listing the point of the mask which are on the island param numb in required type scalar number of the island PRO mskneig msk nx ny indin numb flag the point msk indin numb find its neighbourgs indx indin MOD nx 1L 0L 1L indx temporary indx nx MOD nx x periodicity indy indin nx 1L 0L 1L indy 0 temporary indy a numbisland tmask 0 history Jan 2006: sebastien masson smasson locean ipsl upmc fr version Id: numbisland pro 197 2006 10 26 10:45:17Z smasson FUNCTION numbisland mskin time1 systime 1 performance measurment szmsk size reform mskin IF szmsk 0 NE 2 THEN stop nx szmsk 1 ny szmsk 2 msk fix mskin islnumb 10 default value land where msk EQ 0 count 0 WHILE count NE 0 DO BEGIN IF islnumb 9 MOD 10 EQ 0 THEN print island number : strtrim islnumb 9 1 mskneig msk nx ny land islnumb land where msk EQ 0 count 0 islnumb islnumb 1 ENDWHILE msk msk 9 msk where msk EQ 8 0 print time: systime 1 time1 RETURN msk END"); 47 47 a[45] = new Array("./Grid/restoreboxparam.html", "restoreboxparam.pro", "", " file_comments restore all the zoom parameters defined by calling domdef perviously defined by saveboxparam param filename in required a scalar string defining the file name uses cm_4mesh and cm_demomode_used if we are in demo mode restrictions call def_myuniquetmpdir if myuniquetmpdir is undefined: define create and add it to path examples IDL restoreboxparam filename history Sebastien Masson smasson lodyc jussieu fr July 2005 version Id: restoreboxparam pro 155 2006 08 11 14:32:05Z smasson PRO restoreboxparam filename compile_opt idl2 strictarrsubs cm_4mesh IF lmgr demo EQ 1 THEN BEGIN if we are in demo mode we cannot save the parameters in a temporary file cm_demomode_used lon1 boxzoomparam bound 0 lon2 boxzoomparam bound 1 lat1 boxzoomparam bound 2 lat2 boxzoomparam bound 3 vert1 boxzoomparam bound 4 vert2 boxzoomparam bound 5 firstxt boxzoomparam indexes 0 lastxt boxzoomparam indexes 1 firstyt boxzoomparam indexes 2 lastyt boxzoomparam indexes 3 firstxu boxzoomparam indexes 4 lastxu boxzoomparam indexes 5 firstyu boxzoomparam indexes 6 lastyu boxzoomparam indexes 7 firstxv boxzoomparam indexes 8 lastxv boxzoomparam indexes 9 firstyv boxzoomparam indexes 10 lastyv boxzoomparam indexes 11 firstxf boxzoomparam indexes 12 lastxf boxzoomparam indexes 13 firstyf boxzoomparam indexes 14 lastyf boxzoomparam indexes 15 firstzt boxzoomparam indexes 16 lastzt boxzoomparam indexes 17 firstzw boxzoomparam indexes 18 lastzw boxzoomparam indexes 19 nxt boxzoomparam indexes 20 nyt boxzoomparam indexes 21 nxu boxzoomparam indexes 22 nyu boxzoomparam indexes 23 nxv boxzoomparam indexes 24 nyv boxzoomparam indexes 25 nxf boxzoomparam indexes 26 nyf boxzoomparam indexes 27 nzt boxzoomparam indexes 28 nzw boxzoomparam indexes 29 key_irregular boxzoomparam key boxzoomparam 1 ENDIF ELSE BEGIN restore myuniquetmpdir filename file_delete myuniquetmpdir filename ENDELSE updateold return end "); … … 249 249 a[247] = new Array("./ToBeReviewed/LECTURE/ncdf_lec.html", "ncdf_lec.pro", "", " file_comments Give informations on a file net cdf and allows to recuperate variables which are write in categories Reading param NOM in required Name of a file net cdf situated in the directory stipulated by iodir keyword ATT global or at the name of a variable Allows to see all attributes joined at a variable keyword DIM Give the list of dimensions keyword VAR 1 var: Gove the list of dimensions 2 var nom de variable : in this case the function send back the variable keyword IODIR String containing the directory containing the file to be read keyword _EXTRA Allows to pass keywords defined by IDL to functions NETCDF particularly OFFSET and COUNT in ncdf_varget returns 1 except if var nom de variable then the function send back the variable restrictions Variables s names of the program are similar to these used by the IDL manual scientific data formats history Sebastien Masson smasson lodyc jussieu fr 4 1 98 version Id: ncdf_lec pro 163 2006 08 29 12:59:46Z navarro function ncdf_lec nom ATT att DIM dim VAR var IODIR iodir _extra ex compile_opt idl2 strictarrsubs res 1 if NOT keyword_set IODIR then iodir if not keyword_set att or keyword_set dim or keyword_set var then BEGIN att 1 dim 1 var 1 commande ncdump c iodir nom spawn commande goto fini endif opening of the file name cdfid ncdf_open iodir nom Wht does the file contain wathinside ncdf_inquire cdfid print in the file iodir nom there are: if keyword_set dim then begin print nombre de dimensions: strtrim wathinside ndims 1 print numero de la dimension dont la valeur est infini: strtrim wathinside recdim 1 endif if keyword_set var then if size var type NE 7 then print nombre de variables : strtrim wathinside nvars 1 if keyword_set att then begin if strlowcase att ne global then goto nonglobal print nombre de attributs globaux : strtrim wathinside ngatts 1 endif Global attributes if keyword_set att then begin print print ATTRIBUTS GLOBAUX for attiq 0 wathinside ngatts 1 do begin name ncdf_attname cdfid attiq global attribute s name ncdf_attget cdfid name value global attribute s value print name : string value endfor endif nonglobal: Display of different dimensions if keyword_set dim then begin print print DIMENSIONS endif nomdim strarr wathinside ndims tailledim lonarr wathinside ndims for dimiq 0 wathinside ndims 1 do begin ncdf_diminq cdfid dimiq name value dimension s name and value nomdim dimiq name tailledim dimiq value if keyword_set dim then begin print dimension numero strtrim dimiq 1 nom: nomdim dimiq valeur: strtrim tailledim dimiq 1 endif endfor Display of different variables if keyword_set att or keyword_set var then begin var s value string or 1 help var output nature if strpos nature STRING 0 NE 1 then nature string ELSE nature 1 If we just have to read the variable if nature EQ string then begin ncdf_varget cdfid var res _extra ex GOTO sortie ENDIF If it is to have pieces of information if not keyword_set att then att rien print for varid 0 wathinside nvars 1 do begin varcontent ncdf_varinq cdfid varid What does variable contain if strlowcase att eq strlowcase varcontent name or keyword_set var then begin print variable numero: strtrim varid 1 nom: varcontent name type: varcontent datatype dimensions: nomdim varcontent dim if strlowcase att eq strlowcase varcontent name then begin for attiq 0 varcontent natts 1 do begin name ncdf_attname cdfid varid attiq ncdf_attget cdfid varid name value print strtrim attiq name : strtrim string value 1 endfor goto sortie endif endif endfor endif sortie: ncdf_close cdfid fini: return res end"); 250 250 a[248] = new Array("./ToBeReviewed/LECTURE/read_ftp.html", "read_ftp.pro", "", " file_comments categories param U param CMD param RES keyword OUT keyword COUNT Upon return the number of elements in the result set This is only important when the result set is the empty set in which case COUNT is set to zero restrictions examples history version Id: read_ftp pro 157 2006 08 21 09:01:50Z navarro pro ftp_post u cmd res out out count count compile_opt idl2 if cmd ne then begin printf u cmd format a comment out the following line to disable debug info print cmd endif if size out type eq 0 then out 2 catch err if err ne 0 then return line count 0 while arg_present res do begin readf u line if count eq 0 then res line else res res line count count 1 comment out the following line to disable debug info print READ_FTP ftp: ftp rsinc com pub gzip README GZIP DATA data IDL help data DATA BYTE Array 2134 IDL print string data README file: Research Systems Anonymous FTP site ftp rsinc com pub directory gzip directory 2 Retrieve some files from podaac jpl nasa gov and store the files in the current working directory: IDL files string lindgen 10 50 format MGB370 3 3d gz IDL READ_FTP podaac jpl nasa gov files IDL pub sea_surface_height topex_poseidon mgdrb data MGB_370 FILE IDL spawn dir MGB log_output Volume in drive C is Local Disk Volume Serial Number is 34CE 24DF Directory of C: test test0307 07 28 2003 11:58a 362 167 MGB370 050 gz 07 28 2003 11:58a 333 005 MGB370 051 gz 07 28 2003 11:58a 310 287 MGB370 052 gz 07 28 2003 11:58a 358 771 MGB370 053 gz 07 28 2003 11:59a 387 282 MGB370 054 gz 07 28 2003 11:59a 361 633 MGB370 055 gz 07 28 2003 11:59a 383 075 MGB370 056 gz 07 28 2003 11:59a 365 844 MGB370 057 gz 07 28 2003 11:59a 383 918 MGB370 058 gz 07 28 2003 12:00p 372 712 MGB370 059 gz 10 File s 3 618 694 bytes These compressed files can cosequently be opened with OPENR and the COMPRESSED keyword history version Id: read_ftp pro 157 2006 08 21 09:01:50Z navarro todo seb: que fait on de syntax au debut du header give examples with date in year 0 should not exists but may happen pro read_ftp site files dir port data data file file user user pass pass ptr ptr compile_opt idl2 if n_elements port eq 0 then port ftp if n_elements files eq 0 then begin if strcmp site ftp: 6 then host strmid site 6 else host site pos strpos host dir strmid host pos host strmid host 0 pos pos strpos dir reverse_search files strmid dir pos 1 dir strmid dir 0 pos endif else host site if size user type eq 0 then user anonymous if size pass type eq 0 then pass test test com socket u host port connect_timeout 5 read_timeout 5 get_lun ftp_post u res ftp_post u USER user res out 3 ftp_post u PASS pass res ftp_post u TYPE I res if size dir type ne 0 then ftp_post u CWD dir res if keyword_set file or arg_present data then begin bufsize 512 buffer bytarr bufsize n n_elements files if arg_present data then dat ptrarr n for i 0 n 1 do begin ftp_post u SIZE files i res out 213 sz long64 strmid res n_elements res 1 4 if arg_present data then dat i ptr_new bytarr sz ftp_post u PASV res ftp_parse_pasv res host port ftp_post u RETR files i res out 1 socket v host port connect_timeout 5 read_timeout 5 get_lun rawio tc 0ll if keyword_set file then openw w files i get_lun while tc lt sz do begin if sz tc lt bufsize then begin bufsize sz tc buffer bytarr bufsize endif readu v buffer transfer_count dtc if arg_present data then dat i tc dtc eq bufsize buffer:buffer 0:dtc 1 if keyword_set file then writeu w dtc eq bufsize buffer:buffer 0:dtc 1 tc tc dtc endwhile free_lun v if keyword_set file then free_lun w ftp_post u res endfor if arg_present data then begin if n gt 1 or keyword_set ptr then data dat else data temporary dat 0 endif endif ftp_post u QUIT res free_lun u end"); 251 a[249] = new Array("./ToBeReviewed/LECTURE/read_ncdf.html", "read_ncdf.pro", "", " file_comments Reading function for the file net_cdf This program is less universal than ncdf_lec it appeal to declared variables in common pro but it is very easier to be used It considerate the declaration of the different zooms which have been defined ixminmesh premierx the declaration of the variable key_shift To put it in a nutshell the result of read_ncdf can be directly used in plt This is also this program which is used by default in our reading widgets categories Reading param NAME in required type string It define the field to be read param BEGINNING in required Relative with the time axis These can be 2 date of the type yyyymmdd and in this case we select dates which are included between these two dates 2 indexes which define between which and which time step we have to extract the temporal dimension param ENDING in required Relative with the time axis See BEGINNING param COMPATIBILITY in optional Useless defined for compatibility keyword BOXZOOM Contain the boxzoom on which we have to do the reading keyword CALLITSELF default 0 type scalar: 0 or 1 For ROMS outputs Use by read_ncdf itself to access auxilliary data h and zeta keyword FILENAME required type string It contains he file s name keyword INIT default 0 type scalar: 0 or 1 To call automatically initncdf filename and thus redefine all the grid parameters keyword GRID UTVWF to specify the type of grid Default is 1 based on the name of the file if the file ends by GRID _ TUVFW NC not case sensible or 2 T if case 1 is not found keyword TIMESTEP default 0 type scalar: 0 or 1 Specify that BEGINNING and ENDING refer to indexes of the time axis and not to dates keyword TOUT default 0 type scalar: 0 or 1 We activate it if we want to read the file on the whole domain without considerate the sub domain defined by the boxzoom or lon1 lon2 lat1 lat2 vert1 vert2 keyword NOSTRUCT default 0 type scalar: 0 or 1 We activate it if we do not want that read_ncdf send back a structure but only the array referring to the field keyword TIMEVAR type string It define the name of the variable that contains the time axis This keyword can be useful if there is no unlimited dimension or if the time axis selected by default the first 1D array with unlimited dimension is not the good one keyword ZETAFILENAME default FILENAME type string For ROMS outputs The filename of the file where zeta vriable should be read keyword ZETAZERO default 0 type scalar: 0 or 1 For ROMS outputs To define zeta to 0 instead of reading it keyword _EXTRA Used to pass your keywords returns Structure readable by litchamp pro or an array if NOSTRUCT is activated uses common pro restrictions The field must have a temporal dimension history Sebastien Masson smasson lodyc jussieu fr 15 10 1999 version Id: read_ncdf pro 2 09 2007 02 08 10:01:49Z smasson FUNCTION read_ncdf name beginning ending compatibility BOXZOOM boxzoom FILENAME filename PARENTIN parentin TIMESTEP timestep TIMEVAR timevar TOUT tout NOSTRUCT nostruct CONT_NOFILL CONT_NOFILL INIT init GRID grid CALLITSELF callitself ZETAFILENAME zetafilename ZETAZERO zetazero _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF we find the filename print filename is parent a valid widget if keyword_set parentin then BEGIN parent long parentin parent parent widget_info parent managed ENDIF filename isafile filename filename IODIRECTORY iodir _EXTRA ex Opening of the name file if size filename type NE 7 then return report read_ncdf cancelled IF version OS_FAMILY EQ unix THEN spawn file filename dev null cdfid ncdf_open filename contient ncdf_inquire cdfid we check if the variable name exists in the file if ncdf_varid cdfid name EQ 1 then BEGIN ncdf_close cdfid return report variable name C not found in the file filename ENDIF varcontient ncdf_varinq cdfid name IF varcontient ndims LT 2 THEN return report read_ncdf cannot read scalar or 1D data look for the dimension names dimnames strarr varcontient ndims FOR i 0 varcontient ndims 1 DO BEGIN ncdf_diminq cdfid varcontient dim i tmp dimsize dimnames i tmp ENDFOR shall we redefine the grid parameters if keyword_set init THEN initncdf filename _extra ex check the time axis and the debut and ending dates if n_elements beginning EQ 0 then begin beginning 0 timestep 1 endif if keyword_set timestep then begin firsttps beginning 0 if n_elements ending NE 0 then lasttps ending 0 ELSE lasttps firsttps jpt lasttps firsttps 1 IF NOT keyword_set callitself then time julday 1 1 1 lindgen jpt ENDIF ELSE BEGIN if keyword_set parent then BEGIN widget_control parent get_uvalue top_uvalue filelist extractatt top_uvalue filelist IF filelist 0 EQ many THEN filelist filename currentfile where filelist EQ filename 0 time extractatt top_uvalue fileparameters currentfile time_counter date1 date2jul beginning 0 if n_elements ending NE 0 then date2 date2jul ending 0 ELSE date2 date1 firsttps where time EQ date1 firsttps firsttps 0 lasttps where time EQ date2 lasttps lasttps 0 ENDIF ELSE BEGIN IF keyword_set timevar THEN BEGIN timeid ncdf_varid cdfid timevar IF timeid EQ 1 THEN BEGIN ncdf_close cdfid return report the file filename as no variable timevar C Use the TIMESTEP keyword endif timecontient ncdf_varinq cdfid timeid contient recdim timecontient dim 0 ENDIF ELSE BEGIN we find the infinite dimension timedim contient recdim if timedim EQ 1 then BEGIN ncdf_close cdfid return report the file filename as no infinite dimension C Use TIMESTEP or TIMEVAR keyword endif we find the FIRST time axis timeid 0 repeat BEGIN As long as we have not find a variable having only one dimension: the infinite one timecontient ncdf_varinq cdfid timeid that the variable contain timeid timeid 1 endrep until n_elements timecontient dim EQ 1 AND timecontient dim 0 EQ contient recdim OR timeid EQ contient nvars 1 if timeid EQ contient nvars 1 then BEGIN ncdf_close cdfid return report the file filename as no time axis variable C Use the TIMESTEP keyword endif timeid timeid 1 ENDELSE we must found the time origin of the julian calendar used in the time axis does the attribut units an dcalendar exist for the variable time axis if timecontient natts EQ 0 then BEGIN ncdf_close cdfid return report the variable timecontient name has no attribut C Use the TIMESTEP keyword or add the attribut units to the variable endif attnames strarr timecontient natts for attiq 0 timecontient natts 1 do attnames attiq ncdf_attname cdfid timeid attiq if where attnames EQ units 0 EQ 1 then BEGIN ncdf_close cdfid return report Attribut units not found for the variable timecontient name C Use the TIMESTEP keyword ENDIF now we try to find the attribut called calendar the attribute calendar exists If no we suppose that the calendar is gregorian calendar if where attnames EQ calendar 0 NE 1 then BEGIN ncdf_attget cdfid timeid calendar value value string value CASE value OF noleap :key_caltype noleap 360d :key_caltype 360d greg :IF n_elements key_caltype EQ 0 THEN key_caltype greg ELSE:BEGIN notused report Unknown calendar: value we use greg calendar key_caltype greg END ENDCASE ENDIF ELSE BEGIN notused report Unknown calendar we use key_caltype calendar IF n_elements key_caltype EQ 0 THEN key_caltype greg ENDELSE now we take acre of units attribut ncdf_attget cdfid timeid units value time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 we decript the units attribut to find the time origin value strtrim strcompress string value 2 mots str_sep value unite mots 0 unite strlowcase unite IF strpos unite s strlen unite 1 NE 1 THEN unite strmid unite 0 strlen unite 1 IF strpos unite julian_ NE 1 THEN unite strmid unite 7 IF unite NE second AND unite NE hour AND unite NE day AND unite NE month AND unite NE year THEN BEGIN ncdf_close cdfid return report time units does not start with seconds hours days months years ENDIF IF stregex value since 0 9 1 4 0 9 1 2 0 9 1 2 boolean EQ 0 THEN BEGIN ncdf_close cdfid return report attribut units of time has not the good format: since 0 9 1 4 0 9 1 2 0 9 1 2 ENDIF depart str_sep mots 2 ncdf_varget cdfid timeid time time double time case unite of second :time julday depart 1 depart 2 depart 0 time 86400 d hour :time julday depart 1 depart 2 depart 0 time 24 d day :time julday depart 1 depart 2 depart 0 time month :BEGIN if total fix time NE time NE 0 then we switch to days with 30d m time julday depart 1 depart 2 depart 0 round time 30 ELSE for t 0 n_elements time 1 DO time t julday depart 1 time t depart 2 depart 0 END year :BEGIN if total fix time NE time NE 0 then we switch to days with 365d y time julday depart 1 depart 2 depart 0 round time 365 ELSE for t 0 n_elements time 1 do time t julday depart 1 depart 2 depart 0 time t END ELSE:BEGIN ncdf_close cdfid return report The units attribute of the time axis must be something like: C seconds since 0001 01 01 C days since 1979 01 01 C months since 1979 01 01 C years since 1979 01 01 end ENDCASE date1 date2jul beginning 0 if n_elements ending NE 0 then date2 date2jul ending 0 ELSE date2 date1 time double time firsttps where time GE date1 firsttps firsttps 0 if firsttps EQ 1 THEN BEGIN ncdf_close cdfid return report date 1: strtrim jul2date date1 1 is not found in the time axis ENDIF lasttps where time LE date2 if lasttps 0 EQ 1 THEN BEGIN ncdf_close cdfid return report the time axis has no date before date 2: strtrim jul2date date2 1 endif lasttps lasttps n_elements lasttps 1 if lasttps LT firsttps then BEGIN ncdf_close cdfid return report the time axis has no dates between date1 and date 2: strtrim jul2date date1 1 strtrim jul2date date2 1 endif ENDELSE time time firsttps:lasttps jpt lasttps firsttps 1 ENDELSE Name of the grid on which the field refer to IF keyword_set grid THEN vargrid strupcase grid ELSE BEGIN vargrid T default definition IF finite glamu 0 EQ 1 THEN BEGIN are we in one of the case corresponding to ROMS conventions CASE 1 OF dimnames 2 long key_stride key_shift long testvar var key_shift IF n_elements key_yreverse EQ 0 THEN key_yreverse 0 IF keyword_set key_yreverse THEN BEGIN tmp jpj 1 firsty firsty jpj 1 lasty lasty tmp ENDIF IF n_elements key_zreverse EQ 0 THEN key_zreverse 0 IF keyword_set key_zreverse THEN BEGIN tmp jpk 1 firstz firstz jpk 1 lastz lastz tmp ENDIF IF key_gridtype EQ c_u OR key_gridtype EQ c_f AND vargrid EQ U OR vargrid EQ F THEN BEGIN IF keyword_set key_periodic THEN BEGIN key_shift key_shift 1 ENDIF ELSE BEGIN firstx firstx 1 lastx lastx 1 ENDELSE ENDIF IF key_gridtype EQ c_v OR key_gridtype EQ c_f AND vargrid EQ V OR vargrid EQ F THEN BEGIN firsty firsty 1 lasty lasty 1 ENDIF read_ncdf_varget IF key_gridtype EQ c_u OR key_gridtype EQ c_f AND keyword_set key_periodic AND strupcase vargrid EQ U OR strupcase vargrid EQ F THEN key_shift key_shift 1 We define global variable joined with the variable varname IF NOT keyword_set callitself THEN varname name varunit if varcontient natts NE 0 then begin attnames strarr varcontient natts for attiq 0 varcontient natts 1 do attnames attiq ncdf_attname cdfid name attiq lowattnames strlowcase attnames found where lowattnames EQ units 0 IF found NE 1 then ncdf_attget cdfid name attnames found value ELSE value IF NOT keyword_set callitself THEN varunit strtrim string value 2 found where lowattnames EQ add_offset 0 if found NE 1 then ncdf_attget cdfid name attnames found add_offset ELSE add_offset 0 found where lowattnames EQ scale_factor 0 if found NE 1 then ncdf_attget cdfid name attnames found scale_factor ELSE scale_factor 1 missing_value no found where lowattnames EQ _fillvalue 0 if found NE 1 then ncdf_attget cdfid name attnames found missing_value found where lowattnames EQ missing_value 0 if found NE 1 then ncdf_attget cdfid name attnames found missing_value ENDIF ELSE BEGIN IF NOT keyword_set callitself THEN varunit add_offset 0 scale_factor 1 missing_value no ENDELSE vardate We make a legible date in function of the specified language year long beginning 0 10000 month long beginning 0 100 MOD 100 day long beginning 0 MOD 100 vardate string format C CMoA 31 month 1 strtrim day 1 strtrim year 1 varexp file_basename filename we apply reverse IF keyword_set key_yreverse AND ny NE 1 THEN BEGIN IF varcontient ndims where varcontient dim EQ contient recdim 0 NE 1 EQ 2 THEN res reverse reform res nx ny jpt overwrite 2 ELSE res reverse reform res nx ny nz jpt overwrite 2 ENDIF if keyword_set key_zreverse AND nz NE 1 AND varcontient ndims where varcontient dim EQ contient recdim 0 NE 1 EQ 3 THEN res reverse reform res nx ny nz jpt overwrite 3We apply the value valmask on land points if NOT keyword_set cont_nofill then begin valmask 1e20 case 1 of varcontient ndims eq 2:BEGIN xy array mask mask 0 earth where mask EQ 0 END varcontient ndims eq 3 AND where varcontient dim EQ contient recdim 0 EQ 1:BEGIN xyz array earth where mask EQ 0 END varcontient ndims eq 3 AND where varcontient dim EQ contient recdim 0 NE 1:BEGIN xyt array mask mask 0 earth where mask EQ 0 if earth 0 NE 1 then BEGIN earth earth replicate 1 jpt replicate nx ny n_elements earth lindgen jpt END END varcontient ndims eq 4:BEGIN xyzt array earth where mask EQ 0 if earth 0 NE 1 then BEGIN earth earth replicate 1 jpt replicate nx ny nz n_elements earth lindgen jpt END END endcase ENDIF ELSE earth 1 we look for missing_value IF size missing_value type NE 7 then BEGIN IF size missing_value type EQ 1 THEN BEGIN missing_value strlowcase string missing_value IF strmid missing_value 0 1 reverse_offset EQ f THEN missing_value strmid missing_value 0 strlen missing_value 1 IF isnumber string missing_value tmp EQ 1 THEN missing_value tmp ELSE BEGIN print Warning: missing value is not a number: missing_value missing_value 1 ENDELSE ENDIF if missing_value NE valmask then begin if abs missing_value LT 1e6 then missing where res EQ missing_value ELSE missing where abs res gt abs missing_value 10 ENDIF ELSE missing 1 ENDIF ELSE missing 1 we apply add_offset scale_factor and missing_value if scale_factor NE 1 then res temporary res scale_factor if add_offset NE 0 then res temporary res add_offset if missing 0 NE 1 then res temporary missing values f_nan if earth 0 NE 1 then res temporary earth 1 e20 if it is roms outputs we need to get additionals infos IF NOT keyword_set callitself THEN BEGIN IF strmid dimnames 0 0 3 EQ xi_ AND strmid dimnames 1 0 4 EQ eta_ THEN BEGIN ncdf_attget cdfid theta_s theta_s global ncdf_attget cdfid theta_b theta_b global ncdf_attget cdfid hc hc global look for all variables names allvarnames strarr contient nvars FOR i 0 contient nvars 1 DO BEGIN tmp ncdf_varinq cdfid i allvarnames i tmp name ENDFOR CASE 1 OF keyword_set zetazero :zeta fltarr nx ny jpt keyword_set zetafilename : zeta read_ncdf zeta firsttps lasttps FILENAME zetafilename TIMESTEP NOSTRUCT CONT_NOFILL CONT_NOFILL GRID vargrid CALLITSELF _EXTRA ex where allvarnames EQ zeta 0 NE 1: zeta read_ncdf zeta firsttps lasttps FILENAME filename TIMESTEP NOSTRUCT CONT_NOFILL CONT_NOFILL GRID vargrid CALLITSELF _EXTRA ex ELSE:return report The variable zeta was not found in the file please use the keyword ZETAFILENAME to specify the name of a file containing zeta or use keyword ZETAZERO to define zeta to 0 ENDCASE romszinfos h:romszinfos h zeta:temporary zeta theta_s:theta_s theta_b:theta_b hc:hc ENDIF ELSE romszinfos h: 1 zeta: 1 theta_s: 1 theta_b: 1 hc: 1 ENDIF ncdf_close cdfid IF keyword_set savedbox THEN restoreboxparam boxparam4rdncdf dat IF keyword_set nostruct THEN return res IF keyword_set key_forgetold THEN BEGIN return arr:temporary res grid:vargrid unit:varunit experiment:varexp name:varname ENDIF ELSE BEGIN return tab:temporary res grille:vargrid unite:varunit experience:varexp nom:varname ENDELSE END ");251 a[249] = new Array("./ToBeReviewed/LECTURE/read_ncdf.html", "read_ncdf.pro", "", " file_comments Reading function for the file net_cdf This program is less universal than ncdf_lec it appeal to declared variables in common pro but it is very easier to be used It considerate the declaration of the different zooms which have been defined ixminmesh premierx the declaration of the variable key_shift To put it in a nutshell the result of read_ncdf can be directly used in plt This is also this program which is used by default in our reading widgets categories Reading param NAME in required type string It define the field to be read param BEGINNING in required Relative with the time axis These can be 2 date of the type yyyymmdd and in this case we select dates which are included between these two dates 2 indexes which define between which and which time step we have to extract the temporal dimension param ENDING in required Relative with the time axis See BEGINNING param COMPATIBILITY in optional Useless defined for compatibility keyword BOXZOOM Contain the boxzoom on which we have to do the reading keyword CALLITSELF default 0 type scalar: 0 or 1 For ROMS outputs Use by read_ncdf itself to access auxilliary data h and zeta keyword FILENAME required type string It contains he file s name keyword INIT default 0 type scalar: 0 or 1 To call automatically initncdf filename and thus redefine all the grid parameters keyword GRID UTVWF to specify the type of grid Default is 1 based on the name of the file if the file ends by GRID _ TUVFW NC not case sensible or 2 T if case 1 is not found keyword TIMESTEP default 0 type scalar: 0 or 1 Specify that BEGINNING and ENDING refer to indexes of the time axis and not to dates keyword TOUT default 0 type scalar: 0 or 1 We activate it if we want to read the file on the whole domain without considerate the sub domain defined by the boxzoom or lon1 lon2 lat1 lat2 vert1 vert2 keyword NOSTRUCT default 0 type scalar: 0 or 1 We activate it if we do not want that read_ncdf send back a structure but only the array referring to the field keyword TIMEVAR type string It define the name of the variable that contains the time axis This keyword can be useful if there is no unlimited dimension or if the time axis selected by default the first 1D array with unlimited dimension is not the good one keyword ZETAFILENAME default FILENAME type string For ROMS outputs The filename of the file where zeta vriable should be read keyword ZETAZERO default 0 type scalar: 0 or 1 For ROMS outputs To define zeta to 0 instead of reading it keyword _EXTRA Used to pass your keywords returns Structure readable by litchamp pro or an array if NOSTRUCT is activated uses common pro restrictions The field must have a temporal dimension history Sebastien Masson smasson lodyc jussieu fr 15 10 1999 version Id: read_ncdf pro 212 2007 02 14 10:47:10Z smasson FUNCTION read_ncdf name beginning ending compatibility BOXZOOM boxzoom FILENAME filename PARENTIN parentin TIMESTEP timestep TIMEVAR timevar TOUT tout NOSTRUCT nostruct CONT_NOFILL CONT_NOFILL INIT init GRID grid CALLITSELF callitself ZETAFILENAME zetafilename ZETAZERO zetazero _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF we find the filename print filename is parent a valid widget if keyword_set parentin then BEGIN parent long parentin parent parent widget_info parent managed ENDIF filename isafile filename filename IODIRECTORY iodir _EXTRA ex Opening of the name file if size filename type NE 7 then return report read_ncdf cancelled IF version OS_FAMILY EQ unix THEN spawn file filename dev null cdfid ncdf_open filename contient ncdf_inquire cdfid we check if the variable name exists in the file if ncdf_varid cdfid name EQ 1 then BEGIN ncdf_close cdfid return report variable name C not found in the file filename ENDIF varcontient ncdf_varinq cdfid name IF varcontient ndims LT 2 THEN return report read_ncdf cannot read scalar or 1D data look for the dimension names dimnames strarr varcontient ndims FOR i 0 varcontient ndims 1 DO BEGIN ncdf_diminq cdfid varcontient dim i tmp dimsize dimnames i tmp ENDFOR shall we redefine the grid parameters if keyword_set init THEN initncdf filename _extra ex check the time axis and the debut and ending dates if n_elements beginning EQ 0 then begin beginning 0 timestep 1 endif if keyword_set timestep then begin firsttps beginning 0 if n_elements ending NE 0 then lasttps ending 0 ELSE lasttps firsttps jpt lasttps firsttps 1 IF NOT keyword_set callitself then time julday 1 1 1 lindgen jpt ENDIF ELSE BEGIN if keyword_set parent then BEGIN widget_control parent get_uvalue top_uvalue filelist extractatt top_uvalue filelist IF filelist 0 EQ many THEN filelist filename currentfile where filelist EQ filename 0 time extractatt top_uvalue fileparameters currentfile time_counter date1 date2jul beginning 0 if n_elements ending NE 0 then date2 date2jul ending 0 ELSE date2 date1 firsttps where time EQ date1 firsttps firsttps 0 lasttps where time EQ date2 lasttps lasttps 0 ENDIF ELSE BEGIN IF keyword_set timevar THEN BEGIN timeid ncdf_varid cdfid timevar IF timeid EQ 1 THEN BEGIN ncdf_close cdfid return report the file filename as no variable timevar C Use the TIMESTEP keyword endif timecontient ncdf_varinq cdfid timeid contient recdim timecontient dim 0 ENDIF ELSE BEGIN we find the infinite dimension timedim contient recdim if timedim EQ 1 then BEGIN ncdf_close cdfid return report the file filename as no infinite dimension C Use TIMESTEP or TIMEVAR keyword endif we find the FIRST time axis timeid 0 repeat BEGIN As long as we have not find a variable having only one dimension: the infinite one timecontient ncdf_varinq cdfid timeid that the variable contain timeid timeid 1 endrep until n_elements timecontient dim EQ 1 AND timecontient dim 0 EQ contient recdim OR timeid EQ contient nvars 1 if timeid EQ contient nvars 1 then BEGIN ncdf_close cdfid return report the file filename as no time axis variable C Use the TIMESTEP keyword endif timeid timeid 1 ENDELSE we must found the time origin of the julian calendar used in the time axis does the attribut units an dcalendar exist for the variable time axis if timecontient natts EQ 0 then BEGIN ncdf_close cdfid return report the variable timecontient name has no attribut C Use the TIMESTEP keyword or add the attribut units to the variable endif attnames strarr timecontient natts for attiq 0 timecontient natts 1 do attnames attiq ncdf_attname cdfid timeid attiq if where attnames EQ units 0 EQ 1 then BEGIN ncdf_close cdfid return report Attribut units not found for the variable timecontient name C Use the TIMESTEP keyword ENDIF now we try to find the attribut called calendar the attribute calendar exists If no we suppose that the calendar is gregorian calendar if where attnames EQ calendar 0 NE 1 then BEGIN ncdf_attget cdfid timeid calendar value value string value CASE value OF noleap :key_caltype noleap 360d :key_caltype 360d greg :IF n_elements key_caltype EQ 0 THEN key_caltype greg ELSE:BEGIN notused report Unknown calendar: value we use greg calendar key_caltype greg END ENDCASE ENDIF ELSE BEGIN notused report Unknown calendar we use key_caltype calendar IF n_elements key_caltype EQ 0 THEN key_caltype greg ENDELSE now we take acre of units attribut ncdf_attget cdfid timeid units value time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 we decript the units attribut to find the time origin value strtrim strcompress string value 2 mots str_sep value unite mots 0 unite strlowcase unite IF strpos unite s strlen unite 1 NE 1 THEN unite strmid unite 0 strlen unite 1 IF strpos unite julian_ NE 1 THEN unite strmid unite 7 IF unite NE second AND unite NE hour AND unite NE day AND unite NE month AND unite NE year THEN BEGIN ncdf_close cdfid return report time units does not start with seconds hours days months years ENDIF IF stregex value since 0 9 1 4 0 9 1 2 0 9 1 2 boolean EQ 0 THEN BEGIN ncdf_close cdfid return report attribut units of time has not the good format: since 0 9 1 4 0 9 1 2 0 9 1 2 ENDIF depart str_sep mots 2 ncdf_varget cdfid timeid time time double time case unite of second :time julday depart 1 depart 2 depart 0 time 86400 d hour :time julday depart 1 depart 2 depart 0 time 24 d day :time julday depart 1 depart 2 depart 0 time month :BEGIN if total fix time NE time NE 0 then we switch to days with 30d m time julday depart 1 depart 2 depart 0 round time 30 ELSE for t 0 n_elements time 1 DO time t julday depart 1 time t depart 2 depart 0 END year :BEGIN if total fix time NE time NE 0 then we switch to days with 365d y time julday depart 1 depart 2 depart 0 round time 365 ELSE for t 0 n_elements time 1 do time t julday depart 1 depart 2 depart 0 time t END ELSE:BEGIN ncdf_close cdfid return report The units attribute of the time axis must be something like: C seconds since 0001 01 01 C days since 1979 01 01 C months since 1979 01 01 C years since 1979 01 01 end ENDCASE date1 date2jul beginning 0 if n_elements ending NE 0 then date2 date2jul ending 0 ELSE date2 date1 time double time firsttps where time GE date1 firsttps firsttps 0 if firsttps EQ 1 THEN BEGIN ncdf_close cdfid return report date 1: strtrim jul2date date1 1 is not found in the time axis ENDIF lasttps where time LE date2 if lasttps 0 EQ 1 THEN BEGIN ncdf_close cdfid return report the time axis has no date before date 2: strtrim jul2date date2 1 endif lasttps lasttps n_elements lasttps 1 if lasttps LT firsttps then BEGIN ncdf_close cdfid return report the time axis has no dates between date1 and date 2: strtrim jul2date date1 1 strtrim jul2date date2 1 endif ENDELSE time time firsttps:lasttps jpt lasttps firsttps 1 ENDELSE Name of the grid on which the field refer to IF keyword_set grid THEN vargrid strupcase grid ELSE BEGIN vargrid T default definition IF finite glamu 0 EQ 1 THEN BEGIN are we in one of the case corresponding to ROMS conventions CASE 1 OF dimnames 2 long key_stride key_shift long testvar var key_shift IF n_elements key_yreverse EQ 0 THEN key_yreverse 0 IF keyword_set key_yreverse THEN BEGIN tmp jpj 1 firsty firsty jpj 1 lasty lasty tmp ENDIF IF n_elements key_zreverse EQ 0 THEN key_zreverse 0 IF keyword_set key_zreverse THEN BEGIN tmp jpk 1 firstz firstz jpk 1 lastz lastz tmp ENDIF IF key_gridtype EQ c_u OR key_gridtype EQ c_f AND vargrid EQ U OR vargrid EQ F THEN BEGIN IF keyword_set key_periodic THEN BEGIN key_shift key_shift 1 ENDIF ELSE BEGIN firstx firstx 1 lastx lastx 1 ENDELSE ENDIF IF key_gridtype EQ c_v OR key_gridtype EQ c_f AND vargrid EQ V OR vargrid EQ F THEN BEGIN firsty firsty 1 lasty lasty 1 ENDIF read_ncdf_varget IF key_gridtype EQ c_u OR key_gridtype EQ c_f AND keyword_set key_periodic AND strupcase vargrid EQ U OR strupcase vargrid EQ F THEN key_shift key_shift 1 We define global variable joined with the variable varname IF NOT keyword_set callitself THEN varname name varunit if varcontient natts NE 0 then begin attnames strarr varcontient natts for attiq 0 varcontient natts 1 do attnames attiq ncdf_attname cdfid name attiq lowattnames strlowcase attnames found where lowattnames EQ units 0 IF found NE 1 then ncdf_attget cdfid name attnames found value ELSE value IF NOT keyword_set callitself THEN varunit strtrim string value 2 found where lowattnames EQ add_offset 0 if found NE 1 then ncdf_attget cdfid name attnames found add_offset ELSE add_offset 0 found where lowattnames EQ scale_factor 0 if found NE 1 then ncdf_attget cdfid name attnames found scale_factor ELSE scale_factor 1 missing_value no found where lowattnames EQ _fillvalue 0 if found NE 1 then ncdf_attget cdfid name attnames found missing_value found where lowattnames EQ missing_value 0 if found NE 1 then ncdf_attget cdfid name attnames found missing_value ENDIF ELSE BEGIN IF NOT keyword_set callitself THEN varunit add_offset 0 scale_factor 1 missing_value no ENDELSE vardate We make a legible date in function of the specified language year long beginning 0 10000 month long beginning 0 100 MOD 100 day long beginning 0 MOD 100 vardate string format C CMoA 31 month 1 strtrim day 1 strtrim year 1 varexp file_basename filename We apply the value valmask on land points if NOT keyword_set cont_nofill then begin valmask 1e20 case 1 of varcontient ndims eq 2:BEGIN xy array mask mask 0 earth where mask EQ 0 END varcontient ndims eq 3 AND where varcontient dim EQ contient recdim 0 EQ 1:BEGIN xyz array earth where mask EQ 0 END varcontient ndims eq 3 AND where varcontient dim EQ contient recdim 0 NE 1:BEGIN xyt array mask mask 0 earth where mask EQ 0 if earth 0 NE 1 then BEGIN earth earth replicate 1 jpt replicate nx ny n_elements earth lindgen jpt END END varcontient ndims eq 4:BEGIN xyzt array earth where mask EQ 0 if earth 0 NE 1 then BEGIN earth earth replicate 1 jpt replicate nx ny nz n_elements earth lindgen jpt END END endcase ENDIF ELSE earth 1 we look for missing_value IF size missing_value type NE 7 then BEGIN IF size missing_value type EQ 1 THEN BEGIN missing_value strlowcase string missing_value IF strmid missing_value 0 1 reverse_offset EQ f THEN missing_value strmid missing_value 0 strlen missing_value 1 IF isnumber string missing_value tmp EQ 1 THEN missing_value tmp ELSE BEGIN print Warning: missing value is not a number: missing_value missing_value 1 ENDELSE ENDIF if missing_value NE valmask then begin if abs missing_value LT 1e6 then missing where res EQ missing_value ELSE missing where abs res gt abs missing_value 10 ENDIF ELSE missing 1 ENDIF ELSE missing 1 we apply add_offset scale_factor and missing_value if scale_factor NE 1 then res temporary res scale_factor if add_offset NE 0 then res temporary res add_offset if missing 0 NE 1 then res temporary missing values f_nan if earth 0 NE 1 then res temporary earth 1 e20 if it is roms outputs we need to get additionals infos IF NOT keyword_set callitself THEN BEGIN IF strmid dimnames 0 0 3 EQ xi_ AND strmid dimnames 1 0 4 EQ eta_ THEN BEGIN ncdf_attget cdfid theta_s theta_s global ncdf_attget cdfid theta_b theta_b global ncdf_attget cdfid hc hc global look for all variables names allvarnames strarr contient nvars FOR i 0 contient nvars 1 DO BEGIN tmp ncdf_varinq cdfid i allvarnames i tmp name ENDFOR CASE 1 OF keyword_set zetazero :zeta fltarr nx ny jpt keyword_set zetafilename : zeta read_ncdf zeta firsttps lasttps FILENAME zetafilename TIMESTEP NOSTRUCT CONT_NOFILL CONT_NOFILL GRID vargrid CALLITSELF _EXTRA ex where allvarnames EQ zeta 0 NE 1: zeta read_ncdf zeta firsttps lasttps FILENAME filename TIMESTEP NOSTRUCT CONT_NOFILL CONT_NOFILL GRID vargrid CALLITSELF _EXTRA ex ELSE:return report The variable zeta was not found in the file please use the keyword ZETAFILENAME to specify the name of a file containing zeta or use keyword ZETAZERO to define zeta to 0 ENDCASE romszinfos h:romszinfos h zeta:temporary zeta theta_s:theta_s theta_b:theta_b hc:hc ENDIF ELSE romszinfos h: 1 zeta: 1 theta_s: 1 theta_b: 1 hc: 1 ENDIF ncdf_close cdfid IF keyword_set savedbox THEN restoreboxparam boxparam4rdncdf dat IF keyword_set nostruct THEN return res IF keyword_set key_forgetold THEN BEGIN return arr:temporary res grid:vargrid unit:varunit experiment:varexp name:varname ENDIF ELSE BEGIN return tab:temporary res grille:vargrid unite:varunit experience:varexp nom:varname ENDELSE END "); 252 252 a[250] = new Array("./ToBeReviewed/LECTURE/read_ncdf_varget.html", "read_ncdf_varget.pro", "", ""); 253 253 a[251] = new Array("./ToBeReviewed/LECTURE/xncdf_lec.html", "xncdf_lec.pro", "", " file_comments Reading of a Net Cdf file with widgets categories Widget param NAME in optional type string It give the name of the file to be opened If NAME does not contain the separating character of directories under unix for example the file will be looked for in the current directory keyword IODIR type string It contains the directory where to go look for the file to be read If NAME does not contain the separating character of directories under unix for example the file will be called iodir nom_fichier keyword COUNT type vector An optional vector containing the counts to be used in reading Value COUNT is a 1 based vector with an element for each dimension of the data to be written The default matches the size of the variable so that all data is written out keyword GROUP The widget ID of the widget that calls XNCDF_LEC When this ID is specified a death of the caller results in a death of XNCDF_LEC keyword OFFSET type vector default 0 0 An optional vector containing the starting position for the read The default start position is 0 0 keyword SHIFT type vector default 0 0 A vector of integers specifying for each dimension how much we have to shift it By default it is 0 0 See the function shift for more explanations BEWARE the shift is done on the biggest array before a possible reduction determined by OFFSET and COUNT On the other hand it is done after the possible extraction created by the STRIDE keyword STRIDE type vector default 1 1 An optional vector containing the strides or sampling intervals between accessed values of the netCDF variable The default stride vector is that for a contiguous read 1 1 returns 2 different cases: 1 None attribute has been selected In this case res is the array we wanted to read 2 Some attributes has been selected In this case res is a structure whose the first element having the name of the variable is the values array and the other arguments are the select arguments uses wididbase infovariable resultat motcle examples help xncdf_lec history Sebastien Masson smasson lodyc jussieu fr 24 8 1999 version Id: xncdf_lec pro 163 2006 08 29 12:59:46Z navarro FUNCTION xncdf_lec name ATT att COUNT count GROUP group OFFSET offset IODIR iodir SHIFT shift STRIDE stride VAR var compile_opt idl2 strictarrsubs COMMON wididbase base COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON resultat res COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar Trick for using keywords we pass by variables declarated in a common res 1 if keyword_set att then mcatt att ELSE mcatt 0 if keyword_set count then mccount count ELSE mccount 0 if keyword_set offset then mcoffset offset ELSE mcoffset 0 if keyword_set shift then mcshift shift ELSE mcshift 0 if keyword_set stride then mcstride stride ELSE mcstride 0 if keyword_set var then mcvar var ELSE mcvar 0 choice of the file s name What type of machine is used thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC :sep : WIN :sep ELSE: sep ENDCASE If IODIR is not defined we initialize it at the current directory if NOT keyword_set iodir then cd current iodir mciodir iodir We complete IODIR with a separating character if needed IF rstrpos iodir sep NE strlen iodir 1 THEN iodir iodir sep if n_elements name EQ 0 then BEGIN If NAME is not defined we find one thanks to the program dialog_pickfile name dialog_pickfile filter iodir nc if name 0 EQ then return 1 If we do not have find anything we go out We complete NAME by IODIR if NAME does not contain any directory separating character ENDIF ELSE if strpos name sep EQ 1 then name iodir name test findfile name Does the name looked for correspond to a file while test 0 EQ OR n_elements test GT 1 do BEGIN We look for one as long as it correspond to nothing test test 0 name dialog_pickfile filter iodir nc if name EQ then return 1 test findfile name endwhile Opening of the file name cdfid ncdf_open name contient ncdf_inquire cdfid What does this file contain Opening of the base window as columns if n_elements group EQ 0 then base widget_base column title Fichier: name align_left ELSE base widget_base column title Fichier: name align_left GROUP_LEADER group Opening of base sub windows base 1 title having the file s name base1 widget_base base column align_center rien widget_label base1 value Net Cdf filename align_center rien widget_text base1 value name align_center uvalue 1 editable File s name we can change rien widget_label base1 value We jump a line base 2 General informations on the file base2 widget_base base column Informations on global attributes if contient ngatts NE 1 then begin rien widget_label base2 value Nombre de attributs globaux: strtrim contient ngatts 1 align_left for attiq 0 contient ngatts 1 do BEGIN Loop on the number of global attributes name ncdf_attname cdfid attiq global Attribute s name ncdf_attget cdfid name value global Attribute s value rien widget_text base2 value name : strtrim string value 1 xsize 60 scroll wrap align_right endfor rien widget_label base2 value endif Informations on dimensions rien widget_label base2 value Nombre de dimensions: strtrim contient ndims 1 align_left if contient recdim NE 1 then begin Loop on the number of global attributes ncdf_diminq cdfid contient recdim name value Name and value of the dimension rien widget_label base2 value name de la dimension infinie: name align_left endif nomdim strarr contient ndims Vector containing dimensions s name tailledim lonarr contient ndims Vector containing dimensions s value for dimiq 0 contient ndims 1 do begin Loop on the number of dimensions ncdf_diminq cdfid dimiq name value Name and value of the dimension nomdim dimiq name tailledim dimiq value rien widget_label base2 value name de taille: strtrim value 1 align_right ENDFOR rien widget_label base2 value We jump a line base 3 choice of the variable base3 widget_base base column rien widget_label base3 value Nombre de variables: strtrim contient nvars 1 align_left base31 widget_base base3 row align_center Creation of a listename containing the name of all file s variables listename strarr contient nvars for varid 0 contient nvars 1 do begin varcontient ncdf_varinq cdfid varid that the variable contain listename varid varcontient name endfor rien widget_label base31 value variable Creation of a button with a pop up menu base311 widget_droplist base31 value listename uvalue 2 rien widget_label base3 value base 4 button done base4 widget_base base row base42 widget_button base4 value done uvalue 3 align_right Execution of the base window and of sub windows widget_control base realize xmanager xncdf_lec base return res end La lecture de ce programme se fait de bas en haut: 1 xncdf_lec 2 xncdf_lec_event 3 wid_var wid_var_event file_comments Procedure called by xmanager when we press on a button of a second widget created by wid_var param EVENT in required A structure caracterizing the type of event which arrive to a widget number1 2 uses wididbase resultat infovariable indicewid motcle version Id: xncdf_lec pro 163 2006 08 29 12:59:46Z navarro pro wid_var_event event compile_opt idl2 strictarrsubs COMMON wididbase base COMMON resultat res COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON indicewid_var widbase1 widbase2111 widbase212 widbase213 selectatt COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar What is the type of event widget_control event id get_uvalue uval tailledimvar tailledim varcontient dim if n_elements uval EQ 0 then return case on the type of event case uval OF 1:BEGIN We change values in the array We check that values put in the array are not totally false widget_control widbase1 get_value table Is it the good type of argument If the type is wrong we automatically change it by default values if event x GT size table 1 then return if event y GT size table 2 then return if size table event x event y type GE 6 OR size table event x event y type EQ 0 then BEGIN if event x EQ 1 then widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y ELSE widget_control widbase1 use_table_select event x event y event x event y set_value 0 endif Argument with a wrong name value table fix table case event x of 0:BEGIN We touched the offset if table 0 event y LT 0 then BEGIN table 0 event y 0 widget_control widbase1 use_table_select 0 event y 0 event y set_value 0 endif If it exceed the dimension of the array we put it at the max and the cont at 1 if table 0 event y GT tailledimvar event y table 3 event y then begin widget_control widbase1 use_table_select 0 event y 1 event y set_value tailledimvar event y table 3 event y 1 ENDIF ELSE BEGIN If with the new offset the cont is too big we reduce it until it goes well if table 1 event y GT tailledimvar event y table 3 event y table 0 event y then begin widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y table 3 event y table 0 event y endif ENDELSE END 1:BEGIN We touched the cont if table 1 event y LT 1 then BEGIN table 1 event y 1 widget_control widbase1 use_table_select 1 event y 1 event y set_value 1 endif If it is too big we reduce it until it goes well if table 1 event y GT tailledimvar event y table 3 event y table 0 event y then BEGIN widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y table 3 event y table 0 event y endif END 2:BEGIN We touched the shift widget_control widbase1 use_table_select 2 event y 2 event y set_value table 2 event y MOD tailledimvar event y table 3 event y END 3:BEGIN We touched the stride if table 3 event y LT 1 then BEGIN table 3 event y 1 widget_control widbase1 use_table_select 3 event y 3 event y set_value 1 endif if table 3 event y EQ 0 then It must not be null widget_control widbase1 use_table_select 3 event y 3 event y set_value 1 It must not be too big if table 3 event y GT tailledimvar event y then widget_control widbase1 use_table_select 0 event y 3 event y set_value 0 1 0 tailledimvar event y ELSE BEGIN if table 1 event y GT tailledimvar event y table 3 event y table 0 event y then begin widget_control widbase1 use_table_select 1 event y 1 event y set_value tailledimvar event y table 3 event y table 0 event y endif ENDELSE END ELSE: endcase END 2111:BEGIN We touched buttons yes no We update the vector selectatt at 0 or 1 for the concerned attribute number event id selectatt where widbase2111 EQ event id event select end 31:BEGIN We pressed on get widget_control widbase1 get_value table table fix table mcshift where table 2 NE 0 mcoffset table 0 mccount table 1 mcstride table 3 if mcshift 0 NE 1 then BEGIN There are some shifts We read the wholeness of dimensions for which ones there is a shift mcoffset mcshift 0 mccount mcshift tailledimvar mcshift We do not activate stride when there is no need because it makes write something weird on the screen if total mcstride EQ n_elements mcstride then ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount ELSE ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount STRIDE mcstride To do the shift mcshift table 2 mcoffset table 0 mccount table 1 We define the command allowing to do a shift commande res shift res for dim 0 varcontient ndims 1 do commande commande string table 2 dim commande commande rien execute commande We redefine the command allowing to cut dimensions which has not been cut yet ones we shift commande res res initialization of the command for dim 0 varcontient ndims 1 do BEGIN if mcshift dim EQ 0 then commande commande ELSE commande commande string mcoffset dim : string mccount dim mcoffset dim 1 ENDFOR commande strmid commande 0 strlen commande 1 rien execute commande Case without shift we read directly the good part of the array ENDIF ELSE BEGIN if total mcstride EQ n_elements mcstride then ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount ELSE ncdf_varget cdfid varid res OFFSET mcoffset COUNT mccount STRIDE mcstride ENDELSE Do we have to constitute a structure with selected attributes if total selectatt NE 0 then BEGIN There are selected attributes res create_struct varcontient name res We create the structure selectatt where selectatt EQ 1 We find selected attributes for attid 0 n_elements selectatt 1 do BEGIN for which we take widget_control widbase212 selectatt attid get_value attname the name widget_control widbase213 selectatt attid get_value attvalue the value res create_struct res attname 0 attvalue 0 We concatenate the structure endfor endif widget_control event top destroy We shut the second widget widget_control base destroy We shut the first widget ncdf_close cdfid END 32: Case of the display of a held with xdisplayfile 33:widget_control event top destroy We shut the second widget ELSE: endcase return end file_comments This procedure manage the second created whiget when we call xncdf_lec This widget concern the reading of the variable param WIDID_PERE type scalar in required It contains the identity of the father widget which was created by xncdf_lec and which has allowed to select the variable to be read OUTPUTS: indirectement res le tableau ou la structure resultat uses resultat infovariable indicewid_var motcle version Id: xncdf_lec pro 163 2006 08 29 12:59:46Z navarro PRO wid_var widid_pere compile_opt idl2 strictarrsubs COMMON resultat res COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON indicewid_var widbase1 widbase2111 widbase212 widbase213 selectatt COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar res 1 Opening of the base window as columns widbase widget_base column title variable: varcontient name align_center group_leader widid_pere Opening of the base subwindow widbase1 array of offsets rien widget_label widbase value We jump a line Definition of labels of lines of the array rowlab string tailledim varcontient dim for i 0 n_elements rowlab 1 do rowlab i strtrim rowlab i 1 rowlab nomdim varcontient dim replicate : n_elements varcontient dim rowlab Definition of array s initial values valinit lonarr 4 n_elements varcontient dim column 0 : offsets if keyword_set mcoffset AND n_elements mcoffset EQ varcontient ndims THEN valinit 0 mcoffset ELSE valinit 0 0 colomn 1 : counts if keyword_set mccount AND n_elements mccount EQ varcontient ndims THEN valinit 1 mccount ELSE valinit 1 tailledim varcontient dim column 2 : shifts if keyword_set mcshift AND n_elements mcshift EQ varcontient ndims THEN valinit 2 mcshift ELSE valinit 2 0 column 3 : strides if keyword_set mcstride AND n_elements mcstride EQ varcontient ndims THEN valinit 3 mcstride ELSE valinit 3 1 test of initial values of the array valinit fix valinit valinit 3 1 valinit 3 valinit 0 valinit 1 tailledim varcontient dim valinit 3 valinit 0 valinit 2 valinit 2 MOD tailledim varcontient dim valinit 3 test of shifts declaration of the array widbase1 widget_table widbase row_labels rowlab value valinit editable column_labels Offset Count Shift Stride uvalue 1 un petit blabla rien widget_label widbase value ATTENTION: Faire des return pour que les valeurs align_center rien widget_label widbase value du tableau ou des textes soient bien prises en compte align_center widbase2 choice of attributes rien widget_label widbase value We jump a line widbase2 widget_base widbase column To each attribute we created a widget widbase21 containing in line a button yes no widbase211 and two wigdet text widbase212 widbase213 comprising the name and the value of the attribute widbase21 lonarr varcontient natts widbase211 lonarr varcontient natts widbase2111 lonarr varcontient natts Vector which will serve to know which yes no are selected see wid_var_event selectatt lonarr varcontient natts selectatt 0 widbase212 lonarr varcontient natts widbase213 lonarr varcontient natts for attid 0 varcontient natts 1 do BEGIN Lop on the number of attribute widbase21 attid widget_base widbase2 row name ncdf_attname cdfid varid attid ncdf_attget cdfid varid name value widbase211 attid widget_base widbase21 attid nonexclusive widbase2111 attid widget_button widbase211 attid value uvalue 2111 widbase212 attid widget_text widbase21 attid value name editable widbase213 attid widget_text widbase21 attid value strtrim string value 1 editable endfor widbase3 buttons of the bottom widbase3 widget_base widbase row align_center widbase31 widget_button widbase3 value GET uvalue 31 widbase32 widget_button widbase3 value Help uvalue 32 widbase33 widget_button widbase3 value DONE uvalue 33 execution of the base window and of sub window widget_control widbase realize xmanager wid_var widbase return end file_comments Procedure called by xmanager when we press a button of the first widget created by par xncdf_lec param EVENT A structure caracterising the event type which arrive at the widget number 1 uses resultat infovariable motcle version Id: xncdf_lec pro 163 2006 08 29 12:59:46Z navarro PRO xncdf_lec_event event compile_opt idl2 strictarrsubs COMMON resultat res COMMON infovariable cdfid listename contient nomdim tailledim varid varcontient COMMON motcle mcatt mccount mcoffset mciodir mcshift mcstride mcvar What is the type of event widget_control event id get_uvalue uval case on the type of event case uval of 1:BEGIN We want to read an other file widget_control event id get_value nom We recuperate the name widget_control event top destroy We shut the widget ncdf_close cdfid We shut the wrong file which has been opened We call back xncdf_lec res xncdf_lec nom 0 ATT mcatt COUNT mccount OFFSET mcoffset IODIR mciodir SHIFT mcshift STRIDE mcstride VAR mcvar return END 2:BEGIN A variable is selected varid event index We recuperat its number in the file Netcdf varcontient ncdf_varinq cdfid varid wid_var event top We call the program which launch the second widget See sooner END 3:BEGIN button done widget_control event top destroy We delete the widget ncdf_close cdfid We shut the file END ELSE: endcase return end"); … … 292 292 a[290] = new Array("./ToBeReviewed/PLOTS/legende.html", "legende.pro", "", " file_comments Provide caption categories Graphics param MI in required The min of the drawing param MA in required The max of the plot param COUPE type string Character containing two letters giving the type of the cut for example: xz keyword CONTOUR If we want to trace contours of a different field than the one whose we have the colored drawing by example E P in color and QSR in contours It must be a field respecting same characteristics than the argument number one of plt keyword ENDPOINTS Used when we do vertical cuts in diagonal keyword _EXTRA used to pass your keywords uses common pro restrictions The use of the global variable language allows to change the language and the caption easily history Sebastien Masson smasson lodyc jussieu fr 14 8 98 Eric Guilyardi ericg lodyc jussieu fr GB version 11 6 99 version Id: legende pro 163 2006 08 29 12:59:46Z navarro pro legende mi ma coupe CONTOUR contour ENDPOINTS endpoints DIREC direc VECTLEGENDE vectlegende INTERVALLE intervalle TYPE_YZ type_yz VARNAME2 varname2 NPTS npts _EXTRA ex compile_opt idl2 strictarrsubs common tempsun systime 1 pour key_performance grille 1 1 1 gdep nx ny nz English legends fmt_mm f12 2 fmt_bt f7 1 colorf contourf Contour plot vecteurf Vector norm expf datef fieldf depthf endpointsf Diag Section zonalf IF key_onearth THEN latintf latitudes in ELSE latintf j index in timintf time in onf depthf2 Depth m Meridf Zonal Mean IF key_onearth THEN lonintf longitudes in ELSE lonintf i in hovxt XT plot diaghovxt Diag XT plot depintf depths in timef Time hovyt YT plot diaghovyt Diag YT plot hovzt ZT plot hovt IF key_onearth THEN lontitle Longitude ELSE lontitle i index IF key_onearth THEN lattitle Latitude ELSE lattitle j index vertz depthf2 legniv m IF keyword_set TYPE_YZ THEN BEGIN IF type_yz EQ hPa THEN vertz hPa IF type_yz EQ hPa THEN legniv hPa ENDIF Start legende definition and possible complement of p subtitle if n_elements varunit ne 0 then unite varunit else unite p subtitle colorf unite : Min strtrim string format fmt_mm mi 2 Max strtrim string format fmt_mm ma 2 if keyword_set intervalle then BEGIN if intervalle NE 1 then p subtitle p subtitle Int strtrim string format fmt_mm intervalle 2 endif if size contour type EQ 8 then BEGIN it is a structure unite contour 1 p subtitle p subtitle C contourf unite : Min strtrim string format fmt_mm contour 0 0 2 Max strtrim string format fmt_mm contour 0 1 2 if contour inter NE 1 then p subtitle p subtitle Int strtrim string format fmt_mm contour inter 2 ENDIF if size vectlegende type EQ 8 then begin unite vectlegende 1 p subtitle p subtitle C vecteurf unite : Min strtrim string format fmt_mm vectlegende 0 0 2 Max strtrim string format fmt_mm vectlegende 0 1 2 endif Shapping of subdomain s dimensions la1 strtrim string format fmt_bt lat1 2 la2 strtrim string format fmt_bt lat2 2 lo1 strtrim string format fmt_bt lon1 2 lo2 strtrim string format fmt_bt lon2 2 pr1 strtrim string format fmt_bt vert1 2 pr2 strtrim string format fmt_bt vert2 2 Management of the date if n_elements vardate EQ 0 then vardate if NOT keyword_set direc then direc if strpos direc t NE 1 then begin svardate strtrim vairdate time 0 1 strtrim vairdate time jpt 1 1 ENDIF ELSE svardate vardate case on the caes where the caption is applied case coupe of xy :begin if strupcase vargrid EQ W then firstz firstzw ELSE firstz firstzt if strpos direc z EQ 1 AND firstz NE 0 then BEGIN prof strtrim round gdep 0 1 p title expf varexp datef svardate fieldf varname depthf prof legniv ENDIF ELSE p title expf varexp datef svardate fieldf varname x title lontitle y title lattitle end xz :begin IF keyword_set npts THEN n strtrim npts 1 ELSE n strtrim ny 1 IF long n LE 3 THEN zonalf Section if keyword_set endpoints AND lat1 NE lat2 then p title endpointsf varexp datef svardate fieldf varname ELSE p title zonalf varexp datef svardate fieldf varname x title lontitle if keyword_set endpoints AND lat1 EQ lat2 then BEGIN IF key_onearth THEN x title x title at strtrim lataxe 0 0 lat1 1 ELSE x title x title at j index strtrim lat1 1 ENDIF y title depthf2 end yz :begin IF keyword_set npts THEN n strtrim npts 1 ELSE n strtrim nx 1 IF long n LE 3 THEN meridf if keyword_set endpoints AND lon1 NE lon2 then p title endpointsf varexp datef svardate fieldf varname ELSE p title meridf varexp datef svardate fieldf varname y title vertz x title lattitle if keyword_set endpoints AND lon1 EQ lon2 then BEGIN IF key_onearth THEN x title x title at strtrim lonaxe 0 0 lon1 1 ELSE x title x title at i index strtrim lon1 1 ENDIF end xt :begin IF keyword_set npts THEN n strtrim npts 1 if keyword_set endpoints AND lat1 NE lat2 then p title diaghovxt varexp fieldf varname ELSE p title hovxt varexp fieldf varname IF time size time 0 1 time 0 GE 10 THEN y title timef x title lontitle if keyword_set endpoints AND lat1 EQ lat2 then BEGIN IF key_onearth THEN x title x title at strtrim lataxe 0 0 lat1 1 ELSE x title x title at j index strtrim lat1 1 ENDIF end yt :begin IF keyword_set npts THEN n strtrim npts 1 if keyword_set endpoints AND lon1 NE lon2 then p title diaghovyt varexp fieldf varname ELSE p title hovyt varexp fieldf varname IF time size time 0 1 time 0 GE 10 THEN x title timef y title lattitle if keyword_set endpoints AND lon1 EQ lon2 then BEGIN IF key_onearth THEN x title x title at strtrim lonaxe 0 0 lon1 1 ELSE x title x title at i index strtrim lon1 1 ENDIF end zt :begin IF keyword_set npts THEN n strtrim npts 1 ELSE n strtrim nx ny 1 p title hovzt varexp fieldf varname y title depthf2 IF time size time 0 1 time 0 GE 10 THEN x title timef end t :begin IF keyword_set npts THEN n strtrim npts 1 ELSE BEGIN if keyword_set integration3d then n strtrim nx ny nz 1 ELSE n strtrim nx ny 1 ENDELSE p title hovt varexp fieldf varname y title varname IF time size time 0 1 time 0 GE 10 THEN x title timef end x :begin IF keyword_set npts THEN n strtrim npts 1 ELSE n strtrim ny nz 1 if keyword_set endpoints AND lat1 NE lat2 then p title endpointsf varexp datef svardate fieldf varname ELSE p title varexp datef svardate fieldf varname x title lontitle if keyword_set endpoints AND lat1 EQ lat2 then BEGIN IF key_onearth THEN x title x title at strtrim lataxe 0 0 lat1 1 ELSE x title x title at j index strtrim lat1 1 ENDIF y title varname end y :begin IF keyword_set npts THEN n strtrim npts 1 ELSE n strtrim nx nz 1 if keyword_set endpoints AND lon1 NE lon2 then p title endpointsf varexp datef svardate fieldf varname ELSE p title varexp datef svardate fieldf varname x title lattitle if keyword_set endpoints AND lon1 EQ lon2 then BEGIN IF key_onearth THEN x title x title at strtrim lonaxe 0 0 lon1 1 ELSE x title x title at i index strtrim lon1 1 ENDIF y title varname end z :begin IF keyword_set npts THEN n strtrim npts 1 ELSE n strtrim nx ny 1 p title varexp datef svardate fieldf varname y title depthf2 x title varname end yfx : BEGIN IF keyword_set npts THEN n strtrim npts 1 ELSE n strtrim nx ny nz 1 p title varexp datef svardate varunit x title varname2 y title varname END else: ENDCASE if keyword_set direc then BEGIN if strpos direc x NE 1 then p subtitle lonintf lo1 lo2 onf strtrim nx 1 points C p subtitle if strpos direc y NE 1 then BEGIN if strpos p subtitle EQ 1 then p subtitle latintf la1 la2 onf strtrim ny 1 points C p subtitle ELSE p subtitle latintf la1 la2 onf strtrim ny 1 points p subtitle ENDIF if strpos direc z NE 1 AND nz NE 1 OR coupe NE xy then BEGIN if strpos p subtitle EQ 1 then p subtitle depintf pr1 pr2 onf strtrim nz 1 points C p subtitle ELSE p subtitle depintf pr1 pr2 onf strtrim nz 1 points p subtitle ENDIF ENDIF if keyword_set endpoints AND coupe NE yt AND lat1 NE lat2 then p title p title C C if keyword_set key_performance THEN print temps legende systime 1 tempsun return end"); 293 293 a[291] = new Array("./ToBeReviewed/PLOTS/plotsym.html", "plotsym.pro", "", " file_comments function to make plotting symbols much easier categories Graphics Keyword circle circle symbol Keyword TRIANGLE triangle symbol Keyword DIAMOND diamond symbol Keyword BOX box symbol Keyword LINE line symbol Keyword SCALE scales the symbol Keyword ANGLE angle the symbol should be rotated Keyword _EXTRA extra keywords for usersym These are thick color and fill history Written by: Ronn Kling Ronn Kling Consulting 7038 Westmoreland Dr Warrenton VA 20187 klingrl juno com copyright 1999 all rights reserved version Id: plotsym pro 163 2006 08 29 12:59:46Z navarro function plotsym circle circle triangle triangle diamond diamond angle angle box box line line scale scale _extra extra compile_opt idl2 strictarrsubs if not keyword_set scale then scale 1 0 if not keyword_set angle then angle 0 0 if keyword_set circle then begin theta findgen 30 29 360 endif else if keyword_set triangle then begin theta 30 90 210 30 endif else if keyword_set diamond then begin theta 0 90 180 270 0 endif else if keyword_set box then begin theta 315 45 135 225 315 endif else if keyword_set line then begin theta 180 0 endif theta theta angle x cos theta dtor scale y sin theta dtor scale usersym x y _extra extra return 8 end"); 294 a[292] = new Array("./ToBeReviewed/PLOTS/reinitplt.html", "reinitplt.pro", "", " file_comments This procedure will reinitialize all or a selection of the system plot variables categories Utilities keyword X clear the appropriate variable keyword Y clear the appropriate variable keyword Z clear the appropriate variable keyword P clear the appropriate variable keyword ALL Clear all this is equivalent to x y z p keyword INVERT Invert the logic Clear all unselected variables Therefore clearplt all invert does nothing uses common pro restrictions The system plot variables are changed history Written by: Trevor Harris Physics Dept University of Adelaide July 1990 Sebastien Masson 7 5 98 version Id: reinitplt pro 163 2006 08 29 12:59:46Z navarropro reinitplt all all x x y y z z p p invert invert compile_opt idl2 strictarrsubs clearx 0 cleary 0 clearz 0 clearp 0 if keyword_set x then clearx 1 if keyword_set y then cleary 1 if keyword_set z then clearz 1 if keyword_set p then clearp 1 if keyword_set all or not keyword_set x and not keyword_set y and not keyword_set z and not keyword_set p then begin clearx 1 cleary 1 clearz 1 clearp 1 endif if keyword_set invert then begin clearx not clearx cleary not cleary clearz not clearz clearp not clearp endif if clearx then begin x charsize 0 x GRIDSTYLE 0 X MARGIN 10 3 X MINOR 0 X OMARGIN 0 0 x region 0 X RANGE 0 x STYLE 5 x tick 1 x TICKFORMAT x TICKLEN 0 x tickname x ticks 0 X TICKV 0 X TICKV 1 x title x TYPE 0 endif if cleary then begin y charsize 0 y GRIDSTYLE 0 Y MARGIN 10 3 Y MINOR 0 Y OMARGIN 0 0 y region 0 Y RANGE 0 y STYLE 5 y tick 1 y TICKFORMAT y TICKLEN 0 y tickname y ticks 0 Y TICKV 0 Y TICKV 1 y title y TYPE 0 endif if clearz then begin z charsize 0 z GRIDSTYLE 0 Z MARGIN 10 3 Z MINOR 0 Z OMARGIN 0 0 z region 0 Z RANGE 0 z STYLE 1 z tick 1 z TICKFORMAT z TICKLEN 0 z tickname z ticks 0 Z TICKV 0 Z TICKV 1 z title z TYPE 0 endif if clearp then begin p BACKGROUND d n_colors 1 255 p CHARSIZE 1 p CHARTHICK 0 p LINESTYLE 0 p MULTI replicate 0 5 p NOERASE 0 p POSITION 0 p region 0 p title p subtitle p ticklen 0 02 p thick 0 1 p color 0 endif return end ");294 a[292] = new Array("./ToBeReviewed/PLOTS/reinitplt.html", "reinitplt.pro", "", " file_comments This procedure will reinitialize all or a selection of the system plot variables categories Utilities keyword X clear the appropriate variable keyword Y clear the appropriate variable keyword Z clear the appropriate variable keyword P clear the appropriate variable keyword ALL Clear all this is equivalent to x y z p keyword INVERT Invert the logic Clear all unselected variables Therefore reinitplt all invert does nothing uses common pro restrictions The system plot variables are changed history Written by: Trevor Harris Physics Dept University of Adelaide July 1990 Sebastien Masson 7 5 98 version Id: reinitplt pro 213 2007 02 16 11:29:17Z smasson pro reinitplt all all x x y y z z p p invert invert compile_opt idl2 strictarrsubs clearx 0 cleary 0 clearz 0 clearp 0 if keyword_set x then clearx 1 if keyword_set y then cleary 1 if keyword_set z then clearz 1 if keyword_set p then clearp 1 if keyword_set all or not keyword_set x and not keyword_set y and not keyword_set z and not keyword_set p then begin clearx 1 cleary 1 clearz 1 clearp 1 endif if keyword_set invert then begin clearx not clearx cleary not cleary clearz not clearz clearp not clearp endif if clearx then begin x charsize 0 x GRIDSTYLE 0 X MARGIN 10 3 X MINOR 0 X OMARGIN 0 0 x region 0 X RANGE 0 x STYLE 5 x tick 1 x TICKFORMAT x TICKLEN 0 x tickname x ticks 0 X TICKV 0 X TICKV 1 x title x TYPE 0 endif if cleary then begin y charsize 0 y GRIDSTYLE 0 Y MARGIN 10 3 Y MINOR 0 Y OMARGIN 0 0 y region 0 Y RANGE 0 y STYLE 5 y tick 1 y TICKFORMAT y TICKLEN 0 y tickname y ticks 0 Y TICKV 0 Y TICKV 1 y title y TYPE 0 endif if clearz then begin z charsize 0 z GRIDSTYLE 0 Z MARGIN 10 3 Z MINOR 0 Z OMARGIN 0 0 z region 0 Z RANGE 0 z STYLE 1 z tick 1 z TICKFORMAT z TICKLEN 0 z tickname z ticks 0 Z TICKV 0 Z TICKV 1 z title z TYPE 0 endif if clearp then begin p BACKGROUND d n_colors 1 255 p CHARSIZE 1 p CHARTHICK 0 p LINESTYLE 0 p MULTI replicate 0 5 p NOERASE 0 p POSITION 0 p region 0 p title p subtitle p ticklen 0 02 p thick 0 1 p color 0 endif return end "); 295 295 a[293] = new Array("./ToBeReviewed/PLOTS/style.html", "style.pro", "", " file_comments Choose the way to trace isolines categories Graphics param LABSTYLE in required Number to which the style of drawing choosen refer to param LEVEL_Z2D in required Vector containing values of isolignes to be traced param LINESTYLE out Vector used to define the isocontour s style Comment: remember: Index Linestyle 0 Solid 1 Dotted 2 Dashed 3 Dash Dot 4 Dash Dot Dot Dot 5 Long Dashes param THICK out Vector defining the thick of the isoline history Sebastien Masson smasson lodyc jussieu fr version Id: style pro 163 2006 08 29 12:59:46Z navarro pro style labstyle level_z2d linestyle thick compile_opt idl2 strictarrsubs case labstyle of 0: begin series: Two thin continuous lines one boldface continuous line thick 1 1 2 linestyle 0 return end 1: begin series: Before the middle of levels: thin dash Then thin continuous trait If the middle of the drawing is drawn it is in boldface continuous trait impair n_elements level_z2d 2 fix n_elements level_z2d 2 a replicate 0 fix n_elements level_z2d 2 b replicate 1 fix n_elements level_z2d 2 c replicate 2 fix n_elements level_z2d 2 if impair then begin thick b 2 b linestyle c 0 a endif else begin thick 0 linestyle c a endelse return end 2: begin series: Before the sill defined by answering to a question : thin dash Then thin continuous trait If the sill is drawn it is in boldface continuous trait seuil xquestion Quelle est la limite tirets trait continu 0 seuil float seuil rien where level_z2d lt seuil n a replicate 0 n_elements level_z2d n c replicate 2 n if seuil eq level_z2d n then begin thick replicate 1 n 2 replicate 1 n_elements level_z2d 1 n linestyle c a endif else begin thick 0 linestyle c a endelse return end 3: begin n n_elements level_z2d seuil level_z2d 1 n 2 thick intarr n thick indgen n 4 4 1 thick indgen n 4 4 1 1 thick indgen n 4 4 2 2 thick indgen n 4 4 3 1 linestyle intarr n linestyle indgen n 4 4 3 linestyle indgen n 4 4 1 0 linestyle indgen n 4 4 2 0 linestyle indgen n 4 4 3 0 labels intarr n labels indgen n 2 2 1 labels n 2 0 return end 4: begin Boldface continuous trait seuil 1 e 6 thick replicate 5 n_elements level_z2d linestyle 0 rien where abs level_z2d max abs level_z2d LT seuil if rien 0 NE 1 then thick rien 0 3 end else: begin ras report Le numero de labstyle demande n existe pas stop end endcase return end"); 296 296 a[294] = new Array("./ToBeReviewed/PLOTS/symbols.html", "symbols.pro", "", " file_comments Create custom plotting symbols param NSYM in required 1 open circle 2 filled circle 3 arrow pointing right 4 arrow pointing left 5 arrow pointing up 6 arrow pointing down 7 arrow pointing up and left 45 degrees 8 arrow pointing down and left 9 arrow pointing down and right 10 arrow pointing up and right 11 through 18 are bold versions of 3 through 10 19 horizontal line 20 box 21 diamond 22 triangle 30 filled box 31 filled diamond 32 filled triangle param SCALE in required size of symbols keyword COLOR color of symbols restrictions The desired symbol is stored in the user buffer and will be plotted if P PSYM 8 history Jeff Bennett U of Colorado 198 version Id: symbols pro 142 2006 07 21 12:47:49Z navarro pro symbols nsym scale color col compile_opt idl2 strictarrsubs on_error 2 fill 0 case 1 of nsym le 2 : begin circles for large scales increase number of points for res if scale ge 4 then a findgen 25 else a findgen 13 a a 3 14159 6 0 12 or 24 pi 6 xarr cos a yarr sin a if nsym eq 2 then fill 1 end nsym ge 3 nsym le 18 : begin arrow heads xarr fltarr 5 yarr xarr xarr 1 10 xarr 2 6 yarr 2 2 nsyms greater than 10 should be filled arrows if nsym gt 10 then begin xarr 3 6 xarr 4 10 yarr 3 2 fill 1 endif else begin xarr 3 10 xarr 4 6 yarr 4 2 endelse case 1 of nsym eq 3 : dummy 0b nsym eq 4 : xarr 1 xarr nsym eq 11 nsym eq 12 : begin xarr extrac xarr 0 11 yarr extrac yarr 0 11 yarr 6 0 5 xarr 7 6 yarr 7 0 5 xarr 8 6 yarr 8 0 5 yarr 9 0 5 if nsym eq 12 then begin rotation xarr yarr 180 nx ny xarr nx yarr ny endif end nsym eq 5 nsym eq 13 : begin temp xarr xarr yarr yarr temp end nsym eq 6 nsym eq 14 : begin temp 1 xarr xarr yarr yarr temp end nsym ge 7 nsym le 10 nsym ge 15 nsym le 18 : begin case 1 of nsym eq 7 nsym eq 15 : deg 45 nsym eq 8 nsym eq 16 : deg 135 nsym eq 9 nsym eq 17 : deg 225 nsym eq 10 nsym eq 18 : deg 315 endcase rotation xarr yarr deg nx ny xarr nx yarr ny end end nsym ge 7 endcase end nsym between 3 and 18 nsym eq 20 nsym eq 21 nsym eq 30 nsym eq 31 : begin xarr fltarr 5 3 yarr xarr xarr 1 3 xarr 2 3 yarr 2 3 yarr 3 3 if nsym eq 21 nsym eq 31 then begin rotation xarr yarr 45 nx ny nx 0 70 nx shrink the x direction xarr nx yarr ny endif if nsym ge 30 then fill 1 end nsym 20 21 30 31 nsym eq 22 nsym eq 32 : begin side length 6 0 at centroid yarr fltarr 4 6 4 xarr fltarr 4 6 2 xarr 1 6 2 xarr 2 0 yarr 2 6 sqrt 3 2 6 4 if nsym eq 32 then fill 1 end else: begin xarr fltarr 2 1 yarr xarr 0 xarr 1 1 end endcase xarr xarr scale yarr yarr scale set symbol buffer if keyword_set col then usersym xarr yarr fill fill color col else usersym xarr yarr fill fill return end"); … … 354 354 a[352] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/inserthistory.html", "inserthistory.pro", "", " file_comments categories param BASE param TEXT param LINE1 param LINE2 returns uses restrictions examples history version Id: inserthistory pro 150 2006 08 09 10:12:54Z navarro todo seb PRO inserthistory base text line1 line2 compile_opt idl2 strictarrsubs widget_control base get_uvalue top_uvalue globalcommand extractatt top_uvalue globalcommand top_uvalue 1 findline top_uvalue globaloldcommand globalcommand for i 0 n_elements globalcommand 1 do print globalcommand i we insert text between line1 and line2 index1 where globalcommand EQ line1 index1 index1 0 1 if index1 EQ 1 then begin rien report line1 n est pas trouve ds globalcommand return endif index2 where globalcommand EQ line2 index2 index2 0 if index2 EQ 1 then begin rien report line2 n est pas trouve ds globalcommand return ENDIF the new text: globalcommand globalcommand 0:index1 text globalcommand index2:n_elements globalcommand 1 the new globalcommand top_uvalue 1 findline top_uvalue globalcommand globalcommand return end"); 355 355 a[353] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/letsdraw.html", "letsdraw.pro", "", " file_comments It is the procedure launching the drawing If we do not give the command to it it call construitcommande to know what to trace categories param BASE in required The id of the widget where apply the drawing keyword COMMANDE type string A string of the style: read_data sst keyword _EXTRA Used to pass your keywords uses common pro history Sebastien Masson smasson lodyc jussieu fr version Id: letsdraw pro 163 2006 08 29 12:59:46Z navarro PRO letsdraw base COMMANDE commande _extra ex compile_opt idl2 strictarrsubs common we recuperate the uvalue of base widget_control base get_uvalue top_uvalue print help top_uvalue struct help top_uvalue exextra struct if NOT keyword_set commande then commande buildcmd base _extra ex if commande 0 EQ then return on recupere la uvalue de base widget_control base hourglass widget_control base get_uvalue top_uvalue print help top_uvalue struct print help top_uvalue exextra struct help top_uvalue extra struct print print commande help mixstru top_uvalue exextra top_uvalue extra struct we recuperate the id of the graphic associated to the widget of id base graphid extractatt top_uvalue graphid widget_control graphid get_value win We select it we will pass to it all commands concerning the window wset win erase 255 we clean the window We make sure that if we work with a screen coding colors on 24 bits the specified background color p background is the one applied if d n_colors gt 256 then begin device decomposed 1 p background ffffff x plot 0 0 device decomposed 0 ENDIF smallout long extractatt top_uvalue smallout numdessinout smallout 2 1 tracecadre smallout fill options extractatt top_uvalue options optionsflag extractatt top_uvalue optionsflag portrait strtrim optionsflag where options EQ Portrait Landscape 0 1 0 createpro common noerase 1 key_portrait portrait Commande filename myuniquetmpdir xxx_oneplot pro inserthistory base Commande beginning of strtrim smallout 2 1 end of strtrim smallout 2 1 top_uvalue 1 findline top_uvalue penvs numdessinout p top_uvalue 1 findline top_uvalue xenvs numdessinout x top_uvalue 1 findline top_uvalue yenvs numdessinout y return end"); 356 a[354] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html", "loadgrid.pro", "", " file_comments categories param MESHFILEIN keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: loadgrid pro 192 2006 09 22 09:37:08Z smasson todo seb PRO loadgrid meshfilein _extra ex compile_opt idl2 strictarrsubs cm_4mesh ccmeshparameters filename meshfilein split the name according to delimiter meshfile strsplit meshfilein extract meshfile strtrim meshfile 2 try to find a pro file with this name filepro find meshfile 0 firstfound onlypro 0 if this is an idl batch file or a procedure if filepro NE NOT FOUND THEN BEGIN CASE protype filepro OF this is a procedure proc :listing file_basename filepro pro this is a function this case is not coded func :stop this is an IDL batch file batch :listing file_basename filepro pro ENDCASE ENDIF ELSE BEGIN filenc find meshfile 0 firstfound onlync 0 if filenc EQ NOT FOUND THEN stop listing initncdf filenc ENDELSE add the arguments and keywords if necessary IF n_elements meshfile GT 1 AND strmid listing 0 1 NE THEN BEGIN FOR i 1 n_elements meshfile 1 DO BEGIN IF strpos meshfile i NE 1 THEN str isnumber meshfile i ELSE str createfunc n_elements meshfile i IF str EQ 0 THEN listing listing meshfile i ELSE listing listing meshfile i ENDFOR ENDIFIF strmid listing 0 1 NE THEN listing listing strcalling meshfilein _extra ex createpro listing filename myuniquetmpdir for_createpro pro _extra ex return END ");356 a[354] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html", "loadgrid.pro", "", " file_comments categories param MESHFILEIN keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: loadgrid pro 213 2007 02 16 11:29:17Z smasson todo seb PRO loadgrid meshfiletxtin _extra ex meshfilein strsed meshfiletxtin compile_opt idl2 strictarrsubs cm_4mesh ccmeshparameters filename meshfilein split the name according to delimiter meshfile strsplit meshfilein extract meshfile strtrim meshfile 2 try to find a pro file with this name filepro find meshfile 0 firstfound onlypro 0 if this is an idl batch file or a procedure if filepro NE NOT FOUND THEN BEGIN CASE protype filepro OF this is a procedure proc :listing file_basename filepro pro this is a function this case is not coded func :stop this is an IDL batch file batch :listing file_basename filepro pro ENDCASE ENDIF ELSE BEGIN filenc find meshfile 0 firstfound onlync 0 if filenc EQ NOT FOUND THEN stop listing initncdf filenc ENDELSE add the arguments and keywords if necessary IF n_elements meshfile GT 1 AND strmid listing 0 1 NE THEN listing listing strmid meshfilein strpos meshfilein meshfilein strsed meshfilein IF strmid listing 0 1 NE THEN listing listing strcalling meshfilein _extra ex createpro listing filename myuniquetmpdir for_createpro pro _extra ex return END "); 357 357 a[355] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/longclickaction.html", "longclickaction.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: longclickaction pro 154 2006 08 11 08:06:17Z smasson todo seb PRO longclickaction event compile_opt idl2 strictarrsubs widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue What is the selected drawing smallout extractatt top_uvalue smallout smallin extractatt top_uvalue smallin small smallin x convert_coord uval x 0 uval y 0 device to_normal 0 y convert_coord uval x 0 uval y 0 device to_normal 1 numcolonne n_elements where findgen small 0 small 0 lt x 1 numligne n_elements where findgen small 1 small 1 lt 1 y 1 numdessin numcolonne numligne small 0 we put on numdessin as the leader plot tracecadre smallin erase if total smallin EQ smallout EQ 3 then tracecadre smallout out smallin smallin 0:1 numdessin 1 top_uvalue 1 findline top_uvalue smallin smallin tracecadre smallin p extractatt top_uvalue penvs numdessin x extractatt top_uvalue xenvs numdessin y extractatt top_uvalue yenvs numdessin actionid widget_info event top find_by_uname action type widget_info actionid combobox_gettext Change the domain box: coor convert_coord uval x uval y device to_data x coor 0 0 coor 0 1 y coor 1 0 coor 1 1 domainid widget_info event top find_by_uname domain IF type EQ pltv THEN BEGIN currentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar vlstid widget_info event top find_by_uname varlist namevar widget_info vlstid combobox_gettext indexvar where listvar EQ namevar vargrid strupcase listgrid indexvar grille 1 glam gphi boxzoom glam x 0 y 0 glam x 1 y 1 gphi x 0 y 0 gphi x 1 y 1 ENDIF ELSE boxzoom x y Do we have to pass the boxzoom in indexes currentplot extractatt top_uvalue smallin 2 1 options extractatt top_uvalue options flags extractatt top_uvalue optionsflag flags flags currentplot changex flags where options EQ Longitude x index 0 EQ 1 changey flags where options EQ Latitude y index 0 EQ 1 if changex OR changey then begin We want to find the type of grid which is used currentfile extractatt top_uvalue currentfile listgrid extractatt top_uvalue fileparameters currentfile listgrid listvar extractatt top_uvalue fileparameters currentfile listvar vlstid widget_info event top find_by_uname varlist namevar widget_info vlstid combobox_gettext indexvar where listvar EQ namevar vargrid strupcase listgrid indexvar domdef boxzoom gridtype vargrid grille 1 1 1 1 nx ny nz firstx firsty firstz lastx lasty lastz if changex then boxzoom 0:1 firstx lastx if changey then boxzoom 2:3 firsty lasty endif widget_control domainid set_value boxzoom case uval press of 1:BEGIN nodates type EQ xt OR type EQ yt OR type EQ zt OR type EQ t updatewidget event top noboxzoom nodates nodates notype type NE plt letsdraw event top END 2:BEGIN IF type EQ plt THEN BEGIN top_uvalue 1 findline top_uvalue types smallout 2 1 pltz forcetype pltz ENDIF updatewidget event top noboxzoom letsdraw event top forcetype forcetype END 4:BEGIN IF type EQ plt THEN BEGIN top_uvalue 1 findline top_uvalue types smallout 2 1 pltt forcetype pltt ENDIF updatewidget event top noboxzoom nodates letsdraw event top forcetype forcetype END endcase return end"); 358 358 a[356] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/read_vermair.html", "read_vermair.pro", "", " file_comments categories param NAME param DEBUT param FIN param NOMEXP keyword PARENT same as DIALOG_PARENT de dialog_message pro keyword BOXZOOM Vector indicating the geographic zone on which we want to cut the map If BOXZOOM has : 1 element : The extraction is made on lon1 lon2 lat1 lat2 0 boxzoom 0 2 elements: The extraction is made on lon1 lon2 lat1 lat2 boxzoom 0 boxzoom 1 4 elements: The extraction is made on Boxzoom 0 max gdept gdepw 5 elements: The extraction is made on Boxzoom 0:3 0 Boxzoom 4 6 elements: The extraction is made on Boxzoom Where lon1 lon2 lat1 lat2 are global variables defined at the last domdef keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: read_vermair pro 150 2006 08 09 10:12:54Z navarro todo seb FUNCTION read_vermair name debut fin nomexp PARENT parent BOXZOOM boxzoom _EXTRA ex compile_opt idl2 strictarrsubs common if name EQ un then name vozocrtx if name EQ vn then name vomecrty if debut EQ fin then begin res lec name debut nomexp BOXZOOM boxzoom _EXTRA ex ENDIF ELSE res lect name debut fin nomexp BOXZOOM boxzoom _EXTRA ex return tab:res grille:vargrid unite: experience:varexp nom:varname end"); 359 359 a[357] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.html", "scanfile.pro", "", " file_comments categories param NAMEFILE keyword GRID keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: scanfile pro 199 2006 12 13 07:47:14Z smasson todo seb : I don t know what to do with that liste des presupposes: 1 le fichier a lire est un fichier netcdf 2 le nom de ce fichier finit par U nc V nc W nc T nc ou F nc la lettre avant le nc designant la grille a laquelle se rapporte la champ Si tel n est pas la cas le fichier est attribue a la grille T 3 ce fichier contient une dimension infinie qui doit etre celle qui se rapporte au temps et au mois 2 autres dimensions dont les noms sont x lon xi_ et y lat ou eta_ ou bien en majuscule 4 il doit exiter ds ce fichier une unique variable n ayant qu une dimension et etant la dimension temporelle cette variable sera prise comme axe des temps Rq: si plusieurs variables verifient ces criteres on considere la premiere variable 5 Cette variable axe des temps doit contenir l attribut units qui doit etre ecrit suivant la syntaxe: seconds since 0001 01 01 00:00:00 hours since 0001 01 01 00:00:00 days since 1979 01 01 00:59:59 months since 1979 01 01 00:59:59 years since 1979 01 01 00:59:59 je crois que c est tout GRID UTVWF to specify the type of grid Defaut is 1 based on the name of the file if the file ends by GRID _ TUVFW NC not case sensible or 2 T if case 1 is not found FUNCTION scanfile namefile GRID GRID _extra ex compile_opt idl2 strictarrsubs common res 1 filename fullname isafile filename namefile IODIRECTORY iodir _extra ex open file cdfid ncdf_open fullname What contains the file infile ncdf_inquire cdfid name of all dimensions namedim strarr infile ndims for dimiq 0 infile ndims 1 do begin ncdf_diminq cdfid dimiq tmpname value namedim dimiq strlowcase tmpname ENDFOR roms file dimidx where namedim EQ xi_rho OR namedim EQ xi_u OR namedim EQ xi_v OR namedim EQ xi_psi IF dimidx 0 EQ 1 THEN BEGIN we are looking for a x dimension with a name matching one of the following regular expression: testname longitude lon x longitude lon x longitude lon x cnt 1 ii 0 WHILE cnt NE 1 AND ii LT n_elements testname DO BEGIN dimidx where strmatch namedim testname ii EQ 1 cnt ii ii 1 ENDWHILE CASE cnt OF 0:begin dummy report none of the dimensions name matches one of the following regular expression: longitude lon x longitude lon x longitude lon x we cannot find the x dimension stop END 1:dimidx dimidx 0 ELSE:begin dummy report several and not one unique dimensions name matches the following regular expression: longitude lon x longitude lon x longitude lon x we cannot find the x dimension stop ENDELSE ENDCASE ENDIF roms file dimidy where namedim EQ eta_rho OR namedim EQ eta_u OR namedim EQ eta_v OR namedim EQ eta_psi IF dimidy 0 EQ 1 THEN BEGIN we are looking for a y dimension with a name matching one of the following regular expression: testname latitude lat y latitude lat y eta_ latitude lat y cnt 1 ii 0 WHILE cnt NE 1 AND ii LT n_elements testname DO BEGIN dimidy where strmatch namedim testname ii EQ 1 cnt ii ii 1 ENDWHILE CASE cnt OF 0:begin dummy report none of the dimensions name matches one of the following regular expression: latitude lat y latitude lat y eta_ latitude lat y we cannot find the y dimension stop END 1:dimidy dimidy 0 ELSE:begin dummy report several and not one unique dimensions name matches the following regular expression: latitude lat y latitude lat y eta_ latitude lat y we cannot find the x dimension stop ENDELSE ENDCASE ENDIF name of all variables we keep only the variables containing at least x y and time dimension if existing namevar strarr infile nvars for varid 0 infile nvars 1 do begin invar ncdf_varinq cdfid varid what contains the variable if inter invar dim dimidx 0 NE 1 AND inter invar dim dimidy 0 NE 1 AND where invar dim EQ infile recdim 0 NE 1 OR infile recdim EQ 1 THEN namevar varid invar name ENDFOR namevar namevar where namevar NE find vargrid for each selected variable listgrid strarr n_elements namevar default definitions IF keyword_set grid THEN vargrid strupcase grid ELSE vargrid T look for values of vargrid for each variable IF finite glamu 0 EQ 1 AND NOT keyword_set grid THEN BEGIN for each variable look if we in one of the case corresponding to ROMS conventions FOR i 0 n_elements namevar 1 do begin invar ncdf_varinq cdfid namevar i tmpnm namedim invar dim are we in one of the case corresponding to ROMS conventions CASE 1 OF tmpnm 2 jpt END invar natts EQ 0:BEGIN dummy report the variable invar name has no attribut C we create a fake calendar fakecal 1 time date0fk lindgen 1 jpt END ELSE:BEGIN we want to know which attributes are attached to the time variable attnames strarr invar natts for attiq 0 invar natts 1 do attnames attiq ncdf_attname cdfid varid attiq if where attnames EQ units 0 EQ 1 then BEGIN dummy report Attribut units not found for the variable invar name C we create a fake calendar fakecal 1 time date0fk lindgen 1 jpt ENDIF ELSE BEGIN we read the time axis ncdf_varget cdfid varid time time double time ncdf_attget cdfid varid units value time_counter:units seconds since 0001 01 01 00:00:00 time_counter:units hours since 0001 01 01 00:00:00 time_counter:units days since 1979 01 01 00:00:00 time_counter:units months since 1979 01 01 00:00:00 time_counter:units years since 1979 01 01 00:00:00 value strtrim strcompress string value 2 mots str_sep value unite mots 0 unite strlowcase unite IF strpos unite s strlen unite 1 NE 1 THEN unite strmid unite 0 strlen unite 1 IF strpos unite julian_ NE 1 THEN unite strmid unite 7 err 0 IF unite NE second AND unite NE hour AND unite NE day AND unite NE month AND unite NE year THEN BEGIN dummy report time units does not start with seconds hours days months years err 1 ENDIF IF stregex value since 0 9 1 4 0 9 1 2 0 9 1 2 boolean EQ 0 THEN BEGIN dummy report attribut units of time has not the good format: since 0 9 1 4 0 9 1 2 0 9 1 2 err 1 ENDIF IF err GT 0 THEN BEGIN fakecal 1 time date0fk lindgen 1 jpt ENDIF ELSE BEGIN debut str_sep mots 2 now we try to find the attribut called calendar the the attribute calendar exists If no we suppose that the calendar is gregorian calendar if where attnames EQ calendar 0 NE 1 then BEGIN ncdf_attget cdfid varid calendar value value string value CASE value OF noleap :key_caltype noleap 360d :key_caltype 360d greg :IF n_elements key_caltype EQ 0 THEN key_caltype greg ELSE:BEGIN notused report Unknown calendar: value we use greg calendar key_caltype greg END ENDCASE ENDIF ELSE BEGIN notused report Unknown calendar we use key_caltype calendar IF n_elements key_caltype EQ 0 THEN key_caltype greg ENDELSE BEWARE we have to get back the calendar attribute and ajust time by consequence We pass time in IDL julian days case unite of second :time julday debut 1 debut 2 debut 0 time 86400 d hour :time julday debut 1 debut 2 debut 0 time 24 d day :time julday debut 1 debut 2 debut 0 time month :BEGIN if total fix time NE time NE 0 then we switch to days with 30d m time julday debut 1 debut 2 debut 0 round time 30 ELSE for t 0 n_elements time 1 DO time t julday debut 1 time t debut 2 debut 0 END year :BEGIN if total fix time NE time NE 0 then we switch to days with 365d y time julday debut 1 debut 2 debut 0 round time 365 ELSE for t 0 n_elements time 1 do time t julday debut 1 debut 2 debut 0 time t END ENDCASE high frequency calendar: more than one element per day IF max histogram long time time 0 GT 1 THEN fakecal 1 ELSE fakecal 0 date0fk date2jul 19000101 IF keyword_set fakecal THEN time date0fk lindgen 1 jpt ELSE time long time ENDELSE ENDELSE END ENDCASE ENDELSE ncdf_close cdfid return filename:fullname time_counter:time listvar:namevar listgrid:strupcase listgrid caltype:key_caltype fakecal:date0fk fakecal end"); 360 a[358] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.html", "selectfile.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: selectfile pro 2 02 2007 01 12 11:00:06Z smasson todo seb: documenter EVENT PRO selectfile_event event compile_opt idl2 strictarrsubs common widget_control event id get_uvalue eventuvalue default definition of messenger when selectfile_event is called directly without calling xmanager widget_control event handler get_uvalue messenger messenger 1 IF chkstru eventuvalue name EQ 0 THEN return case eventuvalue name of cancel button Global Cancel :BEGIN widget_control event handler get_uvalue messenger messenger 1 widget_control event handler destroy END data file informations datafilename :BEGIN widget_control event id get_value filename filename isafile filename filename 0 onlync iodirectory iodir title data file name tryfind fully_qualify_path if size filename type NE 7 then BEGIN widget_control event id set_value return ENDIF widget_control event id set_value filename END browse datafilename :BEGIN filename isafile onlync title data file name tryfind fully_qualify_path iodirectory iodir if size filename type NE 7 then return widget_control widget_info event handler find_by_uname datafilename set_value filename END switch automatic by and mesh definition buttons gridload :BEGIN IF event select EQ 1 THEN BEGIN widget_control widget_info event handler find_by_uname argtxt set_value widget_control widget_info event handler find_by_uname kwdtxt set_value widget_control widget_info event handler find_by_uname kwd base sensitive 1 CASE event value OF via initnetcdf :BEGIN widget_control widget_info event handler find_by_uname meshload set_value initncdf editable 0 widget_control widget_info event handler find_by_uname arg base sensitive 0 widget_control widget_info event handler find_by_uname kwdlab set_value initncdf keywords: END via perso :BEGIN widget_control widget_info event handler find_by_uname meshload set_value editable 1 widget_control widget_info event handler find_by_uname arg base sensitive 1 widget_control widget_info event handler find_by_uname kwdlab set_value keywords of IDL procedure: END ENDCASE ENDIF END name of the procedure or batch file meshload :BEGIN widget_control event id get_value filename filename find filename 0 onlypro firstfound 0 if filename EQ NOT FOUND then begin widget_control event id set_value return endif CASE protype filename OF this is a procedure proc :BEGIN widget_control widget_info event handler find_by_uname arg base sensitive 1 widget_control widget_info event handler find_by_uname kwd base sensitive 1 widget_control widget_info event handler find_by_uname kwdlab set_value file_basename filename pro keywords: END this is a function this case is not accepted func :BEGIN widget_control event id set_value return END this is an IDL batch file batch :BEGIN widget_control widget_info event handler find_by_uname arg base sensitive 0 widget_control widget_info event handler find_by_uname kwd base sensitive 0 widget_control widget_info event handler find_by_uname kwdlab set_value no keywords: END ENDCASE widget_control widget_info event handler find_by_uname argtxt set_value widget_control widget_info event handler find_by_uname kwdtxt set_value widget_control event id set_value file_basename filename pro END browse meshload :BEGIN filename isafile iodir homedir onlypro title to load the grid file if size filename type NE 7 then return meshload_id widget_info event handler find_by_uname meshload widget_control meshload_id set_value filename selectfile_event ID:meshload_id TOP:event top HANDLER:event handler END Lets Go button Lets Go :BEGIN widget_control widget_info event handler find_by_uname datafilename get_value datafilename datafilename datafilename 0 IF datafilename EQ THEN return datafilename isafile filename datafilename tryfind onlync title data file name fully_qualify_path if size datafilename type NE 7 then BEGIN widget_control widget_info event handler find_by_uname datafilename set_value return ENDIF widget_control widget_info event handler find_by_uname gridload get_value gridload widget_control widget_info event handler find_by_uname argtxt get_value argtxt argtxt strtrim argtxt 0 2 IF strpos argtxt EQ 0 THEN argtxt strmid argtxt 1 widget_control widget_info event handler find_by_uname kwdtxt get_value kwdtxt kwdtxt strtrim kwdtxt 0 2 IF strpos kwdtxt EQ 0 THEN kwdtxt strmid kwdtxt 1 CASE gridload 0 OF via perso :BEGIN meshload_id widget_info event handler find_by_uname meshload widget_control meshload_id get_value meshload meshload meshload 0 IF meshload EQ THEN return meshload find meshload 0 onlypro firstfound 0 if meshload EQ NOT FOUND then begin widget_control meshload_id set_value return endif END via initnetcdf :meshload datafilename ENDCASE IF strlen argtxt NE 0 THEN meshload meshload argtxt IF strlen kwdtxt NE 0 THEN meshload meshload kwdtxt widget_control event handler get_uvalue messenger messenger create_struct datafilename datafilename meshload meshload widget_control event handler destroy END endcase return end file_comments categories param DATAFILENAME param IDLFILE param ARGSPRO keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: selectfile pro 202 2007 01 12 11:00:06Z smasson todo seb: documenter les params FUNCTION selectfile datafilename idlfile argspro _extra ex compile_opt idl2 strictarrsubs common We create a pointer in the uvalue to recuperate answers at setted questions atthe time of the use of this widget So when the widget is deleted in the procedure event pro the variable on which the pointer pointed contained in the uvalue of the widget is not deleted and we can recuperate the result messenger ptr_new allocate_heap base widget_base column title selectfile align_center uvalue messenger _EXTRA ex cancel button dummyid widget_button base value Cancel uvalue name: Global Cancel data file informations basea widget_base base row align_center dummyid widget_label basea value Data file name: database widget_text basea value uvalue name: datafilename uname datafilename xsize 45 EDITABLE dummyid widget_button basea value Browse uvalue name: browse datafilename switch automatic by and mesh definition buttons baseb widget_base base row align_center gdldid cw_bgroup baseb automatic grid construction with initncdf pro grid construction with other IDL batch or procedure exclusive set_value 0 uvalue name: gridload uname gridload button_uvalue via initnetcdf via perso name of the procedure or batch file basec widget_base base row align_center uname pro base dummyid widget_label basec value IDL batch file of procedure basemeshload widget_text basec value initncdf uvalue name: meshload uname meshload xsize 45 editable 0 dummyid widget_button basec value Browse uvalue name: browse meshload arguments informations based widget_base base row align_center uname arg base sensitive 0 dummyid widget_label based value procedure arguments argbase widget_text based value uvalue name: argtxt uname argtxt xsize 45 EDITABLE keyword informations basee widget_base base row align_center uname kwd base dummyid widget_label basee uname kwdlab value keywords of initncdf: dummyid widget_text basee value uvalue name: kwdtxt uname kwdtxt xsize 45 EDITABLE Lets Go button basego widget_button base value Lets Go uvalue name: Lets Go IF n_elements datafilename NE 0 THEN BEGIN widget_control database set_value datafilename selectfile_event ID:database TOP:base HANDLER:base ENDIF IF n_elements idlfile NE 0 THEN BEGIN widget_control basemeshload set_value idlfile selectfile_event ID:basemeshload TOP:base HANDLER:base widget_control basemeshload get_value idlfile2 IF idlfile2 0 NE THEN widget_control gdldid set_value 1 ENDIF IF n_elements argspro NE 0 THEN widget_control argbase set_value argspro IF n_elements datafilename EQ 0 THEN BEGIN widget_control base realize xmanager selectfile base event_handler selectfile_event no_block 0 ENDIF ELSE selectfile_event ID:basego TOP:base HANDLER:base get back the information from selectfile_event res messenger ptr_free messenger if size res type NE 8 then return 1 loadgrid res meshload _extra ex ccreadparameters funclec_name: read_ncdf jpidta:jpidta jpjdta:jpjdta jpkdta:jpkdta ixmindta:ixmindta ixmaxdta:ixmaxdta iymindta:iymindta iymaxdta:iymaxdta izmindta:izmindta izmaxdta:izmaxdta res3 scanfile res datafilename _extra ex if size res3 type NE 8 then return 1 return fileparameters:res3 readparameters:ccreadparameters meshparameters:ccmeshparameters end");360 a[358] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.html", "selectfile.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: selectfile pro 213 2007 02 16 11:29:17Z smasson todo seb: documenter EVENT PRO selectfile_event event compile_opt idl2 strictarrsubs common widget_control event id get_uvalue eventuvalue default definition of messenger when selectfile_event is called directly without calling xmanager widget_control event handler get_uvalue messenger messenger 1 IF chkstru eventuvalue name EQ 0 THEN return case eventuvalue name of cancel button Global Cancel :BEGIN widget_control event handler get_uvalue messenger messenger 1 widget_control event handler destroy END data file informations datafilename :BEGIN widget_control event id get_value filename filename isafile filename filename 0 onlync iodirectory iodir title data file name tryfind fully_qualify_path if size filename type NE 7 then BEGIN widget_control event id set_value return ENDIF widget_control event id set_value filename END browse datafilename :BEGIN filename isafile onlync title data file name tryfind fully_qualify_path iodirectory iodir if size filename type NE 7 then return widget_control widget_info event handler find_by_uname datafilename set_value filename END switch automatic by and mesh definition buttons gridload :BEGIN IF event select EQ 1 THEN BEGIN widget_control widget_info event handler find_by_uname argtxt set_value widget_control widget_info event handler find_by_uname kwdtxt set_value widget_control widget_info event handler find_by_uname kwd base sensitive 1 CASE event value OF via initnetcdf :BEGIN widget_control widget_info event handler find_by_uname meshload set_value initncdf editable 0 widget_control widget_info event handler find_by_uname arg base sensitive 0 widget_control widget_info event handler find_by_uname kwdlab set_value initncdf keywords: END via perso :BEGIN widget_control widget_info event handler find_by_uname meshload set_value editable 1 widget_control widget_info event handler find_by_uname arg base sensitive 1 widget_control widget_info event handler find_by_uname kwdlab set_value keywords of IDL procedure: END ENDCASE ENDIF END name of the procedure or batch file meshload :BEGIN widget_control event id get_value filename filename find filename 0 onlypro firstfound 0 if filename EQ NOT FOUND then begin widget_control event id set_value return endif CASE protype filename OF this is a procedure proc :BEGIN widget_control widget_info event handler find_by_uname arg base sensitive 1 widget_control widget_info event handler find_by_uname kwd base sensitive 1 widget_control widget_info event handler find_by_uname kwdlab set_value file_basename filename pro keywords: END this is a function this case is not accepted func :BEGIN widget_control event id set_value return END this is an IDL batch file batch :BEGIN widget_control widget_info event handler find_by_uname arg base sensitive 0 widget_control widget_info event handler find_by_uname kwd base sensitive 0 widget_control widget_info event handler find_by_uname kwdlab set_value no keywords: END ENDCASE widget_control widget_info event handler find_by_uname argtxt set_value widget_control widget_info event handler find_by_uname kwdtxt set_value widget_control event id set_value file_basename filename pro END browse meshload :BEGIN filename isafile iodir homedir onlypro title to load the grid file if size filename type NE 7 then return meshload_id widget_info event handler find_by_uname meshload widget_control meshload_id set_value filename selectfile_event ID:meshload_id TOP:event top HANDLER:event handler END Lets Go button Lets Go :BEGIN widget_control widget_info event handler find_by_uname datafilename get_value datafilename datafilename datafilename 0 IF datafilename EQ THEN return datafilename isafile filename datafilename tryfind onlync title data file name fully_qualify_path if size datafilename type NE 7 then BEGIN widget_control widget_info event handler find_by_uname datafilename set_value return ENDIF widget_control widget_info event handler find_by_uname gridload get_value gridload widget_control widget_info event handler find_by_uname argtxt get_value argtxt argtxt strtrim argtxt 0 2 IF strpos argtxt EQ 0 THEN argtxt strmid argtxt 1 widget_control widget_info event handler find_by_uname kwdtxt get_value kwdtxt kwdtxt strtrim kwdtxt 0 2 IF strpos kwdtxt EQ 0 THEN kwdtxt strmid kwdtxt 1 CASE gridload 0 OF via perso :BEGIN meshload_id widget_info event handler find_by_uname meshload widget_control meshload_id get_value meshload meshload meshload 0 IF meshload EQ THEN return meshload find meshload 0 onlypro firstfound 0 if meshload EQ NOT FOUND then begin widget_control meshload_id set_value return endif END via initnetcdf :meshload datafilename ENDCASE IF strlen argtxt NE 0 THEN meshload meshload argtxt IF strlen kwdtxt NE 0 THEN meshload meshload kwdtxt widget_control event handler get_uvalue messenger messenger create_struct datafilename datafilename meshload meshload widget_control event handler destroy END ELSE: endcase return end file_comments categories param DATAFILENAME param IDLFILE param ARGSPRO keyword _EXTRA Used to pass your keywords returns uses restrictions examples history version Id: selectfile pro 213 2007 02 16 11:29:17Z smasson todo seb: documenter les params FUNCTION selectfile datafilename idlfile argspro _extra ex compile_opt idl2 strictarrsubs common We create a pointer in the uvalue to recuperate answers at setted questions atthe time of the use of this widget So when the widget is deleted in the procedure event pro the variable on which the pointer pointed contained in the uvalue of the widget is not deleted and we can recuperate the result messenger ptr_new allocate_heap base widget_base column title selectfile align_center uvalue messenger _EXTRA ex cancel button dummyid widget_button base value Cancel uvalue name: Global Cancel data file informations basea widget_base base row align_center dummyid widget_label basea value Data file name: database widget_text basea value uvalue name: datafilename uname datafilename xsize 45 EDITABLE dummyid widget_button basea value Browse uvalue name: browse datafilename switch automatic by and mesh definition buttons baseb widget_base base row align_center gdldid cw_bgroup baseb automatic grid construction with initncdf pro grid construction with other IDL batch or procedure exclusive set_value 0 uvalue name: gridload uname gridload button_uvalue via initnetcdf via perso name of the procedure or batch file basec widget_base base row align_center uname pro base dummyid widget_label basec value IDL batch file of procedure basemeshload widget_text basec value initncdf uvalue name: meshload uname meshload xsize 45 editable 0 dummyid widget_button basec value Browse uvalue name: browse meshload arguments informations based widget_base base row align_center uname arg base sensitive 0 dummyid widget_label based value procedure arguments argbase widget_text based value uvalue name: argtxt uname argtxt xsize 45 EDITABLE keyword informations basee widget_base base row align_center uname kwd base dummyid widget_label basee uname kwdlab value keywords of initncdf: dummyid widget_text basee value uvalue name: kwdtxt uname kwdtxt xsize 45 EDITABLE Lets Go button basego widget_button base value Lets Go uvalue name: Lets Go IF n_elements datafilename NE 0 THEN BEGIN widget_control database set_value datafilename selectfile_event ID:database TOP:base HANDLER:base ENDIF IF n_elements idlfile NE 0 THEN BEGIN widget_control basemeshload set_value idlfile selectfile_event ID:basemeshload TOP:base HANDLER:base widget_control basemeshload get_value idlfile2 IF idlfile2 0 NE THEN widget_control gdldid set_value 1 ENDIF IF n_elements argspro NE 0 THEN widget_control argbase set_value argspro IF n_elements datafilename EQ 0 THEN BEGIN widget_control base realize xmanager selectfile base event_handler selectfile_event no_block 0 ENDIF ELSE selectfile_event ID:basego TOP:base HANDLER:base get back the information from selectfile_event res messenger ptr_free messenger if size res type NE 8 then return 1 loadgrid res meshload _extra ex ccreadparameters funclec_name: read_ncdf jpidta:jpidta jpjdta:jpjdta jpkdta:jpkdta ixmindta:ixmindta ixmaxdta:ixmaxdta iymindta:iymindta iymaxdta:iymaxdta izmindta:izmindta izmaxdta:izmaxdta res3 scanfile res datafilename _extra ex if size res3 type NE 8 then return 1 return fileparameters:res3 readparameters:ccreadparameters meshparameters:ccmeshparameters end"); 361 361 a[359] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/singleclickaction.html", "singleclickaction.pro", "", " file_comments categories param EVENT returns uses restrictions examples history version Id: singleclickaction pro 150 2006 08 09 10:12:54Z navarro todo seb PRO singleclickaction event compile_opt idl2 strictarrsubs cm_4mesh cm_4data return widget_control event id get_uvalue uval widget_control event top get_uvalue top_uvalue actionid widget_info event top find_by_uname action type widget_info actionid combobox_gettext IF type NE plt THEN return We activate the right window widget_control event id get_value win wset win choice of the type of action case uval press of 1:BEGIN coor convert_coord uval x 0 uval y 0 device to_data x coor 0 y coor 1 help x y oldgrid vargrid CASE strupcase vargrid OF T :vargrid F W :vargrid F U :vargrid V V :vargrid U F :vargrid T ENDCASE grille 1 glam gphi 1 nx ny nz firstx firsty firstz lastx lasty lastz vargrid oldgrid define the corner of the cells in the clockwise direction IF keyword_set key_periodic AND nx EQ jpi THEN BEGIN x1 glam 0:ny 2 y1 gphi 0:ny 2 x2 glam 1:ny 1 y2 gphi 1:ny 1 x3 shift glam 1:ny 1 1 0 y3 shift gphi 1:ny 1 1 0 x4 shift glam 0:ny 2 1 0 y4 shift gphi 0:ny 2 1 0 ENDIF ELSE BEGIN x1 glam 0:nx 2 0:ny 2 y1 gphi 0:nx 2 0:ny 2 x2 glam 0:nx 2 1:ny 1 y2 gphi 0:nx 2 1:ny 1 x3 glam 1:nx 1 1:ny 1 y3 gphi 1:nx 1 1:ny 1 x4 glam 1:nx 1 0:ny 2 y4 gphi 1:nx 1 0:ny 2 ENDELSE glam 1 free memory gphi 1 free memory What is the longitude WHILE x GT x range 1 DO x x 360 WHILE x LT x range 0 DO x x 360 IF x GT x range 1 THEN RETURN IF y GT y range 1 THEN RETURN IF y LT y range 0 THEN RETURN cell inquad x y x1 y1 x2 y2 x3 y3 x4 y4 onsphere key_onearth x1 1 free memory y1 1 free memory x2 1 free memory y2 1 free memory x3 1 free memory y3 1 free memory x4 1 free memory y4 1 free memory IF cell 0 EQ 1 OR n_elements cell GT 1 THEN RETURN yy cell 0 nx 1 key_periodic nx EQ jpi xx cell 0 MOD nx 1 key_periodic nx EQ jpi CASE strupcase vargrid OF T :BEGIN xx xx firstx 1 yy yy firsty 1 END W :BEGIN xx xx firstx 1 yy yy firsty 1 END U :BEGIN xx xx firstx yy yy firsty 1 END V :BEGIN xx xx firstx 1 yy yy firsty END F :BEGIN xx xx firstx yy yy firsty END ENDCASE bad where xx GE jpi IF bad 0 NE 1 THEN BEGIN xx bad xx bad jpi yy bad yy bad 1 ENDIF bad where yy GE jpj IF bad 0 NE 1 THEN stop print glamt xx yy gphit xx yy cmd buildcmd event top boxzoom boxzoom END ELSE: endcase RETURN end"); 362 362 a[360] = new Array("./ToBeReviewed/WIDGET/AUTOUR_de_XXX/tracecadre.html", "tracecadre.pro", "", " file_comments categories param SMALL keyword OUT keyword ERASE keyword FILL returns uses restrictions examples history version Id: tracecadre pro 150 2006 08 09 10:12:54Z navarro todo seb PRO tracecadre small out out erase erase fill fill determination of the column and of the line corresponding in input to small compile_opt idl2 strictarrsubs numdessin small 2 1 numligne numdessin small 0 numcolonne numdessin numligne small 0 determination of poscadre largeurcolonne 1 small 0 largeurligne 1 small 1 cadre numcolonne largeurcolonne 1 numligne 1 largeurligne numcolonne 1 largeurcolonne 1 numligne largeurligne decale 0 001 cadre cadre decale decale decale decale reinitplt p position 0 0 1 1 IF keyword_set fill then begin polyfill cadre 0 cadre 2 cadre 2 cadre 0 cadre 0 cadre 1 cadre 1 cadre 3 cadre 3 cadre 1 color 255 normal ENDIF ELSE BEGIN plot cadre 0 cadre 2 cadre 2 cadre 0 cadre 0 cadre 1 cadre 1 cadre 3 cadre 3 cadre 1 xrange 0 1 yrange 0 1 linestyle 2 keyword_set out noerase normal thick 2 color 0 255 keyword_set erase ENDELSE return end"); -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/.idlwave_catalog
r76 r214 19 19 ("inserthistory" pro nil (lib "inserthistory.pro" nil "saxo") "%s, base, text, line1, line2" (nil)) 20 20 ("letsdraw" pro nil (lib "letsdraw.pro" nil "saxo") "%s, base" (nil ("_extra") ("COMMANDE"))) 21 ("loadgrid" pro nil (lib "loadgrid.pro" nil "saxo") "%s, meshfile in" (nil ("_extra")))21 ("loadgrid" pro nil (lib "loadgrid.pro" nil "saxo") "%s, meshfiletxtin" (nil ("_extra"))) 22 22 ("longclickaction" pro nil (lib "longclickaction.pro" nil "saxo") "%s, event" (nil)) 23 23 ("read_vermair" fun nil (lib "read_vermair.pro" nil "saxo") "Result = %s(name, debut, fin, nomexp)" (nil ("_EXTRA") ("BOXZOOM") ("PARENT")))
Note: See TracChangeset
for help on using the changeset viewer.