Changeset 13


Ignore:
Timestamp:
02/18/14 11:03:22 (10 years ago)
Author:
pinsard
Message:

fix thanks to coding rules

Location:
trunk
Files:
3 deleted
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/adm/guides/contributing.rst

    r12 r13  
    1616.. _contributing: 
    1717 
    18 ============== 
    19  Contributing 
    20 ============== 
     18============ 
     19Contributing 
     20============ 
    2121 
    2222Development is tracked with svn_. 
     
    3030and add/answer tickets. 
    3131 
    32 See :ref:`Contact <contact>` to ask for login or any trouble on your forge.ipsl.jussieu.fr account. 
     32See :ref:`Contact <contact>` to ask for login or any trouble on your 
     33forge.ipsl.jussieu.fr account. 
    3334 
    3435You will find in 
  • trunk/adm/guides/data_content.rst

    r12 r13  
    5656 
    5757 
    58 Small hand made fix:: 
     58Small hand made fix: 
     59 
     60.. code-block:: bash 
    5961 
    6062   diff ./mld_prieur_P1L1.prn /usr/temp/marina/POM//mld_prieur_P1L1.prn 
     63 
     64.. parsed-literal:: 
     65 
    6166   17c17 
    6267   <    1014    39.3438     238      0.0857    0.0723    0.0908     238       249       279       376       236 
     
    139144 - :file:`sta.P2L2.asc` 
    140145 
    141 Small hand made fix :: 
     146Small hand made fix : 
    142147 
    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   > 
    158181 
    159182Tools 
  • trunk/adm/guides/glossary.rst

    r12 r13  
    2929   MLD 
    3030      Mixed Layer Depth 
    31     
     31 
    3232   P1L1 
    3333      POMME 1 LEG 1 
  • trunk/adm/guides/requirements.rst

    r12 r13  
    1212.. - 
    1313 
    14 .. |project| replace:: POMME  
     14.. |project| replace:: POMME 
    1515 
    1616.. _requirements: 
    1717 
    18 ============== 
    19  Requirements 
    20 ============== 
     18============ 
     19Requirements 
     20============ 
    2121 
    2222|project| is written using unix shell scripts and IDL/SAXO sources. 
  • trunk/adm/index.rst

    r12 r13  
    33.. EVOLUTIONS 
    44.. ========== 
    5 ..  
     5.. 
    66.. $Id$ 
    77.. 
  • trunk/adm/sphinx/conf.py

    r8 r13  
    196196# (source start file, target name, title, author, documentclass [howto/manual]). 
    197197latex_documents = [ 
    198   ('index', 'POMME.tex', u'POMME Documentation', 
    199    u'CNRS', 'manual'), 
     198  ('index', 'POMME.tex', u'POMME Documentation', u'CNRS', 'manual'), 
    200199] 
    201200 
  • trunk/src/dm2dd.pro

    r8 r13  
    2323; :examples: 
    2424; 
    25 ; :: 
     25; .. code-block:: idl 
    2626; 
    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 
    3235; 
    3336; :uses: 
     
    5659FUNCTION DM2DD, degree, minute 
    5760 
    58 compile_opt idl2, strictarrsubs 
     61    compile_opt idl2, strictarrsubs 
    5962 
    60 ; Return to caller if errors 
    61 ON_ERROR, 2 
     63    ; Return to caller if errors 
     64    ON_ERROR, 2 
    6265 
    63 usage = 'result=dms2dss(degree, minute)' 
     66    usage = 'result = dms2dss(degree, minute)' 
    6467 
    65 ; check parameters 
    66 nparam = N_PARAMS() 
    67 IF (nparam LT 2) THEN BEGIN 
    68    ras = report(['Incorrect number of arguments.' $ 
    69          + '!C' $ 
    70          + 'Usage : ' + usage]) 
    71    return, -1 
    72 ENDIF 
     68    ; 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 
    7376 
    74 arg_type = size(degree,/type) 
    75 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN 
    76    ras = report(['Incorrect arg type degree' $ 
    77          + '!C' $ 
    78          + 'Usage : ' + usage]) 
    79    return, -1 
    80 ENDIF 
     77    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 
    8184 
    82 arg_dim =  size(degree,/n_elements) 
    83 IF (arg_dim GT 1) THEN BEGIN 
    84    ras = report(['Incorrect arg dimension degree' $ 
    85          + '!C' $ 
    86          + 'Usage : ' + usage]) 
    87    return, -1 
    88 ENDIF 
     85    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 
    8992 
    90 arg_type = size(minute,/type) 
    91 IF (arg_type NE 4) THEN BEGIN 
    92    ras = report(['Incorrect arg type minute' $ 
    93          + '!C' $ 
    94          + 'Usage : ' + usage]) 
    95    return, -1 
    96 ENDIF 
     93    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 
    97100 
    98 arg_dim =  size(minute,/n_elements) 
    99 IF (arg_dim GT 1) THEN BEGIN 
    100    ras = report(['Incorrect arg dimension minute' $ 
    101          + '!C' $ 
    102          + 'Usage : ' + usage]) 
    103    return, -1 
    104 ENDIF 
     101    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 
    105108 
    106 ; conversion 
    107 dd = degree + minute/60.d 
     109    ; conversion 
     110    dd = degree + minute/60.d 
    108111 
    109 return,dd 
     112    return, dd 
    110113 
    111114END 
  • trunk/src/dmean_mld.pro

    r6 r13  
    1818; :examples: 
    1919; 
    20 ; Realistic example with POMME files:: 
     20; Realistic example with POMME files: 
    2121; 
    22 ;    IDL> data_prn=file_prn_to_mem() 
    23 ;    IDL> data_dmean=dmean_mld(data_prn) 
     22; .. code-block:: idl 
    2423; 
    25 ; impression de controle :: 
     24;    data_prn = file_prn_to_mem() 
     25;    data_dmean = dmean_mld(data_prn) 
    2626; 
    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 
    3135; 
    3236; :uses: 
     
    6367;- 
    6468FUNCTION 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    ; 
    139144END 
  • trunk/src/dms2dd.pro

    r8 r13  
    2626; :examples: 
    2727; 
    28 ; :: 
     28; .. code-block:: idl 
    2929; 
    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 
    3639; 
    3740; :uses: 
     
    7073FUNCTION DMS2DD, degree, minute, second 
    7174 
    72 compile_opt idl2, strictarrsubs 
     75    compile_opt idl2, strictarrsubs 
    7376 
    74 ; Return to caller if errors 
    75 ON_ERROR, 2 
     77    ; Return to caller if errors 
     78    ON_ERROR, 2 
    7679 
    77 usage = 'result=dms2dss(degree, minute, second)' 
     80    usage = 'result = dms2dss(degree, minute, second)' 
    7881 
    79 ; check parameters 
    80 nparam = N_PARAMS() 
    81 IF (nparam LT 3) THEN BEGIN 
    82    ras = report(['Incorrect number of arguments.' $ 
    83          + '!C' $ 
    84          + 'Usage : ' + usage]) 
    85    return, -1 
    86 ENDIF 
     82    ; 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 
    8790 
    88 arg_type = size(degree,/type) 
    89 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN 
    90    ras = report(['Incorrect arg type degree' $ 
    91          + '!C' $ 
    92          + 'Usage : ' + usage]) 
    93    return, -1 
    94 ENDIF 
     91    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 
    9598 
    96 arg_dim =  size(degree,/n_elements) 
    97 IF (arg_dim GT 1) THEN BEGIN 
    98    ras = report(['Incorrect arg dimension degree' $ 
    99          + '!C' $ 
    100          + 'Usage : ' + usage]) 
    101    return, -1 
    102 ENDIF 
     99    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 
    103106 
    104 arg_type = size(minute,/type) 
    105 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN 
    106    ras = report(['Incorrect arg type minute' $ 
    107          + '!C' $ 
    108          + 'Usage : ' + usage]) 
    109    return, -1 
    110 ENDIF 
     107    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 
    111114 
    112 arg_dim =  size(minute,/n_elements) 
    113 IF (arg_dim GT 1) THEN BEGIN 
    114    ras = report(['Incorrect arg dimension minute' $ 
    115          + '!C' $ 
    116          + 'Usage : ' + usage]) 
    117    return, -1 
    118 ENDIF 
     115    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 
    119122 
    120 arg_type = size(second,/type) 
    121 IF ((arg_type NE 2) AND (arg_type NE 3)) THEN BEGIN 
    122    ras = report(['Incorrect arg type second' $ 
    123          + '!C' $ 
    124          + 'Usage : ' + usage]) 
    125    return, -1 
    126 ENDIF 
     123    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 
    127130 
    128 arg_dim =  size(second,/n_elements) 
    129 IF (arg_dim GT 1) THEN BEGIN 
    130    ras = report(['Incorrect arg dimension second' $ 
    131          + '!C' $ 
    132          + 'Usage : ' + usage]) 
    133    return, -1 
    134 ENDIF 
     131    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 
    135138 
    136 ; conversion 
    137 dd = degree + float(minute/60.d) + (second/60.d)/60.d 
     139    ; conversion 
     140    dd = degree + float(minute/60.d) + (second/60.d)/60.d 
    138141 
    139 return,dd 
     142    return, dd 
    140143 
    141144END 
  • trunk/src/fig_mld.pro

    r10 r13  
    99; main POMME project program 
    1010; 
    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` 
    1213; - read mld insitu data and metadata 
    1314; - compute daily mean insitu mld data 
     
    4849;           ] 
    4950;           ; 
    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"]; 
    5766; 
    5867;           fig_mld [shape=box, 
     
    6776; :examples: 
    6877; 
    69 ; .. code-block:: guess 
    70 ; 
    71 ;    IDL> @init_pom 
    72 ;    IDL> fig_mld 
    73 ;    IDL> exit 
     78; .. code-block:: idl 
     79; 
     80;    @init_pom 
     81;    fig_mld 
     82;    exit 
    7483; 
    7584; :file:`${PROJECT_OD}/fig_mld_valid_sta.ps` can be used for future work. 
     
    102111; :todo: 
    103112; 
    104 ;  
    105113; - fplod 20110426T170242Z aedon.locean-ipsl.upmc.fr (Darwin) 
    106114; 
    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. 
    111121; 
    112122; remove hard coded value (95) of time axe of model correction 
     
    145155; 
    146156;   * 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 
    148159;   * revision according to Marina work (20101201) 
    149160;     plots production, selection of delta = 1 for figure 
     
    172183;- 
    173184PRO fig_mld 
    174 ; 
    175 compile_opt idl2, strictarrsubs 
    176 ; 
    177 @cm_project 
    178 ; 
    179 ; read MLD in insitu files and metafiles 
    180 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 insitu 
    186 time_insitu=data_insitu.doy 
    187 ; 
    188 ; build compatible insitu arrays with models arrays 
    189 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 BEGIN 
    199    indice_insitu=WHERE(time_insitu-time_insitu[0] EQ iday,count) 
    200    IF (count EQ 0) THEN BEGIN 
    201       mld1[iday] = !VALUES.F_NAN 
    202       mld2[iday] = !VALUES.F_NAN 
    203       mld3[iday] = !VALUES.F_NAN 
    204       mld4[iday] = !VALUES.F_NAN 
    205       mld5[iday] = !VALUES.F_NAN 
    206       std1[iday] = !VALUES.F_NAN 
    207       xlon[iday] = !VALUES.F_NAN 
    208       ylat[iday] = !VALUES.F_NAN 
    209    ENDIF ELSE BEGIN 
    210       mld1[iday] = data_insitu[indice_insitu].mean_zhom001 
    211       mld2[iday] = data_insitu[indice_insitu].mean_zhom002 
    212       mld3[iday] = data_insitu[indice_insitu].mean_zhom005 
    213       mld4[iday] = data_insitu[indice_insitu].mean_zhom010 
    214       mld5[iday] = data_insitu[indice_insitu].mean_zhomelch 
    215       std1[iday] = data_insitu[indice_insitu].std_zhom001 
    216       xlon[iday] = data_insitu[indice_insitu].lon 
    217       ylat[iday] = data_insitu[indice_insitu].lat 
    218    ENDELSE 
    219  ENDFOR 
    220 ; 
    221 ; compute mean of modeled MLD in boxes around lat,lon insitu data 
    222 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 box 
    228 delta=findgen(2) 
    229 delta[0] = 0.5 
    230 delta[1] = 1. 
    231 ndelta=n_elements(delta) 
    232 ; 
    233 ; loop on delta 
    234 FOR idelta=0, ndelta - 1 DO BEGIN 
    235    ; loop on days 
    236    FOR iday=0, ndays - 1 DO BEGIN 
    237       IF (finite(mld1[iday]) NE 0) THEN BEGIN 
    238          domdef 
    239          mybox = [ -xlon[iday]-delta[idelta] $ 
    240                  , -xlon[iday]+delta[idelta] $ 
    241                  , ylat[iday]-delta[idelta] $ 
    242                  , ylat[iday]+delta[idelta] $ 
    243                  ] 
    244  
    245          jt = time_insitu[iday]+95 
    246          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 BEGIN 
    254          mymldm[idelta,iday] = !VALUES.F_NAN 
    255          mymldr[idelta,iday] = !VALUES.F_NAN 
    256          myvarm[idelta,iday] = !VALUES.F_NAN 
    257          myvarr[idelta,iday] = !VALUES.F_NAN 
    258       ENDELSE 
    259    ENDFOR 
    260  ENDFOR 
    261 ; 
    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_insitu 
    278 time_save = time 
    279 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 = 250 
    287 polyfill, [time, reverse(time)], [(-mymldr_1d-myvarr_1d),reverse(-mymldr_1d+myvarr_1d)],  color = 150 
    288 polyfill, [time, reverse(time)], [(-mld1-std1),reverse(-mld1+std1)], color = 90 
    289 plt1d,  -mymldr_1d,  't',  /ov1d, line = 2 
    290 plt1d,  -mld1,  't', /ov1d 
    291 plt1d,  -mymldm_1d,  't', /ov1d,  line = 1 
    292  
    293 time = time_save 
    294 jpt = jpt_save 
    295 plt1d,  ylat,  't',  title='', ytitle='latitude',  color=250, small = [3, 2, 4],  /noerase 
    296 plt1d,  xlon,  't',  title='', ytitle='longitude', color=90 , small = [3, 2, 6],  /noerase 
    297 closeps 
    298  
    299 ; 
    300 ; Write results in ${PROJECT_OD}/fig_mld.txt 
    301 fullfilename=project_od_env+'fig_mld.txt' 
    302 OPENW, lun, fullfilename, /GET_LUN 
    303 ;++ hanlde error 
    304 ; 
    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 header 
    307 printf, lun, header 
    308 ; 
    309 ; write data lines 
    310 FOR iday=0, ndays - 1 DO BEGIN 
    311    printf, lun $ 
    312          , iday $ 
    313          , xlon[iday] $ 
    314          , ylat[iday] $ 
    315          , mld1[iday] $ 
    316          , mld2[iday] $ 
    317          , mld3[iday] $ 
    318          , mld4[iday] $ 
    319          , mld5[iday] $ 
    320          , mymldm[0,iday] $ 
    321          , mymldr[0,iday] $ 
    322          , myvarm[0,iday] $ 
    323          , myvarr[0,iday] $ 
    324          , mymldm[1,iday] $ 
    325          , mymldr[1,iday] $ 
    326          , myvarm[1,iday] $ 
    327          , myvarr[0,iday] $ 
    328          , mymldm[1,iday] $ 
    329          , mymldr[1,iday] $ 
    330          , myvarm[1,iday] $ 
    331          , myvarr[1,iday] 
    332 ENDFOR 
    333 ; 
    334 ; close file 
    335 FREE_LUN, lun 
     185    ; 
     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 
    336347 
    337348END 
  • trunk/src/file_asc_long2mem.pro

    r9 r13  
    2121; :examples: 
    2222; 
    23 ; :: 
     23; .. code-block:: idl 
    2424; 
    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) 
    2727; 
    28 ; impression de contrôle : structure, 1re station, toutes les stations :: 
     28; impression de contrôle : structure, 1re station, toutes les stations : 
    2929; 
    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 
    3335; 
    3436; :uses: 
     
    6264;- 
    6365FUNCTION file_asc_long2mem, filename 
    64 ; 
    65 compile_opt idl2, strictarrsubs 
    66 ; 
    67 ; Return to caller if errors 
    68 ON_ERROR, 2 
    69 ; 
    70 usage = 'result=file_asc_long2mem(filename)' 
    71 ; 
    72 nparam = N_PARAMS() 
    73 IF (nparam LT 1) THEN BEGIN 
    74    ras = report(['Incorrect number of arguments.' $ 
    75          + '!C' $ 
    76          + 'Usage : ' + usage]) 
    77    return, -1 
    78 ENDIF 
    79 ; 
    80 arg_type = size(filename,/type) 
    81 IF (arg_type NE 7) THEN BEGIN 
    82    ras = report(['Incorrect arg type filename' $ 
    83          + '!C' $ 
    84          + 'Usage : ' + usage]) 
    85    return, -1 
    86 ENDIF 
    87 ; 
    88 arg_dim =  size(filename,/n_elements) 
    89 IF (arg_dim LT 1) THEN BEGIN 
    90    ras = report(['Incorrect arg dimension filename' $ 
    91          + '!C' $ 
    92          + 'Usage : ' + usage]) 
    93   return, -1 
    94 ENDIF 
    95 ; 
    96 ; initialize header 
    97 header = STRARR(1) 
    98 ; 
    99 resultstruct = { station: 0L $ 
    100                 , sonde: 0L $ 
    101                 , zmax: 0L $ 
    102                 , an: 0L $ 
    103                 , mm: 0L $ 
    104                 , jj: 0L $ 
    105                 , hh_begin: 0L $ 
    106                 , mm_begin: 0L $ 
    107                 , ss: 0L $ 
    108                 , deg_lat_begin : 0L $ 
    109                 , mm_lat_begin: 0.0 $ 
    110                 , deg_lon_begin: 0L $ 
    111                 , mm_lon_begin: 0.0 $ 
    112                 , deg_lat_end: 0L $ 
    113                 , mm_lat_end: 0.0 $ 
    114                 , deg_lon_end: 0L $ 
    115                 , mm_lon_end: 0.0 $ 
    116                 , hh_end: 0L $ 
    117                 , mm_end: 0L } 
    118 ; 
    119 nrows = file_lines(filename) - N_ELEMENTS(header) 
    120 result = Replicate(resultstruct, nrows) 
    121 ; 
    122 ; open file 
    123 OPENR, lun, filename, /GET_LUN 
    124 ;++ hanlde error 
    125 ; 
    126 ; read header 
    127 READF, lun, header 
    128 ; 
    129 ; read data lines 
    130 READF, lun, result 
    131 ; 
    132 ; close file 
    133 FREE_LUN, lun 
    134 ; 
    135 return, result 
    136 ; 
     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    ; 
    137139END 
  • trunk/src/file_asc_p1l1_to_mem.pro

    r9 r13  
    2121; :examples: 
    2222; 
    23 ; :: 
     23; .. code-block:: idl 
    2424; 
    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) 
    2727; 
    28 ; impression de contrôle : 1re station, toutes les stations :: 
     28; impression de contrôle : 1re station, toutes les stations : 
    2929; 
    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 
    3335; 
    3436; :uses: 
     
    5860;- 
    5961FUNCTION file_asc_p1l1_to_mem, filename 
    60 ; 
    61 compile_opt idl2, strictarrsubs 
    62 ; 
    63 ; Return to caller if errors 
    64 ON_ERROR, 2 
    65 ; 
    66 usage = 'result=file_asc_p1l1_to_mem(filename)' 
    67 ; 
    68 nparam = N_PARAMS() 
    69 IF (nparam LT 1) THEN BEGIN 
    70    ras = report(['Incorrect number of arguments.' $ 
    71          + '!C' $ 
    72          + 'Usage : ' + usage]) 
    73    return, -1 
    74 ENDIF 
    75 ; 
    76 arg_type = size(filename,/type) 
    77 IF (arg_type NE 7) THEN BEGIN 
    78    ras = report(['Incorrect arg type filename' $ 
    79          + '!C' $ 
    80          + 'Usage : ' + usage]) 
    81    return, -1 
    82 ENDIF 
    83 ; 
    84 arg_dim =  size(filename,/n_elements) 
    85 IF (arg_dim LT 1) THEN BEGIN 
    86    ras = report(['Incorrect arg dimension filename' $ 
    87          + '!C' $ 
    88          + 'Usage : ' + usage]) 
    89   return, -1 
    90 ENDIF 
    91 ; 
    92 ; initialize header 
    93 header = STRARR(1) 
    94 ; 
    95 resultstruct = { station:0L $ 
    96                  , prof :0L $ 
    97                  , zctd : 0L $ 
    98                  , an: 0L $ 
    99                  , mm: 0L $ 
    100                  , jj: 0L $ 
    101                  , hh_begin: 0L $ 
    102                  , mm_begin: 0L $ 
    103                  , ss_begin: 0L $ 
    104                  , deg_lat_begin : 0L $ 
    105                  , mm_lat_begin: 0.0 $ 
    106                  , deg_lon_begin: 0L $ 
    107                  , mm_lon_begin: 0.0 $ 
    108                } 
    109 nrows = file_lines(filename) - N_ELEMENTS(header); 
    110 result = Replicate(resultstruct, nrows) 
    111 ; 
    112 ; open file 
    113 OPENR, lun, filename, /GET_LUN 
    114 ;++ hanlde error 
    115 ; 
    116 ; read header 
    117 READF, lun, header 
    118 ; 
    119 ; read data lines 
    120 READF, lun, result 
    121 ; 
    122 ; close file 
    123 FREE_LUN, lun 
    124 ; 
    125 return, result 
    126 ; 
     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    ; 
    127129END 
  • trunk/src/file_asc_p2l1_to_mem.pro

    r9 r13  
    2121; :examples: 
    2222; 
    23 ; :: 
     23; .. code-block:: idl 
    2424; 
     25;    filename='/usr/work/incas/fplod/pomme_d/sta.P2L1.asc' 
     26;    result = file_asc_p2l1_to_mem(filename) 
    2527; 
    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: 
    2829; 
    29 ; impression de controle : 1re station, toutes les stations:: 
     30; .. code-block:: idl 
    3031; 
    31 ;    IDL> print, result, /structure 
    32 ;    IDL> print, result[0].station 
    33 ;    IDL> print, result.station 
    34 ;    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] 
    3637; 
    3738; :uses: 
     
    6869;- 
    6970FUNCTION file_asc_p2l1_to_mem, filename 
    70 ; 
    71 compile_opt idl2, strictarrsubs 
    72 ; 
    73 ; Return to caller if errors 
    74 ON_ERROR, 2 
    75 ; 
    76 usage = 'result=file_asc_p2l1_to_mem(filename)' 
    77 ; 
    78 nparam = N_PARAMS() 
    79 IF (nparam LT 1) THEN BEGIN 
    80    ras = report(['Incorrect number of arguments.' $ 
    81          + '!C' $ 
    82          + 'Usage : ' + usage]) 
    83    return, -1 
    84 ENDIF 
    85 ; 
    86 arg_type = size(filename,/type) 
    87 IF (arg_type NE 7) THEN BEGIN 
    88    ras = report(['Incorrect arg type filename' $ 
    89          + '!C' $ 
    90          + 'Usage : ' + usage]) 
    91    return, -1 
    92 ENDIF 
    93 ; 
    94 arg_dim =  size(filename,/n_elements) 
    95 IF (arg_dim LT 1) THEN BEGIN 
    96    ras = report(['Incorrect arg dimension filename' $ 
    97          + '!C' $ 
    98          + 'Usage : ' + usage]) 
    99    return, -1 
    100 ENDIF 
    101 ; 
    102 ; initialize header 
    103 header = STRARR(1) 
    104 ; 
    105 resultstruct = { station: 0L $ 
    106                , sonde: 0L $ 
    107                , zctd: 0L $ 
    108                , an: 0L $ 
    109                , mm: 0L $ 
    110                , jj: 0L $ 
    111                , hh_begin: 0L $ 
    112                , mm_begin: 0L $ 
    113                , lat_begin: 0.0 $ 
    114                , lon_begin: 0.0 $ 
    115                , hh_end: 0L $ 
    116                , mm_end: 0L $ 
    117                , lat_end: 0.0 $ 
    118                , lon_end: 0.0} 
    119 ; 
    120 nrows = file_lines(filename) - N_ELEMENTS(header); 
    121 result = Replicate(resultstruct, nrows) 
    122 ; 
    123 ; open file 
    124 OPENR, lun, filename, /GET_LUN 
    125 ;++ hanlde error 
    126 ; 
    127 ; read header 
    128 READF, lun, header 
    129 ; 
    130 ; read data lines 
    131 READF, lun, result 
    132 ; 
    133 ; close file 
    134 FREE_LUN, lun 
    135 ; 
    136 return, result 
    137 ; 
     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    ; 
    138139END 
  • trunk/src/file_asc_p2l2_to_mem.pro

    r9 r13  
    2222; :examples: 
    2323; 
    24 ; :: 
     24; .. code-block:: idl 
    2525; 
    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) 
    2828; 
    29 ; impression de contrôle : 1re station, toutes les stations:: 
     29; impression de contrôle : 1re station, toutes les stations: 
    3030; 
    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 
    3436; 
    3537; :uses: 
     
    5961;- 
    6062FUNCTION file_asc_p2l2_to_mem, filename 
    61 ; 
    62 compile_opt idl2, strictarrsubs 
    63 ; 
    64 ; Return to caller if errors 
    65 ON_ERROR, 2 
    66 ; 
    67 usage = 'result=file_asc_p2l2_to_mem(filename)' 
    68 ; 
    69 nparam = N_PARAMS() 
    70 IF (nparam LT 1) THEN BEGIN 
    71    ras = report(['Incorrect number of arguments.' $ 
    72          + '!C' $ 
    73          + 'Usage : ' + usage]) 
    74    return, -1 
    75 ENDIF 
    76 ; 
    77 arg_type = size(filename,/type) 
    78 IF (arg_type NE 7) THEN BEGIN 
    79    ras = report(['Incorrect arg type filename' $ 
    80          + '!C' $ 
    81          + 'Usage : ' + usage]) 
    82    return, -1 
    83 ENDIF 
    84 ; 
    85 arg_dim =  size(filename,/n_elements) 
    86 IF (arg_dim LT 1) THEN BEGIN 
    87    ras = report(['Incorrect arg dimension filename' $ 
    88          + '!C' $ 
    89          + 'Usage : ' + usage]) 
    90   return, -1 
    91 ENDIF 
    92 ; 
    93 ; initialize header 
    94 header = STRARR(1) 
    95 ; 
    96 resultstruct = { station: 0L $ 
    97                 , sonde: 0L $ 
    98                 , zmax: 0L $ 
    99                 , an: 0L $ 
    100                 , mm: 0L $ 
    101                 , jj: 0L $ 
    102                 , hh_begin: 0L $ 
    103                 , mm_begin: 0L $ 
    104                 , deg_lat_begin : 0L $ 
    105                 , mm_lat_begin: 0.0 $ 
    106                 , deg_lon_begin: 0L $ 
    107                 , mm_lon_begin: 0.0 $ 
    108                 , hh_end: 0L $ 
    109                 , mm_end: 0L $ 
    110                 , deg_lat_end: 0L $ 
    111                 , mm_lat_end: 0.0 $ 
    112                 , deg_lon_end: 0L $ 
    113                 , mm_lon_end: 0.0 $ 
    114                 } 
    115 ; 
    116 nrows = file_lines(filename) - N_ELEMENTS(header) 
    117 result = Replicate(resultstruct, nrows) 
    118 ; 
    119 ; open file 
    120 OPENR, lun, filename, /GET_LUN 
    121 ;++ hanlde error 
    122 ; 
    123 ; read header 
    124 READF, lun, header 
    125 ; 
    126 ; read data lines 
    127 READF, lun, result 
    128 ; 
    129 ; close file 
    130 FREE_LUN, lun 
    131 ; 
    132 return, result 
    133 ; 
     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    ; 
    134136END 
  • trunk/src/file_asc_to_mem.pro

    r9 r13  
    1414; :examples: 
    1515; 
    16 ; Realistic example with POMME files:: 
     16; Realistic example with POMME files: 
    1717; 
    18 ;    IDL> result=file_asc_to_mem() 
     18; .. code-block:: idl 
    1919; 
    20 ; impression de controle:: 
     20;    result = file_asc_to_mem() 
    2121; 
    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 
    2428; 
    2529; 
     
    4246;- 
    4347FUNCTION 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 
    87101 
    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 
    98116 
    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 
    113132 
    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 
    146149 
    147150END 
  • trunk/src/file_prn2mem.pro

    r9 r13  
    2121; :examples: 
    2222; 
    23 ; :: 
     23; .. code-block:: idl 
    2424; 
    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) 
    2727; 
     28;    filename='/usr/temp/marina/POM/mld_prieur_P1L2_tot.prn' 
     29;    result = file_prn2mem(filename) 
    2830; 
    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) 
    3133; 
    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) 
    3436; 
    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) 
    3739; 
    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: 
    4041; 
    41 ; impression de controle : 1re station, toutes les stations:: 
     42; .. code-block:: idl 
    4243; 
    43 ;    IDL> help, result, /structure 
    44 ;    IDL> print, result[0].station 
    45 ;    IDL> print, result.station 
    46 ;    IDL> print, result[0].zhomelch 
    47 ;    IDL> print, result[nrows-1].zhomelch 
     44;    help, result, /structure 
     45;    print, result[0].station 
     46;    print, result.station 
     47;    print, result[0].zhomelch 
     48;    print, result[nrows - 1].zhomelch 
    4849; 
    4950; :uses: 
     
    7677;- 
    7778FUNCTION 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    ; 
    145145END 
  • trunk/src/file_prn_to_mem.pro

    r9 r13  
    1616; :examples: 
    1717; 
    18 ; Realistic example with POMME files:: 
     18; Realistic example with POMME files: 
    1919; 
    20 ;    IDL> result=file_prn_to_mem() 
     20; .. code-block:: idl 
    2121; 
    22 ; impression de controle:: 
     22;    result = file_prn_to_mem() 
    2323; 
    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 
    2630; 
    2731; :uses: 
     
    5357;- 
    5458FUNCTION 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 
    98111 
    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 
    108125 
    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 
    122140 
    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 
    153156 
    154157END 
  • trunk/src/init.pro

    r2 r13  
    111111izmaxmesh = -1L 
    112112ixmindta = 0L 
    113 ixmaxdta = jpidta-1 
     113ixmaxdta = jpidta - 1 
    114114iymindta = 0L 
    115 iymaxdta = jpjdta-1 
     115iymaxdta = jpjdta - 1 
    116116izmindta = 0L 
    117 izmaxdta = jpkdta-1 
     117izmaxdta = jpkdta - 1 
    118118key_shift = 0L 
    119119key_periodic = 0L 
  • trunk/src/init_pom.pro

    r9 r13  
    1616; :examples: 
    1717; 
    18 ; :: 
     18; .. code-block:: idl 
    1919; 
    20 ;   IDL> @init_pom 
     20;    @init_pom 
    2121; 
    2222; :see also: 
     
    7474;---------------------------------------------------------- 
    7575;domaine total 
    76 ixminmesh  =-1 
    77 ixmaxmesh  =-1 
    78 iyminmesh  =-1 
    79 iymaxmesh  =-1 
    80 izminmesh  =-1 
    81 izmaxmesh  =-1 
     76ixminmesh = -1 
     77ixmaxmesh = -1 
     78iyminmesh = -1 
     79iymaxmesh = -1 
     80izminmesh = -1 
     81izmaxmesh = -1 
    8282; 
    8383; sans la zone de recirculation 
     
    119119; 
    120120ixmindta = 0 
    121 ixmaxdta = jpidta-1 
     121ixmaxdta = jpidta - 1 
    122122iymindta = 0 
    123 iymaxdta = jpjdta-1 
     123iymaxdta = jpjdta - 1 
    124124izmindta = 0 
    125 izmaxdta = jpkdta-1 
     125izmaxdta = jpkdta - 1 
  • trunk/src/join_dmean_asc.pro

    r8 r13  
    99;    Join information from mean (++details) and asc (++detail) structures 
    1010; 
    11 ;    If station is not found in data_asc structure, latitude and longitude are set 
    12 ;    to NaN. 
     11;    If station is not found in data_asc structure, latitude and longitude 
     12;    are set to NaN. 
    1313; 
    1414;    :param data_dmean: structure ++details 
     
    2525; :examples: 
    2626; 
    27 ; Realistic example with POMME files:: 
     27; Realistic example with POMME files: 
    2828; 
    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 
    3330; 
    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) 
    3535; 
    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 
    4044; 
    4145; :uses: 
     
    6367; 
    6468; 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. 
    6672; 
    6773; :history: 
     
    9096;- 
    9197FUNCTION join_dmean_asc, data_dmean, data_asc 
    92 ; 
    93 compile_opt idl2, strictarrsubs 
    94 ; 
    95 ; Return to caller if errors 
    96 ON_ERROR, 2 
    97 ; 
    98 usage = 'result=join_dmean_asc(data_asc,data_dmean)' 
    99 ; 
    100 nparam = N_PARAMS() 
    101 IF (nparam LT 2) THEN BEGIN 
    102    ras = report(['Incorrect number of arguments.' $ 
    103          + '!C' $ 
    104          + 'Usage : ' + usage]) 
    105    return, -1 
    106 ENDIF 
    107 ; 
    108 ; initialize returned structure 
    109 resultstruct = { doy : 0L $ 
    110              , lat: 0.0 $ 
    111              , lon: 0.0 $ 
    112              , mean_zhom001: 0.0 $ 
    113              , mean_zhom002 : 0.0 $ 
    114              , mean_zhom005 : 0.0 $ 
    115              , mean_zhom010: 0.0 $ 
    116              , mean_zhomelch : 0.0 $ 
    117              , std_zhom001: 0.0 $ 
    118              , std_zhom002 : 0.0 $ 
    119              , std_zhom005 : 0.0 $ 
    120              , std_zhom010: 0.0 $ 
    121              , std_zhomelch : 0.0 $ 
    122              } 
    123 ; 
    124 ndays = n_elements(data_dmean) 
    125 result = replicate(resultstruct, ndays) 
    126 ; 
    127 ; fill returned structure 
    128 FOR iday=0L, ndays -1 DO BEGIN 
    129    result[iday].doy=data_dmean[iday].doy 
    130    result[iday].mean_zhom001=data_dmean[iday].mean_zhom001 
    131    result[iday].mean_zhom002=data_dmean[iday].mean_zhom002 
    132    result[iday].mean_zhom005=data_dmean[iday].mean_zhom005 
    133    result[iday].mean_zhom010=data_dmean[iday].mean_zhom010 
    134    result[iday].mean_zhomelch=data_dmean[iday].mean_zhomelch 
    135    result[iday].std_zhom001=data_dmean[iday].std_zhom001 
    136    result[iday].std_zhom002=data_dmean[iday].std_zhom002 
    137    result[iday].std_zhom005=data_dmean[iday].std_zhom005 
    138    result[iday].std_zhom010=data_dmean[iday].std_zhom010 
    139    result[iday].std_zhomelch=data_dmean[iday].std_zhomelch 
    140    indice_asc=WHERE(data_asc.station EQ data_dmean[iday].first_station,count) 
    141    IF (count EQ 0) THEN BEGIN 
    142       print, 'no station ',  data_dmean[iday].first_station,' in data_asc.station' 
    143       result[iday].lat = !VALUES.F_NAN 
    144       result[iday].lon = !VALUES.F_NAN 
    145    ENDIF ELSE BEGIN 
    146       ;print, 'indice de la first_station', data_dmean[iday].first_station,' dans data_asc = ',indice_asc 
    147       result[iday].lat = data_asc[indice_asc[0]].lat 
    148       result[iday].lon = data_asc[indice_asc[0]].lon 
    149    ENDELSE 
    150 ENDFOR 
    151 ; 
    152 return, result 
    153 ; 
     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    ; 
    154160END 
  • trunk/src/project_init.pro

    r9 r13  
    1212; This is the SAXO initialisation file. 
    1313; 
    14 ; It ++:: 
    15 ;   $ idl -IDL_STARTUP project_init.pro 
     14; It ++: 
     15; .. code-block:: bash 
    1616; 
    17 ; or:: 
     17;    idl -IDL_STARTUP project_init.pro 
    1818; 
    19 ;  $ idl 
    20 ;  IDL> @project_init 
     19; or: 
     20; 
     21; .. code-block:: idl 
     22; 
     23;    @project_init 
    2124; 
    2225; SEE ALSO 
     
    4548; 
    4649; SAXO environment 
    47 saxo_dir_env=GETENV('SAXO_DIR') 
     50saxo_dir_env = GETENV('SAXO_DIR') 
    4851; 
    4952; 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') 
     53project_env_temp = GETENV('PROJECT') 
     54project_id_env_temp = GETENV('PROJECT_ID') 
     55project_od_env_temp = GETENV('PROJECT_OD') 
    5356; 
    5457; path definition 
     
    5962; project environment #2 
    6063@cm_project 
    61 project_env=project_env_temp 
    62 project_id_env=project_id_env_temp 
    63 project_od_env=project_od_env_temp 
     64project_env = project_env_temp 
     65project_id_env = project_id_env_temp 
     66project_od_env = project_od_env_temp 
    6467; 
    6568; compatibility with the old version 
  • trunk/src/project_profile.sh

    r12 r13  
    144144    case ${1} in 
    145145        -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) 
    147148            directory=${2} 
    148149            shift 
     
    171172            echo "eee : unknown option ${1}" 
    172173            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 
    174176        ;; 
    175177    esac 
     
    255257then 
    256258    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 
    258261fi 
    259262# 
Note: See TracChangeset for help on using the changeset viewer.