Changeset 451 for trunk/SRC/Grid
- Timestamp:
- 03/22/11 10:33:45 (13 years ago)
- Location:
- trunk/SRC/Grid
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Grid/micromeshmask.pro
r394 r451 103 103 zgr_varlist = ncdf_listvars(cdfid) 104 104 zgr_varlist = strtrim(strlowcase(zgr_varlist), 2) 105 ; is e3t a real 3D array? 106 IF (where(zgr_varlist EQ 'e3t'))[0] NE -1 THEN BEGIN 107 varinq = ncdf_varinq(cdfid, 'e3t') 108 if varinq.ndims GE 3 THEN BEGIN 109 ncdf_diminq, cdfid, varinq.dim[0], name, iii 110 ncdf_diminq, cdfid, varinq.dim[1], name, jjj 111 ncdf_diminq, cdfid, varinq.dim[2], name, kkk 112 IF iii EQ jpi AND jjj EQ jpj AND kkk EQ jpk THEN key_e3_3d = 1 113 ENDIF 114 ENDIF 115 ; is gdept a real 3D array? 116 IF (where(zgr_varlist EQ 'gdept'))[0] NE -1 THEN BEGIN 117 varinq = ncdf_varinq(cdfid, 'gdept') 118 if varinq.ndims GE 3 THEN BEGIN 119 ncdf_diminq, cdfid, varinq.dim[0], name, iii 120 ncdf_diminq, cdfid, varinq.dim[1], name, jjj 121 ncdf_diminq, cdfid, varinq.dim[2], name, kkk 122 IF iii EQ jpi AND jjj EQ jpj AND kkk EQ jpk THEN key_gdep_3d = 1 123 ENDIF 124 ENDIF 105 125 ;------------------------------------------------------ 106 126 ;------------------------------------------------------ … … 134 154 varid[16+z] = ncdf_vardef(cdfidout, zgrlist[z], [dimidz], /float) 135 155 ; variables related to the partial steps 136 IF (where(zgr_varlist EQ 'hdept'))[0] NE -1 THEN $ 156 with_partial = keyword_set(key_e3_3d) OR (where(zgr_varlist EQ 'hdept'))[0] NE -1 $ 157 OR (where(zgr_varlist EQ 'e3tp'))[0] NE -1 $ 158 OR (where(zgr_varlist EQ 'e3t_ps'))[0] NE -1 159 IF with_partial THEN BEGIN 137 160 varid = [varid, ncdf_vardef(cdfidout, 'hdept', [dimidx, dimidy], /float)] 138 IF (where(zgr_varlist EQ 'hdepw'))[0] NE -1 THEN $139 161 varid = [varid, ncdf_vardef(cdfidout, 'hdepw', [dimidx, dimidy], /float)] 140 ; old variable name. keep for compatibility with old run. Change e3tp to e3t_ps141 IF (where(zgr_varlist EQ 'e3tp'))[0] NE -1 THEN $142 162 varid = [varid, ncdf_vardef(cdfidout, 'e3t_ps', [dimidx, dimidy], /float)] 143 ; old variable name. keep for compatibility with old run. Change e3wp to e3w_ps144 IF (where(zgr_varlist EQ 'e3wp'))[0] NE -1 THEN $145 163 varid = [varid, ncdf_vardef(cdfidout, 'e3w_ps', [dimidx, dimidy], /float)] 146 ; 147 IF (where(zgr_varlist EQ 'e3t_ps'))[0] NE -1 THEN $ 148 varid = [varid, ncdf_vardef(cdfidout, 'e3t_ps', [dimidx, dimidy], /float)] 149 IF (where(zgr_varlist EQ 'e3w_ps'))[0] NE -1 THEN $ 150 varid = [varid, ncdf_vardef(cdfidout, 'e3w_ps', [dimidx, dimidy], /float)] 151 ; IF (where(zgr_varlist EQ 'e3u_ps'))[0] NE -1 THEN $ 152 ; varid = [varid, ncdf_vardef(cdfidout, 'e3u_ps', [dimidx, dimidy], /float)] 153 ; IF (where(zgr_varlist EQ 'e3v_ps'))[0] NE -1 THEN $ 154 ; varid = [varid, ncdf_vardef(cdfidout, 'e3v_ps', [dimidx, dimidy], /float)] 164 ENDIF 165 ; 155 166 IF (where(zgr_varlist EQ 'mbathy'))[0] NE -1 THEN $ 156 167 varid = [varid, ncdf_vardef(cdfidout, 'mbathy', [dimidx, dimidy], /short)] … … 191 202 ncdf_transfer, cdfid, cdfidout, inzgrlist[z], zgrlist[z] 192 203 ; partial step variables 193 IF (where(zgr_varlist EQ 'hdept'))[0] NE -1 THEN $ 194 ncdf_transfer, cdfid, cdfidout, 'hdept' 195 IF (where(zgr_varlist EQ 'hdepw'))[0] NE -1 THEN $ 196 ncdf_transfer, cdfid, cdfidout, 'hdepw' 197 IF (where(zgr_varlist EQ 'e3tp'))[0] NE -1 THEN $ 198 ncdf_transfer, cdfid, cdfidout, 'e3tp', 'e3t_ps' 199 IF (where(zgr_varlist EQ 'e3wp'))[0] NE -1 THEN $ 200 ncdf_transfer, cdfid, cdfidout, 'e3wp', 'e3w_ps' 201 IF (where(zgr_varlist EQ 'e3t_ps'))[0] NE -1 THEN $ 202 ncdf_transfer, cdfid, cdfidout, 'e3t_ps' 203 IF (where(zgr_varlist EQ 'e3w_ps'))[0] NE -1 THEN $ 204 ncdf_transfer, cdfid, cdfidout, 'e3w_ps' 205 ; IF (where(zgr_varlist EQ 'e3u_ps'))[0] NE -1 THEN $ 206 ; ncdf_transfer, cdfid, cdfidout, 'e3u_ps' 207 ; IF (where(zgr_varlist EQ 'e3v_ps'))[0] NE -1 THEN $ 208 ; ncdf_transfer, cdfid, cdfidout, 'e3v_ps' 209 IF (where(zgr_varlist EQ 'mbathy'))[0] NE -1 THEN $ 210 ncdf_transfer, cdfid, cdfidout, 'mbathy' 204 IF (where(zgr_varlist EQ 'hdept' ))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'hdept' 205 IF (where(zgr_varlist EQ 'hdepw' ))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'hdepw' 206 IF (where(zgr_varlist EQ 'e3tp' ))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'e3tp', 'e3t_ps' 207 IF (where(zgr_varlist EQ 'e3wp' ))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'e3wp', 'e3w_ps' 208 IF (where(zgr_varlist EQ 'e3t_ps'))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'e3t_ps' 209 IF (where(zgr_varlist EQ 'e3w_ps'))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'e3w_ps' 210 IF (where(zgr_varlist EQ 'mbathy'))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'mbathy' 211 ; 212 IF keyword_set(key_e3_3d) THEN BEGIN 213 ; get the bottom 214 CASE (ncdf_varinq(cdfid, 'mbathy')).ndims OF 215 2:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj] 216 3:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj, 1] 217 4:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj, 1, 1] 218 ENDCASE 219 bottom = 0L > ( long(bat) - 1L ) 220 bottom = lindgen(jpi, jpj) + jpi*jpj*temporary(bottom) 221 ; 222 CASE (ncdf_varinq(cdfid, 'e3t')).ndims OF 223 3:ncdf_varget, cdfid, 'e3t', res, count = [jpi, jpj, jpk] 224 4:ncdf_varget, cdfid, 'e3t', res, count = [jpi, jpj, jpk, 1] 225 ENDCASE 226 ncdf_varput, cdfidout, 'e3t_ps', (temporary(res))[bottom] * (bat NE 0L) 227 ; 228 CASE (ncdf_varinq(cdfid, 'e3w')).ndims OF 229 3:ncdf_varget, cdfid, 'e3w', res, count = [jpi, jpj, jpk] 230 4:ncdf_varget, cdfid, 'e3w', res, count = [jpi, jpj, jpk, 1] 231 ENDCASE 232 ncdf_varput, cdfidout, 'e3w_ps', (temporary(res))[bottom] * (bat NE 0L) 233 ENDIF 234 ; 235 IF keyword_set(key_gdep_3d) THEN BEGIN 236 ; get the bottom 237 CASE (ncdf_varinq(cdfid, 'mbathy')).ndims OF 238 2:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj] 239 3:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj, 1] 240 4:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj, 1, 1] 241 ENDCASE 242 bottom = 0L > ( long(bat) - 1L ) 243 bottom = lindgen(jpi, jpj) + jpi*jpj*temporary(bottom) 244 ; 245 CASE (ncdf_varinq(cdfid, 'gdept')).ndims OF 246 3:ncdf_varget, cdfid, 'gdept', res, count = [jpi, jpj, jpk] 247 4:ncdf_varget, cdfid, 'gdept', res, count = [jpi, jpj, jpk, 1] 248 ENDCASE 249 ncdf_varput, cdfidout, 'hdept', (temporary(res))[bottom] * (bat NE 0L) 250 ; 251 bottom = jpi*jpj + temporary(bottom) 252 CASE (ncdf_varinq(cdfid, 'gdepw')).ndims OF 253 3:ncdf_varget, cdfid, 'gdepw', res, count = [jpi, jpj, jpk] 254 4:ncdf_varget, cdfid, 'gdepw', res, count = [jpi, jpj, jpk, 1] 255 ENDCASE 256 ncdf_varput, cdfidout, 'hdepw', (temporary(res))[bottom] * (bat NE 0L) 257 ENDIF 211 258 ; 212 259 ; mask -
trunk/SRC/Grid/ncdf_meshread.pro
r371 r451 281 281 ; for the variables related to the partial steps 282 282 allvarname = ncdf_listvars(cdfid) 283 ; 284 key_partialstep = 0 285 hdept = -1 286 hdepw = -1 283 287 IF (where(allvarname EQ 'hdept'))[0] NE -1 THEN BEGIN 284 288 key_partialstep = 1 285 289 namevar = [namevar, 'hdept', 'hdepw'] 286 ENDIF ELSE BEGIN 287 key_partialstep = 0 288 hdept = -1 289 hdepw = -1 290 ENDELSE 290 ENDIF 291 ; is gdept a real 3D array? 292 IF (where(allvarname EQ 'gdept' ))[0] NE -1 THEN BEGIN 293 varinq = ncdf_varinq(cdfid, 'gdept') 294 if varinq.ndims GE 3 THEN BEGIN 295 ncdf_diminq, cdfid, varinq.dim[0], name, iii 296 ncdf_diminq, cdfid, varinq.dim[1], name, jjj 297 ncdf_diminq, cdfid, varinq.dim[2], name, kkk 298 IF iii EQ jpiglo AND jjj EQ jpjglo AND kkk EQ jpkglo THEN key_gdep_3d = 1 299 ENDIF 300 ENDIF 291 301 ; for compatibility with old versions of meshmask/partial steps 292 IF (where(allvarname EQ 'e3tp'))[0] NE -1 THEN $ 293 namevar = [namevar, 'e3tp', 'e3wp'] ELSE BEGIN 294 e3t_ps = -1 295 e3w_ps = -1 296 ENDELSE 297 IF (where(allvarname EQ 'e3t_ps'))[0] NE -1 $ 298 THEN namevar = [namevar, 'e3t_ps', 'e3w_ps' ]ELSE BEGIN 299 e3t_ps = -1 300 e3w_ps = -1 301 ENDELSE 302 IF (where(allvarname EQ 'e3u_ps'))[0] NE -1 $ 303 THEN namevar = [namevar, 'e3u_ps', 'e3v_ps'] ELSE BEGIN 304 e3u_ps = -1 305 e3v_ps = -1 306 ENDELSE 302 e3t_ps = -1 303 e3w_ps = -1 304 IF (where(allvarname EQ 'e3tp' ))[0] NE -1 THEN namevar = [namevar, 'e3tp', 'e3wp'] 305 IF (where(allvarname EQ 'e3t_ps'))[0] NE -1 THEN namevar = [namevar, 'e3t_ps', 'e3w_ps' ] 306 ; is e3t a real 3D array? 307 IF (where(allvarname EQ 'e3t' ))[0] NE -1 THEN BEGIN 308 varinq = ncdf_varinq(cdfid, 'e3t') 309 if varinq.ndims GE 3 THEN BEGIN 310 ncdf_diminq, cdfid, varinq.dim[0], name, iii 311 ncdf_diminq, cdfid, varinq.dim[1], name, jjj 312 ncdf_diminq, cdfid, varinq.dim[2], name, kkk 313 IF iii EQ jpiglo AND jjj EQ jpjglo AND kkk EQ jpkglo THEN BEGIN 314 key_e3_3d = 1 315 key_partialstep = 1 316 ENDIF 317 ENDIF 318 ENDIF 307 319 ; 308 320 ; read all the 2d variables … … 312 324 name = varinq.name 313 325 @read_ncdf_varget 314 command = namevar[i]+'=float(temporary(res))' 326 IF strmid(name, 0, 2) EQ 'e3' THEN command = namevar[i]+' = temporary(res)' $ 327 ELSE command = namevar[i]+' = float(temporary(res))' 315 328 nothing = execute(command) 316 329 ENDFOR … … 403 416 tmask = byte(res) 404 417 ENDELSE 418 ; if e3t is true 3D array... 419 IF keyword_set(key_e3_3d) THEN BEGIN 420 bottom = 0 > ( total(tmask, 3)-1 ) 421 bottom = lindgen(jpi, jpj) + jpi*jpj*temporary(bottom) 422 ; 423 varinq = ncdf_varinq(cdfid, 'e3t') 424 name = varinq.name 425 @read_ncdf_varget 426 e3t_ps = (temporary(res))[bottom] * tmask[*, *, 0] 427 ; 428 varinq = ncdf_varinq(cdfid, 'e3w') 429 name = varinq.name 430 @read_ncdf_varget 431 e3w_ps = (temporary(res))[bottom] * tmask[*, *, 0] 432 ENDIF 433 ; if gdep is true 3D array... 434 IF keyword_set(key_gdep_3d) THEN BEGIN 435 bottom = 0 > ( total(tmask, 3)-1 ) 436 bottom = lindgen(jpi, jpj) + jpi*jpj*temporary(bottom) 437 ; 438 varinq = ncdf_varinq(cdfid, 'gdept') 439 name = varinq.name 440 @read_ncdf_varget 441 hdept = (temporary(res))[bottom] * tmask[*, *, 0] 442 ; 443 bottom = jpi*jpj + temporary(bottom) 444 varinq = ncdf_varinq(cdfid, 'gdepw') 445 name = varinq.name 446 @read_ncdf_varget 447 hdepw = (temporary(res))[bottom] * tmask[*, *, 0] 448 ENDIF 405 449 ; boundary conditions used to compute umask. 406 450 IF ncdf_varid(cdfid, 'umask') NE -1 THEN BEGIN -
trunk/SRC/Grid/smallmeshmask.pro
r371 r451 108 108 zgr_varlist = ncdf_listvars(cdfid) 109 109 zgr_varlist = strtrim(strlowcase(zgr_varlist), 2) 110 ;------------------------------------------------------ 110 ; is e3t a real 3D array? 111 IF (where(zgr_varlist EQ 'e3t'))[0] NE -1 THEN BEGIN 112 varinq = ncdf_varinq(cdfid, 'e3t') 113 if varinq.ndims GE 3 THEN BEGIN 114 ncdf_diminq, cdfid, varinq.dim[0], name, iii 115 ncdf_diminq, cdfid, varinq.dim[1], name, jjj 116 ncdf_diminq, cdfid, varinq.dim[2], name, kkk 117 IF iii EQ jpi AND jjj EQ jpj AND kkk EQ jpk THEN key_e3_3d = 1 118 ENDIF 119 ENDIF 120 ; is gdept a real 3D array? 121 IF (where(zgr_varlist EQ 'gdept'))[0] NE -1 THEN BEGIN 122 varinq = ncdf_varinq(cdfid, 'gdept') 123 if varinq.ndims GE 3 THEN BEGIN 124 ncdf_diminq, cdfid, varinq.dim[0], name, iii 125 ncdf_diminq, cdfid, varinq.dim[1], name, jjj 126 ncdf_diminq, cdfid, varinq.dim[2], name, kkk 127 IF iii EQ jpi AND jjj EQ jpj AND kkk EQ jpk THEN key_gdep_3d = 1 128 ENDIF 129 ENDIF 111 130 ;------------------------------------------------------ 112 131 ; … … 139 158 varid[16+z] = ncdf_vardef(cdfidout, zgrlist[z], [dimidz], /float) 140 159 ; variables related to the partial steps 141 IF (where(zgr_varlist EQ 'hdept'))[0] NE -1 THEN $ 160 with_partial = keyword_set(key_e3_3d) OR (where(zgr_varlist EQ 'hdept'))[0] NE -1 $ 161 OR (where(zgr_varlist EQ 'e3tp'))[0] NE -1 $ 162 OR (where(zgr_varlist EQ 'e3t_ps'))[0] NE -1 163 IF with_partial THEN BEGIN 142 164 varid = [varid, ncdf_vardef(cdfidout, 'hdept', [dimidx, dimidy], /float)] 143 IF (where(zgr_varlist EQ 'hdepw'))[0] NE -1 THEN $144 165 varid = [varid, ncdf_vardef(cdfidout, 'hdepw', [dimidx, dimidy], /float)] 145 ; old variable name. keep for compatibility with old run. Change e3tp to e3t_ps146 IF (where(zgr_varlist EQ 'e3tp'))[0] NE -1 THEN $147 166 varid = [varid, ncdf_vardef(cdfidout, 'e3t_ps', [dimidx, dimidy], /float)] 148 ; old variable name. keep for compatibility with old run. Change e3wp to e3w_ps149 IF (where(zgr_varlist EQ 'e3wp'))[0] NE -1 THEN $150 167 varid = [varid, ncdf_vardef(cdfidout, 'e3w_ps', [dimidx, dimidy], /float)] 151 ; 152 IF (where(zgr_varlist EQ 'e3t_ps'))[0] NE -1 THEN $ 153 varid = [varid, ncdf_vardef(cdfidout, 'e3t_ps', [dimidx, dimidy], /float)] 154 IF (where(zgr_varlist EQ 'e3w_ps'))[0] NE -1 THEN $ 155 varid = [varid, ncdf_vardef(cdfidout, 'e3w_ps', [dimidx, dimidy], /float)] 156 ; IF (where(zgr_varlist EQ 'e3u_ps'))[0] NE -1 THEN $ 157 ; varid = [varid, ncdf_vardef(cdfidout, 'e3u_ps', [dimidx, dimidy], /float)] 158 ; IF (where(zgr_varlist EQ 'e3v_ps'))[0] NE -1 THEN $ 159 ; varid = [varid, ncdf_vardef(cdfidout, 'e3v_ps', [dimidx, dimidy], /float)] 168 ENDIF 169 ; 160 170 IF (where(zgr_varlist EQ 'mbathy'))[0] NE -1 THEN $ 161 171 varid = [varid, ncdf_vardef(cdfidout, 'mbathy', [dimidx, dimidy], /short)] … … 163 173 msklist = ['tmask', 'umask', 'vmask', 'fmask'] 164 174 FOR m = 0, n_elements(msklist)-1 DO $ 165 varid = [varid, ncdf_vardef(cdfidout, msklist[m] $ 166 , [dimidx, dimidy, dimidz], /byte)] 175 varid = [varid, ncdf_vardef(cdfidout, msklist[m], [dimidx, dimidy, dimidz], /byte)] 167 176 ;------------------------------------------------------ 168 177 ;------------------------------------------------------ … … 189 198 inzgrlist = zgrlist 190 199 IF (where(zgr_varlist EQ 'gdept_0'))[0] NE -1 THEN inzgrlist = inzgrlist+'_0' 191 FOR z = 0, n_elements(zgrlist)-1 DO $ 192 ncdf_transfer, cdfid, cdfidout, inzgrlist[z], zgrlist[z] 200 FOR z = 0, n_elements(zgrlist)-1 DO ncdf_transfer, cdfid, cdfidout, inzgrlist[z], zgrlist[z] 193 201 ; partial step variables 194 IF (where(zgr_varlist EQ 'hdept'))[0] NE -1 THEN $ 195 ncdf_transfer, cdfid, cdfidout, 'hdept' 196 IF (where(zgr_varlist EQ 'hdepw'))[0] NE -1 THEN $ 197 ncdf_transfer, cdfid, cdfidout, 'hdepw' 198 IF (where(zgr_varlist EQ 'e3tp'))[0] NE -1 THEN $ 199 ncdf_transfer, cdfid, cdfidout, 'e3tp', 'e3t_ps' 200 IF (where(zgr_varlist EQ 'e3wp'))[0] NE -1 THEN $ 201 ncdf_transfer, cdfid, cdfidout, 'e3wp', 'e3w_ps' 202 IF (where(zgr_varlist EQ 'e3t_ps'))[0] NE -1 THEN $ 203 ncdf_transfer, cdfid, cdfidout, 'e3t_ps' 204 IF (where(zgr_varlist EQ 'e3w_ps'))[0] NE -1 THEN $ 205 ncdf_transfer, cdfid, cdfidout, 'e3w_ps' 206 ; IF (where(zgr_varlist EQ 'e3u_ps'))[0] NE -1 THEN $ 207 ; ncdf_transfer, cdfid, cdfidout, 'e3u_ps' 208 ; IF (where(zgr_varlist EQ 'e3v_ps'))[0] NE -1 THEN $ 209 ; ncdf_transfer, cdfid, cdfidout, 'e3v_ps' 210 IF (where(zgr_varlist EQ 'mbathy'))[0] NE -1 THEN $ 211 ncdf_transfer, cdfid, cdfidout, 'mbathy' 202 IF (where(zgr_varlist EQ 'hdept' ))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'hdept' 203 IF (where(zgr_varlist EQ 'hdepw' ))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'hdepw' 204 IF (where(zgr_varlist EQ 'e3tp' ))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'e3tp', 'e3t_ps' 205 IF (where(zgr_varlist EQ 'e3wp' ))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'e3wp', 'e3w_ps' 206 IF (where(zgr_varlist EQ 'e3t_ps'))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'e3t_ps' 207 IF (where(zgr_varlist EQ 'e3w_ps'))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'e3w_ps' 208 IF (where(zgr_varlist EQ 'mbathy'))[0] NE -1 THEN ncdf_transfer, cdfid, cdfidout, 'mbathy' 209 ; 210 IF keyword_set(key_e3_3d) THEN BEGIN 211 ; get the bottom 212 CASE (ncdf_varinq(cdfid, 'mbathy')).ndims OF 213 2:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj] 214 3:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj, 1] 215 4:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj, 1, 1] 216 ENDCASE 217 bottom = 0L > ( long(bat) - 1L ) 218 bottom = lindgen(jpi, jpj) + jpi*jpj*temporary(bottom) 219 ; 220 CASE (ncdf_varinq(cdfid, 'e3t')).ndims OF 221 3:ncdf_varget, cdfid, 'e3t', res, count = [jpi, jpj, jpk] 222 4:ncdf_varget, cdfid, 'e3t', res, count = [jpi, jpj, jpk, 1] 223 ENDCASE 224 ncdf_varput, cdfidout, 'e3t_ps', (temporary(res))[bottom] * (bat NE 0L) 225 ; 226 CASE (ncdf_varinq(cdfid, 'e3w')).ndims OF 227 3:ncdf_varget, cdfid, 'e3w', res, count = [jpi, jpj, jpk] 228 4:ncdf_varget, cdfid, 'e3w', res, count = [jpi, jpj, jpk, 1] 229 ENDCASE 230 ncdf_varput, cdfidout, 'e3w_ps', (temporary(res))[bottom] * (bat NE 0L) 231 ENDIF 232 ; 233 IF keyword_set(key_gdep_3d) THEN BEGIN 234 ; get the bottom 235 CASE (ncdf_varinq(cdfid, 'mbathy')).ndims OF 236 2:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj] 237 3:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj, 1] 238 4:ncdf_varget, cdfid, 'mbathy', bat, count = [jpi, jpj, 1, 1] 239 ENDCASE 240 bottom = 0L > ( long(bat) - 1L ) 241 bottom = lindgen(jpi, jpj) + jpi*jpj*temporary(bottom) 242 ; 243 CASE (ncdf_varinq(cdfid, 'gdept')).ndims OF 244 3:ncdf_varget, cdfid, 'gdept', res, count = [jpi, jpj, jpk] 245 4:ncdf_varget, cdfid, 'gdept', res, count = [jpi, jpj, jpk, 1] 246 ENDCASE 247 ncdf_varput, cdfidout, 'hdept', (temporary(res))[bottom] * (bat NE 0L) 248 ; 249 bottom = jpi*jpj + temporary(bottom) 250 CASE (ncdf_varinq(cdfid, 'gdepw')).ndims OF 251 3:ncdf_varget, cdfid, 'gdepw', res, count = [jpi, jpj, jpk] 252 4:ncdf_varget, cdfid, 'gdepw', res, count = [jpi, jpj, jpk, 1] 253 ENDCASE 254 ncdf_varput, cdfidout, 'hdepw', (temporary(res))[bottom] * (bat NE 0L) 255 ENDIF 212 256 ; 213 257 ; mask … … 221 265 FOR m = 0, 3 DO BEGIN 222 266 CASE (ncdf_varinq(cdfid, msklist[m])).ndims OF 223 3:ncdf_varget, cdfid, msklist[m], zzz, offset = [0, 0, k] $ 224 , count = [jpi, jpj, 1] 225 4:ncdf_varget, cdfid, msklist[m], zzz, offset = [0, 0, k, 0] $ 226 , count = [jpi, jpj, 1, 1] 267 3:ncdf_varget, cdfid, msklist[m], zzz, offset = [0, 0, k ], count = [jpi, jpj, 1] 268 4:ncdf_varget, cdfid, msklist[m], zzz, offset = [0, 0, k, 0], count = [jpi, jpj, 1, 1] 227 269 ENDCASE 228 ncdf_varput, cdfidout, msklist[m], byte(temporary(zzz)) $ 229 , offset = [0, 0, k], count = [jpi, jpj, 1] 270 ncdf_varput, cdfidout, msklist[m], byte(temporary(zzz)), offset = [0, 0, k], count = [jpi, jpj, 1] 230 271 ENDFOR 231 272 ENDFOR
Note: See TracChangeset
for help on using the changeset viewer.