Changeset 13
- Timestamp:
- 02/18/14 11:03:22 (10 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/adm/guides/contributing.rst
r12 r13 16 16 .. _contributing: 17 17 18 ============ ==19 20 ============ ==18 ============ 19 Contributing 20 ============ 21 21 22 22 Development is tracked with svn_. … … 30 30 and add/answer tickets. 31 31 32 See :ref:`Contact <contact>` to ask for login or any trouble on your forge.ipsl.jussieu.fr account. 32 See :ref:`Contact <contact>` to ask for login or any trouble on your 33 forge.ipsl.jussieu.fr account. 33 34 34 35 You will find in -
trunk/adm/guides/data_content.rst
r12 r13 56 56 57 57 58 Small hand made fix:: 58 Small hand made fix: 59 60 .. code-block:: bash 59 61 60 62 diff ./mld_prieur_P1L1.prn /usr/temp/marina/POM//mld_prieur_P1L1.prn 63 64 .. parsed-literal:: 65 61 66 17c17 62 67 < 1014 39.3438 238 0.0857 0.0723 0.0908 238 249 279 376 236 … … 139 144 - :file:`sta.P2L2.asc` 140 145 141 Small hand made fix : :146 Small hand made fix : 142 147 143 diff ./sta.P1L2.asc /usr/temp/marina/POM//sta.P1L2.asc 144 125a126 145 > 146 diff ./sta.P2L1.asc /usr/temp/marina/POM//sta.P2L1.asc 147 82a83 148 > 149 diff ./sta.P2L2.asc /usr/temp/marina/POM//sta.P2L2.asc 150 25c25 151 < 2177 3830 100 2001 4 23 02 40 41 52.490 19 42.967 00 00 41 52.439 19 42.979 152 --- 153 > 2177 3830 100 2001 4 23 02 40 41 52.490 19 42.967 41 52.439 19 42.979 154 61a62 155 > 2415 446 100 2001 5 03 xx xx 43 20.712 18 57.718 xx xx xx xx xx xx 156 62a64 157 > 148 .. code-block:: bash 149 150 diff ./sta.P1L2.asc /usr/temp/marina/POM//sta.P1L2.asc 151 152 .. parsed-literal:: 153 154 125a126 155 > 156 157 .. code-block:: bash 158 159 diff ./sta.P2L1.asc /usr/temp/marina/POM//sta.P2L1.asc 160 161 .. parsed-literal:: 162 163 82a83 164 > 165 166 .. code-block:: bash 167 168 diff ./sta.P2L2.asc /usr/temp/marina/POM//sta.P2L2.asc 169 170 .. parsed-literal:: 171 172 173 25c25 174 < 2177 3830 100 2001 4 23 02 40 41 52.490 19 42.967 00 00 41 52.439 19 42.979 175 --- 176 > 2177 3830 100 2001 4 23 02 40 41 52.490 19 42.967 41 52.439 19 42.979 177 61a62 178 > 2415 446 100 2001 5 03 xx xx 43 20.712 18 57.718 xx xx xx xx xx xx 179 62a64 180 > 158 181 159 182 Tools -
trunk/adm/guides/glossary.rst
r12 r13 29 29 MLD 30 30 Mixed Layer Depth 31 31 32 32 P1L1 33 33 POMME 1 LEG 1 -
trunk/adm/guides/requirements.rst
r12 r13 12 12 .. - 13 13 14 .. |project| replace:: POMME 14 .. |project| replace:: POMME 15 15 16 16 .. _requirements: 17 17 18 ============ ==19 20 ============ ==18 ============ 19 Requirements 20 ============ 21 21 22 22 |project| is written using unix shell scripts and IDL/SAXO sources. -
trunk/adm/index.rst
r12 r13 3 3 .. EVOLUTIONS 4 4 .. ========== 5 .. 5 .. 6 6 .. $Id$ 7 7 .. -
trunk/adm/sphinx/conf.py
r8 r13 196 196 # (source start file, target name, title, author, documentclass [howto/manual]). 197 197 latex_documents = [ 198 ('index', 'POMME.tex', u'POMME Documentation', 199 u'CNRS', 'manual'), 198 ('index', 'POMME.tex', u'POMME Documentation', u'CNRS', 'manual'), 200 199 ] 201 200 -
trunk/src/dm2dd.pro
r8 r13 23 23 ; :examples: 24 24 ; 25 ; ::25 ; .. code-block:: idl 26 26 ; 27 ; IDL> degree=45 28 ; IDL> minute=30.5 29 ; IDL> dd=dm2dd(degree,minute) 30 ; IDL> print,dd 31 ; 45.5083 27 ; degree = 45 28 ; minute = 30.5 29 ; dd = dm2dd(degree,minute) 30 ; print,dd 31 ; 32 ; .. parsed-literal:: 33 ; 34 ; 45.5083 32 35 ; 33 36 ; :uses: … … 56 59 FUNCTION DM2DD, degree, minute 57 60 58 compile_opt idl2, strictarrsubs61 compile_opt idl2, strictarrsubs 59 62 60 ; Return to caller if errors61 ON_ERROR, 263 ; Return to caller if errors 64 ON_ERROR, 2 62 65 63 usage = 'result=dms2dss(degree, minute)'66 usage = 'result = dms2dss(degree, minute)' 64 67 65 ; check parameters66 nparam = N_PARAMS()67 IF (nparam LT 2) THEN BEGIN68 ras = report(['Incorrect number of arguments.' $69 70 71 return, -172 ENDIF68 ; check parameters 69 nparam = N_PARAMS() 70 IF (nparam LT 2) THEN BEGIN 71 ras = report(['Incorrect number of arguments.' $ 72 + '!C' $ 73 + 'Usage : ' + usage]) 74 return, -1 75 ENDIF 73 76 74 arg_type = size(degree,/type)75 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN76 ras = report(['Incorrect arg type degree' $77 78 79 return, -180 ENDIF77 arg_type = size(degree,/type) 78 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN 79 ras = report(['Incorrect arg type degree' $ 80 + '!C' $ 81 + 'Usage : ' + usage]) 82 return, -1 83 ENDIF 81 84 82 arg_dim = size(degree,/n_elements)83 IF (arg_dim GT 1) THEN BEGIN84 ras = report(['Incorrect arg dimension degree' $85 86 87 return, -188 ENDIF85 arg_dim = size(degree,/n_elements) 86 IF (arg_dim GT 1) THEN BEGIN 87 ras = report(['Incorrect arg dimension degree' $ 88 + '!C' $ 89 + 'Usage : ' + usage]) 90 return, -1 91 ENDIF 89 92 90 arg_type = size(minute,/type)91 IF (arg_type NE 4) THEN BEGIN92 ras = report(['Incorrect arg type minute' $93 94 95 return, -196 ENDIF93 arg_type = size(minute,/type) 94 IF (arg_type NE 4) THEN BEGIN 95 ras = report(['Incorrect arg type minute' $ 96 + '!C' $ 97 + 'Usage : ' + usage]) 98 return, -1 99 ENDIF 97 100 98 arg_dim = size(minute,/n_elements)99 IF (arg_dim GT 1) THEN BEGIN100 ras = report(['Incorrect arg dimension minute' $101 102 103 return, -1104 ENDIF101 arg_dim = size(minute,/n_elements) 102 IF (arg_dim GT 1) THEN BEGIN 103 ras = report(['Incorrect arg dimension minute' $ 104 + '!C' $ 105 + 'Usage : ' + usage]) 106 return, -1 107 ENDIF 105 108 106 ; conversion107 dd = degree + minute/60.d109 ; conversion 110 dd = degree + minute/60.d 108 111 109 return,dd112 return, dd 110 113 111 114 END -
trunk/src/dmean_mld.pro
r6 r13 18 18 ; :examples: 19 19 ; 20 ; Realistic example with POMME files: :20 ; Realistic example with POMME files: 21 21 ; 22 ; IDL> data_prn=file_prn_to_mem() 23 ; IDL> data_dmean=dmean_mld(data_prn) 22 ; .. code-block:: idl 24 23 ; 25 ; impression de controle :: 24 ; data_prn = file_prn_to_mem() 25 ; data_dmean = dmean_mld(data_prn) 26 26 ; 27 ; IDL> help, data_dmean, /structure 28 ; IDL> print, data_dmean[0] 29 ; IDL> print, data_dmean.mean_zhom001 30 ; IDL> print, data_dmean.std_zhom001 27 ; impression de controle : 28 ; 29 ; .. code-block:: idl 30 ; 31 ; help, data_dmean, /structure 32 ; print, data_dmean[0] 33 ; print, data_dmean.mean_zhom001 34 ; print, data_dmean.std_zhom001 31 35 ; 32 36 ; :uses: … … 63 67 ;- 64 68 FUNCTION dmean_mld, data_prn 65 ; 66 compile_opt idl2, strictarrsubs 67 ; 68 ; Return to caller if errors 69 ON_ERROR, 2 70 ; 71 usage = 'result=dmean_mld(data_prn)' 72 ; 73 nparam = N_PARAMS() 74 IF (nparam LT 1) THEN BEGIN 75 ras = report(['Incorrect number of arguments.' $ 76 + '!C' $ 77 + 'Usage : ' + usage]) 78 return, -1 79 ENDIF 80 ; 81 ; initialize returned structure 82 resultstruct = { doy : 0L $ 83 , first_station : 0L $ 84 , mean_zhom001: 0.0 $ 85 , mean_zhom002 : 0.0 $ 86 , mean_zhom005 : 0.0 $ 87 , mean_zhom010: 0.0 $ 88 , mean_zhomelch : 0.0 $ 89 , std_zhom001: 0.0 $ 90 , std_zhom002 : 0.0 $ 91 , std_zhom005 : 0.0 $ 92 , std_zhom010: 0.0 $ 93 , std_zhomelch : 0.0 $ 94 } 95 ; 96 ; found days list 97 multiple_days=ceil(data_prn.doy) 98 days=multiple_days[UNIQ(multiple_days, SORT(multiple_days))] 99 ndays=n_elements(days) 100 ; 101 ; initialize dimension of the returned structure 102 result = replicate(resultstruct, ndays) 103 result.doy=days 104 ; 105 ; loop on each day 106 FOR iday=0L, ndays - 1 DO BEGIN 107 ; find julian day in data_prn 108 ;++print, result[iday].doy 109 indice_prn = WHERE(ceil(data_prn.doy) EQ result[iday].doy,count) 110 ;++print, count 111 ;++print, 'indice du jour', result[iday].doy,' dans data_prn = ',indice_prn 112 ; store the first (in numeric number - supposed to be chronological order) 113 result[iday].first_station = data_prn[indice_prn[0]].station 114 ; compute daily mean of MLDs 115 result[iday].mean_zhom001 = total(data_prn[indice_prn].zhom001)/count 116 result[iday].mean_zhom002 = total(data_prn[indice_prn].zhom002)/count 117 result[iday].mean_zhom005 = total(data_prn[indice_prn].zhom005)/count 118 result[iday].mean_zhom010 = total(data_prn[indice_prn].zhom010)/count 119 result[iday].mean_zhomelch = total(data_prn[indice_prn].zhomelch)/count 120 IF (count GT 1) THEN BEGIN 121 ; compute standart deviation of MLDs 122 result[iday].std_zhom001 = stddev(data_prn[indice_prn].zhom001) 123 result[iday].std_zhom002 = stddev(data_prn[indice_prn].zhom002) 124 result[iday].std_zhom005 = stddev(data_prn[indice_prn].zhom005) 125 result[iday].std_zhom010 = stddev(data_prn[indice_prn].zhom010) 126 result[iday].std_zhomelch = stddev(data_prn[indice_prn].zhomelch) 127 ENDIF ELSE BEGIN 128 result[iday].std_zhom001 = 0.0 129 result[iday].std_zhom002 = 0.0 130 result[iday].std_zhom005 = 0.0 131 result[iday].std_zhom010 = 0.0 132 result[iday].std_zhomelch = 0.0 133 ENDELSE 134 ;++print, 'mean mld 1', result[iday].mean_zhom001 135 ENDFOR 136 ; 137 return, result 138 ; 69 ; 70 compile_opt idl2, strictarrsubs 71 ; 72 ; Return to caller if errors 73 ON_ERROR, 2 74 ; 75 usage = 'result = dmean_mld(data_prn)' 76 ; 77 nparam = N_PARAMS() 78 IF (nparam LT 1) THEN BEGIN 79 ras = report(['Incorrect number of arguments.' $ 80 + '!C' $ 81 + 'Usage : ' + usage]) 82 return, -1 83 ENDIF 84 ; 85 ; initialize returned structure 86 resultstruct = { doy : 0L $ 87 , first_station : 0L $ 88 , mean_zhom001: 0.0 $ 89 , mean_zhom002 : 0.0 $ 90 , mean_zhom005 : 0.0 $ 91 , mean_zhom010: 0.0 $ 92 , mean_zhomelch : 0.0 $ 93 , std_zhom001: 0.0 $ 94 , std_zhom002 : 0.0 $ 95 , std_zhom005 : 0.0 $ 96 , std_zhom010: 0.0 $ 97 , std_zhomelch : 0.0 $ 98 } 99 ; 100 ; found days list 101 multiple_days = ceil(data_prn.doy) 102 days = multiple_days[UNIQ(multiple_days, SORT(multiple_days))] 103 ndays = n_elements(days) 104 ; 105 ; initialize dimension of the returned structure 106 result = replicate(resultstruct, ndays) 107 result.doy = days 108 ; 109 ; loop on each day 110 FOR iday = 0L, ndays - 1 DO BEGIN 111 ; find julian day in data_prn 112 ;++print, result[iday].doy 113 indice_prn = WHERE(ceil(data_prn.doy) EQ result[iday].doy,count) 114 ;++print, count 115 ;++print, 'indice du jour', result[iday].doy,' dans data_prn = ',indice_prn 116 ; store the first (in numeric number - supposed to be 117 ; chronological order) 118 result[iday].first_station = data_prn[indice_prn[0]].station 119 ; compute daily mean of MLDs 120 result[iday].mean_zhom001 = total(data_prn[indice_prn].zhom001)/count 121 result[iday].mean_zhom002 = total(data_prn[indice_prn].zhom002)/count 122 result[iday].mean_zhom005 = total(data_prn[indice_prn].zhom005)/count 123 result[iday].mean_zhom010 = total(data_prn[indice_prn].zhom010)/count 124 result[iday].mean_zhomelch = total(data_prn[indice_prn].zhomelch)/count 125 IF (count GT 1) THEN BEGIN 126 ; compute standart deviation of MLDs 127 result[iday].std_zhom001 = stddev(data_prn[indice_prn].zhom001) 128 result[iday].std_zhom002 = stddev(data_prn[indice_prn].zhom002) 129 result[iday].std_zhom005 = stddev(data_prn[indice_prn].zhom005) 130 result[iday].std_zhom010 = stddev(data_prn[indice_prn].zhom010) 131 result[iday].std_zhomelch = stddev(data_prn[indice_prn].zhomelch) 132 ENDIF ELSE BEGIN 133 result[iday].std_zhom001 = 0.0 134 result[iday].std_zhom002 = 0.0 135 result[iday].std_zhom005 = 0.0 136 result[iday].std_zhom010 = 0.0 137 result[iday].std_zhomelch = 0.0 138 ENDELSE 139 ;++print, 'mean mld 1', result[iday].mean_zhom001 140 ENDFOR 141 ; 142 return, result 143 ; 139 144 END -
trunk/src/dms2dd.pro
r8 r13 26 26 ; :examples: 27 27 ; 28 ; ::28 ; .. code-block:: idl 29 29 ; 30 ; IDL> degree=45 31 ; IDL> minute=30 32 ; IDL> second=30 33 ; IDL> dd=dms2dd(degree,minute,second) 34 ; IDL> print,dd 35 ; 45.5083 30 ; degree = 45 31 ; minute = 30 32 ; second = 30 33 ; dd = dms2dd(degree,minute,second) 34 ; print,dd 35 ; 36 ; .. parsed-literal:: 37 ; 38 ; 45.5083 36 39 ; 37 40 ; :uses: … … 70 73 FUNCTION DMS2DD, degree, minute, second 71 74 72 compile_opt idl2, strictarrsubs75 compile_opt idl2, strictarrsubs 73 76 74 ; Return to caller if errors75 ON_ERROR, 277 ; Return to caller if errors 78 ON_ERROR, 2 76 79 77 usage = 'result=dms2dss(degree, minute, second)'80 usage = 'result = dms2dss(degree, minute, second)' 78 81 79 ; check parameters80 nparam = N_PARAMS()81 IF (nparam LT 3) THEN BEGIN82 ras = report(['Incorrect number of arguments.' $83 84 85 return, -186 ENDIF82 ; check parameters 83 nparam = N_PARAMS() 84 IF (nparam LT 3) THEN BEGIN 85 ras = report(['Incorrect number of arguments.' $ 86 + '!C' $ 87 + 'Usage : ' + usage]) 88 return, -1 89 ENDIF 87 90 88 arg_type = size(degree,/type)89 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN90 ras = report(['Incorrect arg type degree' $91 92 93 return, -194 ENDIF91 arg_type = size(degree,/type) 92 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN 93 ras = report(['Incorrect arg type degree' $ 94 + '!C' $ 95 + 'Usage : ' + usage]) 96 return, -1 97 ENDIF 95 98 96 arg_dim = size(degree,/n_elements)97 IF (arg_dim GT 1) THEN BEGIN98 ras = report(['Incorrect arg dimension degree' $99 100 101 return, -1102 ENDIF99 arg_dim = size(degree,/n_elements) 100 IF (arg_dim GT 1) THEN BEGIN 101 ras = report(['Incorrect arg dimension degree' $ 102 + '!C' $ 103 + 'Usage : ' + usage]) 104 return, -1 105 ENDIF 103 106 104 arg_type = size(minute,/type)105 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN106 ras = report(['Incorrect arg type minute' $107 108 109 return, -1110 ENDIF107 arg_type = size(minute,/type) 108 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN 109 ras = report(['Incorrect arg type minute' $ 110 + '!C' $ 111 + 'Usage : ' + usage]) 112 return, -1 113 ENDIF 111 114 112 arg_dim = size(minute,/n_elements)113 IF (arg_dim GT 1) THEN BEGIN114 ras = report(['Incorrect arg dimension minute' $115 116 117 return, -1118 ENDIF115 arg_dim = size(minute,/n_elements) 116 IF (arg_dim GT 1) THEN BEGIN 117 ras = report(['Incorrect arg dimension minute' $ 118 + '!C' $ 119 + 'Usage : ' + usage]) 120 return, -1 121 ENDIF 119 122 120 arg_type = size(second,/type)121 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN122 ras = report(['Incorrect arg type second' $123 124 125 return, -1126 ENDIF123 arg_type = size(second,/type) 124 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN 125 ras = report(['Incorrect arg type second' $ 126 + '!C' $ 127 + 'Usage : ' + usage]) 128 return, -1 129 ENDIF 127 130 128 arg_dim = size(second,/n_elements)129 IF (arg_dim GT 1) THEN BEGIN130 ras = report(['Incorrect arg dimension second' $131 132 133 return, -1134 ENDIF131 arg_dim = size(second,/n_elements) 132 IF (arg_dim GT 1) THEN BEGIN 133 ras = report(['Incorrect arg dimension second' $ 134 + '!C' $ 135 + 'Usage : ' + usage]) 136 return, -1 137 ENDIF 135 138 136 ; conversion137 dd = degree + float(minute/60.d) + (second/60.d)/60.d139 ; conversion 140 dd = degree + float(minute/60.d) + (second/60.d)/60.d 138 141 139 return,dd142 return, dd 140 143 141 144 END -
trunk/src/fig_mld.pro
r10 r13 9 9 ; main POMME project program 10 10 ; 11 ; - read the 2 mld models :file:`${PROJECT_ID}/noeddy_mld.nc` and :file:`${PROJECT_ID}/eddy_mld.nc` 11 ; - read the 2 mld models :file:`${PROJECT_ID}/noeddy_mld.nc` 12 ; and :file:`${PROJECT_ID}/eddy_mld.nc` 12 13 ; - read mld insitu data and metadata 13 14 ; - compute daily mean insitu mld data … … 48 49 ; ] 49 50 ; ; 50 ; pomme_asc [shape=ellipse,fontname=Courier,label="${VARAMMA_ID}/*.asc", 51 ; URL="http://www.locean-ipsl.upmc.fr/~fplod/varamma/varamma_ws/doc/html/sphinx/guides/data_content.html#data_station"]; 52 ; pomme_prn [shape=ellipse,fontname=Courier,label="${VARAMMA_ID}/*.prn", 53 ; URL="http://www.locean-ipsl.upmc.fr/~fplod/varamma/varamma_ws/doc/html/sphinx/guides/data_content.html#data_mld_insitu"]; 54 ; pomme_nc [shape=ellipse,fontname=Courier,label="${VARAMMA_ID}/*.nc", 55 ; URL="http://www.locean-ipsl.upmc.fr/~fplod/varamma/varamma_ws/doc/html/sphinx/guides/data_content.html#data_mld_models"]; 56 ; pomme_ps [shape=ellipse,fontname=Courier,label="${VARAMMA_OD}/fig_mld_valid_sta.ps"]; 51 ; pomme_asc [shape=ellipse, 52 ; fontname=Courier, 53 ; label="${PROJECT_ID}/*.asc", 54 ; URL="http://www.locean-ipsl.upmc.fr/~fplod/pomme/pomme_ws/doc/html/sphinx/guides/data_content.html#data_station"]; 55 ; pomme_prn [shape=ellipse, 56 ; fontname=Courier, 57 ; label="${PROJECT_ID}/*.prn", 58 ; URL="http://www.locean-ipsl.upmc.fr/~fplod/pomme/pomme_ws/doc/html/sphinx/guides/data_content.html#data_mld_insitu"]; 59 ; pomme_nc [shape=ellipse, 60 ; fontname=Courier, 61 ; label="${PROJECT_ID}/*.nc", 62 ; URL="http://www.locean-ipsl.upmc.fr/~fplod/pomme/pomme_ws/doc/html/sphinx/guides/data_content.html#data_mld_models"]; 63 ; pomme_ps [shape=ellipse, 64 ; fontname=Courier, 65 ; label="${PROJECT_OD}/fig_mld_valid_sta.ps"]; 57 66 ; 58 67 ; fig_mld [shape=box, … … 67 76 ; :examples: 68 77 ; 69 ; .. code-block:: guess70 ; 71 ; IDL>@init_pom72 ; IDL>fig_mld73 ; IDL>exit78 ; .. code-block:: idl 79 ; 80 ; @init_pom 81 ; fig_mld 82 ; exit 74 83 ; 75 84 ; :file:`${PROJECT_OD}/fig_mld_valid_sta.ps` can be used for future work. … … 102 111 ; :todo: 103 112 ; 104 ;105 113 ; - fplod 20110426T170242Z aedon.locean-ipsl.upmc.fr (Darwin) 106 114 ; 107 ; * make it work : now pb with :: 108 ; 109 ; % Error: impossible to make a "t" type plot with jpt = 1 110 ; % Attempt to subscript MLD1 with IDAY is out of range. 115 ; * make it work : now pb with : 116 ; 117 ; .. parsed-literal:: 118 ; 119 ; % Error: impossible to make a "t" type plot with jpt = 1 120 ; % Attempt to subscript MLD1 with IDAY is out of range. 111 121 ; 112 122 ; remove hard coded value (95) of time axe of model correction … … 145 155 ; 146 156 ; * revision according to Marina/myself work (20101130) 147 ; tricky convention differences on longitude between in situ and model files 157 ; tricky convention differences on longitude between in situ and 158 ; model files 148 159 ; * revision according to Marina work (20101201) 149 160 ; plots production, selection of delta = 1 for figure … … 172 183 ;- 173 184 PRO fig_mld 174 ;175 compile_opt idl2, strictarrsubs176 ;177 @cm_project178 ;179 ; read MLD in insitu files and metafiles180 data_asc=file_asc_to_mem()181 data_prn=file_prn_to_mem()182 data_dmean=dmean_mld(data_prn)183 data_insitu=join_dmean_asc(data_dmean,data_asc)184 ;185 ; temps des données insitu186 time_insitu=data_insitu.doy187 ;188 ; build compatible insitu arrays with models arrays189 ndays = n_elements(time_insitu)190 mld1 = findgen(ndays)191 mld2 = findgen(ndays)192 mld3 = findgen(ndays)193 mld4 = findgen(ndays)194 mld5 = findgen(ndays)195 std1 = findgen(ndays)196 xlon = findgen(ndays)197 ylat = findgen(ndays)198 FOR iday=0, ndays - 1 DO BEGIN199 indice_insitu=WHERE(time_insitu-time_insitu[0] EQ iday,count)200 IF (count EQ 0) THEN BEGIN201 mld1[iday] = !VALUES.F_NAN202 mld2[iday] = !VALUES.F_NAN203 mld3[iday] = !VALUES.F_NAN204 mld4[iday] = !VALUES.F_NAN205 mld5[iday] = !VALUES.F_NAN206 std1[iday] = !VALUES.F_NAN207 xlon[iday] = !VALUES.F_NAN208 ylat[iday] = !VALUES.F_NAN209 ENDIF ELSE BEGIN210 mld1[iday] = data_insitu[indice_insitu].mean_zhom001211 mld2[iday] = data_insitu[indice_insitu].mean_zhom002212 mld3[iday] = data_insitu[indice_insitu].mean_zhom005213 mld4[iday] = data_insitu[indice_insitu].mean_zhom010214 mld5[iday] = data_insitu[indice_insitu].mean_zhomelch215 std1[iday] = data_insitu[indice_insitu].std_zhom001216 xlon[iday] = data_insitu[indice_insitu].lon217 ylat[iday] = data_insitu[indice_insitu].lat218 ENDELSE219 ENDFOR220 ;221 ; compute mean of modeled MLD in boxes around lat,lon insitu data222 mymldm = findgen(2,ndays)223 mymldr = findgen(2,ndays)224 myvarm = findgen(2,ndays)225 myvarr = findgen(2,ndays)226 ;227 ; define the size of the box228 delta=findgen(2)229 delta[0] = 0.5230 delta[1] = 1.231 ndelta=n_elements(delta)232 ;233 ; loop on delta234 FOR idelta=0, ndelta - 1 DO BEGIN235 ; loop on days236 FOR iday=0, ndays - 1 DO BEGIN237 IF (finite(mld1[iday]) NE 0) THEN BEGIN238 domdef239 mybox = [ -xlon[iday]-delta[idelta] $240 241 242 243 244 245 jt = time_insitu[iday]+95246 mldm_box = reform(read_ncdf('mld', jt, /timestep, file=project_id_env+'eddy_mld.nc', /nostruct, box = mybox))247 mldr_box = reform(read_ncdf('mld', jt, /timestep, file=project_id_env+'noeddy_mld.nc', /nostruct, box = mybox))248 249 mymldm[idelta,iday] = moyenne(mldm_box, box = mybox, 'xy')250 mymldr[idelta,iday] = moyenne(mldr_box, box = mybox, 'xy')251 myvarm[idelta,iday] = stddev(mldm_box)252 myvarr[idelta,iday] = stddev(mldr_box)253 ENDIF ELSE BEGIN254 mymldm[idelta,iday] = !VALUES.F_NAN255 mymldr[idelta,iday] = !VALUES.F_NAN256 myvarm[idelta,iday] = !VALUES.F_NAN257 myvarr[idelta,iday] = !VALUES.F_NAN258 ENDELSE259 ENDFOR260 ENDFOR261 ;262 ; plot:263 ; selection de la partie qui nous interesse:264 ind = where(finite(mld1) NE 0)265 mld1 = mld1[ind]266 std1 = std1[ind]267 mymldm_1d = mymldm[0, *]268 mymldm_1d = mymldm[ind]269 mymldr_1d = mymldr[0, *]270 mymldr_1d = mymldr[ind]271 272 myvarm_1d = myvarm[0, *]273 myvarm_1d = myvarm[ind]274 myvarr_1d = myvarr[0, *]275 myvarr_1d = myvarr[ind]276 277 time=julday(01,01,2001)+time_insitu278 time_save = time279 jpt_save = n_elements(time)280 time = time[ind]281 jpt=n_elements(time)282 283 284 ;++ ok openps, project_od_env+'fig_mld_valid_sta.ps'285 plt1d, -mld1, 't', -300, 0, ytitle="meters", title='MLD along cruise track', color = 10, small = [1, 2, 1]286 polyfill, [time, reverse(time)], [(-mymldm_1d-myvarm_1d),reverse(-mymldm_1d+myvarm_1d)], color = 250287 polyfill, [time, reverse(time)], [(-mymldr_1d-myvarr_1d),reverse(-mymldr_1d+myvarr_1d)], color = 150288 polyfill, [time, reverse(time)], [(-mld1-std1),reverse(-mld1+std1)], color = 90289 plt1d, -mymldr_1d, 't', /ov1d, line = 2290 plt1d, -mld1, 't', /ov1d291 plt1d, -mymldm_1d, 't', /ov1d, line = 1292 293 time = time_save294 jpt = jpt_save295 plt1d, ylat, 't', title='', ytitle='latitude', color=250, small = [3, 2, 4], /noerase296 plt1d, xlon, 't', title='', ytitle='longitude', color=90 , small = [3, 2, 6], /noerase297 closeps298 299 ;300 ; Write results in ${PROJECT_OD}/fig_mld.txt301 fullfilename=project_od_env+'fig_mld.txt'302 OPENW, lun, fullfilename, /GET_LUN303 ;++ hanlde error304 ;305 header='jt xlon xlat mld1 mld2 mld3 mld4 mld5 mymldm_0 mymldr_0 myvarm_0 myvarr_0 mymldm_1 mymldr_1 myvarm_1 myvarr_1'306 ; write header307 printf, lun, header308 ;309 ; write data lines310 FOR iday=0, ndays - 1 DO BEGIN311 printf, lun $312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 ENDFOR333 ;334 ; close file335 FREE_LUN, lun185 ; 186 compile_opt idl2, strictarrsubs 187 ; 188 @cm_project 189 ; 190 ; read MLD in insitu files and metafiles 191 data_asc = file_asc_to_mem() 192 data_prn = file_prn_to_mem() 193 data_dmean = dmean_mld(data_prn) 194 data_insitu = join_dmean_asc(data_dmean,data_asc) 195 ; 196 ; temps des données insitu 197 time_insitu = data_insitu.doy 198 ; 199 ; build compatible insitu arrays with models arrays 200 ndays = n_elements(time_insitu) 201 mld1 = findgen(ndays) 202 mld2 = findgen(ndays) 203 mld3 = findgen(ndays) 204 mld4 = findgen(ndays) 205 mld5 = findgen(ndays) 206 std1 = findgen(ndays) 207 xlon = findgen(ndays) 208 ylat = findgen(ndays) 209 FOR iday = 0, ndays - 1 DO BEGIN 210 indice_insitu = WHERE(time_insitu-time_insitu[0] EQ iday,count) 211 IF (count EQ 0) THEN BEGIN 212 mld1[iday] = !VALUES.F_NAN 213 mld2[iday] = !VALUES.F_NAN 214 mld3[iday] = !VALUES.F_NAN 215 mld4[iday] = !VALUES.F_NAN 216 mld5[iday] = !VALUES.F_NAN 217 std1[iday] = !VALUES.F_NAN 218 xlon[iday] = !VALUES.F_NAN 219 ylat[iday] = !VALUES.F_NAN 220 ENDIF ELSE BEGIN 221 mld1[iday] = data_insitu[indice_insitu].mean_zhom001 222 mld2[iday] = data_insitu[indice_insitu].mean_zhom002 223 mld3[iday] = data_insitu[indice_insitu].mean_zhom005 224 mld4[iday] = data_insitu[indice_insitu].mean_zhom010 225 mld5[iday] = data_insitu[indice_insitu].mean_zhomelch 226 std1[iday] = data_insitu[indice_insitu].std_zhom001 227 xlon[iday] = data_insitu[indice_insitu].lon 228 ylat[iday] = data_insitu[indice_insitu].lat 229 ENDELSE 230 ENDFOR 231 ; 232 ; compute mean of modeled MLD in boxes around lat,lon insitu data 233 mymldm = findgen(2,ndays) 234 mymldr = findgen(2,ndays) 235 myvarm = findgen(2,ndays) 236 myvarr = findgen(2,ndays) 237 ; 238 ; define the size of the box 239 delta = findgen(2) 240 delta[0] = 0.5 241 delta[1] = 1. 242 ndelta = n_elements(delta) 243 ; 244 ; loop on delta 245 FOR idelta = 0, ndelta - 1 DO BEGIN 246 ; loop on days 247 FOR iday = 0, ndays - 1 DO BEGIN 248 IF (finite(mld1[iday]) NE 0) THEN BEGIN 249 domdef 250 mybox = [ -xlon[iday]-delta[idelta] $ 251 , -xlon[iday]+delta[idelta] $ 252 , ylat[iday]-delta[idelta] $ 253 , ylat[iday]+delta[idelta] $ 254 ] 255 256 jt = time_insitu[iday]+95 257 mldm_box = reform(read_ncdf('mld', jt, /timestep, file=project_id_env+'eddy_mld.nc', /nostruct, box = mybox)) 258 mldr_box = reform(read_ncdf('mld', jt, /timestep, file=project_id_env+'noeddy_mld.nc', /nostruct, box = mybox)) 259 260 mymldm[idelta,iday] = moyenne(mldm_box, box = mybox, 'xy') 261 mymldr[idelta,iday] = moyenne(mldr_box, box = mybox, 'xy') 262 myvarm[idelta,iday] = stddev(mldm_box) 263 myvarr[idelta,iday] = stddev(mldr_box) 264 ENDIF ELSE BEGIN 265 mymldm[idelta,iday] = !VALUES.F_NAN 266 mymldr[idelta,iday] = !VALUES.F_NAN 267 myvarm[idelta,iday] = !VALUES.F_NAN 268 myvarr[idelta,iday] = !VALUES.F_NAN 269 ENDELSE 270 ENDFOR 271 ENDFOR 272 ; 273 ; plot: 274 ; selection de la partie qui nous interesse: 275 ind = where(finite(mld1) NE 0) 276 mld1 = mld1[ind] 277 std1 = std1[ind] 278 mymldm_1d = mymldm[0, *] 279 mymldm_1d = mymldm[ind] 280 mymldr_1d = mymldr[0, *] 281 mymldr_1d = mymldr[ind] 282 283 myvarm_1d = myvarm[0, *] 284 myvarm_1d = myvarm[ind] 285 myvarr_1d = myvarr[0, *] 286 myvarr_1d = myvarr[ind] 287 288 time = julday(01,01,2001)+time_insitu 289 time_save = time 290 jpt_save = n_elements(time) 291 time = time[ind] 292 jpt = n_elements(time) 293 294 295 ;++ ok openps, project_od_env+'fig_mld_valid_sta.ps' 296 plt1d, -mld1, 't', -300, 0, ytitle="meters", title='MLD along cruise track', color = 10, small = [1, 2, 1] 297 polyfill, [time, reverse(time)], [(-mymldm_1d-myvarm_1d),reverse(-mymldm_1d+myvarm_1d)], color = 250 298 polyfill, [time, reverse(time)], [(-mymldr_1d-myvarr_1d),reverse(-mymldr_1d+myvarr_1d)], color = 150 299 polyfill, [time, reverse(time)], [(-mld1-std1),reverse(-mld1+std1)], color = 90 300 plt1d, -mymldr_1d, 't', /ov1d, line = 2 301 plt1d, -mld1, 't', /ov1d 302 plt1d, -mymldm_1d, 't', /ov1d, line = 1 303 304 time = time_save 305 jpt = jpt_save 306 plt1d, ylat, 't', title='', ytitle='latitude', color=250, small = [3, 2, 4], /noerase 307 plt1d, xlon, 't', title='', ytitle='longitude', color=90 , small = [3, 2, 6], /noerase 308 closeps 309 310 ; 311 ; Write results in ${PROJECT_OD}/fig_mld.txt 312 fullfilename = project_od_env+'fig_mld.txt' 313 OPENW, lun, fullfilename, /GET_LUN 314 ;++ hanlde error 315 ; 316 header='jt xlon xlat mld1 mld2 mld3 mld4 mld5 mymldm_0 mymldr_0 myvarm_0 myvarr_0 mymldm_1 mymldr_1 myvarm_1 myvarr_1' 317 ; write header 318 printf, lun, header 319 ; 320 ; write data lines 321 FOR iday = 0, ndays - 1 DO BEGIN 322 printf, lun $ 323 , iday $ 324 , xlon[iday] $ 325 , ylat[iday] $ 326 , mld1[iday] $ 327 , mld2[iday] $ 328 , mld3[iday] $ 329 , mld4[iday] $ 330 , mld5[iday] $ 331 , mymldm[0,iday] $ 332 , mymldr[0,iday] $ 333 , myvarm[0,iday] $ 334 , myvarr[0,iday] $ 335 , mymldm[1,iday] $ 336 , mymldr[1,iday] $ 337 , myvarm[1,iday] $ 338 , myvarr[0,iday] $ 339 , mymldm[1,iday] $ 340 , mymldr[1,iday] $ 341 , myvarm[1,iday] $ 342 , myvarr[1,iday] 343 ENDFOR 344 ; 345 ; close file 346 FREE_LUN, lun 336 347 337 348 END -
trunk/src/file_asc_long2mem.pro
r9 r13 21 21 ; :examples: 22 22 ; 23 ; ::23 ; .. code-block:: idl 24 24 ; 25 ; IDL>filename='/usr/work/incas/fplod/pomme_d/sta.P1L2.asc'26 ; IDL> result=file_asc_long2mem(filename)25 ; filename='/usr/work/incas/fplod/pomme_d/sta.P1L2.asc' 26 ; result = file_asc_long2mem(filename) 27 27 ; 28 ; impression de contrôle : structure, 1re station, toutes les stations : :28 ; impression de contrôle : structure, 1re station, toutes les stations : 29 29 ; 30 ; IDL> print, result, /structure 31 ; IDL> print, result[0].station 32 ; IDL> print, result.station 30 ; .. code-block:: idl 31 ; 32 ; print, result, /structure 33 ; print, result[0].station 34 ; print, result.station 33 35 ; 34 36 ; :uses: … … 62 64 ;- 63 65 FUNCTION file_asc_long2mem, filename 64 ;65 compile_opt idl2, strictarrsubs66 ;67 ; Return to caller if errors68 ON_ERROR, 269 ;70 usage = 'result=file_asc_long2mem(filename)'71 ;72 nparam = N_PARAMS()73 IF (nparam LT 1) THEN BEGIN74 ras = report(['Incorrect number of arguments.' $75 76 77 return, -178 ENDIF79 ;80 arg_type = size(filename,/type)81 IF (arg_type NE 7) THEN BEGIN82 ras = report(['Incorrect arg type filename' $83 84 85 return, -186 ENDIF87 ;88 arg_dim = size(filename,/n_elements)89 IF (arg_dim LT 1) THEN BEGIN90 ras = report(['Incorrect arg dimension filename' $91 92 93 return, -194 ENDIF95 ;96 ; initialize header97 header = STRARR(1)98 ;99 resultstruct = { station: 0L $100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 ;119 nrows = file_lines(filename) - N_ELEMENTS(header)120 result = Replicate(resultstruct, nrows)121 ;122 ; open file123 OPENR, lun, filename, /GET_LUN124 ;++ hanlde error125 ;126 ; read header127 READF, lun, header128 ;129 ; read data lines130 READF, lun, result131 ;132 ; close file133 FREE_LUN, lun134 ;135 return, result136 ;66 ; 67 compile_opt idl2, strictarrsubs 68 ; 69 ; Return to caller if errors 70 ON_ERROR, 2 71 ; 72 usage = 'result = file_asc_long2mem(filename)' 73 ; 74 nparam = N_PARAMS() 75 IF (nparam LT 1) THEN BEGIN 76 ras = report(['Incorrect number of arguments.' $ 77 + '!C' $ 78 + 'Usage : ' + usage]) 79 return, -1 80 ENDIF 81 ; 82 arg_type = size(filename,/type) 83 IF (arg_type NE 7) THEN BEGIN 84 ras = report(['Incorrect arg type filename' $ 85 + '!C' $ 86 + 'Usage : ' + usage]) 87 return, -1 88 ENDIF 89 ; 90 arg_dim = size(filename,/n_elements) 91 IF (arg_dim LT 1) THEN BEGIN 92 ras = report(['Incorrect arg dimension filename' $ 93 + '!C' $ 94 + 'Usage : ' + usage]) 95 return, -1 96 ENDIF 97 ; 98 ; initialize header 99 header = STRARR(1) 100 ; 101 resultstruct = { station: 0L $ 102 , sonde: 0L $ 103 , zmax: 0L $ 104 , an: 0L $ 105 , mm: 0L $ 106 , jj: 0L $ 107 , hh_begin: 0L $ 108 , mm_begin: 0L $ 109 , ss: 0L $ 110 , deg_lat_begin : 0L $ 111 , mm_lat_begin: 0.0 $ 112 , deg_lon_begin: 0L $ 113 , mm_lon_begin: 0.0 $ 114 , deg_lat_end: 0L $ 115 , mm_lat_end: 0.0 $ 116 , deg_lon_end: 0L $ 117 , mm_lon_end: 0.0 $ 118 , hh_end: 0L $ 119 , mm_end: 0L } 120 ; 121 nrows = file_lines(filename) - N_ELEMENTS(header) 122 result = Replicate(resultstruct, nrows) 123 ; 124 ; open file 125 OPENR, lun, filename, /GET_LUN 126 ;++ hanlde error 127 ; 128 ; read header 129 READF, lun, header 130 ; 131 ; read data lines 132 READF, lun, result 133 ; 134 ; close file 135 FREE_LUN, lun 136 ; 137 return, result 138 ; 137 139 END -
trunk/src/file_asc_p1l1_to_mem.pro
r9 r13 21 21 ; :examples: 22 22 ; 23 ; ::23 ; .. code-block:: idl 24 24 ; 25 ; IDL>filename='/usr/work/incas/fplod/pomme_d/sta.P1L1.asc'26 ; IDL> result=file_asc_p1l1_to_mem(filename)25 ; filename='/usr/work/incas/fplod/pomme_d/sta.P1L1.asc' 26 ; result = file_asc_p1l1_to_mem(filename) 27 27 ; 28 ; impression de contrôle : 1re station, toutes les stations : :28 ; impression de contrôle : 1re station, toutes les stations : 29 29 ; 30 ; IDL> help, result, /structure 31 ; IDL> print, result[0].station 32 ; IDL> print, result.station 30 ; .. code-block:: idl 31 ; 32 ; help, result, /structure 33 ; print, result[0].station 34 ; print, result.station 33 35 ; 34 36 ; :uses: … … 58 60 ;- 59 61 FUNCTION file_asc_p1l1_to_mem, filename 60 ;61 compile_opt idl2, strictarrsubs62 ;63 ; Return to caller if errors64 ON_ERROR, 265 ;66 usage = 'result=file_asc_p1l1_to_mem(filename)'67 ;68 nparam = N_PARAMS()69 IF (nparam LT 1) THEN BEGIN70 ras = report(['Incorrect number of arguments.' $71 72 73 return, -174 ENDIF75 ;76 arg_type = size(filename,/type)77 IF (arg_type NE 7) THEN BEGIN78 ras = report(['Incorrect arg type filename' $79 80 81 return, -182 ENDIF83 ;84 arg_dim = size(filename,/n_elements)85 IF (arg_dim LT 1) THEN BEGIN86 ras = report(['Incorrect arg dimension filename' $87 88 89 return, -190 ENDIF91 ;92 ; initialize header93 header = STRARR(1)94 ;95 resultstruct = { station:0L $96 97 98 99 100 101 102 103 104 105 106 107 108 109 nrows = file_lines(filename) - N_ELEMENTS(header);110 result = Replicate(resultstruct, nrows)111 ;112 ; open file113 OPENR, lun, filename, /GET_LUN114 ;++ hanlde error115 ;116 ; read header117 READF, lun, header118 ;119 ; read data lines120 READF, lun, result121 ;122 ; close file123 FREE_LUN, lun124 ;125 return, result126 ;62 ; 63 compile_opt idl2, strictarrsubs 64 ; 65 ; Return to caller if errors 66 ON_ERROR, 2 67 ; 68 usage = 'result = file_asc_p1l1_to_mem(filename)' 69 ; 70 nparam = N_PARAMS() 71 IF (nparam LT 1) THEN BEGIN 72 ras = report(['Incorrect number of arguments.' $ 73 + '!C' $ 74 + 'Usage : ' + usage]) 75 return, -1 76 ENDIF 77 ; 78 arg_type = size(filename,/type) 79 IF (arg_type NE 7) THEN BEGIN 80 ras = report(['Incorrect arg type filename' $ 81 + '!C' $ 82 + 'Usage : ' + usage]) 83 return, -1 84 ENDIF 85 ; 86 arg_dim = size(filename,/n_elements) 87 IF (arg_dim LT 1) THEN BEGIN 88 ras = report(['Incorrect arg dimension filename' $ 89 + '!C' $ 90 + 'Usage : ' + usage]) 91 return, -1 92 ENDIF 93 ; 94 ; initialize header 95 header = STRARR(1) 96 ; 97 resultstruct = { station:0L $ 98 , prof :0L $ 99 , zctd : 0L $ 100 , an: 0L $ 101 , mm: 0L $ 102 , jj: 0L $ 103 , hh_begin: 0L $ 104 , mm_begin: 0L $ 105 , ss_begin: 0L $ 106 , deg_lat_begin : 0L $ 107 , mm_lat_begin: 0.0 $ 108 , deg_lon_begin: 0L $ 109 , mm_lon_begin: 0.0 $ 110 } 111 nrows = file_lines(filename) - N_ELEMENTS(header); 112 result = Replicate(resultstruct, nrows) 113 ; 114 ; open file 115 OPENR, lun, filename, /GET_LUN 116 ;++ hanlde error 117 ; 118 ; read header 119 READF, lun, header 120 ; 121 ; read data lines 122 READF, lun, result 123 ; 124 ; close file 125 FREE_LUN, lun 126 ; 127 return, result 128 ; 127 129 END -
trunk/src/file_asc_p2l1_to_mem.pro
r9 r13 21 21 ; :examples: 22 22 ; 23 ; ::23 ; .. code-block:: idl 24 24 ; 25 ; filename='/usr/work/incas/fplod/pomme_d/sta.P2L1.asc' 26 ; result = file_asc_p2l1_to_mem(filename) 25 27 ; 26 ; IDL> filename='/usr/work/incas/fplod/pomme_d/sta.P2L1.asc' 27 ; IDL> result=file_asc_p2l1_to_mem(filename) 28 ; impression de controle : 1re station, toutes les stations: 28 29 ; 29 ; impression de controle : 1re station, toutes les stations::30 ; .. code-block:: idl 30 31 ; 31 ; IDL>print, result, /structure32 ; IDL>print, result[0].station33 ; IDL>print, result.station34 ; IDL>print, result[0]35 ; IDL>print, result[80]32 ; print, result, /structure 33 ; print, result[0].station 34 ; print, result.station 35 ; print, result[0] 36 ; print, result[80] 36 37 ; 37 38 ; :uses: … … 68 69 ;- 69 70 FUNCTION file_asc_p2l1_to_mem, filename 70 ;71 compile_opt idl2, strictarrsubs72 ;73 ; Return to caller if errors74 ON_ERROR, 275 ;76 usage = 'result=file_asc_p2l1_to_mem(filename)'77 ;78 nparam = N_PARAMS()79 IF (nparam LT 1) THEN BEGIN80 ras = report(['Incorrect number of arguments.' $81 82 83 return, -184 ENDIF85 ;86 arg_type = size(filename,/type)87 IF (arg_type NE 7) THEN BEGIN88 ras = report(['Incorrect arg type filename' $89 90 91 return, -192 ENDIF93 ;94 arg_dim = size(filename,/n_elements)95 IF (arg_dim LT 1) THEN BEGIN96 ras = report(['Incorrect arg dimension filename' $97 98 99 return, -1100 ENDIF101 ;102 ; initialize header103 header = STRARR(1)104 ;105 resultstruct = { station: 0L $106 107 108 109 110 111 112 113 114 115 116 117 118 119 ;120 nrows = file_lines(filename) - N_ELEMENTS(header);121 result = Replicate(resultstruct, nrows)122 ;123 ; open file124 OPENR, lun, filename, /GET_LUN125 ;++ hanlde error126 ;127 ; read header128 READF, lun, header129 ;130 ; read data lines131 READF, lun, result132 ;133 ; close file134 FREE_LUN, lun135 ;136 return, result137 ;71 ; 72 compile_opt idl2, strictarrsubs 73 ; 74 ; Return to caller if errors 75 ON_ERROR, 2 76 ; 77 usage = 'result = file_asc_p2l1_to_mem(filename)' 78 ; 79 nparam = N_PARAMS() 80 IF (nparam LT 1) THEN BEGIN 81 ras = report(['Incorrect number of arguments.' $ 82 + '!C' $ 83 + 'Usage : ' + usage]) 84 return, -1 85 ENDIF 86 ; 87 arg_type = size(filename,/type) 88 IF (arg_type NE 7) THEN BEGIN 89 ras = report(['Incorrect arg type filename' $ 90 + '!C' $ 91 + 'Usage : ' + usage]) 92 return, -1 93 ENDIF 94 ; 95 arg_dim = size(filename,/n_elements) 96 IF (arg_dim LT 1) THEN BEGIN 97 ras = report(['Incorrect arg dimension filename' $ 98 + '!C' $ 99 + 'Usage : ' + usage]) 100 return, -1 101 ENDIF 102 ; 103 ; initialize header 104 header = STRARR(1) 105 ; 106 resultstruct = { station: 0L $ 107 , sonde: 0L $ 108 , zctd: 0L $ 109 , an: 0L $ 110 , mm: 0L $ 111 , jj: 0L $ 112 , hh_begin: 0L $ 113 , mm_begin: 0L $ 114 , lat_begin: 0.0 $ 115 , lon_begin: 0.0 $ 116 , hh_end: 0L $ 117 , mm_end: 0L $ 118 , lat_end: 0.0 $ 119 , lon_end: 0.0} 120 ; 121 nrows = file_lines(filename) - N_ELEMENTS(header); 122 result = Replicate(resultstruct, nrows) 123 ; 124 ; open file 125 OPENR, lun, filename, /GET_LUN 126 ;++ hanlde error 127 ; 128 ; read header 129 READF, lun, header 130 ; 131 ; read data lines 132 READF, lun, result 133 ; 134 ; close file 135 FREE_LUN, lun 136 ; 137 return, result 138 ; 138 139 END -
trunk/src/file_asc_p2l2_to_mem.pro
r9 r13 22 22 ; :examples: 23 23 ; 24 ; ::24 ; .. code-block:: idl 25 25 ; 26 ; IDL>filename='/usr/work/incas/fplod/pomme_d/sta.P2L2.asc'27 ; IDL> result=file_asc_p2l2_to_mem(filename)26 ; filename='/usr/work/incas/fplod/pomme_d/sta.P2L2.asc' 27 ; result = file_asc_p2l2_to_mem(filename) 28 28 ; 29 ; impression de contrôle : 1re station, toutes les stations: :29 ; impression de contrôle : 1re station, toutes les stations: 30 30 ; 31 ; IDL> help, result,/structure 32 ; IDL> print, result[0].station 33 ; IDL> print, result.station 31 ; .. code-block:: idl 32 ; 33 ; help, result,/structure 34 ; print, result[0].station 35 ; print, result.station 34 36 ; 35 37 ; :uses: … … 59 61 ;- 60 62 FUNCTION file_asc_p2l2_to_mem, filename 61 ;62 compile_opt idl2, strictarrsubs63 ;64 ; Return to caller if errors65 ON_ERROR, 266 ;67 usage = 'result=file_asc_p2l2_to_mem(filename)'68 ;69 nparam = N_PARAMS()70 IF (nparam LT 1) THEN BEGIN71 ras = report(['Incorrect number of arguments.' $72 73 74 return, -175 ENDIF76 ;77 arg_type = size(filename,/type)78 IF (arg_type NE 7) THEN BEGIN79 ras = report(['Incorrect arg type filename' $80 81 82 return, -183 ENDIF84 ;85 arg_dim = size(filename,/n_elements)86 IF (arg_dim LT 1) THEN BEGIN87 ras = report(['Incorrect arg dimension filename' $88 89 90 return, -191 ENDIF92 ;93 ; initialize header94 header = STRARR(1)95 ;96 resultstruct = { station: 0L $97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 ;116 nrows = file_lines(filename) - N_ELEMENTS(header)117 result = Replicate(resultstruct, nrows)118 ;119 ; open file120 OPENR, lun, filename, /GET_LUN121 ;++ hanlde error122 ;123 ; read header124 READF, lun, header125 ;126 ; read data lines127 READF, lun, result128 ;129 ; close file130 FREE_LUN, lun131 ;132 return, result133 ;63 ; 64 compile_opt idl2, strictarrsubs 65 ; 66 ; Return to caller if errors 67 ON_ERROR, 2 68 ; 69 usage = 'result = file_asc_p2l2_to_mem(filename)' 70 ; 71 nparam = N_PARAMS() 72 IF (nparam LT 1) THEN BEGIN 73 ras = report(['Incorrect number of arguments.' $ 74 + '!C' $ 75 + 'Usage : ' + usage]) 76 return, -1 77 ENDIF 78 ; 79 arg_type = size(filename,/type) 80 IF (arg_type NE 7) THEN BEGIN 81 ras = report(['Incorrect arg type filename' $ 82 + '!C' $ 83 + 'Usage : ' + usage]) 84 return, -1 85 ENDIF 86 ; 87 arg_dim = size(filename,/n_elements) 88 IF (arg_dim LT 1) THEN BEGIN 89 ras = report(['Incorrect arg dimension filename' $ 90 + '!C' $ 91 + 'Usage : ' + usage]) 92 return, -1 93 ENDIF 94 ; 95 ; initialize header 96 header = STRARR(1) 97 ; 98 resultstruct = { station: 0L $ 99 , sonde: 0L $ 100 , zmax: 0L $ 101 , an: 0L $ 102 , mm: 0L $ 103 , jj: 0L $ 104 , hh_begin: 0L $ 105 , mm_begin: 0L $ 106 , deg_lat_begin : 0L $ 107 , mm_lat_begin: 0.0 $ 108 , deg_lon_begin: 0L $ 109 , mm_lon_begin: 0.0 $ 110 , hh_end: 0L $ 111 , mm_end: 0L $ 112 , deg_lat_end: 0L $ 113 , mm_lat_end: 0.0 $ 114 , deg_lon_end: 0L $ 115 , mm_lon_end: 0.0 $ 116 } 117 ; 118 nrows = file_lines(filename) - N_ELEMENTS(header) 119 result = Replicate(resultstruct, nrows) 120 ; 121 ; open file 122 OPENR, lun, filename, /GET_LUN 123 ;++ hanlde error 124 ; 125 ; read header 126 READF, lun, header 127 ; 128 ; read data lines 129 READF, lun, result 130 ; 131 ; close file 132 FREE_LUN, lun 133 ; 134 return, result 135 ; 134 136 END -
trunk/src/file_asc_to_mem.pro
r9 r13 14 14 ; :examples: 15 15 ; 16 ; Realistic example with POMME files: :16 ; Realistic example with POMME files: 17 17 ; 18 ; IDL> result=file_asc_to_mem()18 ; .. code-block:: idl 19 19 ; 20 ; impression de controle::20 ; result = file_asc_to_mem() 21 21 ; 22 ; IDL> help, result,/structure 23 ; IDL> print, result 22 ; impression de controle: 23 ; 24 ; .. code-block:: idl 25 ; 26 ; help, result,/structure 27 ; print, result 24 28 ; 25 29 ; … … 42 46 ;- 43 47 FUNCTION file_asc_to_mem 44 ; 45 ; Return to caller if errors 46 ON_ERROR, 2 47 ; 48 usage = 'result=file_asc_to_mem()' 49 nparam = N_PARAMS() 50 IF (nparam NE 0) THEN BEGIN 51 ras = report(['Incorrect number of arguments.' $ 52 + '!C' $ 53 + 'Usage : ' + usage]) 54 return, -1 55 ENDIF 56 ; 57 resultstruct = { station: 0L $ 58 , aa: 0L $ 59 , mm: 0L $ 60 , jj: 0L $ 61 , hh: 0L $ 62 , mn: 0L $ 63 , lat : 0.0 $ 64 , lon: 0.0 $ 65 } 66 nrows=0L 67 ; 68 filename='/usr/work/incas/fplod/pomme_d/sta.P1L1.asc' 69 data_p1l1=file_asc_p1l1_to_mem(filename) 70 nrows = nrows + n_elements(data_p1l1) 71 filename='/usr/work/incas/fplod/pomme_d/sta.P1L2.asc' 72 data_p1l2=file_asc_long2mem(filename) 73 nrows = nrows + n_elements(data_p1l2) 74 filename='/usr/work/incas/fplod/pomme_d/sta.P2L1.asc' 75 data_p2l1=file_asc_p2l1_to_mem(filename) 76 nrows = nrows + n_elements(data_p2l1) 77 filename='/usr/work/incas/fplod/pomme_d/sta.P2L2.asc' 78 data_p2l2=file_asc_p2l2_to_mem(filename) 79 nrows = nrows + n_elements(data_p2l2) 80 ; 81 result = Replicate(resultstruct, nrows) 82 ; 83 offset = 0L 84 ; 85 nstations = n_elements(data_p1l1) 86 FOR istation=0L, nstations -1 DO BEGIN 48 ; 49 ; Return to caller if errors 50 ON_ERROR, 2 51 ; 52 usage = 'result = file_asc_to_mem()' 53 nparam = N_PARAMS() 54 IF (nparam NE 0) THEN BEGIN 55 ras = report(['Incorrect number of arguments.' $ 56 + '!C' $ 57 + 'Usage : ' + usage]) 58 return, -1 59 ENDIF 60 ; 61 resultstruct = { station: 0L $ 62 , aa: 0L $ 63 , mm: 0L $ 64 , jj: 0L $ 65 , hh: 0L $ 66 , mn: 0L $ 67 , lat : 0.0 $ 68 , lon: 0.0 $ 69 } 70 nrows = 0L 71 ; 72 filename='/usr/work/incas/fplod/pomme_d/sta.P1L1.asc' 73 data_p1l1 = file_asc_p1l1_to_mem(filename) 74 nrows = nrows + n_elements(data_p1l1) 75 filename='/usr/work/incas/fplod/pomme_d/sta.P1L2.asc' 76 data_p1l2 = file_asc_long2mem(filename) 77 nrows = nrows + n_elements(data_p1l2) 78 filename='/usr/work/incas/fplod/pomme_d/sta.P2L1.asc' 79 data_p2l1 = file_asc_p2l1_to_mem(filename) 80 nrows = nrows + n_elements(data_p2l1) 81 filename='/usr/work/incas/fplod/pomme_d/sta.P2L2.asc' 82 data_p2l2 = file_asc_p2l2_to_mem(filename) 83 nrows = nrows + n_elements(data_p2l2) 84 ; 85 result = Replicate(resultstruct, nrows) 86 ; 87 offset = 0L 88 ; 89 nstations = n_elements(data_p1l1) 90 FOR istation = 0L, nstations - 1 DO BEGIN 91 rstation = istation + offset 92 result[rstation].station = data_p1l1[istation].station 93 result[rstation].aa = data_p1l1[istation].an 94 result[rstation].mm = data_p1l1[istation].mm 95 result[rstation].jj = data_p1l1[istation].jj 96 result[rstation].hh = data_p1l1[istation].hh_begin 97 result[rstation].mn = data_p1l1[istation].mm_begin 98 result[rstation].lat = dm2dd(data_p1l1[istation].deg_lat_begin,data_p1l1[istation].mm_lat_begin) 99 result[rstation].lon = dm2dd(data_p1l1[istation].deg_lon_begin,data_p1l1[istation].mm_lon_begin) 100 ENDFOR 87 101 88 rstation = istation + offset 89 result[rstation].station=data_p1l1[istation].station 90 result[rstation].aa=data_p1l1[istation].an 91 result[rstation].mm=data_p1l1[istation].mm 92 result[rstation].jj=data_p1l1[istation].jj 93 result[rstation].hh=data_p1l1[istation].hh_begin 94 result[rstation].mn=data_p1l1[istation].mm_begin 95 result[rstation].lat=dm2dd(data_p1l1[istation].deg_lat_begin,data_p1l1[istation].mm_lat_begin) 96 result[rstation].lon=dm2dd(data_p1l1[istation].deg_lon_begin,data_p1l1[istation].mm_lon_begin) 97 ENDFOR 102 offset = offset + nstations 103 ; 104 nstations = n_elements(data_p1l2) 105 FOR istation = 0L, nstations - 1 DO BEGIN 106 rstation = istation + offset 107 result[rstation].station = data_p1l2[istation].station 108 result[rstation].aa = data_p1l2[istation].an 109 result[rstation].mm = data_p1l2[istation].mm 110 result[rstation].jj = data_p1l2[istation].jj 111 result[rstation].hh = data_p1l2[istation].hh_begin 112 result[rstation].mn = data_p1l2[istation].mm_begin 113 result[rstation].lat = dm2dd(data_p1l2[istation].deg_lat_begin,data_p1l2[istation].mm_lat_begin) 114 result[rstation].lon = dm2dd(data_p1l2[istation].deg_lon_begin,data_p1l2[istation].mm_lon_begin) 115 ENDFOR 98 116 99 offset=offset + nstations 100 ; 101 nstations = n_elements(data_p1l2) 102 FOR istation=0L, nstations -1 DO BEGIN 103 rstation = istation + offset 104 result[rstation].station=data_p1l2[istation].station 105 result[rstation].aa=data_p1l2[istation].an 106 result[rstation].mm=data_p1l2[istation].mm 107 result[rstation].jj=data_p1l2[istation].jj 108 result[rstation].hh=data_p1l2[istation].hh_begin 109 result[rstation].mn=data_p1l2[istation].mm_begin 110 result[rstation].lat=dm2dd(data_p1l2[istation].deg_lat_begin,data_p1l2[istation].mm_lat_begin) 111 result[rstation].lon=dm2dd(data_p1l2[istation].deg_lon_begin,data_p1l2[istation].mm_lon_begin) 112 ENDFOR 117 offset = offset + nstations 118 ; 119 nstations = n_elements(data_p2l1) 120 ; 121 FOR istation = 0L, nstations - 1 DO BEGIN 122 rstation = istation + offset 123 result[rstation].station = data_p2l1[istation].station 124 result[rstation].aa = data_p2l1[istation].an 125 result[rstation].mm = data_p2l1[istation].mm 126 result[rstation].jj = data_p2l1[istation].jj 127 result[rstation].hh = data_p2l1[istation].hh_begin 128 result[rstation].mn = data_p2l1[istation].mm_begin 129 result[rstation].lat = data_p2l1[istation].lat_begin 130 result[rstation].lon = data_p2l1[istation].lon_begin 131 ENDFOR 113 132 114 offset=offset + nstations 115 ; 116 nstations = n_elements(data_p2l1) 117 ; 118 FOR istation=0L, nstations -1 DO BEGIN 119 rstation = istation + offset 120 result[rstation].station=data_p2l1[istation].station 121 result[rstation].aa=data_p2l1[istation].an 122 result[rstation].mm=data_p2l1[istation].mm 123 result[rstation].jj=data_p2l1[istation].jj 124 result[rstation].hh=data_p2l1[istation].hh_begin 125 result[rstation].mn=data_p2l1[istation].mm_begin 126 result[rstation].lat=data_p2l1[istation].lat_begin 127 result[rstation].lon=data_p2l1[istation].lon_begin 128 ENDFOR 129 130 offset=offset + nstations 131 ; 132 nstations = n_elements(data_p2l2) 133 FOR istation=0L, nstations -1 DO BEGIN 134 rstation = istation + offset 135 result[rstation].station=data_p2l2[istation].station 136 result[rstation].aa=data_p2l2[istation].an 137 result[rstation].mm=data_p2l2[istation].mm 138 result[rstation].jj=data_p2l2[istation].jj 139 result[rstation].hh=data_p2l2[istation].hh_begin 140 result[rstation].mn=data_p2l2[istation].mm_begin 141 result[rstation].lat=dm2dd(data_p2l2[istation].deg_lat_begin,data_p2l2[istation].mm_lat_begin) 142 result[rstation].lon=dm2dd(data_p2l2[istation].deg_lon_begin,data_p2l2[istation].mm_lon_begin) 143 ENDFOR 144 ; 145 return, result 133 offset = offset + nstations 134 ; 135 nstations = n_elements(data_p2l2) 136 FOR istation = 0L, nstations - 1 DO BEGIN 137 rstation = istation + offset 138 result[rstation].station = data_p2l2[istation].station 139 result[rstation].aa = data_p2l2[istation].an 140 result[rstation].mm = data_p2l2[istation].mm 141 result[rstation].jj = data_p2l2[istation].jj 142 result[rstation].hh = data_p2l2[istation].hh_begin 143 result[rstation].mn = data_p2l2[istation].mm_begin 144 result[rstation].lat = dm2dd(data_p2l2[istation].deg_lat_begin,data_p2l2[istation].mm_lat_begin) 145 result[rstation].lon = dm2dd(data_p2l2[istation].deg_lon_begin,data_p2l2[istation].mm_lon_begin) 146 ENDFOR 147 ; 148 return, result 146 149 147 150 END -
trunk/src/file_prn2mem.pro
r9 r13 21 21 ; :examples: 22 22 ; 23 ; ::23 ; .. code-block:: idl 24 24 ; 25 ; IDL>filename='/usr/temp/marina/POM/mld_prieur_P1L1.prn'26 ; IDL> result=file_prn2mem(filename)25 ; filename='/usr/temp/marina/POM/mld_prieur_P1L1.prn' 26 ; result = file_prn2mem(filename) 27 27 ; 28 ; filename='/usr/temp/marina/POM/mld_prieur_P1L2_tot.prn' 29 ; result = file_prn2mem(filename) 28 30 ; 29 ; IDL> filename='/usr/temp/marina/POM/mld_prieur_P1L2_tot.prn'30 ; IDL> result=file_prn2mem(filename)31 ; filename='/usr/temp/marina/POM/mld_prieur_P2L1.prn' 32 ; result = file_prn2mem(filename) 31 33 ; 32 ; IDL> filename='/usr/temp/marina/POM/mld_prieur_P2L1.prn'33 ; IDL> result=file_prn2mem(filename)34 ; filename='/usr/temp/marina/POM/mld_prieur_P2L2.prn' 35 ; result = file_prn2mem(filename) 34 36 ; 35 ; IDL> filename='/usr/temp/marina/POM/mld_prieur_P2L2.prn'36 ; IDL> result=file_prn2mem(filename)37 ; filename='/usr/temp/marina/POM/mld_prieur_P1L2_tot.prn' 38 ; result = file_prn2mem(filename) 37 39 ; 38 ; IDL> filename='/usr/temp/marina/POM/mld_prieur_P1L2_tot.prn' 39 ; IDL> result=file_prn2mem(filename) 40 ; impression de controle : 1re station, toutes les stations: 40 41 ; 41 ; impression de controle : 1re station, toutes les stations::42 ; .. code-block:: idl 42 43 ; 43 ; IDL>help, result, /structure44 ; IDL>print, result[0].station45 ; IDL>print, result.station46 ; IDL>print, result[0].zhomelch47 ; IDL> print, result[nrows-1].zhomelch44 ; help, result, /structure 45 ; print, result[0].station 46 ; print, result.station 47 ; print, result[0].zhomelch 48 ; print, result[nrows - 1].zhomelch 48 49 ; 49 50 ; :uses: … … 76 77 ;- 77 78 FUNCTION file_prn2mem, filename 78 ; 79 compile_opt idl2, strictarrsubs 80 ; 81 ; Return to caller if errors 82 ON_ERROR, 2 83 ; 84 usage = 'result=file_prn2mem(filename) 85 ; 86 nparam = N_PARAMS() 87 IF (nparam LT 1) THEN BEGIN 88 ras = report(['Incorrect number of arguments.' $ 89 + '!C' $ 90 + 'Usage : ' + usage]) 91 return, -1 92 ENDIF 93 ; 94 arg_type = size(filename,/type) 95 IF (arg_type NE 7) THEN BEGIN 96 ras = report(['Incorrect arg type filename' $ 97 + '!C' $ 98 + 'Usage : ' + usage]) 99 return, -1 100 ENDIF 101 ; 102 arg_dim = size(filename,/n_elements) 103 IF (arg_dim LT 1) THEN BEGIN 104 ras = report(['Incorrect arg dimension filename' $ 105 + '!C' $ 106 + 'Usage : ' + usage]) 107 return, -1 108 ENDIF 109 ; 110 ; initialize header 111 header = STRARR(3) 112 ; 113 resultstruct = { station: 0L $ 114 , doy: 0.0 $ 115 , zm: 0L $ 116 , fluo: 0.0 $ 117 , zfluo: 0.0 $ 118 , fluosurfac: 0.0 $ 119 , zhom001: 0.0 $ 120 , zhom002 : 0.0 $ 121 , zhom005 : 0.0 $ 122 , zhom010: 0.0 $ 123 , zhomelch : 0.0 $ 124 } 125 126 ; 127 nrows = file_lines(filename) - N_ELEMENTS(header) 128 result = Replicate(resultstruct, nrows) 129 ; 130 ; open file 131 OPENR, lun, filename, /GET_LUN 132 ;++ hanlde error 133 ; 134 ; read header 135 READF, lun, header 136 ; 137 ; read data lines 138 READF, lun, result 139 ; 140 ; close file 141 FREE_LUN, lun 142 ; 143 return, result 144 ; 79 ; 80 compile_opt idl2, strictarrsubs 81 ; 82 ; Return to caller if errors 83 ON_ERROR, 2 84 ; 85 usage = 'result = file_prn2mem(filename) 86 ; 87 nparam = N_PARAMS() 88 IF (nparam LT 1) THEN BEGIN 89 ras = report(['Incorrect number of arguments.' $ 90 + '!C' $ 91 + 'Usage : ' + usage]) 92 return, -1 93 ENDIF 94 ; 95 arg_type = size(filename,/type) 96 IF (arg_type NE 7) THEN BEGIN 97 ras = report(['Incorrect arg type filename' $ 98 + '!C' $ 99 + 'Usage : ' + usage]) 100 return, -1 101 ENDIF 102 ; 103 arg_dim = size(filename,/n_elements) 104 IF (arg_dim LT 1) THEN BEGIN 105 ras = report(['Incorrect arg dimension filename' $ 106 + '!C' $ 107 + 'Usage : ' + usage]) 108 return, -1 109 ENDIF 110 ; 111 ; initialize header 112 header = STRARR(3) 113 ; 114 resultstruct = { station: 0L $ 115 , doy: 0.0 $ 116 , zm: 0L $ 117 , fluo: 0.0 $ 118 , zfluo: 0.0 $ 119 , fluosurfac: 0.0 $ 120 , zhom001: 0.0 $ 121 , zhom002 : 0.0 $ 122 , zhom005 : 0.0 $ 123 , zhom010: 0.0 $ 124 , zhomelch : 0.0 $ 125 } 126 ; 127 nrows = file_lines(filename) - N_ELEMENTS(header) 128 result = Replicate(resultstruct, nrows) 129 ; 130 ; open file 131 OPENR, lun, filename, /GET_LUN 132 ;++ hanlde error 133 ; 134 ; read header 135 READF, lun, header 136 ; 137 ; read data lines 138 READF, lun, result 139 ; 140 ; close file 141 FREE_LUN, lun 142 ; 143 return, result 144 ; 145 145 END -
trunk/src/file_prn_to_mem.pro
r9 r13 16 16 ; :examples: 17 17 ; 18 ; Realistic example with POMME files: :18 ; Realistic example with POMME files: 19 19 ; 20 ; IDL> result=file_prn_to_mem()20 ; .. code-block:: idl 21 21 ; 22 ; impression de controle::22 ; result = file_prn_to_mem() 23 23 ; 24 ; IDL> help, result, /structure 25 ; IDL> print, result 24 ; impression de controle: 25 ; 26 ; .. code-block:: idl 27 ; 28 ; help, result, /structure 29 ; print, result 26 30 ; 27 31 ; :uses: … … 53 57 ;- 54 58 FUNCTION file_prn_to_mem 55 ; 56 ; Return to caller if errors 57 ON_ERROR, 2 58 ; 59 usage = 'result=file_prn_to_mem()' 60 nparam = N_PARAMS() 61 IF (nparam NE 0) THEN BEGIN 62 ras = report(['Incorrect number of arguments.' $ 63 + '!C' $ 64 + 'Usage : ' + usage]) 65 return, -1 66 ENDIF 67 ; 68 resultstruct = { station: 0L $ 69 , doy: 0.0 $ 70 , zhom001: 0.0 $ 71 , zhom002 : 0.0 $ 72 , zhom005 : 0.0 $ 73 , zhom010: 0.0 $ 74 , zhomelch : 0.0 $ 75 } 76 ; 77 nrows=0L 78 ; 79 filename='/usr/work/incas/fplod/pomme_d/mld_prieur_P1L1.prn' 80 data_p1l1=file_prn2mem(filename) 81 nrows = nrows + n_elements(data_p1l1) 82 filename='/usr/work/incas/fplod/pomme_d/mld_prieur_P1L2_tot.prn' 83 data_p1l2=file_prn2mem(filename) 84 nrows = nrows + n_elements(data_p1l2) 85 filename='/usr/work/incas/fplod/pomme_d/mld_prieur_P2L1.prn' 86 data_p2l1=file_prn2mem(filename) 87 nrows = nrows + n_elements(data_p2l1) 88 filename='/usr/work/incas/fplod/pomme_d/mld_prieur_P2L2.prn' 89 data_p2l2=file_prn2mem(filename) 90 nrows = nrows + n_elements(data_p2l2) 91 ; 92 result = Replicate(resultstruct, nrows) 93 ; 94 offset = 0L 95 ; 96 nstations = n_elements(data_p1l1) 97 FOR istation=0L, nstations -1 DO BEGIN 59 ; 60 ; Return to caller if errors 61 ON_ERROR, 2 62 ; 63 usage = 'result = file_prn_to_mem()' 64 nparam = N_PARAMS() 65 IF (nparam NE 0) THEN BEGIN 66 ras = report(['Incorrect number of arguments.' $ 67 + '!C' $ 68 + 'Usage : ' + usage]) 69 return, -1 70 ENDIF 71 ; 72 resultstruct = { station: 0L $ 73 , doy: 0.0 $ 74 , zhom001: 0.0 $ 75 , zhom002 : 0.0 $ 76 , zhom005 : 0.0 $ 77 , zhom010: 0.0 $ 78 , zhomelch : 0.0 $ 79 } 80 ; 81 nrows = 0L 82 ; 83 filename='/usr/work/incas/fplod/pomme_d/mld_prieur_P1L1.prn' 84 data_p1l1 = file_prn2mem(filename) 85 nrows = nrows + n_elements(data_p1l1) 86 filename='/usr/work/incas/fplod/pomme_d/mld_prieur_P1L2_tot.prn' 87 data_p1l2 = file_prn2mem(filename) 88 nrows = nrows + n_elements(data_p1l2) 89 filename='/usr/work/incas/fplod/pomme_d/mld_prieur_P2L1.prn' 90 data_p2l1 = file_prn2mem(filename) 91 nrows = nrows + n_elements(data_p2l1) 92 filename='/usr/work/incas/fplod/pomme_d/mld_prieur_P2L2.prn' 93 data_p2l2 = file_prn2mem(filename) 94 nrows = nrows + n_elements(data_p2l2) 95 ; 96 result = Replicate(resultstruct, nrows) 97 ; 98 offset = 0L 99 ; 100 nstations = n_elements(data_p1l1) 101 FOR istation = 0L, nstations - 1 DO BEGIN 102 rstation = istation + offset 103 result[rstation].station = data_p1l1[istation].station 104 result[rstation].doy = data_p1l1[istation].doy 105 result[rstation].zhom001 = data_p1l1[istation].zhom001 106 result[rstation].zhom002 = data_p1l1[istation].zhom002 107 result[rstation].zhom005 = data_p1l1[istation].zhom005 108 result[rstation].zhom010 = data_p1l1[istation].zhom010 109 result[rstation].zhomelch = data_p1l1[istation].zhomelch 110 ENDFOR 98 111 99 rstation = istation + offset 100 result[rstation].station=data_p1l1[istation].station 101 result[rstation].doy=data_p1l1[istation].doy 102 result[rstation].zhom001=data_p1l1[istation].zhom001 103 result[rstation].zhom002=data_p1l1[istation].zhom002 104 result[rstation].zhom005=data_p1l1[istation].zhom005 105 result[rstation].zhom010=data_p1l1[istation].zhom010 106 result[rstation].zhomelch=data_p1l1[istation].zhomelch 107 ENDFOR 112 offset = offset + nstations 113 ; 114 nstations = n_elements(data_p1l2) 115 FOR istation = 0L, nstations - 1 DO BEGIN 116 rstation = istation + offset 117 result[rstation].station = data_p1l2[istation].station 118 result[rstation].doy = data_p1l2[istation].doy 119 result[rstation].zhom001 = data_p1l2[istation].zhom001 120 result[rstation].zhom002 = data_p1l2[istation].zhom002 121 result[rstation].zhom005 = data_p1l2[istation].zhom005 122 result[rstation].zhom010 = data_p1l2[istation].zhom010 123 result[rstation].zhomelch = data_p1l2[istation].zhomelch 124 ENDFOR 108 125 109 offset=offset + nstations 110 ; 111 nstations = n_elements(data_p1l2) 112 FOR istation=0L, nstations -1 DO BEGIN 113 rstation = istation + offset 114 result[rstation].station=data_p1l2[istation].station 115 result[rstation].doy=data_p1l2[istation].doy 116 result[rstation].zhom001=data_p1l2[istation].zhom001 117 result[rstation].zhom002=data_p1l2[istation].zhom002 118 result[rstation].zhom005=data_p1l2[istation].zhom005 119 result[rstation].zhom010=data_p1l2[istation].zhom010 120 result[rstation].zhomelch=data_p1l2[istation].zhomelch 121 ENDFOR 126 offset = offset + nstations 127 ; 128 nstations = n_elements(data_p2l1) 129 ; 130 FOR istation = 0L, nstations - 1 DO BEGIN 131 rstation = istation + offset 132 result[rstation].station = data_p2l1[istation].station 133 result[rstation].doy = data_p2l1[istation].doy 134 result[rstation].zhom001 = data_p2l1[istation].zhom001 135 result[rstation].zhom002 = data_p2l1[istation].zhom002 136 result[rstation].zhom005 = data_p2l1[istation].zhom005 137 result[rstation].zhom010 = data_p2l1[istation].zhom010 138 result[rstation].zhomelch = data_p2l1[istation].zhomelch 139 ENDFOR 122 140 123 offset=offset + nstations 124 ; 125 nstations = n_elements(data_p2l1) 126 ; 127 FOR istation=0L, nstations -1 DO BEGIN 128 rstation = istation + offset 129 result[rstation].station=data_p2l1[istation].station 130 result[rstation].doy=data_p2l1[istation].doy 131 result[rstation].zhom001=data_p2l1[istation].zhom001 132 result[rstation].zhom002=data_p2l1[istation].zhom002 133 result[rstation].zhom005=data_p2l1[istation].zhom005 134 result[rstation].zhom010=data_p2l1[istation].zhom010 135 result[rstation].zhomelch=data_p2l1[istation].zhomelch 136 ENDFOR 137 138 offset=offset + nstations 139 ; 140 nstations = n_elements(data_p2l2) 141 FOR istation=0L, nstations -1 DO BEGIN 142 rstation = istation + offset 143 result[rstation].station=data_p2l2[istation].station 144 result[rstation].doy=data_p2l2[istation].doy 145 result[rstation].zhom001=data_p2l2[istation].zhom001 146 result[rstation].zhom002=data_p2l2[istation].zhom002 147 result[rstation].zhom005=data_p2l2[istation].zhom005 148 result[rstation].zhom010=data_p2l2[istation].zhom010 149 result[rstation].zhomelch=data_p2l2[istation].zhomelch 150 ENDFOR 151 ; 152 return, result 141 offset = offset + nstations 142 ; 143 nstations = n_elements(data_p2l2) 144 FOR istation = 0L, nstations - 1 DO BEGIN 145 rstation = istation + offset 146 result[rstation].station = data_p2l2[istation].station 147 result[rstation].doy = data_p2l2[istation].doy 148 result[rstation].zhom001 = data_p2l2[istation].zhom001 149 result[rstation].zhom002 = data_p2l2[istation].zhom002 150 result[rstation].zhom005 = data_p2l2[istation].zhom005 151 result[rstation].zhom010 = data_p2l2[istation].zhom010 152 result[rstation].zhomelch = data_p2l2[istation].zhomelch 153 ENDFOR 154 ; 155 return, result 153 156 154 157 END -
trunk/src/init.pro
r2 r13 111 111 izmaxmesh = -1L 112 112 ixmindta = 0L 113 ixmaxdta = jpidta -1113 ixmaxdta = jpidta - 1 114 114 iymindta = 0L 115 iymaxdta = jpjdta -1115 iymaxdta = jpjdta - 1 116 116 izmindta = 0L 117 izmaxdta = jpkdta -1117 izmaxdta = jpkdta - 1 118 118 key_shift = 0L 119 119 key_periodic = 0L -
trunk/src/init_pom.pro
r9 r13 16 16 ; :examples: 17 17 ; 18 ; ::18 ; .. code-block:: idl 19 19 ; 20 ; IDL>@init_pom20 ; @init_pom 21 21 ; 22 22 ; :see also: … … 74 74 ;---------------------------------------------------------- 75 75 ;domaine total 76 ixminmesh =-177 ixmaxmesh =-178 iyminmesh =-179 iymaxmesh =-180 izminmesh =-181 izmaxmesh =-176 ixminmesh = -1 77 ixmaxmesh = -1 78 iyminmesh = -1 79 iymaxmesh = -1 80 izminmesh = -1 81 izmaxmesh = -1 82 82 ; 83 83 ; sans la zone de recirculation … … 119 119 ; 120 120 ixmindta = 0 121 ixmaxdta = jpidta -1121 ixmaxdta = jpidta - 1 122 122 iymindta = 0 123 iymaxdta = jpjdta -1123 iymaxdta = jpjdta - 1 124 124 izmindta = 0 125 izmaxdta = jpkdta -1125 izmaxdta = jpkdta - 1 -
trunk/src/join_dmean_asc.pro
r8 r13 9 9 ; Join information from mean (++details) and asc (++detail) structures 10 10 ; 11 ; If station is not found in data_asc structure, latitude and longitude are set12 ; to NaN.11 ; If station is not found in data_asc structure, latitude and longitude 12 ; are set to NaN. 13 13 ; 14 14 ; :param data_dmean: structure ++details … … 25 25 ; :examples: 26 26 ; 27 ; Realistic example with POMME files: :27 ; Realistic example with POMME files: 28 28 ; 29 ; IDL> data_asc=file_asc_to_mem() 30 ; IDL> data_prn=file_prn_to_mem() 31 ; IDL> data_dmean=dmean_mld(data_prn) 32 ; IDL> data_insitu=join_dmean_asc(data_dmean,data_asc) 29 ; .. code-block:: idl 33 30 ; 34 ; impression de controle :: 31 ; data_asc = file_asc_to_mem() 32 ; data_prn = file_prn_to_mem() 33 ; data_dmean = dmean_mld(data_prn) 34 ; data_insitu = join_dmean_asc(data_dmean,data_asc) 35 35 ; 36 ; IDL> help, data_insitu, /structure 37 ; IDL> print, data_insitu[0] 38 ; IDL> print, data_insitu.lat 39 ; IDL> print, data_insitu.lon 36 ; impression de controle : 37 ; 38 ; .. code-block:: idl 39 ; 40 ; help, data_insitu, /structure 41 ; print, data_insitu[0] 42 ; print, data_insitu.lat 43 ; print, data_insitu.lon 40 44 ; 41 45 ; :uses: … … 63 67 ; 64 68 ; check doy in prn files vs computed julianday 65 ; now (20101124) differences due to either bad calculation here or bad doy calculion in .prn file or difference choice between begin, end, middle time. 69 ; now (20101124) differences due to either bad calculation here or bad 70 ; doy calculion in .prn file or difference choice between begin, end, 71 ; middle time. 66 72 ; 67 73 ; :history: … … 90 96 ;- 91 97 FUNCTION join_dmean_asc, data_dmean, data_asc 92 ;93 compile_opt idl2, strictarrsubs94 ;95 ; Return to caller if errors96 ON_ERROR, 297 ;98 usage = 'result=join_dmean_asc(data_asc,data_dmean)'99 ;100 nparam = N_PARAMS()101 IF (nparam LT 2) THEN BEGIN102 ras = report(['Incorrect number of arguments.' $103 104 105 return, -1106 ENDIF107 ;108 ; initialize returned structure109 resultstruct = { doy : 0L $110 111 112 113 114 115 116 117 118 119 120 121 122 123 ;124 ndays = n_elements(data_dmean)125 result = replicate(resultstruct, ndays)126 ;127 ; fill returned structure128 FOR iday=0L, ndays -1 DO BEGIN129 result[iday].doy=data_dmean[iday].doy130 result[iday].mean_zhom001=data_dmean[iday].mean_zhom001131 result[iday].mean_zhom002=data_dmean[iday].mean_zhom002132 result[iday].mean_zhom005=data_dmean[iday].mean_zhom005133 result[iday].mean_zhom010=data_dmean[iday].mean_zhom010134 result[iday].mean_zhomelch=data_dmean[iday].mean_zhomelch135 result[iday].std_zhom001=data_dmean[iday].std_zhom001136 result[iday].std_zhom002=data_dmean[iday].std_zhom002137 result[iday].std_zhom005=data_dmean[iday].std_zhom005138 result[iday].std_zhom010=data_dmean[iday].std_zhom010139 result[iday].std_zhomelch=data_dmean[iday].std_zhomelch140 indice_asc=WHERE(data_asc.station EQ data_dmean[iday].first_station,count)141 IF (count EQ 0) THEN BEGIN142 print, 'no station ', data_dmean[iday].first_station,' in data_asc.station'143 result[iday].lat = !VALUES.F_NAN144 result[iday].lon = !VALUES.F_NAN145 ENDIF ELSE BEGIN146 ;print, 'indice de la first_station', data_dmean[iday].first_station,' dans data_asc = ',indice_asc147 result[iday].lat = data_asc[indice_asc[0]].lat148 result[iday].lon = data_asc[indice_asc[0]].lon149 ENDELSE150 ENDFOR151 ;152 return, result153 ;98 ; 99 compile_opt idl2, strictarrsubs 100 ; 101 ; Return to caller if errors 102 ON_ERROR, 2 103 ; 104 usage = 'result = join_dmean_asc(data_asc,data_dmean)' 105 ; 106 nparam = N_PARAMS() 107 IF (nparam LT 2) THEN BEGIN 108 ras = report(['Incorrect number of arguments.' $ 109 + '!C' $ 110 + 'Usage : ' + usage]) 111 return, -1 112 ENDIF 113 ; 114 ; initialize returned structure 115 resultstruct = { doy : 0L $ 116 , lat: 0.0 $ 117 , lon: 0.0 $ 118 , mean_zhom001: 0.0 $ 119 , mean_zhom002 : 0.0 $ 120 , mean_zhom005 : 0.0 $ 121 , mean_zhom010: 0.0 $ 122 , mean_zhomelch : 0.0 $ 123 , std_zhom001: 0.0 $ 124 , std_zhom002 : 0.0 $ 125 , std_zhom005 : 0.0 $ 126 , std_zhom010: 0.0 $ 127 , std_zhomelch : 0.0 $ 128 } 129 ; 130 ndays = n_elements(data_dmean) 131 result = replicate(resultstruct, ndays) 132 ; 133 ; fill returned structure 134 FOR iday = 0L, ndays - 1 DO BEGIN 135 result[iday].doy = data_dmean[iday].doy 136 result[iday].mean_zhom001 = data_dmean[iday].mean_zhom001 137 result[iday].mean_zhom002 = data_dmean[iday].mean_zhom002 138 result[iday].mean_zhom005 = data_dmean[iday].mean_zhom005 139 result[iday].mean_zhom010 = data_dmean[iday].mean_zhom010 140 result[iday].mean_zhomelch = data_dmean[iday].mean_zhomelch 141 result[iday].std_zhom001 = data_dmean[iday].std_zhom001 142 result[iday].std_zhom002 = data_dmean[iday].std_zhom002 143 result[iday].std_zhom005 = data_dmean[iday].std_zhom005 144 result[iday].std_zhom010 = data_dmean[iday].std_zhom010 145 result[iday].std_zhomelch = data_dmean[iday].std_zhomelch 146 indice_asc = WHERE(data_asc.station EQ data_dmean[iday].first_station,count) 147 IF (count EQ 0) THEN BEGIN 148 print, 'no station ', data_dmean[iday].first_station,' in data_asc.station' 149 result[iday].lat = !VALUES.F_NAN 150 result[iday].lon = !VALUES.F_NAN 151 ENDIF ELSE BEGIN 152 ;print, 'indice de la first_station', data_dmean[iday].first_station,' dans data_asc = ',indice_asc 153 result[iday].lat = data_asc[indice_asc[0]].lat 154 result[iday].lon = data_asc[indice_asc[0]].lon 155 ENDELSE 156 ENDFOR 157 ; 158 return, result 159 ; 154 160 END -
trunk/src/project_init.pro
r9 r13 12 12 ; This is the SAXO initialisation file. 13 13 ; 14 ; It ++: :15 ; $ idl -IDL_STARTUP project_init.pro14 ; It ++: 15 ; .. code-block:: bash 16 16 ; 17 ; or::17 ; idl -IDL_STARTUP project_init.pro 18 18 ; 19 ; $ idl 20 ; IDL> @project_init 19 ; or: 20 ; 21 ; .. code-block:: idl 22 ; 23 ; @project_init 21 24 ; 22 25 ; SEE ALSO … … 45 48 ; 46 49 ; SAXO environment 47 saxo_dir_env =GETENV('SAXO_DIR')50 saxo_dir_env = GETENV('SAXO_DIR') 48 51 ; 49 52 ; project environment #1 50 project_env_temp =GETENV('PROJECT')51 project_id_env_temp =GETENV('PROJECT_ID')52 project_od_env_temp =GETENV('PROJECT_OD')53 project_env_temp = GETENV('PROJECT') 54 project_id_env_temp = GETENV('PROJECT_ID') 55 project_od_env_temp = GETENV('PROJECT_OD') 53 56 ; 54 57 ; path definition … … 59 62 ; project environment #2 60 63 @cm_project 61 project_env =project_env_temp62 project_id_env =project_id_env_temp63 project_od_env =project_od_env_temp64 project_env = project_env_temp 65 project_id_env = project_id_env_temp 66 project_od_env = project_od_env_temp 64 67 ; 65 68 ; compatibility with the old version -
trunk/src/project_profile.sh
r12 r13 144 144 case ${1} in 145 145 -d) 146 # directory for application choosen by user (see svn checkout command used) 146 # directory for application choosen by user 147 # (see svn checkout command used) 147 148 directory=${2} 148 149 shift … … 171 172 echo "eee : unknown option ${1}" 172 173 echo "${usage}" 173 # nb : no exit because this file should be launched by login process 174 # nb : no exit because this file should be launched 175 # by login process 174 176 ;; 175 177 esac … … 255 257 then 256 258 echo " eee : ${PROJECT_LOG} not writable" 257 # nb : no exit because this file shouldreachable be launched by login process 259 # nb : no exit because this file should reachable be launched 260 # by login process 258 261 fi 259 262 #
Note: See TracChangeset
for help on using the changeset viewer.