Back to OASIS4 home

Arborescence of the Transformer (in oasis4/src) : main program is prismdrv_main
prismdrv_main calls :

Prismdrv_init
(communications with psmile_init_mpi1)
=> psmile_char2buf
=> psmile_redirstdout
Prismdrv_set_scc_info
Routines only called by PRISMdrv_root (fixed in prismdrv_init)
=> open_scc_file
=> get_execution_mode
=> get_transformer_pes

=> get_dates
=> get_appli_number
=> get_appli_details
=> get_transi_io_numbers
=> get_appliarg_details
=> get_applihost_details
=> get_applicomp_details
=> get_applicomprk_detls
then some infos to allocate the arrays are sent to all the other processes of the Transformer
Prismdrv_init_appl : set up the communicators in MPI1 and spawn the applications in MPI2 (communications with psmile_init_mpi1 and prism_init_comp)
If MPI1 :
=> prismdrv_def_mpi_comm (communications with psmile_def_mpi_comm)
If MPI2 :
=> prismdrv_spawn_child
Prismdrv_set_smioc_info
Routines only called by PRISM_root (= PRISMdrv_root)
=> prismdrv_init_smioc_struct (communications with psmile_smioc_init)
First pass for this Component
=> prismdrv_get_comp_names
=> prismdrv_get_udef_transients (first pass)
=> prismdrv_get_comp_names
=> get_smioc_numbers (iga_comp_id_doc_XML(ib_c), il_nb_unitsets, iga_xml_comp_nb_grids(ib_c), iga_comp_nb_transi(ib_c)ll_userdef_details=false ... )
=> get_transi_io_numbers (iga_comp_id_doc_XML(ib_c), iga_comp_nb_transi(ib_c), ila_comp_nb_stand_name(:), ila_comp_nb_transi_in(:), ila_comp_nb_transi_out(:) ... ll_userdef_details=true)
=> init_transi (initialisation of  iga_comp_nb_stand_name, iga_comp_nb_transi_in, iga_comp_nb_transi_out,  sga_xml_smioc_transi ...)
=>
init_transi (initialisation of ila_comp_nb_stand_name, ila_comp_nb_transi_in, ila_comp_nb_transi_out, sla_driver_transi ... )
=> init_comp_udef (initialisation of  sga_comp_udef_idx ... )
=> get_transi_details  (iga_comp_id_doc_XML(ib_c), iga_comp_nb_transi(ib_c),  sla_driver_transi(:), ib_c, cla_appli_name, cla_comp_name, ll_userdef_details=true ... -> find out how many userdef are declared in the smioc sga_comp_udef_idx(id_comp)%sla_driver_udef(il_transi)%lga_trin_orig(il_input) = .true.)
Then calculate the total number of userdef structures. For one transient, there are 2 userdef structures that will be defined (for source and target) (which means that there will be 2 gridless grids for one transient)
Count all "user3D" interpolations for all origins and all outputs. An associated "gridless" transient is created for each input and output channel only if the flag "userdef" is .true.
Reset global counters to 0 and keep present value in ig_nb_tot_xml_transi
Keep also sga_xml_smioc_transi (=sla_driver_transi), iga_xml_comp_nb_transi
Second pass for this Component
=> prismdrv_get_comp_names
=> get_smioc_numbers (iga_comp_id_doc_XML(ib_c), iga_comp_nb_unitsets, iga_comp_nb_grids(ib_c), iga_comp_nb_transi(ib_c)ll_userdef_details=true ... ) -> userdef data are added to xml data
=> get_unitsets_details (iga_comp_id_doc_XML(ib_c), iga_comp_nb_unitsets(ib_c), ila_driver_unitsets ... )
=> init_grids (ig_nb_tot_grids, sga_smioc_grids ... ) -> global structures
=> init_grids (iga_comp_nb_grids(ib_c), sla_driver_grids ... ) -> local structures
=> prismdrv_get_comp_names
=> get_grids_details (iga_comp_id_doc_XML(ib_c), iga_xml_comp_nb_grids(ib_c), cla_appli_name, cla_comp_name, sla_driver_grids ...) -> geographical grids
=> prismdrv_get_all_grids (iga_comp_nb_grids(ib_c), iga_xml_comp_nb_grids(ib_c), sla_driver_grids(:) ... ) ->  creates all "User-defined" associated gridless grids for each input or output channel
                                                                                                                                                                                         that uses a "user3D" interpolation method :  for each transient involved with
                                                                                                                                                                                         User_defined Interp we need to associate a gridless grid.
                                                                                                                                                                                         The name of this gridless grid is just the transient local name with a suffix :
                                                                                                                                                                                          _glgrid_I_XX   (or O_XX) where XX is the input-origin  or the output channel number
=> prismdrv_get_comp_names
=> get_transi_io_numbers (iga_comp_id_doc_XML(ib_c), iga_comp_nb_transi(ib_c), ila_comp_nb_stand_name(:), ila_comp_nb_transi_in(:), ila_comp_nb_transi_out(:) ... ll_userdef_details=false )
=> init_transi (ig_nb_tot_transi, iga_comp_nb_stand_name, iga_comp_nb_transi_in, iga_comp_nb_transi_out, sga_smioc_transi ...) -> global structure
=> init_transi (iga_comp_nb_transi(ib_c), ila_comp_nb_stand_name, ila_comp_nb_transi_in, ila_comp_nb_transi_out, sla_driver_transi ... ) -> local structure
Copy global structure for XML transients (from 1st pass) into sla_driver_transi
sla_driver_transi(1:iga_xml_comp_nb_transi(ib_c)) =  sga_xml_smioc_transi(il_ntr_xml+1:il_ntr_xml+iga_xml_comp_nb_transi(ib_c))
=> prismdrv_get_all_transi (iga_comp_nb_transi(ib_c), sla_driver_transi(:) ... ) ->  creates all "User-defined" associated gridless transients for each input or output channel that uses a
                                                                                                                                        "user3D" interpolation method;  modifed names (add suffix "_ug_XX") are created ;
                                                                                                                                        XX is the channel number ; copy of the geographic transients (copy of pointers except names)
=> write_grids_details
=> write_transi_details
=> init_persis
=> get_persis_details
=> write_persis_details
=> prismdrv_init_drv_exchange (routine defined in prismtrs_drv_exchange_util.F90)
=> prismdrv_finalize_smioc_struct (deallocation of some global arrays used in init_smioc_struct)
Prismtrs_main
=> prismtrs_bcast2trs (some infos are sent to all the other processes of the Transformer by PRISMdrv_root)
=> prismtrs_loop (linked to the exchanges of coordinates with the procs of the components for the interpolation :
communications with psmile_trs_set_src_epio3d, psmile_trs_tgt_epio3d)
=> prismtrs_get_trans_rank
=> prismtrs_get_epio_handle
=> prismtrs_set_src_epio_dble
=> prismtrs_set_src_epio_real
=> prismtrs_set_tgt_epio_dble
=> prismtrs_set_tgt_epio_real
=> prismtrs_set_triple_links
=> prismtrs_set_neighbors3d
=> prismtrs_mind_int
=> prismtrs_mind_real
=> prismtrs_mind_dble
=> prismtrs_interp
Calculate the weights for interpolation :
3D interpolations (il_interp_type = PSMILe_3D) :
=> prismtrs_distwght_weight_3d  (PSMILe_nnghbr3D)
=> prismtrs_gauswght_weight_3d  (PSMILe_nnghbr3D + gaussweight)
=> prismtrs_trilinear_weight (PSMILe_trilinear)
2D interpolations + 1D (il_interp_type=PSMILe_2D1D) :
direction (i,j) + none in (k)  (il_interp_type=PSMILe_2D1D, ila_interp_method(2)=PSMILe_none) :
=> prismtrs_conserv2d_weight (ila_interp_method(1)=PSMILe_conserv2D)
=> prismtrs_remap_conserv
=> prismtrs_sort_add
=> prismtrs_resize_remap_vars
=> prismtrs_distwght_weight_2d (ila_interp_method(1)=PSMILe_nnghbr2D)
=> prismtrs_gauswght_weight_2d
(ila_interp_method(1)=PSMILe_nnghbr2D + gaussweight)
=> prismtrs_bilinear_weight_2d (ila_interp_method(1)=PSMILe_bilinear)
=> prismtrs_bicubic_grad_2d (ila_interp_method(1)=PSMILe_bicubic + PSMILe_gradient)
=> prismtrs_bicubic_weight_2d (ila_interp_method(1)=PSMILe_bicubic)
direction(i,j) + linear interpolation in (k) (il_interp_type=PSMILe_2D1D, ila_interp_method(2)/=PSMILe_none) :
=> prismtrs_distwght_weight_2d1d (ila_interp_method(1)=PSMILe_nnghbr2D)
=> prismtrs_bilinear_weight_2d1d (ila_interp_method(1)=PSMILe_bilinear)
=> prismtrs_linear_weight_for_2d1d (ila_interp_method(2)=DEFAULT)
Apply the weights to calculate the interpolated transient field :

=> prismtrs_apply_weights_2dcons (ila_interp_method(1)=PSMILe_conserv2D)
=> prismtrs_apply_grads (ila_interp_method(1)/=PSMILe_conserv2D + bicubic gradient(il_method=gardient))
=> prismtrs_apply_weights (other interpolations)
=> primsdrv_enqueue_in_field_dble
=> primsdrv_enqueue_in_field_real
=> primsdrv_enqueue_in_field_int
=> prismdrv_enqueue_glob_sum_dble
=> prismdrv_enqueue_glob_sum_dble
=> prismdrv_enqueue_glob_sum_int
=> prismtrs_target_int
=> prismtrs_target_real
=> prismtrs_target_dble
=> prismdrv_dequeue_in_field_dble
=> prismdrv_dequeue_glob_sum_dble
Prismdrv_finalize