Changeset 103 for trunk/SRC/Documentation/idldoc_html_output/search.js
- Timestamp:
- 06/12/06 14:12:53 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/idldoc_html_output/search.js
r102 r103 21 21 a[19] = new Array("./ForOldVersion/updatenew.html", "updatenew.pro", "", ""); 22 22 a[20] = new Array("./ForOldVersion/updateold.html", "updateold.pro", "", ""); 23 a[21] = new Array("./Grid/computegrid.html", "computegrid.pro", "", " NAME:computegrid PURPOSE:compute the grid parameters from cm_4mesh common: horizontal parameters: glam tf gphi tf e1t and e2t and if FULLCGRID keyword is defined: glam uv gphi uv e1 uvf and e2 uvf verticals parameters: gdep tw e3 tw masks: tmask and if FULLCGRID keyword is defined: uv maskred fmaskred xy triangulation: triangles_list key_ parameters: key_shift key_periodic key_zreverse key_yreverse key_stride key_onearth key_partialstep CATEGORY:grid CALLING SEQUENCE: computegrid startx starty stepx stepy nx ny computegrid startx starty stepx stepy computegrid xaxis xaxis yaxis yaxis or a suitable mix INPUTS: startx:scalar x starting point starty:scalar y starting point stepx:scalar or vector: x direction step must be 0 if vector nx is not used stepy:scalar or vector: y direction step could be 0 south to north or lon1 and lon2 lon1 le 360 key_shift will be defined automaticaly computed according to glamboundary by using the FIRST LINE of glamt but key_shift will 0 only if key_periodic 1 MASK: to specify the mask with a 2 or 3 dimension array ONEARTH 0 or 1: to force the manual definition of key_onearth to specify if the data are on earth use longitude latitude etc By default key_onearth 1 note that ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY PERIODIC 0 or 1: to force the manual definition of key_periodic By default key_periodic is automaticaly computed by using the first line of glamt PLAIN: 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 SHIFT scalar to force the manual definition of key_shift By debault key_shift is automaticaly computed according to glamboundary when defined by using the FIRST LINE of glamt if key_periodic 0 then in any case key_shift 0 STRCALLING: a string containing the calling command used to call computegrid this is used by xxx pro STRIDE : a 3 elements vector to specify the stride in x y z direction Default definition is 1 1 1 The resulting value will be stored in the common cm_4mesh variable key_stride XAXIS: to specify longitude1 with a 1 or 2 dimension array 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 YAXIS: to specify latitudes with a 1 or 2 dimension array 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 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 XYZ MINMESH: to define the common variables i xyz minmesh used to define the grid only in a zoomed part of the original grid Defaut values are 0L max value is XYZ MAXMESH XYZ MAXMESH: to define the common variables i xyz maxmesh used to define the grid only in a zoomed part of the original grid Defaut values are jp ijk glo 1 max value is jp ijk glo 1 if XYZ MAXMESH is negative then we define i xyz maxmesh as jp ijk glo 1 XYZ MAXMESH instead of XYZ MAXMESH ZAXIS: to specify the vertical axis with a 1 dimension array Must be sorted in the increasing or deceasing order OUTPUTS: COMMON BLOCKS: cm_4mesh cm_4data cm_4cal SIDE EFFECTS: 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 EXAMPLE: MODIFICATION 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 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 FBASE2TBASE fbase2tbase STRCALLING strcalling _extra ex 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 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 iymaxmesh iymaxmesh keyword_set fbase2tbase 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 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 defaut mask eq 1 if NOT keyword_set mask then mask 1 if mask 0 NE 1 then BEGIN tmask byte mask 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 FBASE2TBASE fbase2tbase STRCALLING strcalling _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 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 ");24 a[22] = new Array("./Grid/micromeshmask.html", "micromeshmask.pro", "", " NAME: micromeshmask pro PURPOSE: reduce the size of the NetCDF meshmask created by OPA by using bit and not byte format for the masks and the foat format for the other fields CATEGORY:for OPA meshmask files CALLING SEQUENCE: reducencmeshmask ncfilein ncfileout INPUTS: ncfilein: 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 ncfileout: the name of the uniq reduced meshmask file default definition is micromeshmask nc KEYWORD PARAMETERSSAT: IODIR:to define the files path OUTPUTS: no COMMON BLOCKS: no EXAMPLE: IDL meshdir d1fes2 raid2 smasson DATA ORCA05 IDL micromeshmask meshmask_ORCA_R05 nc iodir meshdir MODIFICATION HISTORY: July 2004 Sebastien Masson smasson lodyc jussieu fr PRO ncdf_transfer inid outid inname outname IF n_elements outname EQ 0 THEN outname inname ncdf_varget inid inname zzz ncdf_varput outid outname float reform zzz over RETURN ENDPRO micromeshmask ncfilein ncfileout IODIR iodir 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 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");25 a[23] = new Array("./Grid/n128gaussian.html", "n128gaussian.pro", "", " NAME:n128gaussian PURPOSE:compute the latitudes of the n128 gaussian grid See: http: www ecmwf int products data technical gaussian n128FIS html CATEGORY:grid CALLING SEQUENCE:lat n128gaussian INPUTS:None KEYWORD PARAMETERS:None OUTPUTS:a 1d array COMMON BLOCKS:None SIDE EFFECTS:None RESTRICTIONS:None EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2004 FUNCTION n128gaussian 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");26 a[24] = new Array("./Grid/n160gaussian.html", "n160gaussian.pro", "", " NAME:n160gaussian PURPOSE:compute the latitudes of the n160 gaussian grid See: http: www ecmwf int products data technical gaussian n160FIS html CATEGORY:grid CALLING SEQUENCE:lat n160gaussian INPUTS:None KEYWORD PARAMETERS:None OUTPUTS:a 1d array COMMON BLOCKS:None SIDE EFFECTS:None RESTRICTIONS:None EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2004 FUNCTION n160gaussian latitude reduced regular latitude number points points n160 1 18 640 89 57009 2 25 640 89 01318 3 36 640 88 45297 4 40 640 87 89203 5 45 640 87 33080 6 50 640 86 76944 7 60 640 86 20800 8 64 640 85 64651 9 72 640 85 08499 10 72 640 84 52345 11 80 640 83 96190 12 90 640 83 40033 13 90 640 82 83876 14 96 640 82 27718 15 108 640 81 71559 16 120 640 81 15400 17 120 640 80 59240 18 125 640 80 03080 19 128 640 79 46920 20 135 640 78 90760 21 144 640 78 34600 22 150 640 77 78439 23 160 640 77 22278 24 160 640 76 66117 25 180 640 76 09956 26 180 640 75 53795 27 180 640 74 97634 28 192 640 74 41473 29 192 640 73 85311 30 200 640 73 29150 31 216 640 72 72988 32 216 640 72 16827 33 225 640 71 60665 34 225 640 71 04504 35 240 640 70 48342 36 240 640 69 92181 37 243 640 69 36019 38 250 640 68 79857 39 256 640 68 23695 40 270 640 67 67534 41 270 640 67 11372 42 288 640 66 55210 43 288 640 65 99048 44 288 640 65 42886 45 300 640 64 86725 46 300 640 64 30563 47 320 640 63 74401 48 320 640 63 18239 49 320 640 62 62077 50 320 640 62 05915 51 324 640 61 49753 52 360 640 60 93591 53 360 640 60 37429 54 360 640 59 81267 55 360 640 59 25105 56 360 640 58 68943 57 360 640 58 12781 58 375 640 57 56619 59 375 640 57 00457 60 375 640 56 44295 61 384 640 55 88133 62 384 640 55 31971 63 400 640 54 75809 64 400 640 54 19647 65 400 640 53 63485 66 405 640 53 07323 67 432 640 52 51161 68 432 640 51 94999 69 432 640 51 38837 70 432 640 50 82675 71 432 640 50 26513 72 450 640 49 70351 73 450 640 49 14189 74 450 640 48 58026 75 450 640 48 01864 76 480 640 47 45702 77 480 640 46 89540 78 480 640 46 33378 79 480 640 45 77216 80 480 640 45 21054 n160 n160 81 480 640 44 64892 82 480 640 44 08730 83 500 640 43 52567 84 500 640 42 96405 85 500 640 42 40243 86 500 640 41 84081 87 500 640 41 27919 88 512 640 40 71757 89 512 640 40 15595 90 540 640 39 59433 91 540 640 39 03270 92 540 640 38 47108 93 540 640 37 90946 94 540 640 37 34784 95 540 640 36 78622 96 540 640 36 22460 97 540 640 35 66298 98 576 640 35 10136 99 576 640 34 53973 100 576 640 33 97811 101 576 640 33 41649 102 576 640 32 85487 103 576 640 32 29325 104 576 640 31 73163 105 576 640 31 17000 106 576 640 30 60838 107 576 640 30 04676 108 600 640 29 48514 109 600 640 28 92352 110 600 640 28 36190 111 600 640 27 80028 112 600 640 27 23865 113 600 640 26 67703 114 600 640 26 11541 115 600 640 25 55379 116 600 640 24 99217 117 640 640 24 43055 118 640 640 23 86892 119 640 640 23 30730 120 640 640 22 74568 121 640 640 22 18406 122 640 640 21 62244 123 640 640 21 06082 124 640 640 20 49919 125 640 640 19 93757 126 640 640 19 37595 127 640 640 18 81433 128 640 640 18 25271 129 640 640 17 69109 130 640 640 17 12946 131 640 640 16 56784 132 640 640 16 00622 133 640 640 15 44460 134 640 640 14 88298 135 640 640 14 32136 136 640 640 13 75973 137 640 640 13 19811 138 640 640 12 63649 139 640 640 12 07487 140 640 640 11 51325 141 640 640 10 95162 142 640 640 10 39000 143 640 640 9 82838 144 640 640 9 26676 145 640 640 8 70514 146 640 640 8 14352 147 640 640 7 58189 148 640 640 7 02027 149 640 640 6 45865 150 640 640 5 89703 151 640 640 5 33541 152 640 640 4 77379 153 640 640 4 21216 154 640 640 3 65054 155 640 640 3 08892 156 640 640 2 52730 157 640 640 1 96568 158 640 640 1 40405 159 640 640 0 84243 160 640 640 0 28081 n160 reform n160 4 160 over n160 reform n160 3 over n160 n160 reverse n160 return n160 end");27 a[25] = new Array("./Grid/n256gaussian.html", "n256gaussian.pro", "", " NAME:n256gaussian PURPOSE:compute the latitudes of the n256 gaussian grid See: http: www ecmwf int products data technical gaussian n256FIS html CATEGORY:grid CALLING SEQUENCE:lat n256gaussian INPUTS:None KEYWORD PARAMETERS:None OUTPUTS:a 1d array COMMON BLOCKS:None SIDE EFFECTS:None RESTRICTIONS:None EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2004 FUNCTION n256gaussian latitude reduced regular latitude number points points n256 1 18 1024 89 73115 2 25 1024 89 38287 3 32 1024 89 03254 4 40 1024 88 68175 5 45 1024 88 33077 6 50 1024 87 97972 7 60 1024 87 62861 8 64 1024 87 27748 9 72 1024 86 92632 10 72 1024 86 57515 11 75 1024 86 22398 12 81 1024 85 87279 13 90 1024 85 52160 14 96 1024 85 17041 15 100 1024 84 81921 16 108 1024 84 46801 17 120 1024 84 11681 18 120 1024 83 76560 19 125 1024 83 41440 20 135 1024 83 06319 21 144 1024 82 71198 22 150 1024 82 36077 23 160 1024 82 00956 24 160 1024 81 65835 25 180 1024 81 30714 26 180 1024 80 95593 27 180 1024 80 60471 28 192 1024 80 25350 29 192 1024 79 90229 30 200 1024 79 55107 31 216 1024 79 19986 32 216 1024 78 84864 33 216 1024 78 49743 34 225 1024 78 14621 35 240 1024 77 79500 36 240 1024 77 44378 37 243 1024 77 09256 38 250 1024 76 74135 39 256 1024 76 39013 40 270 1024 76 03891 41 270 1024 75 68770 42 288 1024 75 33648 43 288 1024 74 98526 44 288 1024 74 63405 45 300 1024 74 28283 46 300 1024 73 93161 47 320 1024 73 58040 48 320 1024 73 22918 49 320 1024 72 87796 50 324 1024 72 52674 51 360 1024 72 17552 52 360 1024 71 82431 53 360 1024 71 47309 54 360 1024 71 12187 55 360 1024 70 77065 56 360 1024 70 41944 57 375 1024 70 06822 58 375 1024 69 71700 59 384 1024 69 36578 60 384 1024 69 01456 61 400 1024 68 66334 62 400 1024 68 31213 63 400 1024 67 96091 64 432 1024 67 60969 65 432 1024 67 25847 66 432 1024 66 90725 67 432 1024 66 55603 68 432 1024 66 20482 69 450 1024 65 85360 70 450 1024 65 50238 71 450 1024 65 15116 72 480 1024 64 79994 73 480 1024 64 44872 74 480 1024 64 09750 75 480 1024 63 74629 76 480 1024 63 39507 77 486 1024 63 04385 78 500 1024 62 69263 79 500 1024 62 34141 80 500 1024 61 99019 n256 n256 81 512 1024 61 63897 82 512 1024 61 28776 83 540 1024 60 93654 84 540 1024 60 58532 85 540 1024 60 23410 86 540 1024 59 88288 87 540 1024 59 53166 88 576 1024 59 18044 89 576 1024 58 82922 90 576 1024 58 47800 91 576 1024 58 12679 92 576 1024 57 77557 93 576 1024 57 42435 94 600 1024 57 07313 95 600 1024 56 72191 96 600 1024 56 37069 97 600 1024 56 01947 98 600 1024 55 66825 99 640 1024 55 31703 100 640 1024 54 96581 101 640 1024 54 61460 102 640 1024 54 26338 103 640 1024 53 91216 104 640 1024 53 56094 105 640 1024 53 20972 106 640 1024 52 85850 107 648 1024 52 50728 108 675 1024 52 15606 109 675 1024 51 80484 110 675 1024 51 45362 111 675 1024 51 10241 112 675 1024 50 75119 113 675 1024 50 39997 114 720 1024 50 04875 115 720 1024 49 69753 116 720 1024 49 34631 117 720 1024 48 99509 118 720 1024 48 64387 119 720 1024 48 29265 120 720 1024 47 94143 121 720 1024 47 59021 122 720 1024 47 23899 123 729 1024 46 88778 124 729 1024 46 53656 125 750 1024 46 18534 126 750 1024 45 83412 127 750 1024 45 48290 128 750 1024 45 13168 129 750 1024 44 78046 130 768 1024 44 42924 131 768 1024 44 07802 132 768 1024 43 72680 133 768 1024 43 37558 134 800 1024 43 02436 135 800 1024 42 67315 136 800 1024 42 32193 137 800 1024 41 97071 138 800 1024 41 61949 139 800 1024 41 26827 140 800 1024 40 91705 141 800 1024 40 56583 142 810 1024 40 21461 143 810 1024 39 86339 144 864 1024 39 51217 145 864 1024 39 16095 146 864 1024 38 80973 147 864 1024 38 45851 148 864 1024 38 10730 149 864 1024 37 75608 150 864 1024 37 40486 151 864 1024 37 05364 152 864 1024 36 70242 153 864 1024 36 35120 154 864 1024 35 99998 155 864 1024 35 64876 156 864 1024 35 29754 157 864 1024 34 94632 158 900 1024 34 59510 159 900 1024 34 24388 160 900 1024 33 89266 n256 n256 161 900 1024 33 54145 162 900 1024 33 19023 163 900 1024 32 83901 164 900 1024 32 48779 165 900 1024 32 13657 166 900 1024 31 78535 167 900 1024 31 43413 168 900 1024 31 08291 169 960 1024 30 73169 170 960 1024 30 38047 171 960 1024 30 02925 172 960 1024 29 67803 173 960 1024 29 32681 174 960 1024 28 97559 175 960 1024 28 62438 176 960 1024 28 27316 177 960 1024 27 92194 178 960 1024 27 57072 179 960 1024 27 21950 180 960 1024 26 86828 181 960 1024 26 51706 182 960 1024 26 16584 183 960 1024 25 81462 184 960 1024 25 46340 185 960 1024 25 11218 186 960 1024 24 76096 187 960 1024 24 40974 188 960 1024 24 05852 189 960 1024 23 70731 190 960 1024 23 35609 191 972 1024 23 00487 192 972 1024 22 65365 193 972 1024 22 30243 194 972 1024 21 95121 195 972 1024 21 59999 196 1000 1024 21 24877 197 1000 1024 20 89755 198 1000 1024 20 54633 199 1000 1024 20 19511 200 1000 1024 19 84389 201 1000 1024 19 49267 202 1000 1024 19 14145 203 1000 1024 18 79023 204 1000 1024 18 43902 205 1000 1024 18 08780 206 1000 1024 17 73658 207 1000 1024 17 38536 208 1000 1024 17 03414 209 1000 1024 16 68292 210 1000 1024 16 33170 211 1000 1024 15 98048 212 1024 1024 15 62926 213 1024 1024 15 27804 214 1024 1024 14 92682 215 1024 1024 14 57560 216 1024 1024 14 22438 217 1024 1024 13 87316 218 1024 1024 13 52194 219 1024 1024 13 17073 220 1024 1024 12 81951 221 1024 1024 12 46829 222 1024 1024 12 11707 223 1024 1024 11 76585 224 1024 1024 11 41463 225 1024 1024 11 06341 226 1024 1024 10 71219 227 1024 1024 10 36097 228 1024 1024 10 00975 229 1024 1024 9 65853 230 1024 1024 9 30731 231 1024 1024 8 95609 232 1024 1024 8 60487 233 1024 1024 8 25365 234 1024 1024 7 90244 235 1024 1024 7 55122 236 1024 1024 7 20000 237 1024 1024 6 84878 238 1024 1024 6 49756 239 1024 1024 6 14634 240 1024 1024 5 79512 n256 n256 241 1024 1024 5 44390 242 1024 1024 5 09268 243 1024 1024 4 74146 244 1024 1024 4 39024 245 1024 1024 4 03902 246 1024 1024 3 68780 247 1024 1024 3 33658 248 1024 1024 2 98536 249 1024 1024 2 63415 250 1024 1024 2 28293 251 1024 1024 1 93171 252 1024 1024 1 58049 253 1024 1024 1 22927 254 1024 1024 0 87805 255 1024 1024 0 52683 256 1024 1024 0 17561 n256 reform n256 4 256 over n256 reform n256 3 over n256 n256 reverse n256 return n256 end");28 a[26] = new Array("./Grid/n48gaussian.html", "n48gaussian.pro", "", " NAME:n48gaussian PURPOSE:compute the latitudes of the n48 gaussian grid See: http: www ecmwf int products data technical gaussian n48FIS html CATEGORY:grid CALLING SEQUENCE:lat n48gaussian INPUTS:None KEYWORD PARAMETERS:None OUTPUTS:a 1d array COMMON BLOCKS:None SIDE EFFECTS:None RESTRICTIONS:None EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2004 FUNCTION n48gaussian 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");29 a[27] = new Array("./Grid/n80gaussian.html", "n80gaussian.pro", "", " NAME:n80gaussian PURPOSE:compute the latitudes of the n80 gaussian grid See: http: www ecmwf int products data technical gaussian n80FIS html CATEGORY:grid CALLING SEQUENCE:lat n80gaussian INPUTS:None KEYWORD PARAMETERS:None OUTPUTS:a 1d array COMMON BLOCKS:None SIDE EFFECTS:None RESTRICTIONS:None EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2004 FUNCTION n80gaussian 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");30 a[28] = new Array("./Grid/ncdf_meshread.html", "ncdf_meshread.pro", "", " NAME:ncdf_meshread PURPOSE:read NetCDF meshmask file created by OPA CATEGORY:grid reading CALLING SEQUENCE:ncdf_meshread filename INPUTS: filename: the name of the meshmask file to read Default is meshmask nc 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 PARAMETERS: GLAMBOUNDARY:a 2 elements vector lon1 lon2 the longitute boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 le 360 key_shift will be automaticaly defined according to GLAMBOUNDARY CHECKDAT: Suppressed Use micromeshmask pro to create an appropriate meshmask ONEARTH 0 or 1: to force the manual definition of key_onearth to specify if the data are on earth use longitude latitude etc By default key_onearth 1 note that ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY PERIODIC 0 or 1: to force the manual definition of key_periodic By default key_periodic is automaticaly computed by using the first line of glamt SHIFT : to force the manual definition of key_shift By debault key_shift is automaticaly computed according to the glamboundary when defined by using the first line of glamt if key_periodic 0 then in any case key_shift 0 STRCALLING: a string containing the calling command used to call computegrid this is used by xxx pro STRIDE : a 3 elements vector to specify the stride in x y z direction Default definition is key_stride The resulting value will be stored in the common cm_4mesh variable key_stride OUTPUTS:none COMMON BLOCKS: cm_4mesh cm_4data cm_4cal SIDE EFFECTS: define and or use common variables from cm_4mesh cm_4data cm_4cal RESTRICTIONS: ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh must be defined febore calling ncdf_meshread if some of those value are equal to 1 they will be automatically defined EXAMPLE: MODIFICATION 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 PRO ncdf_meshread filename GLAMBOUNDARY glamboundary CHECKDAT checkdat ONEARTH onearth GETDIMENSIONS getdimensions PERIODIC periodic SHIFT shift STRIDE stride STRCALLING strcalling _EXTRA ex 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 de filename par defaut 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 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 commande namevar i float res rien execute commande 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 kase 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 commande ncdf_varget cdfid namevar i namevar i offset 0 0 izminmesh 0 count 1 1 jpk 1 if key_stride 2 NE 1 then commande commande stride 1 1 key_stride 2 1 END 2:BEGIN commande ncdf_varget cdfid namevar i namevar i offset izminmesh 0 count jpk 1 if key_stride 2 NE 1 then commande commande stride key_stride 2 END 1:BEGIN commande ncdf_varget cdfid namevar i namevar i offset izminmesh count jpk if key_stride 2 NE 1 then commande commande stride key_stride 2 END ENDCASE rien execute commande commande namevar i float namevar i rien execute commande commande if size namevar i n_dimension gt 0 then namevar i reform namevar i over rien execute commande ENDFOR ncdf_close cdfid Apply Glamboudary if keyword_set glamboundary AND key_onearth then BEGIN if glamboundary 0 NE glamboundary 1 then BEGIN glamt 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 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 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 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 0 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 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");31 a[29] = new Array("./Grid/restoreboxparam.html", "restoreboxparam.pro", "", " NAME: restoreboxparam PURPOSE: restore all the zoom parameters defined by calling domdef perviously defined by saveboxparam CATEGORY: CALLING SEQUENCE: restoreboxparam filename INPUTS: filename a scalar string defining the file name KEYWORD PARAMETERS: none OUTPUTS:none COMMON BLOCKS: cm_4mesh and cm_demomode_used if we are in demo mode SIDE EFFECTS: call def_myuniquetmpdir if myuniquetmpdir is undefined: define create and add it to path RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr July 2005 PRO restoreboxparam filename 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 ");32 a[30] = new Array("./Grid/saveboxparam.html", "saveboxparam.pro", "", " NAME: saveboxparam PURPOSE: save all the zoom parameters defined by calling domdef in a file using save command located in myuniquetmpdir common variable defined by def_myuniquetmpdir CATEGORY: CALLING SEQUENCE: saveboxparam filename INPUTS: filename a scalar string defining the file name KEYWORD PARAMETERS: none OUTPUTS:none COMMON BLOCKS: cm_4mesh and cm_demomode_used if we are in demo mode SIDE EFFECTS: call def_myuniquetmpdir if myuniquetmpdir is undefined: define create and add it to path RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr June 2005 PRO saveboxparam filename cm_4mesh def_myuniquetmpdir 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 boxzoomparam bound: lon1 lon2 lat1 lat2 vert1 vert2 indexes: firstxt lastxt firstyt lastyt firstxu lastxu firstyu lastyu firstxv lastxv firstyv lastyv firstxf lastxf firstyf lastyf firstzt lastzt firstzw lastzw nxt nyt nxu nyu nxv nyv nxf nyf nzt nzw key:key_irregular ENDIF ELSE BEGIN save lon1 lon2 lat1 lat2 vert1 vert2 firstxt lastxt firstyt lastyt firstxu lastxu firstyu lastyu firstxv lastxv firstyv lastyv firstxf lastxf firstyf lastyf firstzt lastzt firstzw lastzw nxt nyt nxu nyu nxv nyv nxf nyf nzt nzw key_irregular filename myuniquetmpdir filename ENDELSE return end");33 a[31] = new Array("./Grid/smallmeshmask.html", "smallmeshmask.pro", "", " NAME: smallmeshmask pro PURPOSE: reduce the size of the NetCDF meshmask created by OPA by using byte format for the masks and the foat format for the other fields CATEGORY:for OPA meshmask files CALLING SEQUENCE: smallmeshmask ncfilein ncfileout INPUTS: ncfilein: 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 ncfileout: the name of the reduced meshmask file default definition is smallmeshmask nc KEYWORD PARAMETERS: IODIR:to define the files path OUTPUTS: no COMMON BLOCKS: no EXAMPLE: IDL meshdir d1fes2 raid2 smasson DATA ORCA05 IDL smallmeshmask meshmask_ORCA_R05 nc iodir meshdir MODIFICATION HISTORY: July 2004 Sebastien Masson smasson lodyc jussieu fr PRO ncdf_transfer inid outid inname outname IF n_elements outname EQ 0 THEN outname inname ncdf_varget inid inname zzz ncdf_varput outid outname float reform zzz over RETURN ENDPRO smallmeshmask ncfilein ncfileout IODIR iodir 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 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 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 smallmeshmask 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 dimidz ncdf_dimdef cdfidout z jpk global attributs ncdf_attput cdfidout IDL_Program_Name smallmeshmask 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 varid varid ncdf_vardef cdfidout msklist m dimidx dimidy dimidz byte 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 ncdf_varput cdfidout msklist m byte temporary zzz offset 0 0 k count jpi jpj 1 ENDFOR ENDFOR ncdf_close cdfid ncdf_close cdfidout RETURN END");23 a[21] = new Array("./Grid/computegrid.html", "computegrid.pro", "", " file_comments compute the grid parameters from cm_4mesh common: computegrid startx starty stepx stepy nx ny computegrid startx starty stepx stepy computegrid xaxis xaxis yaxis yaxis or a suitable mix horizontal parameters: glam tf gphi tf e1t and e2t and if FULLCGRID keyword is defined: glam uv gphi uv e1 uvf and e2 uvf verticals parameters: gdep tw e3 tw masks: tmask and if FULLCGRID keyword is defined: uv maskred fmaskred xy triangulation: triangles_list key_ parameters: key_shift key_periodic key_zreverse key_yreverse key_stride key_onearth key_partialstep categories grid param startx in required scalar x starting point param starty in required scalar y starting point param stepxin in required scalar or vector: x direction step must be 0 if vector nx is not used param stepyin in required scalar or vector: y direction step could be 0 south to north or lon1 and lon2 lon1 le 360 key_shift will be defined automaticaly computed according to glamboundary by using the FIRST LINE of glamt but key_shift will 0 only if key_periodic 1 keyword MASK to specify the mask with a 2 or 3 dimension array keyword ONEARTH 0 or 1 to force the manual definition of key_onearth to specify if the data are on earth use longitude latitude etc By default key_onearth 1 note that ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword PERIODIC 0 or 1 to force the manual definition of key_periodic By default key_periodic is automaticaly computed by using the first line of glamt keyword PLAIN 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 scalar to force the manual definition of key_shift By debault key_shift is automaticaly computed according to glamboundary when defined by using the FIRST LINE of glamt if key_periodic 0 then in any case key_shift 0 keyword STRCALLING a string containing the calling command used to call computegrid this is used by xxx pro keyword STRIDE a 3 elements vector to specify the stride in x y z direction Default definition is 1 1 1 The resulting value will be stored in the common cm_4mesh variable key_stride keyword XAXIS to specify longitude1 with a 1 or 2 dimension array 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 to specify latitudes with a 1 or 2 dimension array 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 keyword YMINMESH keyword ZMINMESH to define the common variables i xyz minmesh used to define the grid only in a zoomed part of the original grid Defaut values are 0L max value is XYZ MAXMESH keyword XMAXMESH keyword YMAXMESH keyword ZMAXMESH to define the common variables i xyz maxmesh used to define the grid only in a zoomed part of the original grid Defaut values are jp ijk glo 1 max value is jp ijk glo 1 if XYZ MAXMESH is negative then we define i xyz maxmesh as jp ijk glo 1 XYZ MAXMESH instead of XYZ MAXMESH keyword ZAXIS to specify the vertical axis with a 1 dimension array Must be sorted in the increasing or deceasing order 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 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 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 FBASE2TBASE fbase2tbase STRCALLING strcalling _extra ex 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 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 iymaxmesh iymaxmesh keyword_set fbase2tbase 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 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 defaut mask eq 1 if NOT keyword_set mask then mask 1 if mask 0 NE 1 then BEGIN tmask byte mask 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 FBASE2TBASE fbase2tbase STRCALLING strcalling _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 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 "); 24 a[22] = 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 foat format for the other fields categories for OPA meshmask files examples IDL reducencmeshmask ncfilein ncfileout examples IDL meshdir d1fes2 raid2 smasson DATA ORCA05 IDL micromeshmask meshmask_ORCA_R05 nc iodir meshdir history July 2004 Sebastien Masson smasson lodyc jussieu fr PRO ncdf_transfer inid outid inname outname IF n_elements outname EQ 0 THEN outname inname ncdf_varget inid inname zzz ncdf_varput outid outname float reform zzz over RETURN END keyword IODIR to define the files path 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 required the name of the uniq reduced meshmask file default definition is micromeshmask nc PRO micromeshmask ncfilein ncfileout IODIR iodir 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 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"); 25 a[23] = 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 FUNCTION n128gaussian 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"); 26 a[24] = new Array("./Grid/n160gaussian.html", "n160gaussian.pro", "", " file_comments compute the latitudes of the n160 gaussian grid See: http: www ecmwf int products data technical gaussian n160FIS html categories grid examples IDL lat n160gaussian returns a 1d array history Sebastien Masson smasson lodyc jussieu fr June 2004 FUNCTION n160gaussian latitude reduced regular latitude number points points n160 1 18 640 89 57009 2 25 640 89 01318 3 36 640 88 45297 4 40 640 87 89203 5 45 640 87 33080 6 50 640 86 76944 7 60 640 86 20800 8 64 640 85 64651 9 72 640 85 08499 10 72 640 84 52345 11 80 640 83 96190 12 90 640 83 40033 13 90 640 82 83876 14 96 640 82 27718 15 108 640 81 71559 16 120 640 81 15400 17 120 640 80 59240 18 125 640 80 03080 19 128 640 79 46920 20 135 640 78 90760 21 144 640 78 34600 22 150 640 77 78439 23 160 640 77 22278 24 160 640 76 66117 25 180 640 76 09956 26 180 640 75 53795 27 180 640 74 97634 28 192 640 74 41473 29 192 640 73 85311 30 200 640 73 29150 31 216 640 72 72988 32 216 640 72 16827 33 225 640 71 60665 34 225 640 71 04504 35 240 640 70 48342 36 240 640 69 92181 37 243 640 69 36019 38 250 640 68 79857 39 256 640 68 23695 40 270 640 67 67534 41 270 640 67 11372 42 288 640 66 55210 43 288 640 65 99048 44 288 640 65 42886 45 300 640 64 86725 46 300 640 64 30563 47 320 640 63 74401 48 320 640 63 18239 49 320 640 62 62077 50 320 640 62 05915 51 324 640 61 49753 52 360 640 60 93591 53 360 640 60 37429 54 360 640 59 81267 55 360 640 59 25105 56 360 640 58 68943 57 360 640 58 12781 58 375 640 57 56619 59 375 640 57 00457 60 375 640 56 44295 61 384 640 55 88133 62 384 640 55 31971 63 400 640 54 75809 64 400 640 54 19647 65 400 640 53 63485 66 405 640 53 07323 67 432 640 52 51161 68 432 640 51 94999 69 432 640 51 38837 70 432 640 50 82675 71 432 640 50 26513 72 450 640 49 70351 73 450 640 49 14189 74 450 640 48 58026 75 450 640 48 01864 76 480 640 47 45702 77 480 640 46 89540 78 480 640 46 33378 79 480 640 45 77216 80 480 640 45 21054 n160 n160 81 480 640 44 64892 82 480 640 44 08730 83 500 640 43 52567 84 500 640 42 96405 85 500 640 42 40243 86 500 640 41 84081 87 500 640 41 27919 88 512 640 40 71757 89 512 640 40 15595 90 540 640 39 59433 91 540 640 39 03270 92 540 640 38 47108 93 540 640 37 90946 94 540 640 37 34784 95 540 640 36 78622 96 540 640 36 22460 97 540 640 35 66298 98 576 640 35 10136 99 576 640 34 53973 100 576 640 33 97811 101 576 640 33 41649 102 576 640 32 85487 103 576 640 32 29325 104 576 640 31 73163 105 576 640 31 17000 106 576 640 30 60838 107 576 640 30 04676 108 600 640 29 48514 109 600 640 28 92352 110 600 640 28 36190 111 600 640 27 80028 112 600 640 27 23865 113 600 640 26 67703 114 600 640 26 11541 115 600 640 25 55379 116 600 640 24 99217 117 640 640 24 43055 118 640 640 23 86892 119 640 640 23 30730 120 640 640 22 74568 121 640 640 22 18406 122 640 640 21 62244 123 640 640 21 06082 124 640 640 20 49919 125 640 640 19 93757 126 640 640 19 37595 127 640 640 18 81433 128 640 640 18 25271 129 640 640 17 69109 130 640 640 17 12946 131 640 640 16 56784 132 640 640 16 00622 133 640 640 15 44460 134 640 640 14 88298 135 640 640 14 32136 136 640 640 13 75973 137 640 640 13 19811 138 640 640 12 63649 139 640 640 12 07487 140 640 640 11 51325 141 640 640 10 95162 142 640 640 10 39000 143 640 640 9 82838 144 640 640 9 26676 145 640 640 8 70514 146 640 640 8 14352 147 640 640 7 58189 148 640 640 7 02027 149 640 640 6 45865 150 640 640 5 89703 151 640 640 5 33541 152 640 640 4 77379 153 640 640 4 21216 154 640 640 3 65054 155 640 640 3 08892 156 640 640 2 52730 157 640 640 1 96568 158 640 640 1 40405 159 640 640 0 84243 160 640 640 0 28081 n160 reform n160 4 160 over n160 reform n160 3 over n160 n160 reverse n160 return n160 end"); 27 a[25] = new Array("./Grid/n256gaussian.html", "n256gaussian.pro", "", " file_comments compute the latitudes of the n256 gaussian grid See: http: www ecmwf int products data technical gaussian n256FIS html categories grid examples IDL lat n256gaussian returns a 1d array history Sebastien Masson smasson lodyc jussieu fr June 2004 FUNCTION n256gaussian latitude reduced regular latitude number points points n256 1 18 1024 89 73115 2 25 1024 89 38287 3 32 1024 89 03254 4 40 1024 88 68175 5 45 1024 88 33077 6 50 1024 87 97972 7 60 1024 87 62861 8 64 1024 87 27748 9 72 1024 86 92632 10 72 1024 86 57515 11 75 1024 86 22398 12 81 1024 85 87279 13 90 1024 85 52160 14 96 1024 85 17041 15 100 1024 84 81921 16 108 1024 84 46801 17 120 1024 84 11681 18 120 1024 83 76560 19 125 1024 83 41440 20 135 1024 83 06319 21 144 1024 82 71198 22 150 1024 82 36077 23 160 1024 82 00956 24 160 1024 81 65835 25 180 1024 81 30714 26 180 1024 80 95593 27 180 1024 80 60471 28 192 1024 80 25350 29 192 1024 79 90229 30 200 1024 79 55107 31 216 1024 79 19986 32 216 1024 78 84864 33 216 1024 78 49743 34 225 1024 78 14621 35 240 1024 77 79500 36 240 1024 77 44378 37 243 1024 77 09256 38 250 1024 76 74135 39 256 1024 76 39013 40 270 1024 76 03891 41 270 1024 75 68770 42 288 1024 75 33648 43 288 1024 74 98526 44 288 1024 74 63405 45 300 1024 74 28283 46 300 1024 73 93161 47 320 1024 73 58040 48 320 1024 73 22918 49 320 1024 72 87796 50 324 1024 72 52674 51 360 1024 72 17552 52 360 1024 71 82431 53 360 1024 71 47309 54 360 1024 71 12187 55 360 1024 70 77065 56 360 1024 70 41944 57 375 1024 70 06822 58 375 1024 69 71700 59 384 1024 69 36578 60 384 1024 69 01456 61 400 1024 68 66334 62 400 1024 68 31213 63 400 1024 67 96091 64 432 1024 67 60969 65 432 1024 67 25847 66 432 1024 66 90725 67 432 1024 66 55603 68 432 1024 66 20482 69 450 1024 65 85360 70 450 1024 65 50238 71 450 1024 65 15116 72 480 1024 64 79994 73 480 1024 64 44872 74 480 1024 64 09750 75 480 1024 63 74629 76 480 1024 63 39507 77 486 1024 63 04385 78 500 1024 62 69263 79 500 1024 62 34141 80 500 1024 61 99019 n256 n256 81 512 1024 61 63897 82 512 1024 61 28776 83 540 1024 60 93654 84 540 1024 60 58532 85 540 1024 60 23410 86 540 1024 59 88288 87 540 1024 59 53166 88 576 1024 59 18044 89 576 1024 58 82922 90 576 1024 58 47800 91 576 1024 58 12679 92 576 1024 57 77557 93 576 1024 57 42435 94 600 1024 57 07313 95 600 1024 56 72191 96 600 1024 56 37069 97 600 1024 56 01947 98 600 1024 55 66825 99 640 1024 55 31703 100 640 1024 54 96581 101 640 1024 54 61460 102 640 1024 54 26338 103 640 1024 53 91216 104 640 1024 53 56094 105 640 1024 53 20972 106 640 1024 52 85850 107 648 1024 52 50728 108 675 1024 52 15606 109 675 1024 51 80484 110 675 1024 51 45362 111 675 1024 51 10241 112 675 1024 50 75119 113 675 1024 50 39997 114 720 1024 50 04875 115 720 1024 49 69753 116 720 1024 49 34631 117 720 1024 48 99509 118 720 1024 48 64387 119 720 1024 48 29265 120 720 1024 47 94143 121 720 1024 47 59021 122 720 1024 47 23899 123 729 1024 46 88778 124 729 1024 46 53656 125 750 1024 46 18534 126 750 1024 45 83412 127 750 1024 45 48290 128 750 1024 45 13168 129 750 1024 44 78046 130 768 1024 44 42924 131 768 1024 44 07802 132 768 1024 43 72680 133 768 1024 43 37558 134 800 1024 43 02436 135 800 1024 42 67315 136 800 1024 42 32193 137 800 1024 41 97071 138 800 1024 41 61949 139 800 1024 41 26827 140 800 1024 40 91705 141 800 1024 40 56583 142 810 1024 40 21461 143 810 1024 39 86339 144 864 1024 39 51217 145 864 1024 39 16095 146 864 1024 38 80973 147 864 1024 38 45851 148 864 1024 38 10730 149 864 1024 37 75608 150 864 1024 37 40486 151 864 1024 37 05364 152 864 1024 36 70242 153 864 1024 36 35120 154 864 1024 35 99998 155 864 1024 35 64876 156 864 1024 35 29754 157 864 1024 34 94632 158 900 1024 34 59510 159 900 1024 34 24388 160 900 1024 33 89266 n256 n256 161 900 1024 33 54145 162 900 1024 33 19023 163 900 1024 32 83901 164 900 1024 32 48779 165 900 1024 32 13657 166 900 1024 31 78535 167 900 1024 31 43413 168 900 1024 31 08291 169 960 1024 30 73169 170 960 1024 30 38047 171 960 1024 30 02925 172 960 1024 29 67803 173 960 1024 29 32681 174 960 1024 28 97559 175 960 1024 28 62438 176 960 1024 28 27316 177 960 1024 27 92194 178 960 1024 27 57072 179 960 1024 27 21950 180 960 1024 26 86828 181 960 1024 26 51706 182 960 1024 26 16584 183 960 1024 25 81462 184 960 1024 25 46340 185 960 1024 25 11218 186 960 1024 24 76096 187 960 1024 24 40974 188 960 1024 24 05852 189 960 1024 23 70731 190 960 1024 23 35609 191 972 1024 23 00487 192 972 1024 22 65365 193 972 1024 22 30243 194 972 1024 21 95121 195 972 1024 21 59999 196 1000 1024 21 24877 197 1000 1024 20 89755 198 1000 1024 20 54633 199 1000 1024 20 19511 200 1000 1024 19 84389 201 1000 1024 19 49267 202 1000 1024 19 14145 203 1000 1024 18 79023 204 1000 1024 18 43902 205 1000 1024 18 08780 206 1000 1024 17 73658 207 1000 1024 17 38536 208 1000 1024 17 03414 209 1000 1024 16 68292 210 1000 1024 16 33170 211 1000 1024 15 98048 212 1024 1024 15 62926 213 1024 1024 15 27804 214 1024 1024 14 92682 215 1024 1024 14 57560 216 1024 1024 14 22438 217 1024 1024 13 87316 218 1024 1024 13 52194 219 1024 1024 13 17073 220 1024 1024 12 81951 221 1024 1024 12 46829 222 1024 1024 12 11707 223 1024 1024 11 76585 224 1024 1024 11 41463 225 1024 1024 11 06341 226 1024 1024 10 71219 227 1024 1024 10 36097 228 1024 1024 10 00975 229 1024 1024 9 65853 230 1024 1024 9 30731 231 1024 1024 8 95609 232 1024 1024 8 60487 233 1024 1024 8 25365 234 1024 1024 7 90244 235 1024 1024 7 55122 236 1024 1024 7 20000 237 1024 1024 6 84878 238 1024 1024 6 49756 239 1024 1024 6 14634 240 1024 1024 5 79512 n256 n256 241 1024 1024 5 44390 242 1024 1024 5 09268 243 1024 1024 4 74146 244 1024 1024 4 39024 245 1024 1024 4 03902 246 1024 1024 3 68780 247 1024 1024 3 33658 248 1024 1024 2 98536 249 1024 1024 2 63415 250 1024 1024 2 28293 251 1024 1024 1 93171 252 1024 1024 1 58049 253 1024 1024 1 22927 254 1024 1024 0 87805 255 1024 1024 0 52683 256 1024 1024 0 17561 n256 reform n256 4 256 over n256 reform n256 3 over n256 n256 reverse n256 return n256 end"); 28 a[26] = 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 FUNCTION n48gaussian 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"); 29 a[27] = 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 FUNCTION n80gaussian 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"); 30 a[28] = new Array("./Grid/ncdf_meshread.html", "ncdf_meshread.pro", "", " file_comments read NetCDF meshmask file created by OPA categories grid reading examples IDL ncdf_meshread filename param filename in optional the name of the meshmask file to read Default is meshmask nc 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 a 2 elements vector lon1 lon2 the longitute boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 le 360 key_shift will be automaticaly defined according to GLAMBOUNDARY keyword CHECKDAT Suppressed Use micromeshmask pro to create an appropriate meshmask keyword ONEARTH 0 or 1 to force the manual definition of key_onearth to specify if the data are on earth use longitude latitude etc By default key_onearth 1 note that ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword PERIODIC 0 or 1 to force the manual definition of key_periodic By default key_periodic is automaticaly computed by using the first line of glamt keyword SHIFT to force the manual definition of key_shift By debault key_shift is automaticaly computed according to the glamboundary when defined by using the first line of glamt if key_periodic 0 then in any case key_shift 0 keyword STRCALLING a string containing the calling command used to call computegrid this is used by xxx pro keyword STRIDE a 3 elements vector to specify the stride in x y z direction Default definition is key_stride The resulting value will be stored in the common cm_4mesh variable key_stride uses cm_4mesh cm_4data cm_4cal restrictions define and or use common variables from cm_4mesh cm_4data cm_4cal restrictions ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh must be defined febore 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 PRO ncdf_meshread filename GLAMBOUNDARY glamboundary CHECKDAT checkdat ONEARTH onearth GETDIMENSIONS getdimensions PERIODIC periodic SHIFT shift STRIDE stride STRCALLING strcalling _EXTRA ex 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 de filename par defaut 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 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 commande namevar i float res rien execute commande 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 kase 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 commande ncdf_varget cdfid namevar i namevar i offset 0 0 izminmesh 0 count 1 1 jpk 1 if key_stride 2 NE 1 then commande commande stride 1 1 key_stride 2 1 END 2:BEGIN commande ncdf_varget cdfid namevar i namevar i offset izminmesh 0 count jpk 1 if key_stride 2 NE 1 then commande commande stride key_stride 2 END 1:BEGIN commande ncdf_varget cdfid namevar i namevar i offset izminmesh count jpk if key_stride 2 NE 1 then commande commande stride key_stride 2 END ENDCASE rien execute commande commande namevar i float namevar i rien execute commande commande if size namevar i n_dimension gt 0 then namevar i reform namevar i over rien execute commande ENDFOR ncdf_close cdfid Apply Glamboudary if keyword_set glamboundary AND key_onearth then BEGIN if glamboundary 0 NE glamboundary 1 then BEGIN glamt 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 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 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 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 0 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 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"); 31 a[29] = new Array("./Grid/restoreboxparam.html", "restoreboxparam.pro", "", " file_comments restore all the zoom parameters defined by calling domdef perviously defined by saveboxparam examples IDL restoreboxparam filename 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 all def_myuniquetmpdir if myuniquetmpdir is undefined: define create and add it to path history Sebastien Masson smasson lodyc jussieu fr July 2005 PRO restoreboxparam filename 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 "); 32 a[30] = new Array("./Grid/saveboxparam.html", "saveboxparam.pro", "", " file_comments save all the zoom parameters defined by calling domdef in a file using save command located in myuniquetmpdir common variable defined by def_myuniquetmpdir examples IDL saveboxparam filename 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 history Sebastien Masson smasson lodyc jussieu fr June 2005 PRO saveboxparam filename cm_4mesh def_myuniquetmpdir 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 boxzoomparam bound: lon1 lon2 lat1 lat2 vert1 vert2 indexes: firstxt lastxt firstyt lastyt firstxu lastxu firstyu lastyu firstxv lastxv firstyv lastyv firstxf lastxf firstyf lastyf firstzt lastzt firstzw lastzw nxt nyt nxu nyu nxv nyv nxf nyf nzt nzw key:key_irregular ENDIF ELSE BEGIN save lon1 lon2 lat1 lat2 vert1 vert2 firstxt lastxt firstyt lastyt firstxu lastxu firstyu lastyu firstxv lastxv firstyv lastyv firstxf lastxf firstyf lastyf firstzt lastzt firstzw lastzw nxt nyt nxu nyu nxv nyv nxf nyf nzt nzw key_irregular filename myuniquetmpdir filename ENDELSE return end"); 33 a[31] = new Array("./Grid/smallmeshmask.html", "smallmeshmask.pro", "", " categories for OPA meshmask files history July 2004 Sebastien Masson smasson lodyc jussieu fr PRO ncdf_transfer inid outid inname outname IF n_elements outname EQ 0 THEN outname inname ncdf_varget inid inname zzz ncdf_varput outid outname float reform zzz over RETURN END file_comments reduce the size of the NetCDF meshmask created by OPA by using byte format for the masks and the foat format for the other fields keyword IODIR to define the files path 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 reduced meshmask file default definition is smallmeshmask nc examples IDL meshdir d1fes2 raid2 smasson DATA ORCA05 IDL smallmeshmask meshmask_ORCA_R05 nc iodir meshdir categories for OPA meshmask files history July 2004 Sebastien Masson smasson lodyc jussieu fr PRO smallmeshmask ncfilein ncfileout IODIR iodir 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 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 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 smallmeshmask 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 dimidz ncdf_dimdef cdfidout z jpk global attributs ncdf_attput cdfidout IDL_Program_Name smallmeshmask 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 varid varid ncdf_vardef cdfidout msklist m dimidx dimidy dimidz byte 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 ncdf_varput cdfidout msklist m byte temporary zzz offset 0 0 k count jpi jpj 1 ENDFOR ENDFOR ncdf_close cdfid ncdf_close cdfidout RETURN END"); 34 34 a[32] = new Array("./Interpolation/angle.html", "angle.pro", "", " file_comments north stereographic polar projection keyword DOUBLE use double precision default is float returns gsinu gcosu : sinus and cosinus of the angle gsinv gcosv between north south direction gsint gcost and the j direction of the mesh restrictions to compute the lateral boundary conditions we assume that: 1 the first line is similar to the second line gcosu 0 gcosu 1 gsinu 0 gsinu 1 2 the grid follows OPA x periodicity rule first column is equal to the next to last column gcosv 0 gcosv jpj 2 gsinv 0 gsinv jpj 2 history Original : 96 07 O Marti 98 06 G Madec Feb 2005: IDL adaptation S Masson FUNCTION fsnspp plam pphi DOUBLE double IF keyword_set double THEN BEGIN a 2 d tan dpi 4 d dpi 180 d pphi 2 d x cos dpi 180 d plam a y sin dpi 180 d plam a ENDIF ELSE BEGIN a 2 tan pi 4 pi 180 float pphi 2 x cos pi 180 float plam a y sin pi 180 float plam a ENDELSE RETURN x:x y:y END file_comments Compute angles between grid lines and direction of the North fom angle F v 2 2 in OPA8 2 param fileocemesh in required a netcdf file that contains at least : glamu gphiu: longitudes and latitudes at U points glamv gphiv: longitudes and latitudes at V points glamf gphif: longitudes and latitudes at F points keyword IODIRECTORY the directory path where is located fileocemesh keyword DOUBLE use double precision default is float PRO angle fileocemesh gcosu gsinu gcosv gsinv gcost gsint IODIRECTORY iodirectory DOUBLE double 0 read oceanic grid parameters IF keyword_set IODIRECTORY THEN BEGIN IF strpos iodirectory reverse_search NE strlen iodirectory 1 THEN iodirectory iodirectory ENDIF ELSE iodirectory fileoce iodirectory fileocemesh fileoce findfile fileoce count okfile IF okfile NE 1 THEN BEGIN print the file fileoce is not found we stop stop ENDIF cdfido ncdf_open fileoce 0 ncdf_varget cdfido glamt glamt ncdf_varget cdfido glamu glamu ncdf_varget cdfido glamv glamv ncdf_varget cdfido glamf glamf ncdf_varget cdfido gphit gphit ncdf_varget cdfido gphiu gphiu ncdf_varget cdfido gphiv gphiv ncdf_varget cdfido gphif gphif ncdf_close cdfido glamt reform glamt over glamu reform glamu over glamv reform glamv over glamf reform glamf over gphit reform gphit over gphiu reform gphiu over gphiv reform gphiv over gphif reform gphif over jpj size glamf dimension 1 I Compute the cosinus and sinus computation done on the north stereographic polar plan north pole direction modulous at t point znpt fsnspp glamt gphit DOUBLE double glamt 1 gphit 1 free memory znpt x znpt x znpt y znpt y znnpt znpt x znpt x znpt y znpt y north pole direction modulous at u point znpu fsnspp glamu gphiu DOUBLE double glamu 1 gphiu 1 free memory znpu x znpu x znpu y znpu y znnpu znpu x znpu x znpu y znpu y north pole direction modulous at v point znpv fsnspp glamv gphiv DOUBLE double znpv00 znpv znpv01 fsnspp shift glamv 0 1 shift gphiv 0 1 DOUBLE double glamv 1 gphiv 1 free memory znpv x znpv x znpv y znpv y znnpv znpv x znpv x znpv y znpv y f point znpf00 fsnspp glamf gphif DOUBLE double znpf01 fsnspp shift glamf 0 1 shift gphif 0 1 DOUBLE double znpf10 fsnspp shift glamf 1 0 shift gphif 1 0 DOUBLE double glamf 1 gphif 1 free memory j direction: v point segment direction t point zxvvt znpv00 x znpv01 x zyvvt znpv00 y znpv01 y zmnpvt sqrt temporary znnpt zxvvt zxvvt zyvvt zyvvt znpv00 1 free memory znpv01 1 free memory IF keyword_set double THEN zmnpvt 1 e 14 zmnpvt ELSE zmnpvt 1 e 6 zmnpvt j direction: f point segment direction u point zxffu znpf00 x znpf01 x zyffu znpf00 y znpf01 y zmnpfu sqrt temporary znnpu zxffu zxffu zyffu zyffu znpf01 1 free memory IF keyword_set double THEN zmnpfu 1 e 14 zmnpfu ELSE zmnpfu 1 e 6 zmnpfu i direction: f point segment direction v point zxffv znpf00 x znpf10 x zyffv znpf00 y znpf10 y znpf00 1 znpf10 1 free memory zmnpfv sqrt temporary znnpv zxffv zxffv zyffv zyffv IF keyword_set double THEN zmnpfv 1 e 14 zmnpfv ELSE zmnpfv 1 e 6 zmnpfv cosinus and sinus using scalar and vectorial products gsint znpt x zyvvt znpt y zxvvt zmnpvt gcost znpt x zxvvt znpt y zyvvt zmnpvt cosinus and sinus using scalar and vectorial products gsinu znpu x zyffu znpu y zxffu zmnpfu gcosu znpu x zxffu znpu y zyffu zmnpfu cosinus and sinus using scalar and vectorial products caution rotation of 90 degres gsinv znpv x zxffv znpv y zyffv zmnpfv gcosv znpv x zyffv znpv y zxffv zmnpfv II Geographic mesh bad where abs glamf shift glamf 0 1 LT 1 e 8 IF bad 0 NE 1 THEN BEGIN gcosu bad 1 gsinu bad 0 ENDIF bad where abs gphif shift gphif 1 0 LT 1 e 8 IF bad 0 NE 1 THEN BEGIN gcosv bad 1 gsinv bad 0 ENDIF III Lateral boundary conditions gcost 0 gcost 1 gsint 0 gsint 1 gcosu 0 gcosu 1 gsinu 0 gsinu 1 gcosv 0 gcosv jpj 2 gsinv 0 gsinv jpj 2 RETURN END"); 35 35 a[33] = new Array("./Interpolation/clickincell.html", "clickincell.pro", "", " file_comments click on a map and find in which cell the click was categories finding where is a point on a grid examples res clickincell Click with the left button to select a cell Clicking one more time in the same cell remove the cell from the selection Click on the right button to quit keyword CELLTYPE T W U V or F This this the type of point that is located in the center of the cell which the click is located default is T type of cell with corner defined by F points keyword DRAWCELL to draw the cell in which we clicked keyword COLOR the color used to draw the cells Clicking one more time in the same cell will draw the cell with the white color keyword ORIGINAL to get the position of the cell regarding the original grid with no key_shift ixminmesh iyminmesh keyword IJ see outpus keyword _EXTRA to pass extra keywords to inquad and plot when drawcell returns the index of the selected cells regarding to the grid which is in memory in the variable of the common If ij keyword is activated give 2D array 2 n which are the i j position of the n selected cells uses common pro examples IDL plt findgen jpi jpj nodata map 90 0 0 ortho IDL print clickincell draw color 150 xy history Sebastien Masson smasson lodyc jussieu fr August 2003 FUNCTION clickincell CELLTYPE celltype DRAWCELL drawcell COLOR color ORIGINAL original IJ ij _EXTRA extra common initialization cellnum 1L selected 0 Cell list get the grid parameter according to celltype oldgrid vargrid IF NOT keyword_set celltype THEN celltype T CASE strupcase celltype 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 get mousse position on the reference map cursor x y data up while mouse button ne 4 do BEGIN IF finite x finite x EQ 0 THEN GOTO outwhile case mouse button of 1:BEGIN 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 GOTO outwhile IF y GT y range 1 THEN GOTO outwhile IF y LT y range 0 THEN GOTO outwhile cell inquad x y x1 y1 x2 y2 x3 y3 x4 y4 onsphere _extra extra IF cell 0 EQ 1 OR n_elements cell GT 1 THEN GOTO outwhile cell cell 0 already where cellnum EQ cell 0 IF already EQ 1 THEN BEGIN cellnum cellnum cell selected selected 1 already n_elements selected 1 ENDIF ELSE selected already 1 selected already IF keyword_set drawcell THEN BEGIN oplot x1 cell x2 cell x3 cell x4 cell x1 cell y1 cell y2 cell y3 cell y4 cell y1 cell color color selected already d n_colors 255 1 selected already _extra extra ENDIF END 2: middle button ELSE: ENDCASE get mousse position on the reference map outwhile: cursor x y data up ENDWHILE good where selected NE 0 IF good 0 EQ 1 THEN RETURN 1 cellnum cellnum good yy cellnum nx 1 key_periodic nx EQ jpi xx cellnum MOD nx 1 key_periodic nx EQ jpi CASE strupcase celltype 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 IF keyword_set original THEN BEGIN xx xx key_shift bad where xx LT 0 IF bad 0 NE 1 THEN xx bad xx bad jpi xx xx MOD jpi xx xx ixminmesh yy yy iyminmesh ENDIF ncell n_elements xx IF keyword_set ij THEN RETURN reform xx 1 ncell over reform yy 1 ncell over IF keyword_set original THEN RETURN xx jpiglo yy ELSE RETURN xx jpi yy END "); … … 40 40 a[38] = new Array("./Interpolation/extrapolate.html", "extrapolate.pro", "", " file_comments extrapolate data zinput where maskinput eq 0 by filling step by step the coastline points with the mean value of the 8 neighbourgs FUNCTION extrapolate zinput maskinput nb_iteration x_periodic x_periodic MINVAL minval MAXVAL maxval compile_opt strictarr strictarrsubs check the number of iteration used in the extrapolation IF n_elements nb_iteration EQ 0 THEN nb_iteration 10 E20 IF nb_iteration EQ 0 THEN return zinput nx size zinput 1 ny size zinput 2 take care of the boundary conditions for the x direction we put 2 additional columns at the left and right side of the array for the y direction we put 2 additional lines at the bottom and top side of the array These changes allow us to use shift function without taking care of the x and y periodicity ztmp bytarr nx 2 ny 2 ztmp 1:nx 1:ny byte maskinput msk temporary ztmp ztmp replicate 1 e20 nx 2 ny 2 ztmp 1:nx 1:ny zinput if keyword_set x_periodic then begin ztmp 0 1:ny zinput nx 1 ztmp nx 1 1:ny zinput 0 ENDIF remove NaN points if there is some nan where finite ztmp EQ 0 cnt_nan IF cnt_nan NE 0 THEN ztmp temporary nan 1 e20 z temporary ztmp nx2 nx 2 ny2 ny 2 extrapolation sqrtinv 1 sqrt 2 cnt 1 When we look for the coast line we don t whant to select the borderlines of the array we force the value of the mask for those lines msk 0 1b msk nx 1 1b msk 0 1b msk ny 1 1b find the land points land where msk EQ 0 cnt_land WHILE cnt LE nb_iteration AND cnt_land NE 0 DO BEGIN find the coast line points Once the land points list has been found we change back the the mask values for the boundary conditions msk 0 0b msk nx 1 0b msk 0 0b msk ny 1 0b if keyword_set x_periodic then begin msk 0 msk nx msk nx 1 msk 1 endif we compute the weighted number of sea neighbourgs those 4 neighbours have a weight of 1: those 4 neighbours have a weight of 1 sqrt 2 : As we make sure that none of the land points are located on the border of the array we can compute the weight without shift faster weight msk land 1 msk land 1 msk land nx2 msk land nx2 sqrtinv msk land nx2 1 msk land nx2 1 msk land nx2 1 msk land nx2 1 list all the points that have sea neighbourgs ok where weight GT 0 the coastline points coast land ok their weighted number of sea neighbourgs weight weight temporary ok fill the coastine points z temporary z msk zcoast z 1 coast z 1 coast z nx2 coast z nx2 coast 1 sqrt 2 z nx2 1 coast z nx2 1 coast z nx2 1 coast z nx2 1 coast IF n_elements minval NE 0 THEN zcoast minval temporary zcoast IF n_elements maxval NE 0 THEN zcoast temporary zcoast we force the value of the mask for those lines msk 0 1b msk nx 1 1b msk 0 1b msk ny 1 1b find the land points land where msk EQ 0 cnt_land ENDWHILE we return the original size of the array return z 1:nx 1:ny END "); 41 41 a[39] = new Array("./Interpolation/fromreg.html", "fromreg.pro", "", " file_comments interpolate data from a regular rectangular grid to any grid 2 metods availables: bilinear and imoms3 A regular rectangular grid is defined as a grid for which each lontitudes lines have the same latitude and each latitudes columns have the same longitude categories interpolation examples dataout fromreg method datain lonin latin lonout latout param method in required a string defining the interpolation method must be bilinear or imoms3 param datain in required a 2D array the input data to interpolate param lonin latin in required longitude latitude of the input data optionals if WEIG and ADDR keywords used param lonout latout in required longitude latitude of the output data optionals if WEIG and ADDR keywords used keyword WEIG ADDR 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpio jpjo over Those keywords can be set to named variables into which the values will be copied when the current routine exits Next they can be used to perform the interpolation whithout computing again those 2 parameters In that case lonin latin lonout and latout are not necessary keyword NONORTHERNLINE and NOSOUTHERNLINE activate if you don t whant to take into account the northen southern line of the input data when perfoming the interpolation returns 2D array: the interpolated data restrictions We supposed the data are located on a sphere with a periodicity along the longitude examples topa fromreg bilinear tncep xncep yncep glamt gphit or t1opa fromreg bilinear t1ncep xncep yncep glamt gphit WEIG a ADDR b help a b t2opa fromreg bilinear t2ncep xncep WEIG a ADDR b history November 2005: Sebastien Masson smasson lodyc jussieu fr FUNCTION fromreg method datain lonin latin lonout latout WEIG weig ADDR addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt strictarr strictarrsubs IF NOT keyword_set weig AND keyword_set addr THEN BEGIN atmospheric grid parameters alon lonin alat latin get_gridparams alon alat jpia jpja 1 double Oceanic grid parameters olon lonout olat latout get_gridparams olon olat jpio jpjo 2 double Compute weight and address CASE method OF bilinear :compute_fromreg_bilinear_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline imoms3 : compute_fromreg_imoms3_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline ELSE:BEGIN print unknown interpolation method we stop stop ENDELSE ENDCASE ENDIF dataout total weig datain addr 1 dataout reform dataout jpio jpjo over RETURN dataout END"); 42 a[40] = new Array("./Interpolation/get_gridparams.html", "get_gridparams.pro", "", " file_comments 1 extract from a NetCDF file the longitude latidude and their dimensions and make sure it is 1D or 2D arrays or 2 given longitude and latitude arrays get their dimensions and make sure they are 1D or 2D arrays categories interpolation examples 1 get_gridparams file lonname latname lon lat jpi jpj n_dimensions or 2 get_gridparams lon lat jpi jpj n_dimensions 1 param in1 in required the name of the netcdf file param in2 in required the name of the variable that contains the longitude in the NetCDF file param in3 in required the name of the variable that contains the latitude in the NetCDF file param in4 out the number of points in the longitudinal direction param in5 out the number of points in the latitudinal direction param in6 out the variable that will contain the longitudes param in7 out the variable that will contain the latitudes param in8 out 1 or 2 to specify if lon and lat should be 1D jpi or jpj or 2 param lon lat in required 1d or 2D arrays defining longitudes and latitudes Note that these arrays are also outputs and can therefore be modified param in1 out the variable that will contain the longitudes param in2 out the variable that will contain the latitudes param in3 out the number of points in the longitudinal direction param in4 out the number of points in the latitudinal direction param in5 out1 or 2 to specify if lon and lat should be 1D jpi or jpj arrays or 2D arrays jpi jpj Note that of n_dimensions 1 then the grid must be regular each longitudes must be the same for all latitudes and each latitudes should be the sae for all longitudes examples 1 ncdf_get_gridparams coordinates_ORCA_R05 nc glamt gphit olon olat jpio jpjo 2 2 ncdf_get_gridparams olon olat jpio jpjo 2 history November 2005: Sebastien Masson smasson lodyc jussieu fr PRO get_gridparams in1 in2 in3 in4 in5 in6 in7 in8 DOUBLE double file lonname latname lon lat jpi jpj n_dimensions lon lat jpi jpj n_dimensions CASE n_params OF 8:BEGIN get longitude and latitude IF file_test in1 EQ 0 THEN BEGIN print file in1 does not exist stop ENDIF cdfido ncdf_open in1 ncdf_varget cdfido in2 lon ncdf_varget cdfido in3 lat ncdf_close cdfido n_dimensions in8 END 5:BEGIN lon temporary in1 lat temporary in2 n_dimensions in5 END ELSE:BEGIN print Bad nimber of input parameters stop end ENDCASE sizelon size lon sizelat size lat CASE 1 OF lon and lat are 1D arrays sizelon 0 EQ 1 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelat 1 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1: 2:BEGIN make lon and lat 2D arrays lon temporary lon replicate 1 jpj lat replicate 1 jpi temporary lat END ELSE:stop ENDCASE END lon is 2D array and lat is 1D array sizelon 0 EQ 2 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelon 2 IF jpj NE n_elements lat THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 END 2:lat replicate 1 jpi temporary lat ELSE:stop ENDCASE END lon is 1D array and lat is 2D array sizelon 0 EQ 1 AND sizelat 0 EQ 2:BEGIN get jpi and jpj jpi sizelat 1 jpj sizelat 2 IF jpi NE n_elements lon THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lat replicate 1 jpi lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2:lon temporary lon replicate 1 jpj ELSE:stop ENDCASE END lon and lat are 2D arrays sizelon 0 EQ 2 AND sizelat 0 EQ 2:BEGIN get jpi and jpj IF array_equal sizelon 1:2 sizelat 1:2 NE 1 THEN stop jpi sizelon 1 jpj sizelon 2 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 IF array_equal lat replicate 1 jpi reform lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2: ELSE:stop ENDCASE END lon and lat are not 1D and or 2D arrays ELSE:stop ENDCASE double keyword if keyword_set double then BEGIN lon double temporary lon lat double temporary lat ENDIF give back the right outparameters CASE n_params OF 8:BEGIN in4 temporary lon in5 temporary lat in6 temporary jpi in7 temporary jpj END 5:BEGIN in1 temporary lon in2 temporary lat in3 temporary jpi in4 temporary jpj END ENDCASE return END");42 a[40] = new Array("./Interpolation/get_gridparams.html", "get_gridparams.pro", "", " file_comments 1 extract from a NetCDF file the longitude latidude and their dimensions and make sure it is 1D or 2D arrays or 2 given longitude and latitude arrays get their dimensions and make sure they are 1D or 2D arrays categories interpolation examples 1 get_gridparams file lonname latname lon lat jpi jpj n_dimensions or 2 get_gridparams lon lat jpi jpj n_dimensions 1 param in1 in required the name of the netcdf file param in2 in required the name of the variable that contains the longitude in the NetCDF file param in3 in required the name of the variable that contains the latitude in the NetCDF file param in4 out the number of points in the longitudinal direction param in5 out the number of points in the latitudinal direction param in6 out the variable that will contain the longitudes param in7 out the variable that will contain the latitudes param in8 out 1 or 2 to specify if lon and lat should be 1D jpi or jpj or 2 param in1 in required 1d or 2D arrays defining longitudes and latitudes param in2 in required 1d or 2D arrays defining longitudes and latitudes Note that these arrays are also outputs and can therefore be modified param in1 out the variable that will contain the longitudes param in2 out the variable that will contain the latitudes param in3 in the number of points in the longitudinal direction param in4 in the number of points in the latitudinal direction param in5 in 1 or 2 to specify if lon and lat should be 1D jpi or jpj arrays or 2D arrays jpi jpj Note that of n_dimensions 1 then the grid must be regular each longitudes must be the same for all latitudes and each latitudes should be the sae for all longitudes examples 1 ncdf_get_gridparams coordinates_ORCA_R05 nc glamt gphit olon olat jpio jpjo 2 2 ncdf_get_gridparams olon olat jpio jpjo 2 history November 2005: Sebastien Masson smasson lodyc jussieu fr PRO get_gridparams in1 in2 in3 in4 in5 in6 in7 in8 DOUBLE double file lonname latname lon lat jpi jpj n_dimensions lon lat jpi jpj n_dimensions CASE n_params OF 8:BEGIN get longitude and latitude IF file_test in1 EQ 0 THEN BEGIN print file in1 does not exist stop ENDIF cdfido ncdf_open in1 ncdf_varget cdfido in2 lon ncdf_varget cdfido in3 lat ncdf_close cdfido n_dimensions in8 END 5:BEGIN lon temporary in1 lat temporary in2 n_dimensions in5 END ELSE:BEGIN print Bad nimber of input parameters stop end ENDCASE sizelon size lon sizelat size lat CASE 1 OF lon and lat are 1D arrays sizelon 0 EQ 1 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelat 1 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1: 2:BEGIN make lon and lat 2D arrays lon temporary lon replicate 1 jpj lat replicate 1 jpi temporary lat END ELSE:stop ENDCASE END lon is 2D array and lat is 1D array sizelon 0 EQ 2 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelon 2 IF jpj NE n_elements lat THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 END 2:lat replicate 1 jpi temporary lat ELSE:stop ENDCASE END lon is 1D array and lat is 2D array sizelon 0 EQ 1 AND sizelat 0 EQ 2:BEGIN get jpi and jpj jpi sizelat 1 jpj sizelat 2 IF jpi NE n_elements lon THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lat replicate 1 jpi lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2:lon temporary lon replicate 1 jpj ELSE:stop ENDCASE END lon and lat are 2D arrays sizelon 0 EQ 2 AND sizelat 0 EQ 2:BEGIN get jpi and jpj IF array_equal sizelon 1:2 sizelat 1:2 NE 1 THEN stop jpi sizelon 1 jpj sizelon 2 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 IF array_equal lat replicate 1 jpi reform lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2: ELSE:stop ENDCASE END lon and lat are not 1D and or 2D arrays ELSE:stop ENDCASE double keyword if keyword_set double then BEGIN lon double temporary lon lat double temporary lat ENDIF give back the right outparameters CASE n_params OF 8:BEGIN in4 temporary lon in5 temporary lat in6 temporary jpi in7 temporary jpj END 5:BEGIN in1 temporary lon in2 temporary lat in3 temporary jpi in4 temporary jpj END ENDCASE return END"); 43 43 a[41] = new Array("./Interpolation/imoms3.html", "imoms3.pro", "", " FUNCTION imoms3 xin x abs xin y fltarr n_elements x test1 where x LT 1 IF test1 0 NE 1 THEN BEGIN xtmp x test1 y test1 0 5 xtmp xtmp xtmp xtmp xtmp 0 5 xtmp 1 ENDIF test1 where x LT 2 AND x GE 1 IF test1 0 NE 1 THEN BEGIN xtmp x test1 y test1 1 6 xtmp xtmp xtmp xtmp xtmp 11 6 xtmp 1 ENDIF RETURN y END"); 44 44 a[42] = new Array("./Interpolation/inquad.html", "inquad.pro", "", " file_comments to find if an x y point is in a quadrilateral x1 x2 x3 x4 categories grid manipulation examples res inquad x y x1 y1 x2 y2 x3 y3 x4 y4 param x y in required the coordinates of the point we want to know where it is Must be a scalar if onsphere activated else can be scalar or array param x1 y1 x2 y2 x3 y3 x4 y4 in required the coordinates of the quadrilateral given in the CLOCKWISE order Scalar or array keyword DOUBLE use double precision to perform the computation keyword ONSPHERE to specify that the quadilateral are on a sphere and that teir coordinates are longitude latitude coordinates In this case est west periodicity poles singularity and other pbs related to longitude latitude coordinates are managed automatically keyword ZOOMRADIUS :the zoom circle centred on the x y with a radius of zoomradius degree where we look for the the quadrilateral which contains the x y point used for the satellite projection when onsphere is activated Default is 4 and seems to be the minimum which can be used Can be increase if the cell size is larger than 5 degrees keyword NOPRINT to suppress the print messages returns a n element vector Where n is the number of elements of x res i j means that the point number i is located in the quadrilateral number j with 0 j n_elements x0 1 restrictions I think degenerated quadrilateral e g flat of twisted is not work This has to be tested examples x 1 1 2 6 7 3 y 1 1 3 3 4 7 x1 1 0 4 2 y1 1 1 4 8 x2 1 1 6 4 y2 1 5 6 8 x3 1 3 8 4 y3 1 4 4 6 x4 1 2 6 2 y4 1 0 2 6 splot 0 10 0 10 xstyle 1 ystyle 1 nodata for i 0 2 do oplot x4 i x1 i x2 i x3 i x4 i y4 i y1 i y2 i y3 i y4 i oplot x y color 20 psym 1 thick 2 print inquad x y x1 y1 x2 y2 x3 y3 x4 y4 On a sphere see clickincell pro history Sebastien Masson smasson lodyc jussieu fr August 2003 Based on Convert_clic_ij pro written by Gurvan Madec FUNCTION inquad x y x1 y1 x2 y2 x3 y3 x4 y4 ONSPHERE onsphere DOUBLE double ZOOMRADIUS zoomradius NOPRINT noprint NEWCOORD newcoord ntofind n_elements x nquad n_elements x2 IF keyword_set onsphere THEN BEGIN save the inputs parameters xin x yin y x1in x1 y1in y1 x2in x2 y2in y2 x3in x3 y3in y3 x4in x4 y4in y4 for map_set x x MOD 360 x1 x1 MOD 360 x2 x2 MOD 360 x3 x3 MOD 360 x4 x4 MOD 360 save map save map: map x: x y: y z: z p: p do a satellite projection IF NOT keyword_set zoomradius THEN zoomradius 4 map_set y 0 x 0 0 satellite sat_p 1 zoomradius 20 6371 229 0 0 noerase iso noborder use normal coordinates to reject cells which are out of the projection tmp convert_coord x y DATA TO_NORMAL DOUBLE double tmp1 convert_coord x1 y1 DATA TO_NORMAL DOUBLE double tmp2 convert_coord x2 y2 DATA TO_NORMAL DOUBLE double tmp3 convert_coord x3 y3 DATA TO_NORMAL DOUBLE double tmp4 convert_coord x4 y4 DATA TO_NORMAL DOUBLE double remove cell which have one corner with coordinates equal to NaN test finite tmp1 0 tmp1 1 tmp2 0 tmp2 1 tmp3 0 tmp3 1 tmp4 0 tmp4 1 good where temporary test EQ 1 IF good 0 EQ 1 THEN BEGIN IF NOT keyword_set noprint THEN print The point is out of the cells restore the input parameters x temporary xin y temporary yin x1 temporary x1in y1 temporary y1in x2 temporary x2in y2 temporary y2in x3 temporary x3in y3 temporary y3in x4 temporary x4in y4 temporary y4in restore old map map save map x save x y save y z save z p save p RETURN 1 ENDIF x tmp 0 y tmp 1 x1 tmp1 0 good y1 tmp1 1 good x2 tmp2 0 good y2 tmp2 1 good x3 tmp3 0 good y3 tmp3 1 good x4 tmp4 0 good y4 tmp4 1 good tmp1 1 tmp2 1 tmp3 1 tmp4 1 remove cells which are obviously bad test x1 GT x AND x2 GT x AND x3 GT x AND x4 GT x OR x1 LT x AND x2 LT x AND x3 LT x AND x4 LT x OR y1 GT y AND y2 GT y AND y3 GT y AND y4 GT y OR y1 LT y AND y2 LT y AND y3 LT y AND y4 LT y good2 where temporary test EQ 0 IF good2 0 EQ 1 THEN BEGIN IF NOT keyword_set noprint THEN print The point is out of the cells restore the input parameters x temporary xin y temporary yin x1 temporary x1in y1 temporary y1in x2 temporary x2in y2 temporary y2in x3 temporary x3in y3 temporary y3in x4 temporary x4in y4 temporary y4in restore old map map save map x save x y save y z save z p save p RETURN 1 ENDIF nquad n_elements good2 x1 x1 good2 y1 y1 good2 x2 x2 good2 y2 y2 good2 x3 x3 good2 y3 y3 good2 x4 x4 good2 y4 y4 good2 ENDIF the point is inside the quadilateral if test eq 1 with test equal to: test x x1 y2 y1 GE x2 x1 y y1 x x2 y3 y2 GT x3 x2 y y2 x x3 y4 y3 GT x4 x3 y y3 x x4 y1 y4 GE x1 x4 y y4 computation of test without any do loop for ntofind points x y and nquad quadilateral x1 x2 x3 x4 y1 y2 y3 y4 test dimensions are ntofind nquad column i of test corresponds to the intersection of point i with all quadirlateral row j of test corresponds to all the points localized in cell j test x x1 x replicate 1 nquad replicate 1 ntofind x1 y2 y1 replicate 1 ntofind y2 y1 GE x2 x1 GE replicate 1 ntofind x2 x1 y y1 y replicate 1 nquad replicate 1 ntofind y1 test temporary test x x2 x replicate 1 nquad replicate 1 ntofind x2 y3 y2 replicate 1 ntofind y3 y2 GE x3 x2 GE replicate 1 ntofind x3 x2 y y2 y replicate 1 nquad replicate 1 ntofind y2 test temporary test x x3 x replicate 1 nquad replicate 1 ntofind x3 y4 y3 replicate 1 ntofind y4 y3 GE x4 x3 GE replicate 1 ntofind x4 x3 y y3 y replicate 1 nquad replicate 1 ntofind y3 test temporary test x x4 x replicate 1 nquad replicate 1 ntofind x4 y1 y4 replicate 1 ntofind y1 y4 GE x1 x4 GE replicate 1 ntofind x1 x4 y y4 y replicate 1 nquad replicate 1 ntofind y4 check test if ntofind gt 1 if ntofind gt 1 each point must be localised in one uniq cell IF ntofind GT 1 THEN BEGIN each column of test must have only 1 position equal to one chtest total test 2 points out of the cells IF where chtest EQ 0 0 NE 1 THEN BEGIN IF NOT keyword_set noprint THEN print Points number strjoin strtrim where chtest EQ 0 1 are out of the grid stop ENDIF points in more than one cell IF where chtest GT 1 0 NE 1 THEN BEGIN IF NOT keyword_set noprint THEN print Points number strjoin strtrim where chtest GT 1 1 are in more than one cell stop ENDIF ENDIF find the points for which test eq 1 found where temporary test EQ 1 if ntofind eq 1 the point may be localised in more than one grid cell ou may also be out of the cells IF ntofind EQ 1 THEN BEGIN CASE 1 OF found 0 EQ 1:BEGIN IF NOT keyword_set noprint THEN print The point is out of the cells IF keyword_set onsphere THEN BEGIN restore old map map save map x save x y save y z save z p save p ENDIF return 1 END n_elements found GT ntofind:BEGIN IF NOT keyword_set noprint THEN print The point is in more than one cell END ELSE: ENDCASE ENDIF ELSE BEGIN if ntofind GT 1 found must be sorted i position of found this corresponds to one x y point forsort found MOD ntofind j position of found this corresponds to cell in which is one x y point found temporary found ntofind found must be sorted accordind to forsort found found sort forsort ENDELSE IF keyword_set onsphere THEN BEGIN IF arg_present newcoord THEN BEGIN newcoord x1 found y1 found x2 found y2 found x3 found y3 found x4 found y4 found x y ENDIF found good good2 found restore the input parameters x temporary xin y temporary yin x1 temporary x1in y1 temporary y1in x2 temporary x2in y2 temporary y2in x3 temporary x3in y3 temporary y3in x4 temporary x4in y4 temporary y4in restore old map map save map x save x y save y z save z p save p ENDIF RETURN found END"); … … 55 55 a[53] = new Array("./Obsolete/common.html", "common.pro", "", ""); 56 56 a[54] = new Array("./Obsolete/cp.html", "cp.pro", "", " file_comments copy files obsolete file_comments file_copy should be used instead history June 2005: Sebastien Masson obsolete routine PRO cp filenamein filenameout _extra ex file_copy filenamein filenameout _extra ex RETURN END"); 57 a[55] = new Array("./Obsolete/ficdate.html", "ficdate.pro", "", " file_comments sets s_fichier to name of the vairmer file associated to the given date in vairmer format yymmdd obsolete param vdate in date vairmer ex:930124 param dim in so ou vo par defaut so est choisi param nomexp in nom de l experience en trois lettres par defaut prefix returns le nom du fichier vairmer depuis iodir uses common pro example IDL fic ficdate 930124 history Jerome Vialard jv lodyc jussieu fr 1 7 98 function ficdate vdate dim nomexp common case n_params of 1: dim SO 2: dim strupcase dim 3: begin prefix nomexp dim strupcase dim end endcase constitution de l adresse ou aller chercher le fichier date yymmdd vdate sets month year and day to the good value : rien juldate vdate constitution de la date yymmdd case 1 of year lt 10: s_year 0 string format i1 year year ge 10 and year lt 100:s_year string format i2 year year ge 100:BEGIN year year 1900 if year LT 10 then s_year 0 string format i1 year ELSE s_year string format i2 year end endcase if month lt 10 then s_month 0 string format i1 month else s_month string format i2 month if day lt 10 then s_day 0 string format i1 day else s_day string format i2 day case dim of SO : begin case 1 of year eq 0 and month eq 0 : s_fichier iodir prefix O EX SO year eq 0 and month ne 0 and day eq 0 : s_fichier iodir prefix O SE SO s_month year ne 0 and month eq 0 : s_fichier iodir prefix O AN SO s_year year ne 0 and day eq 0 : s_fichier iodir prefix O MO SO s_year s_month else: s_fichier iodir prefix O SO s_year s_month s_day endcase end VO : begin case 1 of year eq 0 and month eq 0 : s_fichier iodir prefix O EX VO year eq 0 and month ne 0 and day eq 0 : s_fichier iodir prefix O SE VO s_month year ne 0 and month eq 0 : s_fichier iodir prefix O AN VO s_year year ne 0 and day eq 0 : s_fichier iodir prefix O MO VO s_year s_month else: s_fichier iodir prefix O VO s_year s_month s_day endcase end else: return report le fichier doit etre VO ou SO endcase print print adresse du fichier: fichier return s_fichier end ");58 a[56] = new Array("./Obsolete/fictype.html", "fictype.pro", "", " file_comments gives fictype DA MO AN SE EX corresponding to the given date in vairmer format yymmdd uses common pro exam mples IDL fictype fictype 930124 history Jerome Vialard jv lodyc jussieu fr 2 7 98 function fictype vdate dim common constitution de l adresse ou aller chercher le fichier date yymmdd vdate jul juldate vdate case 1 of year eq 0 and month eq 0 : return EX year eq 0 and month ne 0 and day eq 0 : return SE year ne 0 and month eq 0 : return AN year ne 0 and day eq 0 : return MO else : return DA endcase fini: return 1 end ");57 a[55] = new Array("./Obsolete/ficdate.html", "ficdate.pro", "", " file_comments sets s_fichier to name of the vairmer file associated to the given date in vairmer format yymmdd obsolete param vdate in date vairmer ex:930124 param dim in so ou vo par defaut so est choisi param nomexp in nom de l experience en trois lettres par defaut prefix returns le nom du fichier vairmer depuis iodir uses common pro examples IDL fic ficdate 930124 history Jerome Vialard jv lodyc jussieu fr 1 7 98 function ficdate vdate dim nomexp common case n_params of 1: dim SO 2: dim strupcase dim 3: begin prefix nomexp dim strupcase dim end endcase constitution de l adresse ou aller chercher le fichier date yymmdd vdate sets month year and day to the good value : rien juldate vdate constitution de la date yymmdd case 1 of year lt 10: s_year 0 string format i1 year year ge 10 and year lt 100:s_year string format i2 year year ge 100:BEGIN year year 1900 if year LT 10 then s_year 0 string format i1 year ELSE s_year string format i2 year end endcase if month lt 10 then s_month 0 string format i1 month else s_month string format i2 month if day lt 10 then s_day 0 string format i1 day else s_day string format i2 day case dim of SO : begin case 1 of year eq 0 and month eq 0 : s_fichier iodir prefix O EX SO year eq 0 and month ne 0 and day eq 0 : s_fichier iodir prefix O SE SO s_month year ne 0 and month eq 0 : s_fichier iodir prefix O AN SO s_year year ne 0 and day eq 0 : s_fichier iodir prefix O MO SO s_year s_month else: s_fichier iodir prefix O SO s_year s_month s_day endcase end VO : begin case 1 of year eq 0 and month eq 0 : s_fichier iodir prefix O EX VO year eq 0 and month ne 0 and day eq 0 : s_fichier iodir prefix O SE VO s_month year ne 0 and month eq 0 : s_fichier iodir prefix O AN VO s_year year ne 0 and day eq 0 : s_fichier iodir prefix O MO VO s_year s_month else: s_fichier iodir prefix O VO s_year s_month s_day endcase end else: return report le fichier doit etre VO ou SO endcase print print adresse du fichier: fichier return s_fichier end "); 58 a[56] = new Array("./Obsolete/fictype.html", "fictype.pro", "", " file_comments gives fictype DA MO AN SE EX corresponding to the given date in vairmer format yymmdd uses common pro examples IDL fictype fictype 930124 history Jerome Vialard jv lodyc jussieu fr 2 7 98 function fictype vdate dim common constitution de l adresse ou aller chercher le fichier date yymmdd vdate jul juldate vdate case 1 of year eq 0 and month eq 0 : return EX year eq 0 and month ne 0 and day eq 0 : return SE year ne 0 and month eq 0 : return AN year ne 0 and day eq 0 : return MO else : return DA endcase fini: return 1 end "); 59 59 a[57] = new Array("./Obsolete/imprime.html", "imprime.pro", "", " file_comments use printps instead obsolete history June 2005: Sebastien Masson english version PRO imprime filename TRANS trans NB nb this is working only with unix linux osX machines thisOS strupcase strmid version os_family 0 3 CASE thisOS OF MAC :return WIN :return ELSE: ENDCASE call printps CASE N_PARAMS OF 0:printps 1:printps filename ELSE: BEGIN ras report imprime accept only one element: psfilename return END ENDCASE return END "); 60 60 a[58] = new Array("./Obsolete/jourdsmois.html", "jourdsmois.pro", "", " file_comments used daysinmonth instead obsolete history Sebastien Masson smasson lodyc jussieu fr June 2005: Sebastien Masson english version function jourdsmois mois annee case n_params OF 0:return daysinmonth 1:return daysinmonth mois 2:return daysinmonth mois annee endcase end"); … … 70 70 a[68] = new Array("./Obsolete/nlecsaison.html", "nlecsaison.pro", "", " file_comments lit les moyennes annuelles sur maia: u rech eee reee217 TOTEM REF OUTPUTS obsolete categories lecture de NETCDF examples IDL res nlecsaison nom numsortie79 nbretps param nom in required nom du tableau contenant le champ que l on veut le trouver avec ncdflec fichier var param numsortie79 in required le numero du pas de temps que l on veut sortir du fichier compte a partir de 1 a partir de 79 param nbretps in required nombre de pas de temps a extraire keyword BOITE boite sur laquelle integrer par defaut tt le domaine keyword GRILLE impose la grille a laquelle est rapporte le champ rq permet d aller plus vite ds la lecture keyword TOUT oblige a lire le tableau entier en non pas celui reduit a domdef returns tableau 2d qd la serie ne fait que 1 pas de temps ou 3d valable ds 1 premier tps que pour les tableaux 2d uses common pro restrictions appele par nlec history Sebastien Masson smasson lodyc jussieu fr REF saisonnier climato grid T nc function nlecsaison nom numsortie79 nbretps BOITE boite GRILLE grille TOUT tout _EXTRA ex common res 1 anneedepart 1979 gestion du nom de la grille en testant les differentes possibilites et ouverture du fichier if keyword_set grille then begin vargrid grille nomfich prefix saisonnier climato grid vargrid nc IF version OS_FAMILY EQ unix THEN spawn file iodir nomfich dev null cdfid ncdf_open iodir nomfich varcontient ncdf_varinq cdfid nom endif else begin liste des fichiers pouvant convenir quelsfichiers findfile iodir prefix saisonnier climato grid IF quelsfichiers 0 EQ THEN liste vide return report LES FICHIERS: iodir prefix saisonnier climato grid n existe pas for i 0 n_elements quelsfichiers 1 do begin IF version OS_FAMILY EQ unix THEN spawn file quelsfichiers i dev null cdfid ncdf_open quelsfichiers i contient ncdf_inquire cdfid for varid 0 contient nvars 1 do BEGIN ds les fichiers existants on varcontient ncdf_varinq cdfid varid cherche le nom des variables if varcontient name eq nom then BEGIN vargrid strmid quelsfichiers i strpos quelsfichiers i grid 5 1 nom de grille goto grilletrouvee ENDIF endfor ncdf_close cdfid endfor return report La variable nom n existe pas ds les fichiers iodir prefix saisonnier climato grid endelse grilletrouvee: lecture de certains attributs et de l axe des temps ncdf_attget cdfid nom title value varname string value ncdf_attget cdfid nom units value varunit string value if rstrpos varname eq 1 then varname varname varunit varexp prefix lecture de l axe des temps ncdf_varget cdfid time_counter time offset numsortie79 1 count nbretps time long time julday 12 31 1978 jpt nbretps IF jpt EQ 1 THEN BEGIN IF numsortie79 EQ 13 THEN vardate CLIMATOLOGIE prefix ELSE begin vardate climato mensuelle strtrim numsortie79 1 endelse endif extraction du tableau qui nous interesse determination du domaine geographique if keyword_set tout then begin nx jpi ny jpj nz jpk glam 1 gphi 1 gdep 1 premierx 0 premiery 0 premierz 0 endif else BEGIN redefinition eventuelle du domaine ajuste a boite a 6 elements on recupere la dim du no9uveau domaine if keyword_set boite then BEGIN CASE N_Elements Boite Of 1:Domdef lon1 lon2 lat1 lat2 0 boite 0 GRILLE vargrid _EXTRA ex 2:Domdef lon1 lon2 lat1 lat2 boite 0 boite 1 GRILLE vargrid _EXTRA ex 4:Domdef Boite prof1 prof2 GRILLE vargrid _EXTRA ex 5:Domdef Boite 0:3 0 Boite 4 GRILLE vargrid _EXTRA ex 6:Domdef Boite GRILLE vargrid _EXTRA ex Else:return report Mauvaise Definition de Boite endcase ENDIF grille mask glam gphi gdep nx ny nz premierx premiery premierz ENDELSE if varcontient ndims eq 3 then ncdf_varget cdfid nom res offset premierx premiery numsortie79 1 count nx ny nbretps else ncdf_varget cdfid nom res offset premierx premiery premierz numsortie79 1 count nx ny nz nbretps ncdf_close cdfid return res end"); 71 71 a[69] = new Array("./Obsolete/nlecserie.html", "nlecserie.pro", "", " file_comments lit les series temporelles se rapportant a une variable sur maia: u rech eee reee217 TOTEM REF OUTPUTS obsolete categories lecture de NETCDF examples IDL res nlecserie nom date1 date2 param nom in required nom du tableau contenant le champ que l on veut le trouver avec ncdflec fichier var param date1 date2 in required les dates vermairs qui delimitent la serie temporelle keyword BOITE boite sur laquelle integrer par defaut tt le domaine keyword GRILLE impose la grille a laquelle est rapporte le champ rq permet d aller plus vite ds la lecture keyword TOUT oblige a lire le tableau entier en non pas celui reduit a domdef returns tableau 2d qd la serie ne fait que 1 pas de temps ou 3d valable ds 1 premier tps que pour les tableaux 2d uses common pro restrictions appele par nlec history Sebastien Masson smasson lodyc jussieu fr REF sss grid T nc function nlecserie nom date1 date2 BOITE boite GRILLE grille TOUT tout _EXTRA ex common res 1 anneedepart 1979 gestion du nom de la grille et ouverture du fichier liste des fichiers pouvant convenir quelsfichiers findfile iodir prefix nom grid IF quelsfichiers 0 EQ THEN BEGIN liste vide print LES FICHIERS: iodir prefix nom grid n existe pas return 1 ENDIF ELSE BEGIN vargrid strmid quelsfichiers 0 strpos quelsfichiers 0 grid 5 1 nom de grille IF version OS_FAMILY EQ unix THEN spawn file quelsfichiers 0 dev null cdfid ncdf_open quelsfichiers 0 ENDELSE lecture de certains attributs et de l axe des temps ncdf_attget cdfid nom title value varname string value ncdf_attget cdfid nom units value varunit string value if rstrpos varname eq 1 then varname varname varunit ncdf_attget cdfid file_name value global varexp string value varexp strmid varexp 0 strpos varexp lecture de l axe des temps en entier on ja reperer la place des dates debut et fin pour faire l extraction temporelle ncdf_varget cdfid time_counter time time long time julday 1 5 1979 debut where time EQ juldate date1 fin where time EQ juldate date2 debut where time EQ date1 fin where time EQ date2 if debut 0 EQ 1 then return report l axe des temps ne contient pas la date de debut strtrim date1 1 if fin 0 EQ 1 then return report l axe des temps ne contient pas la date de fin strtrim date2 1 time time debut 0 :fin 0 jpt fin 0 debut 0 1 IF jpt EQ 1 THEN BEGIN caldat time 0 month day year case 1 of year lt 10: s_year 0 string format i1 year year lt 100 and year ge 10 :s_year string format i2 year year ge 100: s_year string format i2 year 1900 endcase if month lt 10 then s_month 0 string format i1 month else s_month string format i2 month if day lt 10 then s_day 0 string format i1 day else s_day string format i2 day vardate s_year s_month s_day endif extraction du tableau qui nous interesse determination du domaine geographique if keyword_set tout then begin nx jpi ny jpj nz jpk premierx 0 premiery 0 premierz 0 endif else BEGIN redefinition eventuelle du domaine ajuste a boite a 6 elements on recupere la dim du no9uveau domaine if keyword_set boite then BEGIN Case N_Elements Boite Of 1:Domdef lon1 lon2 lat1 lat2 0 boite 0 GRILLE vargrid _EXTRA ex 2:Domdef lon1 lon2 lat1 lat2 boite 0 boite 1 GRILLE vargrid _EXTRA ex 4:Domdef Boite prof1 prof2 GRILLE vargrid _EXTRA ex 5:Domdef Boite 0:3 0 Boite 4 GRILLE vargrid _EXTRA ex 6:Domdef Boite GRILLE vargrid _EXTRA ex Else:return report Mauvaise Definition de Boite endcase ENDIF grille mask glam gphi gdep nx ny nz premierx premiery ENDELSE ncdf_varget cdfid nom res offset premierx premiery debut 0 count nx ny fin 0 debut 0 1 ncdf_close cdfid return res end"); 72 a[70] = new Array("./Obsolete/vairdate.html", "vairdate.pro", "", " file_comments gives vairmer date equivalent of a date in julian format sets month day and year to the corresp values obsolete file_comments you better use jul2date examples IDL vdate vairdate 1755087 param jdate in required date en jours juliens keyword MENSUEL a activer si on veut pour que les dates dont le jour est 15 deviennent avec un jour egale a 0 par ex: 19990115 19990100 keyword ANNUEL a activer si on veut pour que les dates dont le mois est 6 et dont le jour est 1 deviennent avec un mois et jour egale a 0 par ex: 19990601 19990000 returns vdate date vairmer plus year month et day uses common prohistory Jerome Vialard jv lodyc jussieu fr 2 7 98 13 9 1999 Sebastien Masson smasson lodyc jussieu fr ANNUEL MENSUEL _EXTRA et possibilite d utiliser vairdate avec des scalaire ou des tableaux function vairdate jdate ANNUEL annuel MENSUEL mensuel _EXTRA ex common caldat jdate month day year _EXTRA ex index where year eq 1 if index 0 NE 1 then year index 0 if keyword_set mensuel THEN BEGIN index where day EQ 15 if index 0 NE 1 then day index 0 endif if keyword_set annuel THEN BEGIN index where day EQ 1 AND month EQ 6 if index 0 NE 1 then BEGIN day index 0 month index 0 endif endif return 10000L year 100L month day end ");72 a[70] = new Array("./Obsolete/vairdate.html", "vairdate.pro", "", " file_comments gives vairmer date equivalent of a date in julian format sets month day and year to the corresp values obsolete file_comments you better use jul2date examples IDL vdate vairdate 1755087 param jdate in required date en jours juliens keyword MENSUEL a activer si on veut pour que les dates dont le jour est 15 deviennent avec un jour egale a 0 par ex: 19990115 19990100 keyword ANNUEL a activer si on veut pour que les dates dont le mois est 6 et dont le jour est 1 deviennent avec un mois et jour egale a 0 par ex: 19990601 19990000 returns vdate date vairmer plus year month et day uses common history Jerome Vialard jv lodyc jussieu fr 2 7 98 13 9 1999 Sebastien Masson smasson lodyc jussieu fr ANNUEL MENSUEL _EXTRA et possibilite d utiliser vairdate avec des scalaire ou des tableaux function vairdate jdate ANNUEL annuel MENSUEL mensuel _EXTRA ex common caldat jdate month day year _EXTRA ex index where year eq 1 if index 0 NE 1 then year index 0 if keyword_set mensuel THEN BEGIN index where day EQ 15 if index 0 NE 1 then day index 0 endif if keyword_set annuel THEN BEGIN index where day EQ 1 AND month EQ 6 if index 0 NE 1 then BEGIN day index 0 month index 0 endif endif return 10000L year 100L month day end "); 73 73 a[71] = new Array("./Obsolete/vraidate.html", "vraidate.pro", "", " file_comments donne la date en long obsolete param date in required une date du type yyyymmdd keyword GRADS if 1 le year le 49 then year 2000 year if 50 le year le 99 then year 1900 year returns une date vairmer du type yyyymmdd si year est nulle ou egale a 1 ne change rien examples IDL res vraidate date IDL vraidate 980703 donne 19980703 qui est un long history Sebastien Masson smasson lodyc jussieu fr 3 7 98 remove automatic change from year 1 to 1901 Aug 2004 function vraidate date GRADS grads _EXTRA ex IF NOT keyword_set GRADS THEN return long date date long date annee date 10000 return date 19000000L annee GE 50 and date lt 1000000 20000000L annee LT 50 and date lt 1000000 end"); 74 74 a[72] = new Array("./Postscript/closeps.html", "closeps.pro", "", " NAME: closeps PURPOSE: Close the Postscript mode CALLING SEQUENCE: closeps KEYWORD PARAMETERS: INFOWIDGET: A long integer giving the id of the information widget created by openps that we have de destroy at the end of closeps when the postscript is done COMMON BLOCKS: cm_4ps SIDE EFFECTS: when archive_ps ne 0 we add the name and the date at the bottom left corner of the postcript page If the postscript is called idl ps we change its name to number ps number automatically found to be 1 larger that any of the existing ps file MODIFICATION HISTORY: Sebastien Masson smasson lodyc jussieu fr 21 12 98 June 2005: Sebastien Masson english version with new commons PRO closeps INFOWIDGET infowidget IF lmgr demo EQ 1 THEN return include commons cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF IF d name NE PS THEN GOTO last_part if archive_ps 0 we will add its name and the date at the bottom left corner of the page in case if the postscript will be archived in printps IF keyword_set archive_ps THEN BEGIN we get the name of the latest created postscript psdir isadirectory psdir title Select psdir nameps file_search psdir ps test_regular test_write nosort dates file_info nameps mtime lastdate reverse sort temporary dates 0 nameps nameps lastdate nameps file_basename nameps ps If this name is idl ps then we change it to the number ps IF nameps EQ idl then BEGIN get the name of all the ps or ps gz files available in psdir allps file_search psdir ps ps gz pdf test_regular nosort allps file_basename file_basename allps gz ps allps file_basename allps pdf find which of these names corresponds to numbers get ascii codes of the names testnumb byte allps longest name maxstrlen size testnumb dimensions 0 ascii codes can be 0 or between byte 0 and byte 9 testnumb testnumb EQ 0 OR testnumb GE byte 0 0 AND testnumb LE byte 9 0 testnumb where total testnumb 1 EQ maxstrlen count IF count NE 0 THEN BEGIN get the largest number psnumber fix allps testnumb psnumber psnumber reverse sort psnumber 0 1 ENDIF ELSE psnumber 0 nameps strtrim psnumber 2 ENDIF we annote the postscript date byte systime 0 we get the date xyouts d x_px_cm d y_px_cm nameps string date 4:10 string date 20:23 device charsize 75 ENDIF close the postcript mode device close last_part: thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC : SET_PLOT thisOS WIN : SET_PLOT thisOS ELSE: SET_PLOT X ENDCASE def_myuniquetmpdir colorfile myuniquetmpdir original_colors dat IF file_test colorfile regular THEN BEGIN restore colorfile file_delete colorfile quiet reload the original colors tvlct red green blue ENDIF p font 1 force background color to the last color white p BACKGROUND d n_colors 1 255 p color 0 if d n_colors gt 256 then p background ffffff x if keyword_set infowidget then widget_control long infowidget bad_id toto destroy return end");
Note: See TracChangeset
for help on using the changeset viewer.