Back to OASIS4 home

Arborescence of the Psmile (in oasis4/lib/psmile_oa4/src or oasis4/lib/common_oa4/src) : routines are called by each applications of the coupled model

Prism_init
(communications with prismdrv_init_appl)
=> psmile_init_datatypes
=> psmile_init_mpi1 (communications with prismdrv_init_appl)
=> psmile_def_mpi_comm (communications with prismdrv_def_mpi_comm)
=> psmile_init_mpi2
=> psmile_char2buf
=> psmile_redirstdout
=> psmile_int2char
=> psmile_def_mpi_compcomm (definition of local comm to each component Comps(i)%comm)
=> psmile_attach
=> psmile_def_datatypes
=> psmile_io_init (initialise environment for MPP_IO (comm for application ...), but separated from rest of the data exchange library)


Prism_init_comp (communications with prismdrv_init_appl)
=> psmile_get_comp_handle
=> psmile_smioc_init (communications with prismdrv_init_smioc_struct if not Appl%stand_alone)
=> get_smioc_numbers (routine called only if Appl%stand_alone mode)
=> get_unitsets_details (routine called only if Appl%stand_alone mode)
=> init_grids
=> get_grids_details (routine called only if Appl%stand_alone mode)
=> get_transi_io_numbers (routine called only if Appl%stand_alone mode)
=> init_transi (initialisation of sda_smioc_transi to Psmile_Undef)
=> get_transi_details (routine called only if Appl%stand_alone mode)
=> init_persis
=> get_persis_details
(routine called only if Appl%stand_alone mode)
=> write_grids_details
=> write_transi_details
=> write_persi_details
else data sent by the root of the Transformer (comminucations with prismdrv_init_smioc_struct)
=> psmile_io_init_comp


Prism_get_localcomm
MPI_Comm_Size
MPI_Comm_Rank
Prism_def_grid

=> psmile_store_data_grid
Prism_def_partition
=> psmile_store_data_partition
Prism_set_corners
=> psmile_cell_test_dble
Prism_set_points
=> psmile_get_method_handle
Prism_set_mask
=> psmile_get_mask_handle


Prism_def_var
=> psmile_get_field_handle
=> psmile_create_timeaxis
=> psmile_date2ju
=> psmile_ju2date
=> psmile_def_metadata
=> psmile_io_get_info_init (in module psmile_io_get.F90)
=> psmile_io_get_info (x n) (in module psmile_io_get.F90)


Prism_enddef
=> psmile_apply_user_data (new routine of Moritz : generate psmile data structures from data provided by the user which is stored in psmile_user_data)
If  (Grid_type == PRISM_Gaussreduced_regvrt or Grid_type == PRISM_Gaussreduced_sigmavrt or Grid_type == PRISM_Gridless)
=> psmile_def_grid
=> add_pair
=> psmile_def_partition
endif Grid_type
If  (Grid_type == PRISM_Gaussreduced_regvrt or Grid_type == PRISM_Gaussreduced_sigmavrt)
=> psmile_reducedgrid_map
endif  Grid_type
if  (Grid_type == PRISM_Gaussreduced_regvrt or Grid_type == PRISM_Gaussreduced_sigmavrt or Grid_type == PRISM_Gridless)
=> psmile_set_corners_3d_double
=>
psmile_set_corners_3d_real
else (other grids)
=> generate_partition_data
=> psmile_def_grid
=> add_pair
=> psmile_def_partition
=> psmile_set_corners_3d_double
=> psmile_set_corners_3d_real
endif  Grid_type
=> psmile_set_mask
=> add_pair
if  Grid_type == PRISM_Gridless
=> psmile_set_points_gridless
else
=> psmile_set_points_3d_double
=> psmile_set_points_3d_real
=> add_pair
endif  Grid_type
=> psmile_def_var
=> add_pair
=> psmile_set_userdef (read weight and addresses file and define associated gridless grid and function for nbr_in  = number of "In channels")
=> psmile_set_userdef (read weight and addresses file and define associated gridless grid and function for nbr_out  = number of "Taskout structures")
=> psmile_control_grids
=> psmile_get_act_comps
=> psmile_enddef_comp_grid
if  Grid_type == PRISM_Gaussreduced_regvrt
=> psmile_gauss_setup (to construct the auxiliary grid that will be used in psmile_mg_method_gauss2)
=> psmile_gauss_get_neighbours
=> psmile_quicksort
=> psmile_get_index
=> psmile_gauss_setup_dble
=> psmile_gauss_setup_real
endif  Grid_type
Loop on n_act_comp of one appl
=> psmile_enddef_comp
Loop on Number_of_Grids
=> psmile_get_grid_extent
=> psmile_get_grid_extent_real
=> psmile_get_grid_extent_dble (based on the corners of the grid)
=> psmile_extent_subgrid_1d_dble
=> psmile_extent_subgrid_2d_dble
=> psmile_extent_subgrid_3d_dble
=> psmile_get_grid_extent_quad
=> psmile_transform_extent_cyclic  (transformation of the coordinates of the source and the target in a common space [-180°:180°]/[-90°:90°] => new sub grids)
end loop on grids of each component
=> psmile_enddef_comp_periodic
end loop on components of one appl
=> psmile_enddef_appl (communications between applications)
=> psmile_enddef_appl_miss
=> psmile_field2grid
=> psmile_print_comp_info
Loop on  PRISM_noCompsPerProc of one appl
=> psmile_io_init_pelist
=> psmile_io_derive_pelist
=> mpp_declare_pelist
end loop on components of one appl
=> psmile_enddef_metadata
=> indexi
=> psmile_def_domains
=> psmile_open_files
=> psmile_get_initial_date (PRISM_initial_date == Experiment_start_date)
=> psmile_open_file_byid
=> psmile_write_meta
Loop on the number of Fields (Number_of_Fields_allocated)
=> psmile_write_meta_byid
end loop on the number of Fields
Loop on n_act_comp of one appl (comp_info == comp_infos(i))
=> psmile_find_intersect (calculates all the intersections between all "subgrids" of the processor that calls the routines with all grids of the other components)
=> psmile_to_be_coupled (logical function)
Loop on partitions in the common space
=> psmile_transform_extent_back (shifts the parts generated by psmile_transform_extent_cyclic back into their original coordinate range for intersections that are found in find_intersect)
end loop on the partitions in the common space
=> psmile_remove_intersect_int
=> psmile_remove_intersect (remove common intersections based on real coordinates calculated by psmile_transform_extent_back : output = dinter)
Loop on partitions in the common space
=> psmile_sel_grid_range
=> psmile_sel_grid_range_real (computes the range inter of grid contained in corner~(ibeg:iend,jbeg:jend,~nbr_corners) which contains the real intersection "dinter")
=> psmile_range_subgrid_1d_real
=> psmile_range_subgrid_2d_real
=> psmile_range_subgrid_3d_real
=> psmile_sel_grid_range_dble
=> psmile_range_subgrid_1d_dble
=> psmile_range_subgrid_2d_dble
=> psmile_range_subgrid_3d_dble
end loop on the partitions in the common space
=> psmile_is_mask_defined
=> psmile_bsend
=> psmile_mg_setup (Creation of the different grids from coarse to finest for multigrid search, lev=0 for gaussian reduced grid, lev=1 for other grids ; only one MG by grid_id))
=> psmile_mg_first_level
=> psmile_mg_first_level_real
=> psmile_mg_first_level_dble
Grid_type = PRISM_Reglonlatvrt
=> psmile_mg_first_subgrid_1d_dble
=> psmile_mg_ctrl_subgrid_1d_dble
Grid_type = PRISM_Irrlonlat_regvrt
=> psmile_mg_first_subgrid_2d_dble
=> psmile_mg_first_subgrid_1d_dble
=> psmile_mg_ctrl_subgrid_2d_dble
Grid_type = PRISM_Gaussreduced_regvrt
=> psmile_mg_first_subgrid_1d_dble
=> psmile_mg_first_subgrid_1d_dble
=> psmile_mg_ctrl_subgrid_1d_dble
Grid_type = PRISM_Irrlonlatvrt
=> psmile_mg_first_subgrid_3d_dble
=> psmile_mg_ctrl_subgrid_3d_dble
endif  Grid_type
=> psmile_mg_first_level_quad
=> psmile_mg_coars_level
=> psmile_mg_coars_level_real
=> psmile_mg_coars_level_dble
=> psmile_mg_coars_subgrid_3d_dble (dim i=1)
=> psmile_mg_coars_level_quad
gp%grid_type == PRISM_Gaussreduced_regvrt
=>
psmile_mg_first_level for lev=0 and simplified_grid = .false. with the entire shape of the gaussina reduced grid
=> psmile_mg_get_cyclic
end loop on n_act_comp of one appl
Loop on Number_of_Comps_allocated
=> psmile_get_halo_indices (halos will be used in the construction of the method point grid when searching the lower left closer source point, see psmile_mg_method_irreg2_*)
=> psmile_get_halo_points
end loop on Number_of_Comps_allocated
=> psmile_get_intersect (receives the messages sent from routine "PSMILe_find_intersect", performs the actions required from other processes (enddef_action) and performs the search of donor cells)
=> psmile_nullify_enddef_search
if index = 3 of MPI_Waitany after posting some requests
=> psmile_search_donor_cells
=> psmile_find_corr_field (search corresponding field with global transout id "id_transout" for this component "comp_id" and grid "grid_id")
Grids(grid_id)%grid_type == PRISM_Gridless (source grid)
=> psmile_search_donor_gridless
end of prism_gridless

=> psmile_transform_coords (transforms the coordinates to be seached into the coordinate space of the source grid)
=> psmile_transform_coords_db_re (with dble args ; defined in psmile_transform_extent)
=> psmile_transform_coords_db_re (with real args ; defined in psmile_transform_extent)
=> psmile_mg_search (creates the found and locations arrays and filles them with the inital results of the multigrid search)
=>  psmile_mg_search_1d_dble (regular in all 3 directions)
Loop on the number of intersections (ipart = 1,search%npart)
=> psmile_mg_search_2d_dble + psmile_mg_search_1d_dble (irregular in lonlat direction, regular in vertical direction)
=> psmile_mg_coarse_2d_dble
=> psmile_mg_next_level_2d_dble
=> psmile_mg_final_2d_dble (get final locations controlling the real cells)
end loop over the number of intersections
=> psmile_mg_search_3d_dble (irregular in lonlat and vertical direction)
Grid_type = PRISM_Reglonlatvrt
Grid_type = PRISM_Gaussreduced_regvrt
=> psmile_search_donor_gauss2_dble
=> psmile_transform_gauss2 (to get arrays found and locations on the initial gaussian reduced grid because for gaussian reduced grid the search is done on a reglonlatvrtgrid type)
if  Method grid type
=> psmile_mg_final_gauss2_dble (searches the final locations found and locations on the real grid)
=>
psmile_bbcells_1d_dble (computes boxes for the cells)
=>
psmile_mg_method_gauss2_dble (searches the donor cells (lower left point) for the subgrid sent by the target sending process)
=> psmile_mg_method_1d_dble
else if  (2D or 3D conservative interpolation)
=> psmile_compact_locations (eliminate double entries)
if search%grid_type == PRISM_Irrlonlatvrt or search%grid_type == PRISM_Reglonlatvrt or search%grid_type == PRISM_Irrlonlat_Regvrt
=>
psmile_mg_found_loc_to_3d (transforms the input fields "found" and "locations" (containing the results of the MG search) into the fully 3d versions of that fields)
=> psmile_locations_3d (stores the data on locations found for the method (grid) and the subgrid coords)
if (ncpl > 0) then
=> psmile_get_info_index
=> psmile_locations_alloc
Loop over the number of intersections (ipart = 1, search%npart)
=> psmile_store_dest_locs_3d
=> psmile_store_source_locs_3d
if (msk_required) then
=> psmile_store_mask_locs_3d
if (virtual_cell_required) then
=> psmile_store_source_virt_3d
endif
endif
endif
end loop over the intersections
if (ndir > 0) then
=> psmile_get_info_index
=> psmile_locations_alloc
Loop over the number of intersections (ipart = 1, search%npart)
=> psmile_store_dest_locs_3d
=> psmile_store_source_locs_3d
endif
end loop over the intersections
if search%grid_type == PRISM_Gaussreduced_Regvrt
=> psmile_locations_gauss2
endif  search%grid_type
endif  type of interpolation
=> psmile_info_trs_loc_gauss2_dble (if cpl_index /= prism_undefined) else psmile_bsend
(informs the coupler/transformer on the data to be interpolated for the method (grid) and the subgrid coords of the sending process "search%sender")
=> psmile_neigh_trili_gauss2 (the star was found, now find the other neighbours)
=> psmile_get_epio_handle
=> psmile_trs_set_triple_links
=> psmile_trs_set_src_epio3d_dble (communications with prismtrs_loop and prismtrs_set_src_epio_dble)
=> psmile_trs_inform (communications with T)
=> psmile_trs_set_tgt_epio3d_dble (communications with prismtrs_loop and prismtrs_set_tgt_epio_dble)
=> psmile_trs_set_triple_links (communications with TO DO)
=> psmile_trs_give_neighcells3d (for conservative, communications with prismtrs_loop and prismtrs_set_neighbors3d)
=> psmile_trs_give_neighbors_gauss (communications with prismtrs_loop and prismtrs_set_neighbors3d)
=> psmile_locations_dealloc
=> psmile_store_send_info
=> psmile_return_locations_3d
=> psmile_get_next_field


Grid_type = PRISM_Irrlonlat_regvrt
=> psmile_search_donor_irreg2_dble
if  search%grid_type == PRISM_Reglonlatvrt (target grid)
=> psmile_srch_coords_reg_21d_dble (transforms search coordinates from grids of type "PRISM_Reglonlatvrt" into search coordinates for  grids of type "PRISM_irrlonlat_regvrt")
endif  search%grid_type
2D or 3D conservative interpolation (compute bounding boxes for the cells)
=> psmile_bbcells_1d_dble
=> psmile_mg_cells_2d_dble
=> psmile_mg_method_1d_dble
=> psmile_mg_cells_1d_dble
else (method point)
=> psmile_mg_method_irreg2_dble (searches the donor cells for the subgrid sent by the target sending process for irrlonlatregvrt source grid)
=> psmile_bbcells_virt_2d_dble (computes the bounding box for each virtual cell of the 2-dimensional block <=> halos)
Loop over 2 first dimensions
=> psmile_bbcells_2d_dble (computes the bounding box for each cell contained in the proc in the (i,j))
End loop
=> psmile_bbcells_1d_dble (computes the bounding box for each cell contained in the proc for k)
=> psmile_bbcells_pole_dble (correction for the pole cells)
=> psmile_transform_cell_cyclic
=> compute_midpoint
=> psmile_transrot_dble
=> psmile_transrot_back_dble
Loop on the number of intersections (ipart = 1,search%npart)
=> psmile_mg_method_2d_dble (get locations star in first 2 irregular directions (i,j))
=> psmile_transrot_dble (if the coordinates of the source cell is close to the pole call this routine)
=>
psmile_transform_cell_cyclic
=> psmile_mg_method_1d_dble (get locations star in 3rd regular direction k)
end loop over the number of intersections
endif  (conservative or method point)
=> psmile_compact_locations
=> psmile_mg_found_loc_to_3d
=> psmile_locations_3d
Generate send areas for data send to a coupler process
=> psmile_get_info_index
=> psmile_locations_alloc
=> psmile_store_dest_locs_3d
=> psmile_store_source_locs_3d
=> psmile_store_mask_locs_3d
=> psmile_store_source_virt_3d
Generate send areas for data with application process
=> psmile_get_info_index
=> psmile_locations_alloc
=> psmile_store_dest_locs_3d
=> psmile_store_source_locs_3d
=> psmile_locations_irreg2
=> psmile_info_trs_loc_irreg2_dble
=> psmile_extract_indices_2d_dble
=> psmile_extract_indices_3d_dble
=> psmile_neigh_extra_search_init
Look for neighbours depending on the interpolation
=> psmile_info_coords_irreg2_dble (transform coords of source grid)
=> psmile_neigh_near_irr2_3d_dble (look for nearest neighbours)
=> psmile_neigh_near_irreg2_dble (look for nearest neighbours)
=> psmile_neigh_tricu_3d (look for nearest neighbours)
=> psmile_neigh_trili_3d (look for nearest neighbours from location found during the search)
=> psmile_neigh_tricu_irreg2 (look for nearest neighbours)
=> psmile_neigh_trili_irreg2 (look for nearest neighbours)
=> psmile_neigh_cells_3d_dble (look for nearest neighbours)
=> psmile_neigh_cells_irreg2_dble (look for nearest neighbours)
=> psmile_neigh_cells_3d_reg_dble (look for nearest neighbours)
=> psmile_neigh_global_points
=> psmile_global_search_dble
=> psmile_neigh_extra_points (checks which points will need extra search depending of the option if_masked)
=> psmile_neigh_extra_search_dble (search extra points)
=> psmile_info_coords_irreg2_dble (search extra points)
=> psmile_neigh_nearx_irr2_3d_dble (search extra points)
=> psmile_neigh_nearx_irreg2_dble (search extra points)
=> psmile_global_search_nnx_dble (search extra points)
=> psmile_neigh_extra_search_clean
=> psmile_compact_neighbors_3d
=> psmile_move0_neighbors
=> psmile_ccompact_irreg2_dble
=> psmile_compact_neighbors_3d
=> psmile_ext_compact_list_log2int
=> psmile_ext_compact_irreg2_dble
=> psmile_print_irreg2_coord_dble
=> psmile_print_3d_coord_dble
=> psmile_get_epio_handle
=> psmile_trs_set_triple_links
=> psmile_trs_set_src_epio3d_dble (communications with prismtrs_loop and prismtrs_set_src_epio_dble)
=> psmile_trs_inform (communications with T)
=> psmile_trs_set_tgt_epio3d_dble (communications with prismtrs_loop and prismtrs_set_tgt_epio_dble)
=> psmile_trs_set_triple_links (communications with )
=> psmile_trs_give_neighcells3d (for conservative, communications with prismtrs_loop and prismtrs_set_neighbors3d)
=> psmile_trs_give_neighbors3d
(communications with prismtrs_loop and prismtrs_set_neighbors3d)
=> psmile_locations_dealloc
=> psmile_init_enddef_msg_locs
=> psmile_pack_msg_locations
=> psmile_bsend
=> psmile_store_send_info
=> psmile_return_locations_3d
=> psmile_get_next_field
=>


if index = 2 of MPI_Waitany after posting some requests => perform actions
=> psmile_enddef_action (performs the action required after a request/message from another process was received)
=> psmile_init_enddef_msg_inters
=> psmile_unpack_msg_intersections
=> psmile_bsend
=> psmile_recv_req_subgrid
if (search%search_data%grid_type == PRISM_Gridless) then
=> psmile_recv_req_mask
if index = 1 of MPI_Waitany after posting some requests => perform actions
=> psmile_send_req_subgrid
=> psmile_enddef_action_cell
=> psmile_enddef_action_loc
=> psmile_recv_req_subgrid
=> psmile_enddef_action_extra
=> psmile_enddef_action_sel
=> psmile_enddef_action_cell
=> psmile_enddef_action_loc
=> psmile_print_send_info
=> psmile_mg_clean
=> psmile_get_restart
=> psmile_print_grid_info
=> psmile_print_field_info
=> psmile_print_method_info
=> psmile_merge_fields


Prism_calc_newdate
Prism_put
=> psmile_date2ju
If User def is defined
=> psmile_gridless_func_dble (calculates gridless function = weights*source_function)
=> psmile_check_action
=> psmile_put_int
=> psmile_put_real
=> psmile_put_dble
=> psmile_loc_trans_dble
=> psmile_multi_reduce_dble
=> psmile_write_byid_dble
=> psmile_put_field_dble
Send the data which can be sent directly to application processes
=> psmile_bsend
=> psmile_put_irr_field_dble
=> psmile_put_field_gauss2_dble
=> psmile_put_field_21d_dble
=> psmile_put_field_3d_dble
End sending directly data to application processes
=> psmile_extract_indices_3d_dble
=> psmile_bsend
=> MPI_Irecv
=> psmile_ext_compact_list_3d_dble
=> psmile_global_sum_compute_dble
=> psmile_ddadd
=> psmile_trs_put_dble (communications with prismtrs_loop and prismtrs_mind_dble)
=> psmile_global_sum_send_dble
(communications with prismtrs_mind_dble)


Prism_get
=> psmile_date2ju
=> psmile_check_action
If User defined is defined
=> psmile_get_dble (get the gridless function = weights*source_function)
=> psmile_gridless_func_dble (accumulates the gridless function on the target grid)
Else
=> psmile_get_int
=> psmile_get_real
=> psmile_get_dble
=> psmile_read_byid_dble
=> psmile_get_field_dble
=> psmile_get_irr_field_dble
=> psmile_trs_get_dble (communications with prismtrs_loop and prismtrs_target_dble or prismtrs_mind_dble)
=> psmile_trs_inform
=> psmile_put_compact_list_3d_dble
=> psmile_write_byid_dble
=> psmile_loc_trans_dble
=> psmile_multi_reduce_dble


Prism_terminate
=> psmile_io_finalize
=> MPI_Finalized
=> MPI_Barrier
=> psmile_trs_finalize
=> psmile_deallocate