Changeset 20 for trunk


Ignore:
Timestamp:
06/05/07 15:04:05 (17 years ago)
Author:
pinsard
Message:

initorca2_bab.pro can now be used in xxx call

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/condmag_on_orca.pro

    r19 r20  
    104104     'ORCA2': BEGIN 
    105105                 msg = 'iii : valid orcares parameter = ' + orcares 
    106                  PRINT, msg 
     106                 ras = report(msg) 
    107107                 filename_oce = 'meshmask_bab.nc' 
    108108                 IF keyword_set(DRAKKAR_EXP) THEN BEGIN 
    109109                    msg = 'www : unused DRAKKAR_EXP keyword = ' + drakkar_exp 
    110                     PRINT, msg 
     110                    ras = report(msg) 
    111111                 END 
    112112              END 
    113113     'ORCA025': BEGIN 
    114114                 msg = 'iii : valid orcares parameter = ' + orcares 
    115                  PRINT, msg 
     115                 ras = report(msg) 
    116116                 IF keyword_set(DRAKKAR_EXP) THEN BEGIN 
    117117                    msg = 'iii : DRAKKAR_EXP keyword set' 
    118                     PRINT, msg 
     118                    ras = report(msg) 
    119119                    msg = 'iii : DRAKKAR_EXP = ' + drakkar_exp 
    120                     PRINT, msg 
     120                    ras = report(msg) 
    121121                    CASE drakkar_exp OF 
    122122                       'G42' : BEGIN 
    123123                                  msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp 
    124                                   PRINT, msg 
     124                                  ras = report(msg) 
    125125                               END 
    126126                       'G70' : BEGIN 
    127127                                  msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp 
    128                                   PRINT, msg 
     128                                  ras = report(msg) 
    129129                               END 
    130130                       ELSE : BEGIN 
    131131                                  msg = 'eee : invalid DRAKKAR_EXP keyword = ' + drakkar_exp 
    132                                   PRINT, msg 
     132                                  ras = report(msg) 
    133133                                  RETURN 
    134134                              END 
     
    139139      ELSE  : BEGIN 
    140140                 msg = 'eee : invalid orcares parameter = ' + orcares 
    141                  PRINT, msg 
     141                 ras = report(msg) 
    142142                 msg = 'eee : orcares must be ORCA2 or ORCA025' 
    143                  PRINT, msg 
     143                 ras = report(msg) 
    144144                 RETURN 
    145145              END 
     
    150150     'bilinear': BEGIN 
    151151                    msg = 'iii : valid method parameter = ' + method 
    152                     PRINT, msg 
     152                    ras = report(msg) 
    153153                 END 
    154154     'imoms3'  : BEGIN 
    155155                    msg = 'iii : valid method parameter = ' + method 
    156                     PRINT, msg 
     156                    ras = report(msg) 
    157157                 END 
    158158     ELSE      : BEGIN 
    159159                    msg = 'eee : invalid method parameter = ' + method 
    160                     PRINT, msg 
     160                    ras = report(msg) 
    161161                    msg = 'eee : method must be bilinear or imoms3' 
    162                     PRINT, msg 
     162                    ras = report(msg) 
    163163                    RETURN 
    164164                 END 
     
    170170     'T' : BEGIN 
    171171              msg = 'iii : valid gridtype parameter = ' + gridtype 
    172               PRINT, msg 
     172              ras = report(msg) 
    173173           END 
    174174     'U' : BEGIN 
    175175              msg = 'iii : valid gridtype parameter = ' + gridtype 
    176               PRINT, msg 
     176              ras = report(msg) 
    177177           END 
    178178     'V' : BEGIN 
    179179              msg = 'iii : valid gridtype parameter = ' + gridtype 
    180               PRINT, msg 
     180              ras = report(msg) 
    181181           END 
    182182     ELSE: BEGIN 
    183183              msg = 'eee : invalid gridtype parameter = ' + gridtype 
    184               PRINT, msg 
     184              ras = report(msg) 
    185185              msg = 'eee : gridtype must be T, U or V' 
    186               PRINT, msg 
     186              ras = report(msg) 
    187187              RETURN 
    188188           END 
     
    196196     ''  :  BEGIN 
    197197              msg = 'eee : ${GEOMAG_ID} is not defined' 
    198               PRINT, msg 
     198              ras = report(msg) 
    199199              RETURN 
    200200            END 
    201201     ELSE: BEGIN 
    202202             msg = 'iii : ${GEOMAG_ID} is ' + geomag_id_env 
    203              PRINT, msg 
     203             ras = report(msg) 
    204204           END 
    205205  ENDCASE 
     
    210210  IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
    211211     msg = 'eee : the directory' + iodirin  + ' is not accessible.' 
    212      PRINT, msg 
     212     ras = report(msg) 
    213213     RETURN 
    214214  ENDIF 
     
    221221  IF fullfilename_condmag[0] EQ '' THEN BEGIN 
    222222     msg = 'eee : the file ' + fullfilename_condmag + ' was not found.' 
    223      PRINT, msg 
     223     ras = report(msg) 
    224224     RETURN 
    225225  ENDIF 
     
    228228  IF (FILE_TEST(fullfilename_condmag[0], /READ) EQ 0) THEN BEGIN 
    229229     msg = 'eee : the file ' + fullfilename_condmag[0] + ' is not readable.' 
    230      PRINT, msg 
     230     ras = report(msg) 
    231231     RETURN 
    232232  ENDIF 
     
    238238  IF fullfilename_oce[0] EQ '' THEN BEGIN 
    239239     msg = 'eee : the file ' + fullfilename_oce + ' was not found.' 
    240      PRINT, msg 
     240     ras = report(msg) 
    241241     RETURN 
    242242  ENDIF 
     
    245245  IF (FILE_TEST(fullfilename_oce[0], /READ) EQ 0) THEN BEGIN 
    246246     msg = 'eee : the file ' + fullfilename_oce[0] + ' is not readable.' 
    247      PRINT, msg 
     247     ras = report(msg) 
    248248     RETURN 
    249249  ENDIF 
     
    254254     '' : BEGIN 
    255255             msg = 'eee : ${GEOMAG_OD} is not defined' 
    256              PRINT, msg 
     256             ras = report(msg) 
    257257             RETURN 
    258258          END 
    259259     ELSE: BEGIN 
    260260             msg = 'iii : ${GEOMAG_OD} is ' + geomag_od_env 
    261              PRINT, msg 
     261             ras = report(msg) 
    262262           END 
    263263  ENDCASE 
     
    269269  IF (FILE_TEST(iodirout, /DIRECTORY, /WRITE) EQ 0) THEN BEGIN 
    270270     msg = 'eee : the directory' + iodirout  + ' was not found.' 
    271      PRINT, msg 
     271     ras = report(msg) 
    272272     RETURN 
    273273  ENDIF 
     
    295295     olon, olat, jpio, jpjo, 2, /DOUBLE 
    296296  msg = 'iii : ' + fullfilename_oce[0] + ' opened for read' 
    297   PRINT, msg 
     297  ras = report(msg) 
    298298; 
    299299;--------------- 
     
    311311  netcdf_id_condmag = NCDF_OPEN(fullfilename_condmag[0], /NOWRITE) 
    312312  msg = 'iii : ' + fullfilename_condmag[0] + ' opened for read' 
    313   PRINT, msg 
     313  ras = report(msg) 
    314314; 
    315315  varname_cond_sed = 'cond_sed' 
  • trunk/initorca2_bab.pro

    r19 r20  
    11; + 
     2; 
    23; @file_comments 
    3 ; initialisation on ORCA2 grid 
     4; initialisation on ORCA grid 
     5; 
     6; @param orcares {in}{required}{type=string} 
     7; code of ORCA grid to use for output results 
     8; must be 'ORCA2' or 'ORCA025' 
     9; 
     10; @keyword DRAKKAR_EXP {type=string} 
     11; code for Drakkar experiment 
     12; only used when orcares = ORCA025 
     13; must be G42 ++ G70 
     14; 
     15; @keyword EXTRA 
     16; must exist in order to be able to use this procedure as an argument 
     17; 
     18; @examples 
     19; appel classique 
     20; IDL> initocemesh,'ORCA2' 
     21; 
     22; to plot ${GEOMAG_OD}/cond_sed_ORCA2.nc : 
     23; IDL> myfile=getenv('GEOMAG_OD') + 'cond_sed_ORCA2.nc' 
     24; IDL> xxx, myfile, 'initocemesh', '''ORCA2''',format='(i5)', 
    425; 
    526; @history 
     
    728; F. Pinsard adaptation to new SAXO 
    829; according to SAXO ./SRC/Tests/tst_initorca2.pro 
     30; fplod 2007-05-15T13:43:21Z aedon.locean-ipsl.upmc.fr (Darwin) 
     31; transformation in procedure with parameter orcares 
     32; fplod 2007-06-05T12:22:38Z aedon.locean-ipsl.upmc.fr (Darwin) 
     33; (following Sebastien Masson advices) 
     34; . add EXTRA keyword in order to be able to use this procedure as an argument 
     35; of <pro>xxx</pro>. 
     36; . add  EXTRA to the call of ncdf_meshlec 
     37; replace initorca2_bab by initocemesh in filename and procedure name 
    938; 
    1039; @todo 
    11 ; parametrisation for ORCA025 
    12 ; can I use CASE statement in a file called by @...++ 
    13 ; can I use RETURN or STOP statement in a file called by @...++ 
    14 ; 
    15 ; zminmesh and izmaxmesh may be set to 0,0 because we only work with  
    16 ; surface problem (no z) whatever the resolution of ORCA. this will safe lot  
     40; 
     41; zminmesh and izmaxmesh may be set to 0,0 because we only work with 
     42; surface problem (no z) whatever the resolution of ORCA. this will safe lot 
    1743; of memory 
    18 ;  
    19 ; use ncdf_getaxis to recover meshmask dimension 
     44; 
     45; use <pro>ncdf_getaxis</pro> to recover meshmask dimension 
    2046; on x, retrieve -1 and -1 (bande de recouvrement haut et bas) 
    21 ; on y, for ORCA2, retrieve -2 (bande de recouvrement ++ et ++)  
     47; on y, for ORCA2, retrieve -2 (bande de recouvrement ++ et ++) 
    2248; 
    2349; reminder : ORCA2 = 182 x 149 and ORCA025 1442 x 1021 
    24 ;  
    25 ; for ORCA025, user /keepcont in triangule call. 
     50; 
     51; for ORCA025, use /keepcont in <pro>triangule</pro> call. 
    2652; 
    2753; @version 
    2854; $Id$ 
     55; 
    2956;- 
     57; 
     58PRO initocemesh, orcares, DRAKKAR_EXP = drakkar_exp, _EXTRA = ex 
     59; 
     60  compile_opt idl2, strictarrsubs 
    3061; 
    3162@cm_4mesh 
     
    3364@cm_4data 
    3465; 
    35  
     66; check input parameters 
     67CASE orcares OF 
     68   'ORCA2': BEGIN 
     69               msg = 'iii : valid orcares parameter = ' + orcares 
     70               ras = report(msg) 
     71               filename_oce = 'meshmask_bab.nc' 
     72               IF keyword_set(DRAKKAR_EXP) THEN BEGIN 
     73                  msg = 'www : unused DRAKKAR_EXP keyword = ' + drakkar_exp 
     74                  ras = report(msg) 
     75               END 
     76            END 
     77     'ORCA025': BEGIN 
     78                 msg = 'iii : valid orcares parameter = ' + orcares 
     79                 ras = report(msg) 
     80                 IF keyword_set(DRAKKAR_EXP) THEN BEGIN 
     81                    msg = 'iii : DRAKKAR_EXP keyword set' 
     82                    ras = report(msg) 
     83                    msg = 'iii : DRAKKAR_EXP = ' + drakkar_exp 
     84                    ras = report(msg) 
     85                    CASE drakkar_exp OF 
     86                       'G42' : BEGIN 
     87                                  msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp 
     88                                  ras = report(msg) 
     89                               END 
     90                       'G70' : BEGIN 
     91                                  msg = 'iii : valid DRAKKAR_EXP keyword = ' + drakkar_exp 
     92                                  ras = report(msg) 
     93                               END 
     94                       ELSE : BEGIN 
     95                                  msg = 'eee : invalid DRAKKAR_EXP keyword = ' + drakkar_exp 
     96                                  ras = report(msg) 
     97                                  RETURN 
     98                              END 
     99                    ENDCASE 
     100                    filename_oce = orcares + '-' + drakkar_exp + '_mesh_hgr.nc' 
     101                 END 
     102              END 
     103    ELSE  : BEGIN 
     104               msg = 'eee : invalid orcares parameter = ' + orcares 
     105               ras = report(msg) 
     106               msg = 'eee : orcares must be ORCA2 or ORCA025' 
     107               ras = report(msg) 
     108               RETURN 
     109            END 
     110  ENDCASE 
     111; 
     112; check for input files 
     113; 
    36114; test if ${GEOMAG_ID} defined 
    37 geomag_id_env=GETENV('GEOMAG_ID') 
    38 ; ++ pb syntaxe case dans @... 
    39  
     115  geomag_id_env=GETENV('GEOMAG_ID') 
     116  CASE geomag_id_env OF 
     117     ''  :  BEGIN 
     118              msg = 'eee : ${GEOMAG_ID} is not defined' 
     119              ras = report(msg) 
     120              RETURN 
     121            END 
     122     ELSE: BEGIN 
     123             msg = 'iii : ${GEOMAG_ID} is ' + geomag_id_env 
     124             ras = report(msg) 
     125           END 
     126  ENDCASE 
    40127iodirin = isadirectory(geomag_id_env) 
    41128; 
    42 ; existence and protection of ${GEOMAG_ID} ++ 
    43  
    44 filename_oce='meshmask_bab.nc' 
     129; existence and protection of ${GEOMAG_ID} 
     130  IF (FILE_TEST(iodirin, /DIRECTORY, /EXECUTABLE, /READ) EQ 0) THEN BEGIN 
     131     msg = 'eee : the directory' + iodirin  + ' is not accessible.' 
     132     ras = report(msg) 
     133     RETURN 
     134  ENDIF 
     135; 
    45136; check if this file exists 
    46137fullfilename_oce = isafile(iodirin + filename_oce, NEW=0, /MUST_EXIST, $ 
    47138                     RECURSIVE=0) 
    48 print,fullfilename_oce[0] 
    49  
     139  IF fullfilename_oce[0] EQ '' THEN BEGIN 
     140     msg = 'eee : the file ' + fullfilename_oce + ' was not found.' 
     141     ras = report(msg) 
     142     RETURN 
     143  ENDIF 
     144; 
     145; protection 
     146  IF (FILE_TEST(fullfilename_oce[0], /READ) EQ 0) THEN BEGIN 
     147     msg = 'eee : the file ' + fullfilename_oce[0] + ' is not readable.' 
     148     ras = report(msg) 
     149     RETURN 
     150  ENDIF 
     151; 
    50152;-------------------------------------------------------- 
    51153; boundaries of the read grid regarding to the original grid 
    52154;---------------------------------------------------------- 
    53155; 
     156CASE orcares OF 
     157   'ORCA2': BEGIN 
    54158ixminmesh  =1 
    55159ixmaxmesh  =180 
     
    61165izmaxmesh  =-1 
    62166; 
     167              END 
     168   'ORCA025': BEGIN 
     169ixminmesh  =1 
     170ixmaxmesh  =1440 
     171; 
     172iyminmesh  =0 
     173iymaxmesh  =1019 
     174; 
     175izminmesh  =-1 
     176izmaxmesh  =-1 
     177; 
     178              END 
     179      ELSE  : BEGIN 
     180                 msg = 'eee : invalid orcares parameter = ' + orcares 
     181                 ras = report(msg) 
     182                 msg = 'eee : orcares must be ORCA2 or ORCA025' 
     183                 ras = report(msg) 
     184                 RETURN 
     185              END 
     186  ENDCASE 
    63187jpt = 1 
    64188time = 0 
     
    66190; read the grid 
    67191;------------------------------------------------------ 
    68  
     192; 
    69193key_stride = [1, 1, 1] 
    70 ncdf_meshlec, fullfilename_oce[0], glamboundary = [20, 380] 
     194ncdf_meshlec, fullfilename_oce[0], glamboundary = [20, 380], _extra = ex 
    71195;------------------------------------------------------------- 
    72196domdef 
    73197; 
    74 triangles_list = triangule() 
    75 ;---------------------------------------------------------- 
     198CASE orcares OF 
     199  'ORCA2'  : BEGIN 
     200                triangles_list = triangule() 
     201             END 
     202  'ORCA025': BEGIN 
     203                triangles_list = triangule(/keepcont) 
     204             END 
     205      ELSE : BEGIN 
     206                msg = 'eee : invalid orcares parameter = ' + orcares 
     207                ras = report(msg) 
     208                msg = 'eee : orcares must be ORCA2 or ORCA025' 
     209                ras = report(msg) 
     210                RETURN 
     211             END 
     212ENDCASE 
     213; 
    76214; boundaries of the data regarding to the original grid 
    77 ;---------------------------------------------------------- 
    78215jpidta = jpiglo 
    79216jpjdta = jpjglo 
     
    85222izmindta = 0 
    86223izmaxdta = jpkdta-1 
    87 ;---------------------------------------------------------- 
     224; 
    88225@updateold 
     226; 
     227END 
Note: See TracChangeset for help on using the changeset viewer.