[17] | 1 | ; + |
---|
[20] | 2 | ; |
---|
[17] | 3 | ; @file_comments |
---|
[20] | 4 | ; initialisation on ORCA grid |
---|
[2] | 5 | ; |
---|
[20] | 6 | ; @param orcares {in}{required}{type=string} |
---|
| 7 | ; code of ORCA grid to use for output results |
---|
| 8 | ; must be 'ORCA2' or 'ORCA025' |
---|
| 9 | ; |
---|
| 10 | ; @keyword DRAKKAR_EXP {type=string} |
---|
| 11 | ; code for Drakkar experiment |
---|
| 12 | ; only used when orcares = ORCA025 |
---|
| 13 | ; must be G42 ++ G70 |
---|
| 14 | ; |
---|
| 15 | ; @keyword EXTRA |
---|
| 16 | ; must exist in order to be able to use this procedure as an argument |
---|
| 17 | ; |
---|
| 18 | ; @examples |
---|
[23] | 19 | ; appel classique pour ORCA2 |
---|
[24] | 20 | ; IDL> initocemeshmask,'ORCA2' |
---|
[20] | 21 | ; |
---|
[23] | 22 | ; appel classique pour ORCA025 |
---|
[24] | 23 | ; IDL> initocemeshmask,'ORCA025',DRAKKAR_EXP='G42' |
---|
[23] | 24 | ; |
---|
[20] | 25 | ; to plot ${GEOMAG_OD}/cond_sed_ORCA2.nc : |
---|
| 26 | ; IDL> myfile=getenv('GEOMAG_OD') + 'cond_sed_ORCA2.nc' |
---|
[24] | 27 | ; IDL> xxx, myfile, 'initocemeshmask', '''ORCA2''',format='(i5)' |
---|
[20] | 28 | ; |
---|
[23] | 29 | ; to plot ${GEOMAG_OD}/cond_sed_ORCA025.nc : |
---|
| 30 | ; IDL> myfile=getenv('GEOMAG_OD') + 'cond_sed_ORCA025.nc' |
---|
[24] | 31 | ; IDL> xxx, myfile, 'initocemeshmask', '''ORCA025''',DRAKKAR_EXP='G42',format='(i5)' |
---|
| 32 | |
---|
[17] | 33 | ; @history |
---|
[24] | 34 | ; reee522 2007-06-08T15:35:17Z rhodes (IRIX64) |
---|
| 35 | ; rename from initocemesh to initocemeshmask |
---|
[23] | 36 | ; reee522 2007-06-06T15:27:54Z rhodes (IRIX64) |
---|
| 37 | ; add examples for ORCA025. ++ to be tested |
---|
[22] | 38 | ; reee522 2007-06-06T14:57:39Z rhodes (IRIX64) |
---|
| 39 | ; correction for DRAKKAR_EXP usage |
---|
[17] | 40 | ; F. Vivier 2003 |
---|
| 41 | ; F. Pinsard adaptation to new SAXO |
---|
| 42 | ; according to SAXO ./SRC/Tests/tst_initorca2.pro |
---|
[20] | 43 | ; fplod 2007-05-15T13:43:21Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 44 | ; transformation in procedure with parameter orcares |
---|
| 45 | ; fplod 2007-06-05T12:22:38Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
| 46 | ; (following Sebastien Masson advices) |
---|
| 47 | ; . add EXTRA keyword in order to be able to use this procedure as an argument |
---|
| 48 | ; of <pro>xxx</pro>. |
---|
| 49 | ; . add EXTRA to the call of ncdf_meshlec |
---|
| 50 | ; replace initorca2_bab by initocemesh in filename and procedure name |
---|
[2] | 51 | ; |
---|
[17] | 52 | ; @todo |
---|
[24] | 53 | ; add call to smallmeshmask to mix zhg, hgr and byte_mask files for ORCA025 |
---|
[17] | 54 | ; |
---|
[20] | 55 | ; zminmesh and izmaxmesh may be set to 0,0 because we only work with |
---|
| 56 | ; surface problem (no z) whatever the resolution of ORCA. this will safe lot |
---|
[17] | 57 | ; of memory |
---|
[20] | 58 | ; |
---|
| 59 | ; use <pro>ncdf_getaxis</pro> to recover meshmask dimension |
---|
[17] | 60 | ; on x, retrieve -1 and -1 (bande de recouvrement haut et bas) |
---|
[20] | 61 | ; on y, for ORCA2, retrieve -2 (bande de recouvrement ++ et ++) |
---|
[17] | 62 | ; |
---|
| 63 | ; reminder : ORCA2 = 182 x 149 and ORCA025 1442 x 1021 |
---|
| 64 | ; |
---|
[20] | 65 | ; for ORCA025, use /keepcont in <pro>triangule</pro> call. |
---|
| 66 | ; |
---|
[17] | 67 | ; @version |
---|
| 68 | ; $Id$ |
---|
[20] | 69 | ; |
---|
[17] | 70 | ;- |
---|
| 71 | ; |
---|
[24] | 72 | PRO initocemeshmask, orcares, DRAKKAR_EXP = drakkar_exp, _EXTRA = ex |
---|
[20] | 73 | ; |
---|
| 74 | compile_opt idl2, strictarrsubs |
---|
| 75 | ; |
---|
[17] | 76 | @cm_4mesh |
---|
| 77 | @cm_4cal |
---|
| 78 | @cm_4data |
---|
| 79 | ; |
---|
[20] | 80 | ; check input parameters |
---|
| 81 | CASE orcares OF |
---|
| 82 | 'ORCA2': BEGIN |
---|
| 83 | msg = 'iii : valid orcares parameter = ' + orcares |
---|
| 84 | ras = report(msg) |
---|
| 85 | filename_oce = 'meshmask_bab.nc' |
---|
| 86 | IF keyword_set(DRAKKAR_EXP) THEN BEGIN |
---|
| 87 | msg = 'www : unused DRAKKAR_EXP keyword = ' + drakkar_exp |
---|
| 88 | ras = report(msg) |
---|
| 89 | END |
---|
| 90 | END |
---|
| 91 | 'ORCA025': BEGIN |
---|
| 92 | msg = 'iii : valid orcares parameter = ' + orcares |
---|
| 93 | ras = report(msg) |
---|
| 94 | IF keyword_set(DRAKKAR_EXP) THEN BEGIN |
---|
| 95 | msg = 'iii : DRAKKAR_EXP keyword set' |
---|
| 96 | ras = report(msg) |
---|
| 97 | msg = 'iii : DRAKKAR_EXP = ' + drakkar_exp |
---|
| 98 | ras = report(msg) |
---|
| 99 | CASE drakkar_exp OF |
---|
| 100 | 'G42' : BEGIN |
---|
| 101 | msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp |
---|
| 102 | ras = report(msg) |
---|
| 103 | END |
---|
| 104 | 'G70' : BEGIN |
---|
| 105 | msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp |
---|
| 106 | ras = report(msg) |
---|
| 107 | END |
---|
| 108 | ELSE : BEGIN |
---|
| 109 | msg = 'eee : invalid DRAKKAR_EXP keyword = ' + drakkar_exp |
---|
| 110 | ras = report(msg) |
---|
| 111 | RETURN |
---|
| 112 | END |
---|
| 113 | ENDCASE |
---|
| 114 | filename_oce = orcares + '-' + drakkar_exp + '_mesh_hgr.nc' |
---|
[22] | 115 | ENDIF ELSE BEGIN |
---|
| 116 | msg = 'eee : unset DRAKKAR_EXP keyword' |
---|
| 117 | ras = report(msg) |
---|
| 118 | msg = 'eee : orcares must be G42 or G70' |
---|
| 119 | ras = report(msg) |
---|
| 120 | RETURN |
---|
| 121 | ENDELSE |
---|
[20] | 122 | END |
---|
| 123 | ELSE : BEGIN |
---|
| 124 | msg = 'eee : invalid orcares parameter = ' + orcares |
---|
| 125 | ras = report(msg) |
---|
| 126 | msg = 'eee : orcares must be ORCA2 or ORCA025' |
---|
| 127 | ras = report(msg) |
---|
| 128 | RETURN |
---|
| 129 | END |
---|
| 130 | ENDCASE |
---|
| 131 | ; |
---|
| 132 | ; check for input files |
---|
| 133 | ; |
---|
[19] | 134 | ; test if ${GEOMAG_ID} defined |
---|
[20] | 135 | geomag_id_env=GETENV('GEOMAG_ID') |
---|
| 136 | CASE geomag_id_env OF |
---|
| 137 | '' : BEGIN |
---|
| 138 | msg = 'eee : ${GEOMAG_ID} is not defined' |
---|
| 139 | ras = report(msg) |
---|
| 140 | RETURN |
---|
| 141 | END |
---|
| 142 | ELSE: BEGIN |
---|
| 143 | msg = 'iii : ${GEOMAG_ID} is ' + geomag_id_env |
---|
| 144 | ras = report(msg) |
---|
| 145 | END |
---|
| 146 | ENDCASE |
---|
[19] | 147 | iodirin = isadirectory(geomag_id_env) |
---|
| 148 | ; |
---|
[20] | 149 | ; existence and protection of ${GEOMAG_ID} |
---|
| 150 | IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN |
---|
| 151 | msg = 'eee : the directory' + iodirin + ' is not accessible.' |
---|
| 152 | ras = report(msg) |
---|
| 153 | RETURN |
---|
| 154 | ENDIF |
---|
| 155 | ; |
---|
[19] | 156 | ; check if this file exists |
---|
| 157 | fullfilename_oce = isafile(iodirin + filename_oce, NEW=0, /MUST_EXIST, $ |
---|
| 158 | RECURSIVE=0) |
---|
[20] | 159 | IF fullfilename_oce[0] EQ '' THEN BEGIN |
---|
| 160 | msg = 'eee : the file ' + fullfilename_oce + ' was not found.' |
---|
| 161 | ras = report(msg) |
---|
| 162 | RETURN |
---|
| 163 | ENDIF |
---|
| 164 | ; |
---|
| 165 | ; protection |
---|
| 166 | IF (FILE_TEST(fullfilename_oce[0], /READ) EQ 0) THEN BEGIN |
---|
| 167 | msg = 'eee : the file ' + fullfilename_oce[0] + ' is not readable.' |
---|
| 168 | ras = report(msg) |
---|
| 169 | RETURN |
---|
| 170 | ENDIF |
---|
| 171 | ; |
---|
[19] | 172 | ;-------------------------------------------------------- |
---|
[17] | 173 | ; boundaries of the read grid regarding to the original grid |
---|
[2] | 174 | ;---------------------------------------------------------- |
---|
[17] | 175 | ; |
---|
[20] | 176 | CASE orcares OF |
---|
| 177 | 'ORCA2': BEGIN |
---|
[2] | 178 | ixminmesh =1 |
---|
| 179 | ixmaxmesh =180 |
---|
| 180 | ; |
---|
| 181 | iyminmesh =0 |
---|
| 182 | iymaxmesh =147 |
---|
| 183 | ; |
---|
| 184 | izminmesh =-1 |
---|
| 185 | izmaxmesh =-1 |
---|
| 186 | ; |
---|
[20] | 187 | END |
---|
| 188 | 'ORCA025': BEGIN |
---|
| 189 | ixminmesh =1 |
---|
| 190 | ixmaxmesh =1440 |
---|
| 191 | ; |
---|
| 192 | iyminmesh =0 |
---|
| 193 | iymaxmesh =1019 |
---|
| 194 | ; |
---|
| 195 | izminmesh =-1 |
---|
| 196 | izmaxmesh =-1 |
---|
| 197 | ; |
---|
| 198 | END |
---|
| 199 | ELSE : BEGIN |
---|
| 200 | msg = 'eee : invalid orcares parameter = ' + orcares |
---|
| 201 | ras = report(msg) |
---|
| 202 | msg = 'eee : orcares must be ORCA2 or ORCA025' |
---|
| 203 | ras = report(msg) |
---|
| 204 | RETURN |
---|
| 205 | END |
---|
| 206 | ENDCASE |
---|
[2] | 207 | jpt = 1 |
---|
| 208 | time = 0 |
---|
| 209 | ;------------------------------------------------------ |
---|
[17] | 210 | ; read the grid |
---|
[2] | 211 | ;------------------------------------------------------ |
---|
[20] | 212 | ; |
---|
[2] | 213 | key_stride = [1, 1, 1] |
---|
[20] | 214 | ncdf_meshlec, fullfilename_oce[0], glamboundary = [20, 380], _extra = ex |
---|
[2] | 215 | ;------------------------------------------------------------- |
---|
| 216 | domdef |
---|
| 217 | ; |
---|
[20] | 218 | CASE orcares OF |
---|
| 219 | 'ORCA2' : BEGIN |
---|
| 220 | triangles_list = triangule() |
---|
| 221 | END |
---|
| 222 | 'ORCA025': BEGIN |
---|
| 223 | triangles_list = triangule(/keepcont) |
---|
| 224 | END |
---|
| 225 | ELSE : BEGIN |
---|
| 226 | msg = 'eee : invalid orcares parameter = ' + orcares |
---|
| 227 | ras = report(msg) |
---|
| 228 | msg = 'eee : orcares must be ORCA2 or ORCA025' |
---|
| 229 | ras = report(msg) |
---|
| 230 | RETURN |
---|
| 231 | END |
---|
| 232 | ENDCASE |
---|
| 233 | ; |
---|
[17] | 234 | ; boundaries of the data regarding to the original grid |
---|
[2] | 235 | jpidta = jpiglo |
---|
| 236 | jpjdta = jpjglo |
---|
| 237 | jpkdta = jpkglo |
---|
| 238 | ixmindta = 0 |
---|
| 239 | ixmaxdta = jpidta-1 |
---|
| 240 | iymindta = 0 |
---|
| 241 | iymaxdta = jpjdta-1 |
---|
| 242 | izmindta = 0 |
---|
| 243 | izmaxdta = jpkdta-1 |
---|
[20] | 244 | ; |
---|
[17] | 245 | @updateold |
---|
[20] | 246 | ; |
---|
| 247 | END |
---|