00001 !------------------------------------------------------------------------ 00002 ! Copyright 2006-2010, CERFACS, Toulouse, France. 00003 ! All rights reserved. Use is subject to license terms. 00004 !------------------------------------------------------------------------ 00005 !BOP 00006 ! 00007 ! !MODULE PSMILe_smioc 00008 MODULE PSMILe_smioc 00009 00010 ! !PUBLIC TYPES 00011 USE PRISM_Constants 00012 USE PSMILe_Common 00013 IMPLICIT NONE 00014 00015 ! 00016 ! !DESCRIPTION 00017 ! This module gathers the structures used to extract the 00018 ! information from the smioc files. 00019 ! 00020 ! !REVISED HISTORY 00021 ! Date Programmer Description 00022 ! ---------- ---------- ----------- 00023 ! 20/10/2003 S. Valcke Creation 00024 ! 30/12/2003 D. Declat Implemented as a module 00025 ! 22/03/2010 JM Epitalon Simultaneous access to multiple SMIOC files 00026 ! 00027 !EOP 00028 !---------------------------------------------------------------------- 00029 ! $Id: psmile_smioc.F90 2697 2010-11-01 12:32:46Z hanke $ 00030 ! $Author: hanke $ 00031 !---------------------------------------------------------------------- 00032 !------------------------------------------------------------------------- 00033 ! 00034 ! Grid structure for the driver 00035 ! ============================= 00036 ! 00037 ! ig_grid_id : global grid id (set by the driver) 00038 ! 00039 ! ig_comp_id : component id the grid belongs (set by the driver) 00040 ! 00041 ! iga_periodic : periodicity in the dimension (PSMILe_true or PSMILe_false) 00042 ! 00043 ! cg_grid_name : name of the grid 00044 ! 00045 ! 00046 TYPE smioc_grid 00047 00048 INTEGER :: ig_grid_id 00049 INTEGER :: ig_comp_id 00050 INTEGER, DIMENSION(3) :: iga_periodic 00051 CHARACTER(len=max_name) :: cg_grid_name 00052 00053 END TYPE smioc_grid 00054 ! 00055 00056 !---------------------------------------------------------------------- 00057 ! 00058 ! Structure for file information 00059 ! ==================================================== 00060 ! 00061 ! cg_file_name : name of the file 00062 ! 00063 ! ig_suffix : PSMILe_true if the file name is composed of cg_file_name 00064 ! + PRISM suffix for dates (standard tbd) 00065 ! 00066 ! ig_file_format: PSMILe_mpp_ascii, PSMILe_mpp_ieee32, 00067 ! PSMILe_mpp_native, or PSMILe_mpp_netcdf 00068 ! 00069 ! ig_file_iomode: iosingle, parallel, distributed 00070 ! 00071 ! ig_file_set: PSMILe_mpp_single, or PSMILe_mpp_multi 00072 ! 00073 ! ig_file_pack: PSMILe_one, PSMILe_two, PSMILe_four, PSMILe_eight 00074 ! 00075 ! dg_file_scal: CF convention scale_factor 00076 ! 00077 ! dg_file_add: CF convention add_offset 00078 ! 00079 ! dg_fill_val: CF convention FillValue or missing_value 00080 ! 00081 TYPE PSMILe_file_struct 00082 00083 CHARACTER(len=max_name) :: cg_file_name 00084 INTEGER :: ig_suffix 00085 INTEGER :: ig_file_format 00086 INTEGER :: ig_file_set 00087 INTEGER :: ig_file_iomode 00088 INTEGER :: ig_file_pack 00089 DOUBLE PRECISION :: dg_file_scal 00090 DOUBLE PRECISION :: dg_file_add 00091 DOUBLE PRECISION :: dg_fill_val 00092 END TYPE PSMILe_file_struct 00093 ! 00094 !---------------------------------------------------------------------- 00095 ! 00096 ! Structure for the exchanges date 00097 ! ================================ 00098 ! 00099 ! sg_period: the data is exchanged at a fixed period 00100 ! 00101 ! sg_precise: if a nbr X of years is defined in precise, the data is exchanged 00102 ! every X years, on month, day, hour, minute, second specified in precise; 00103 ! if no year is defined, but if a number X of months is defined in 00104 ! precise, the data is exchanged every X months, on day, hour, minute, 00105 ! second specified in precise 00106 ! 00107 ! sg_lastdayinmonth: the data are exchanged on the last day of each month on 00108 ! hour, minute, second defined 00109 ! 00110 ! sga_list: the data is exchanged on a list of dates 00111 ! 00112 TYPE PSMILe_exch_date 00113 TYPE (PRISM_time_struct) :: sg_period 00114 END TYPE PSMILe_exch_date 00115 00116 ! 00117 !------------------------------------------------------------------------- 00118 ! 00119 ! Structure for source local transformations 00120 ! ========================================== 00121 ! 00122 ! ig_scatter : indicates if a scattering is needed 00123 ! (PSMILe_true or PSMILe_false) 00124 ! 00125 ! ig_reduc_type : type of reduction for each dimension (PSMILe_min, 00126 ! PSMILe_max, PSMILe_ave, PSMILe_wgt_ave, 00127 ! PSMILe_subgrid_ave, PSMILe_undef) 00128 ! 00129 ! ig_reduc_order : order of reduction for each dimension (PSMILe_first, 00130 ! PSMILe_second, PSMILe_third, PSMILe_fourth) 00131 ! 00132 ! dg_add_scalar : scalar to add to the field 00133 ! 00134 ! dg_mult_scalar : scalar to multiply the field 00135 ! 00136 TYPE PSMILe_src_local_trans 00137 00138 INTEGER :: ig_scatter 00139 INTEGER, DIMENSION(4) :: ig_reduc_type 00140 INTEGER, DIMENSION(4) :: ig_reduc_order 00141 DOUBLE PRECISION :: dg_add_scalar 00142 DOUBLE PRECISION :: dg_mult_scalar 00143 00144 END TYPE PSMILe_src_local_trans 00145 00146 !------------------------------------------------------------------------- 00147 ! 00148 ! Structure for target local transformations 00149 ! ========================================== 00150 ! 00151 ! ig_gather : indicates if a gathering is needed 00152 ! (PSMILe_true or PSMILe_false) 00153 ! 00154 ! dg_add_scalar : scalar to add to the field 00155 ! 00156 ! dg_mult_scalar : scalar to multiply the field 00157 ! 00158 TYPE PSMILe_tgt_local_trans 00159 00160 INTEGER :: ig_gather 00161 DOUBLE PRECISION :: dg_add_scalar 00162 DOUBLE PRECISION :: dg_mult_scalar 00163 00164 END TYPE PSMILe_tgt_local_trans 00165 00166 !---------------------------------------------------------------------- 00167 ! 00168 ! Structure for interpolations 00169 ! ============================ 00170 ! 00171 ! ig_interp_type : type of interpolation (PSMILe_3D, PSMILe_2D1D, 00172 ! PSMILe_1D1D1D) 00173 ! 00174 ! iga_interp_meth: method of interpolation (1/2/3 needed for 3D/2D1D/1D1D1D) 00175 ! PSMILe_nnghbr3D, PSMILe_trilinear, PSMILe_conserv3D, 00176 ! PSMILe_user3D, PSMILe_nnghbr2D, PSMILe_bilinear, PSMILe_bicubic, 00177 ! PSMILe_conserv2D, PSMILe_user2D, PSMILe_nnghbr1D, 00178 ! PSMILe_linear, PSMILe_cubic, PSMILe_conserv1D, PSMILe_user1D 00179 ! PSMILe_none 00180 ! 00181 ! iga_arg1 : interpolation first argument (obsolete) 00182 ! 00183 ! iga_arg2 : interpolation second argument 00184 ! ->nbr_nghbr for nnghbr3D/2D 00185 ! ->order (PSMILe_first or PSMILe_second) for 00186 ! for conserv3D/2D/1D 00187 ! 00188 ! iga_arg3 : interpolation third argument 00189 ! ->para_search (PSMILe_approx=local or PSMILe_precise=global) 00190 ! for nnghbr3D/2D, trilinear, bilinear, bicubic, linear, 00191 ! for conserv3D/2D/1D 00192 ! 00193 ! iga_arg4 : interpolation fourth argument 00194 ! ->methnorm: 00195 ! PSMILe_fracarea, PSMILe_destarea, PSMILe_none for conserv2D 00196 ! ->if_masked for linear, bilinear, trilinear, cubic, bicubic, 00197 ! nnghbr3D/2D 00198 ! 00199 ! iga_arg5 : interpolation fifth argument 00200 ! ->bicubic_meth: 00201 ! PSMIle_gradient or PSMILe_sixteen for bicubic 00202 ! (->nearnei: 00203 ! PSMILe_true or PSMILe_false for conserv2D - not supported) 00204 ! ->PSMILe_undef for all other interpolations 00205 ! 00206 ! iga_arg6 : interpolation sixth argument 00207 ! -> truearea: 00208 ! PSMILe_true or PSMILe_false for conserv2D 00209 ! ->PSMILe_undef for all other interpolations 00210 ! 00211 ! iga_arg7 : interpolation seventh argument 00212 ! ->currently PSMILe_undef for all interpolations 00213 !! 00214 ! dg_arg8 : interpolation seventh argument 00215 ! ->gaussian_variance for nnghbr3D/2D 00216 ! ->PSMILe_undef for all other interpolations 00217 ! 00218 ! cg_arg9 : interpolation eigth argument 00219 ! ->gradient_var_name for (conserv2D +) bicubic 00220 ! ->' ' for all other interpolations 00221 ! 00222 ! sg_arg10 : (interpolation nineth argument 00223 ! -> file for user3D/2D/1D) 00224 ! 00225 TYPE PSMILe_interp 00226 00227 INTEGER :: ig_interp_type 00228 INTEGER, DIMENSION(3) :: iga_interp_meth 00229 INTEGER, DIMENSION(3) :: iga_arg1 00230 INTEGER, DIMENSION(3) :: iga_arg2 00231 INTEGER, DIMENSION(3) :: iga_arg3 00232 INTEGER, DIMENSION(3) :: iga_arg4 00233 INTEGER, DIMENSION(3) :: iga_arg5 00234 INTEGER, DIMENSION(3) :: iga_arg6 00235 INTEGER, DIMENSION(3) :: iga_arg7 00236 DOUBLE PRECISION :: dg_arg8 00237 CHARACTER(len=max_name) :: cg_arg9 00238 TYPE (PSMILe_file_struct) :: sg_arg10 00239 00240 END TYPE PSMILe_interp 00241 00242 !---------------------------------------------------------------------- 00243 ! 00244 ! Structure for combination 00245 ! ========================= 00246 ! 00247 ! cg_combi_name : name of the combination 00248 ! 00249 ! cg_ext_mask_name : meaningful if PSMILe_ext_mask 00250 ! 00251 ! sg_ext_mask_file : meaningful if PSMILe_ext_mask 00252 ! 00253 ! dg_combi_param : parameter for combination 00254 ! 00255 ! dg_scalar : scalar to apply 00256 ! 00257 ! ig_location : where the combination will be done (define by Driver) 00258 ! (PSMILe_source if fields come from same source; 00259 ! PSMILe_target if not) 00260 ! 00261 ! ig_operand : operand to apply to the field 00262 ! (PSMILe_sin, PSMILe_cos, PSMILe_log) 00263 ! 00264 ! ig_mask_type : type of masking 00265 ! ->PSMIle_var_mask: the transient is masked with its mask 00266 ! ->PSMILe_ext_mask: the transient is masked with an 00267 ! ext mask coming from a file 00268 ! ->PSMILe_undef : no masking 00269 ! 00270 ! ig_combi_meth : method (PSMILe_smooth or PSMILe_raw) 00271 ! 00272 ! 00273 TYPE PSMILe_combi_struct 00274 00275 CHARACTER(len=max_name) :: cg_combi_name 00276 CHARACTER(len=max_name) :: cg_ext_mask_name 00277 TYPE (PSMILe_file_struct) :: sg_ext_mask_file 00278 DOUBLE PRECISION :: dg_combi_param 00279 DOUBLE PRECISION :: dg_scalar 00280 INTEGER :: ig_location 00281 INTEGER :: ig_operand 00282 INTEGER :: ig_mask_type 00283 INTEGER :: ig_combi_meth 00284 00285 END TYPE PSMILe_combi_struct 00286 00287 !---------------------------------------------------------------------- 00288 ! 00289 ! Input origin structure 00290 ! ====================== 00291 ! 00292 ! ig_transi_in_id : transient in global id 00293 ! 00294 ! ig_orig_type : PSMILe_comp, or PSMILe_file 00295 ! 00296 ! ig_orig_transi_id : origin transient id 00297 ! 00298 ! ig_orig_comp_id : origin component id 00299 ! 00300 ! ig_conserv : conservation to perform on the transient 00301 ! PSMILe_glob_conserv (only choice for now) 00302 ! 00303 ! cg_transi_in_id : transient in name 00304 ! 00305 ! cg_orig_transi : transient name in the origin component or 00306 ! origin combination name 00307 ! 00308 ! cg_orig_comp_name : origin component name 00309 00310 ! sg_orig_file : all information on the origin file 00311 ! 00312 ! sg_cpl_rst_file : coupling restart file (from SMIOC) 00313 ! 00314 ! sg_interp : interpolations to perform on the transient 00315 ! 00316 ! 00317 ! sg_combi : combination to perform on the transient 00318 ! 00319 ! 00320 TYPE PSMILe_in_origin 00321 00322 INTEGER :: ig_transi_in_id 00323 INTEGER :: ig_orig_type 00324 INTEGER :: ig_orig_transi_id 00325 INTEGER :: ig_orig_comp_id 00326 INTEGER :: ig_conserv 00327 CHARACTER(len=max_name) :: cg_transi_in_name 00328 CHARACTER(len=max_name) :: cg_orig_transi 00329 CHARACTER(len=max_name) :: cg_orig_comp_name 00330 TYPE (PSMILe_file_struct) :: sg_orig_file 00331 TYPE (PSMILe_file_struct) :: sg_cpl_rst_file 00332 TYPE (PSMILe_interp) :: sg_interp 00333 TYPE (PSMILe_combi_struct) :: sg_combi 00334 00335 END TYPE PSMILe_in_origin 00336 ! 00337 !---------------------------------------------------------------------- 00338 ! 00339 ! Input transient structures 00340 ! ========================== 00341 ! 00342 ! ig_nb_in_orig : number of input origins 00343 ! 00344 ! ig_exch_date_type : date format (PSMILe_period, PSMILe_preciseday, 00345 ! PSMILe_list, PSMIle_lastdayinm) or 00346 ! (PSMILe_beg, PSMIle_end, or PSMIle_beg_and_end) 00347 ! Only PSMILe_period allowed for now. 00348 ! 00349 ! ig_debugmode : PSMILe_true or PSMILe_false; if debug_mode is true 00350 ! the data will automatically be written to 00351 ! a file below the prism_get after reception 00352 ! 00353 ! ig_tgt_timeop : time operation to perform on the transient 00354 ! (PSMILe_time_nnghbr, PSMILe_time_linear) 00355 ! 00356 ! iga_stats : PSMILe_true or PSMILe_false for each possible 00357 ! statistics (masked_points, notmasked_points, all_points) 00358 ! 00359 ! sg_min_period : shortest possible period of exchange 00360 ! 00361 ! sg_tgt_local_trans: local_transformation to perform on the transient 00362 ! 00363 ! sg_exch_date : exchange date 00364 ! 00365 ! sga_in_orig : vector of origin structures 00366 ! 00367 ! 00368 TYPE transient_in 00369 00370 INTEGER :: ig_nb_in_orig 00371 INTEGER :: ig_exch_date_type 00372 INTEGER :: ig_debugmode 00373 INTEGER :: ig_tgt_timeop 00374 INTEGER, DIMENSION(3) :: iga_stats 00375 TYPE (PRISM_time_struct) :: sg_min_period 00376 TYPE (PSMILe_tgt_local_trans) :: sg_tgt_local_trans 00377 TYPE (PSMILe_exch_date) :: sg_exch_date 00378 TYPE (PSMILe_in_origin),POINTER :: sga_in_orig(:) 00379 00380 END TYPE transient_in 00381 ! 00382 !---------------------------------------------------------------------- 00383 ! 00384 ! Output transient structures 00385 ! =========================== 00386 ! 00387 ! ig_transi_out_id : transient out global id 00388 ! 00389 ! ig_dest_type : PSMILe_comp or PSMILe_file 00390 ! 00391 ! ig_dest_transi_id : destination transient id 00392 ! 00393 ! ig_dest_comp_id : destination component id 00394 ! 00395 ! ig_exch_date_type : date format (PSMILe_period, PSMILe_preciseday, 00396 ! PSMILe_list) or 00397 ! (PSMILe_beg, PSMIle_end, or PSMIle_beg_and_end) 00398 ! 00399 ! ig_debugmode : PSMILe_true or PSMILe_false; if debug_mode is true 00400 ! the data will automatically be written to 00401 ! a file below the prism_put before sending 00402 ! ig_lag : lag i.e. number of source model timesteps to add to 00403 ! the prism_put date to match a target model prism_get 00404 ! 00405 ! ig_src_timeop : time operation to perform on the transient 00406 ! (PSMILe_tave, PSMILe_tacc, PSMILe_tmin or PSMILe_tmax) 00407 ! 00408 ! ig_conserv : conservation to perform on the transient 00409 ! PSMILe_glob_conserv (only choice for now) 00410 ! In the SMIOC, conservation is defined as a target 00411 ! transformation. The conservation info is copied 00412 ! in the transient_out by the Driver as some calculation 00413 ! may be needed in the source PSMILe (to verify). 00414 ! 00415 ! iga_stats : PSMILe_true or PSMILe_false for each possible 00416 ! statistics (masked_points, notmasked_points, all_points) 00417 ! 00418 ! cg_transi_out_name : transient out local name 00419 ! 00420 ! cg_dest_transi : transient name in the target component 00421 ! 00422 ! cg_dest_comp_name : destination component name 00423 ! 00424 ! sg_dest_file : all information on the destination file 00425 ! 00426 ! sg_cpl_rst_file : coupling restart file (determined by Driver based 00427 ! on corresponding target coupling restart file) 00428 ! 00429 ! sg_min_period : shortest possible period of exchange 00430 ! 00431 ! sg_exch_date : exchange dates 00432 ! 00433 ! sg_src_local_trans: local_transformation to perform on the transient 00434 ! 00435 ! sg_interp : interpolations to perform on the transient 00436 ! In the SMIOC, interpolation is defined as a target 00437 ! transformation. The interpolation information is 00438 ! copied in the transient_out by the Driver as these 00439 ! information may be needed by the source PSMILe. 00440 ! 00441 ! sg_combi : combination to perform on the transient 00442 ! In the SMIOC, combination is defined as a target 00443 ! transformation. The combination info is copied 00444 ! in the transient_out by the Driver only if the 00445 ! combination will be done in the source PSMILe. 00446 ! 00447 ! 00448 TYPE transient_out 00449 00450 INTEGER :: ig_transi_out_id 00451 INTEGER :: ig_dest_type 00452 INTEGER :: ig_dest_transi_id 00453 INTEGER :: ig_dest_comp_id 00454 INTEGER :: ig_exch_date_type 00455 INTEGER :: ig_debugmode 00456 INTEGER :: ig_lag 00457 INTEGER :: ig_src_timeop 00458 INTEGER :: ig_conserv 00459 INTEGER, DIMENSION(3) :: iga_stats 00460 CHARACTER(len=max_name) :: cg_transi_out_name 00461 CHARACTER(len=max_name) :: cg_dest_transi 00462 CHARACTER(len=max_name) :: cg_dest_comp_name 00463 TYPE (PSMILe_file_struct) :: sg_dest_file 00464 TYPE (PSMILe_file_struct) :: sg_cpl_rst_file 00465 TYPE (PRISM_time_struct) :: sg_min_period 00466 TYPE (PSMILe_exch_date) :: sg_exch_date 00467 TYPE (PSMILe_src_local_trans) :: sg_src_local_trans 00468 TYPE (PSMILe_interp) :: sg_interp 00469 TYPE (PSMILe_combi_struct) :: sg_combi 00470 00471 END TYPE transient_out 00472 ! 00473 !---------------------------------------------------------------------- 00474 ! 00475 ! Transient variables structure 00476 ! ============================= 00477 ! 00478 ! ig_nb_stand_name : number of standard names 00479 ! 00480 ! ig_comp_id : component id the transient belongs (set by the drv) 00481 ! 00482 ! ig_transi_id : global id for transient (set by the drv) 00483 ! 00484 ! ig_transi_type : PSMILe_single, PSMILe_vector or PSMILe_bundle 00485 ! 00486 ! ig_nb_bndl : number of bundles for this variable 00487 ! 00488 ! ig_datatype : numerical type of the variable 00489 ! (see PRISM Data Types in prism.inc) 00490 ! 00491 ! ig_grid_id : ig_grid_id of associated grid (set by the drv) 00492 ! 00493 ! ig_nb_transi_out : number of outputs 00494 ! 00495 ! cg_local_name : local name of the transient variable 00496 ! 00497 ! cg_comp_name : name of the component the transient belongs 00498 ! 00499 ! cg_units : units of the transient variable 00500 ! 00501 ! cga_stand_name : standard name(s) of the transient variable 00502 ! 00503 ! dg_transi_min : minimum possible value for the variable 00504 ! 00505 ! dg_transi_max : maximum possible value for the variable 00506 ! 00507 ! sg_transi_in : associated transient_in (if any) 00508 ! 00509 ! sga_transi_out(:) : associated transient_out 00510 ! 00511 TYPE transient 00512 00513 INTEGER :: ig_nb_stand_name 00514 INTEGER :: ig_comp_id 00515 INTEGER :: ig_transi_id 00516 INTEGER :: ig_transi_type 00517 INTEGER :: ig_nb_bndl 00518 INTEGER :: ig_datatype 00519 INTEGER :: ig_grid_id 00520 INTEGER :: ig_nb_transi_out 00521 CHARACTER(len=max_name) :: cg_local_name 00522 CHARACTER(len=max_name) :: cg_long_name 00523 CHARACTER(len=max_name) :: cg_comp_name 00524 CHARACTER(len=max_name) :: cg_units 00525 CHARACTER(len=max_name), POINTER :: cga_stand_name(:) 00526 DOUBLE PRECISION :: dg_transi_min 00527 DOUBLE PRECISION :: dg_transi_max 00528 TYPE(transient_in) :: sg_transi_in 00529 TYPE(transient_out),POINTER :: sga_transi_out(:) 00530 00531 END TYPE transient 00532 00533 !---------------------------------------------------------------------- 00534 ! 00535 ! Structure for persistent variables 00536 ! ================================== 00537 ! 00538 ! ig_comp_id : component id the persistent belongs (set by the drv) 00539 ! 00540 ! ig_persis_id : persistent Id (set by the Driver) 00541 ! 00542 ! ig_persis_type : variable type (PSMILe_local or PSMILe_global) 00543 ! 00544 ! ig_datatype : numerical type of the variable 00545 ! (PRISM Data Types in prism.inc) 00546 ! 00547 ! cg_local_name : local name of the persistent variable 00548 ! 00549 ! cg_stand_name : standard name of the persistent variable 00550 ! 00551 ! cg_long_name : long descriptive name of the persistent variable 00552 ! 00553 ! cg_comp_name : name of the component the persistent belongs 00554 ! 00555 ! cg_units : unit of the persistent variable 00556 ! 00557 ! rg_persis_min : minimum value for the variable 00558 ! 00559 ! rg_persis_max : maximum value for the variable 00560 ! 00561 ! rg_persis : value of the persistent variable 00562 ! 00563 TYPE persistent 00564 00565 INTEGER :: ig_comp_id 00566 INTEGER :: ig_persis_id 00567 INTEGER :: ig_persis_type 00568 INTEGER :: ig_datatype 00569 CHARACTER(len=max_name) :: cg_local_name 00570 CHARACTER(len=max_name) :: cg_stand_name 00571 CHARACTER(len=max_name) :: cg_long_name 00572 CHARACTER(len=max_name) :: cg_comp_name 00573 CHARACTER(len=max_name) :: cg_units 00574 REAL :: rg_persis_min 00575 REAL :: rg_persis_max 00576 REAL :: rg_persis 00577 00578 END TYPE persistent 00579 ! 00580 ! 00581 !====================================================================== 00582 ! 00583 ! Structure for search of User-defined interpolations 00584 ! ==================================================== 00585 ! Allocate one per component 00586 ! 00587 ! ig_xml_udef : number of XML transients of this component with Udef Interpolation 00588 ! 00589 ! ig_tot_comp_ugl : total number of additional "gridless" transients for this component 00590 ! depends on the number of origins or outputs of the XML "Udef" transients 00591 ! 00592 ! iga_xml_trindex : dimension = ig_tot_comp_ugl, contain index of XML "Udef" transient 00593 ! for each gridless transient in component 00594 ! 00595 ! iga_trans_udef : dimension = ig_xml_udef, indexes of geographic transients "ud" in component 00596 ! 00597 ! sla_driver_udef : array of structures : one per XML transient in component 00598 ! 00599 TYPE PSMILe_comp_udef 00600 00601 Integer :: ig_xml_udef 00602 00603 Integer :: ig_tot_comp_ugl 00604 00605 Integer, pointer :: iga_xml_trindex(:) 00606 00607 Integer, pointer :: iga_trans_udef(:) 00608 00609 Type(PSMILe_udef_idx), pointer :: sla_driver_udef(:) 00610 00611 END TYPE PSMILe_comp_udef 00612 00613 !====================================================================== 00614 ! 00615 ! Allocate one per XML transient 00616 ! 00617 ! lg_trans_ud : true if transient needs a Usr-defined Interpolation 00618 ! 00619 ! ig_dim_orig : dimension of pointer lga_trin_orig, = ig_nb_in_orig 00620 ! 00621 ! ig_dim_out : dimension of pointer lga_trout, = ig_nb_transi_out 00622 ! 00623 ! iga_comp_ud_idx : for each XML transient, array of dimension 00624 ! ig_nb_in_orig + ig_nb_transi_out 00625 ! contains the index of "gridless" transient in component 00626 ! (single index from 1 to iga_comp_nb_transi(ib_c) 00627 ! associated with a specific in_ or out_ channel 00628 ! Note that a transient can be "in" and "out" 00629 ! 00630 ! lga_trin_orig : true if transient_in%origin need a User-defined Interp 00631 ! Allocated to dimension ig_dim_orig = ig_nb_in_orig 00632 ! 00633 ! lga_trout : true if transient output needs a User-defined Interpolation 00634 ! Allocated to dimension : ig_dim_out = ig_nb_transi_out 00635 ! 00636 ! cg_local_name : local name of transient found in XML. 00637 ! (used for generating the associated gridless grid name) 00638 00639 ! 00640 TYPE PSMILe_udef_idx 00641 00642 Logical :: lg_trans_ud 00643 00644 Integer :: ig_dim_orig 00645 Integer :: ig_dim_out 00646 Integer, pointer :: iga_comp_ud_idx(:) 00647 00648 Logical, pointer :: lga_trin_orig(:) 00649 00650 Logical, pointer :: lga_trout(:) 00651 00652 Character(len=max_name) :: cg_local_name 00653 00654 END TYPE PSMILe_udef_idx 00655 ! 00656 ! Definition of the different arrays used in the driver to store the 00657 ! SMIOC Informations. 00658 ! The sla/ila structures are component structures used to fill up the global 00659 ! sga/iga structures 00660 ! 00661 TYPE smioc_comp 00662 00663 ! Informations about the Fortran unit numbers 00664 INTEGER, DIMENSION(:,:), POINTER :: iga_smioc_unitsets 00665 ! 00666 ! Informations about the grids 00667 TYPE(smioc_grid), DIMENSION(:), POINTER :: sga_smioc_grids 00668 00669 ! Informations about the transients 00670 TYPE(transient), DIMENSION(:), POINTER :: sga_smioc_transi 00671 00672 ! Informations about the persistents 00673 TYPE(persistent), DIMENSION(:), POINTER :: sga_smioc_persis 00674 00675 END TYPE smioc_comp 00676 00677 ! 00678 !====================================================================== 00679 00680 !====================================================================== 00681 ! Global variables 00682 SAVE 00683 !====================================================================== 00684 ! 00685 ! Number of grids, transients, persistents and unit sets per component 00686 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_comp_nb_grids 00687 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_comp_nb_transi 00688 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_comp_nb_persis 00689 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_comp_nb_unitsets 00690 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_comp_nb_udef 00691 00692 ! Number of input and output transients and standard names per transients 00693 ! the ila arrays are local arrays used to fill up the global iga arrays 00694 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_comp_nb_stand_name 00695 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_comp_nb_transi_in 00696 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_comp_nb_transi_out 00697 00698 ! Definition of the different arrays used in the driver to store the 00699 ! SMIOC Informations. 00700 ! The sla/ila structures are component structures used to fill up the global 00701 ! sga/iga structures 00702 ! 00703 00704 ! Handle to open XML document (SMIOC) files 00705 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_comp_id_doc_XML 00706 00707 TYPE(smioc_comp), DIMENSION(:), POINTER :: sga_smioc_comp 00708 00709 INTEGER, DIMENSION(:,:), POINTER :: iga_smioc_unitsets 00710 TYPE(smioc_grid), DIMENSION(:), POINTER :: sga_smioc_grids 00711 TYPE(transient), DIMENSION(:), POINTER :: sga_smioc_transi 00712 TYPE(persistent), DIMENSION(:), POINTER :: sga_smioc_persis 00713 00714 ! Global counter for first pass 00715 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_xml_comp_nb_grids 00716 INTEGER, DIMENSION(:), ALLOCATABLE :: iga_xml_comp_nb_transi 00717 00718 ! Global pointer for first pass (search of User-defined Interpolations) 00719 TYPE(transient), DIMENSION(:), POINTER :: sga_xml_smioc_transi 00720 00721 ! Global identification of User-defined Interpolation in transients 00722 TYPE(PSMILe_comp_udef), Dimension(:), POINTER :: sga_comp_udef_idx 00723 ! 00724 ! Total number of grids in XML SMIOC files 00725 INTEGER :: ig_nb_tot_xml_grids 00726 ! Total number of transients in XML SMIOC files 00727 INTEGER :: ig_nb_tot_xml_transi 00728 ! 00729 !!!!!!!!!!!!!!!!!!!!!!! 00730 00731 !====================================================================== 00732 !====================================================================== 00733 ! 00734 00735 END MODULE PSMILe_smioc 00736 ! 00737 !----------------------------------------------------------------------