Changeset 226 for trunk/SRC/ReadWrite
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- Location:
- trunk/SRC/ReadWrite
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ReadWrite/idl-NetCDF/ncdf_quickread/ncdf_quickread_helper.pro
r163 r226 1 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 2 ; 3 ; ncdf_quickread_helper.pro - This file contains IDL functions to read netCDF 4 ; data files into IDL variables. 3 ; ncdf_quickread_helper.pro - This file contains IDL functions to read netCDF 4 ; data files into IDL variables. 5 5 ; 6 6 ; Adapted from CDF2IDL.pro … … 8 8 ; This file contains the following functions and procedures: 9 9 ; functions: 10 ; ncdf_quickread_getfile - strips the directory and optionally) any 10 ; ncdf_quickread_getfile - strips the directory and optionally) any 11 11 ; suffixes from the path+file 12 12 ; ncdf_quickread_getdir - returns the directory from the full path+file … … 25 25 ; 10 Jun 97 S. Rupert Modified keyword usage. 26 26 ; 03 Feb 98 S. Rupert Added additional error checking, and warning to 27 ; output script. 27 ; output script. 28 28 ; 17 Feb 98 S. Rupert Corrected validation routine to handle instance 29 29 ; of name strating with a number and containing a … … 58 58 ; @examples 59 59 ; Call: file = ncdf_quickread_getfile(fullpath) 60 ; 60 ; 61 61 ; @history 62 62 ; … … 68 68 on_error,2 69 69 compile_opt hidden 70 ; Retrieve the pos tion at which the first '/' character occurs from70 ; Retrieve the position at which the first '/' character occurs from 71 71 ; the end of the string. 72 72 dirlen = rstrpos(fullpath, '/') … … 111 111 ; @examples 112 112 ; Call: dir = ncdf_quickread_getdir(fullpath) 113 ; 113 ; 114 114 ; @history 115 115 ; … … 122 122 on_error,2 123 123 compile_opt hidden 124 ; Retrieve the pos tion at which the first '/' character occurs from124 ; Retrieve the position at which the first '/' character occurs from 125 125 ; the end of the string. 126 126 len = rstrpos(fullpath, '/') … … 139 139 ; @file_comments 140 140 ; This routine ensures that the given name does not start with a number, 141 ; nor contain a dash. IDL cannot accept a variable starting with a 142 ; number or containing a dash. If the name starts with a number, an 143 ; underscore is prepended to the name, and if it contains a dash, the 144 ; dash is replaced with an underscore. 141 ; nor contain a dash. IDL cannot accept a variable starting with a 142 ; number or containing a dash. If the name starts with a number, an 143 ; underscore is prepended to the name, and if it contains a dash, the 144 ; dash is replaced with an underscore. 145 145 ; 146 146 ; @categories … … 149 149 ; @param VARNAME 150 150 ; The name of the variable to be read 151 ; 151 ; 152 152 ; 153 153 ; @returns … … 158 158 ; 159 159 ; @examples 160 ; 161 ; 160 ; 161 ; 162 162 ; @history 163 163 ; … … 186 186 if (strpos(varname, '9') EQ 0) then name = strcompress("_"+varname) 187 187 188 ; If the name contains a dash replace it with an underscore. 188 ; If the name contains a dash replace it with an underscore. 189 189 if (strpos(name, '-') NE -1) then begin 190 190 pieces = str_sep(name, '-') … … 214 214 ; full path to netCDF file of interest 215 215 ; 216 ; @keyword VERBOSE 216 ; @keyword VERBOSE 217 217 ; Set this keyword to return an error message in case of an error. 218 218 ; … … 224 224 ; 225 225 ; @keyword REFORM 226 ; see changelog above .226 ; see changelog above 227 227 ; 228 228 ; @returns … … 233 233 ; 234 234 ; @examples 235 ; 236 ; 235 ; 236 ; 237 237 ; @history 238 238 ; … … 274 274 275 275 ; Place the desired variables in local arrays. 276 for i=0, ncidinfo.Nvars-1 do begin 276 for i=0, ncidinfo.Nvars-1 do begin 277 277 vardata = NCDF_VARINQ(ncid, i) 278 278 if not subset then begin … … 283 283 endelse 284 284 if wanted then begin 285 varname = ncdf_quickread_validatename(vardata.Name) 285 varname = ncdf_quickread_validatename(vardata.Name) 286 286 if keyword_set(prefix) then varname=prefix+varname 287 287 commands=$ … … 304 304 endfor 305 305 306 if (keyword_set(verbose)) then begin 306 if (keyword_set(verbose)) then begin 307 307 for i=0, ncidinfo.Ngatts-1 do begin 308 308 name = NCDF_ATTNAME(ncid, /GLOBAL, i) -
trunk/SRC/ReadWrite/readoldoparestart.pro
r163 r226 11 11 ; 12 12 ; @param PARAMS 13 ; 14 ; 13 ; 15 14 ; @param NUM 16 ; 17 ; 18 ; @restrictions 15 ; 16 ; @restrictions 19 17 ; bug for etab and etan written on the same record??? 20 18 ; 21 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 19 ; @history 20 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 22 21 ; June 2002 23 ; @version $Id$ 22 ; 23 ; @version 24 ; $Id$ 24 25 ;- 25 26 ;------------------------------------------------------------ … … 44 45 ; 45 46 ; @param PARAMS 46 ; 47 ; 47 ; 48 48 ; @param NUM 49 ; 50 ; 51 ; @historySebastien Masson (smasson\@lodyc.jussieu.fr)49 ; 50 ; @history 51 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 52 52 ; June 2002 53 53 ;- … … 66 66 ; based on the OPA subroutine dtrlec included at the end of the file. 67 67 ; 68 ; @categories 68 ; @categories 69 69 ; For OPA 70 70 ; … … 73 73 ; 74 74 ; @param JPIGLO {in}{required} 75 ; 76 ; 75 ; 77 76 ; @param JPJGLO {in}{required} 78 ; 79 ; 77 ; 80 78 ; @param JPK {in}{required} 81 79 ; dimensions of the opa grid 82 80 ; 83 ; @keyword IBLOC {default=4096L} 81 ; @keyword IBLOC {default=4096L} 84 82 ; Ibloc size 85 ; 83 ; 86 84 ; @keyword JPBYT {default=8L} 87 85 ; Jpbyt size 88 ; 89 ; @keyword NUMREC {default=19L*jpk} 86 ; 87 ; @keyword NUMREC {default=19L*jpk} 90 88 ; Number of records in the file 91 ; 89 ; 92 90 ; @keyword UB 93 ; 94 ; 91 ; 92 ; 95 93 ; @keyword VB 96 ; 97 ; 94 ; 95 ; 98 96 ; @keyword TB 99 ; 100 ; 97 ; 101 98 ; @keyword SB 102 ; 103 ; 99 ; 104 100 ; @keyword ROTB 105 ; 106 ; 101 ; 107 102 ; @keyword HDIVB 108 ; 109 ; 103 ; 110 104 ; @keyword UN 111 ; 112 ; 105 ; 113 106 ; @keyword VN 114 ; 115 ; 107 ; 116 108 ; @keyword TN 117 ; 118 ; 109 ; 119 110 ; @keyword SN 120 ; 121 ; 111 ; 122 112 ; @keyword ROTN 123 ; 124 ; 113 ; 125 114 ; @keyword HDIVN 126 ; 127 ; 115 ; 128 116 ; @keyword GCX 129 ; 130 ; 117 ; 131 118 ; @keyword GCXB 132 ; 133 ; 119 ; 134 120 ; @keyword ETAB 135 ; 136 ; 121 ; 137 122 ; @keyword ETAN 138 ; 139 ; 123 ; 140 124 ; @keyword BSFB 141 ; 142 ; 125 ; 143 126 ; @keyword BSFN 144 ; 145 ; 127 ; 146 128 ; @keyword BSFD 147 ; 148 ; 129 ; 149 130 ; @keyword EN 150 131 ; the variable we want to read. 151 132 ; 152 ; @returns 133 ; @returns 153 134 ; According to the given keywords. 154 ; 155 ; @restrictions 135 ; 136 ; @restrictions 156 137 ; Bug for etab and etan written on the same record??? 157 138 ; 158 ; @history 139 ; @history 159 140 ; Sebastien Masson (smasson\@lodyc.jussieu.fr) 160 141 ; June 2002 161 ; 142 ; 162 143 ; @version 163 144 ; $Id$ … … 458 439 ; IF(lwp) THEN 459 440 ; WRITE(numout,*) ' ===>>>> : the previous restart file', 460 ; $ ' did nt used tke scheme'441 ; $ ' did''nt used tke scheme' 461 442 ; WRITE(numout,*) ' ======= =======' 462 443 ; ENDIF
Note: See TracChangeset
for help on using the changeset viewer.