00001
00002
00003
00004
00005
00006 SUBROUTINE get_grids_details ( id_XML_doc, &
00007 id_nb_grids, &
00008 cda_app_name, &
00009 cda_comp_name, &
00010 sda_smioc_grids, &
00011 id_error )
00012
00013
00014
00015
00016
00017
00018
00019 USE PSMILe_smioc
00020 IMPLICIT NONE
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 INTEGER, INTENT(In) :: id_XML_doc
00039
00040
00041 INTEGER, INTENT(In) :: id_nb_grids
00042
00043
00044 CHARACTER(len=*), INTENT(In) :: cda_app_name
00045 CHARACTER(len=*), INTENT(In) :: cda_comp_name
00046
00047
00048 TYPE (smioc_grid), DIMENSION(id_nb_grids), INTENT(Out) :: sda_smioc_grids
00049
00050
00051 INTEGER, INTENT(Out) :: id_error
00052
00053 #if CIM
00054 INTEGER :: sasa_c_get_element_7th_level_c
00055 CHARACTER(len=max_name+44) :: cla_model_appli
00056 CHARACTER(len=max_name+44) :: cla_model_comp
00057 #else
00058 INTEGER :: sasa_c_convert_char2int
00059 INTEGER :: sasa_c_get_attri_2nd_level, sasa_c_get_attri_3rd_level
00060 INTEGER :: sasa_c_get_attri_4th_level, sasa_c_get_attri_5th_level
00061 INTEGER :: sasa_c_get_element_5th_level_i
00062 INTEGER :: sasa_c_get_element_5th_level_d
00063 INTEGER :: sasa_c_get_number_3rd_level
00064 #endif
00065
00066 CHARACTER(LEN=max_name) :: cla_char
00067 INTEGER :: ib, ib_bis, ib_ind, il_index
00068
00069 INTEGER :: il_length
00070
00071
00072
00073 #if CIM
00074
00075
00076 cla_model_appli = 'modelComponent[normalize-space(shortName)="'//TRIM(cda_app_name)//'"]'
00077 cla_model_comp = 'modelComponent[normalize-space(shortName)="'//TRIM(cda_comp_name)//'"]'
00078 #endif
00079
00080 DO ib =1, id_nb_grids
00081
00082 #if CIM
00083
00084
00085
00086
00087 sda_smioc_grids(ib)%cg_grid_name = ' '
00088 id_error = &
00089 sasa_c_get_element_7th_level_c (id_XML_doc, &
00090 "simulationComposite/child/simulationRun/model/modelComponent", 0, &
00091 "childComponent", 0, TRIM(cla_model_appli), 0, "childComponent", 0, &
00092 TRIM(cla_model_comp), 0, "grid", ib, "reference", 0, "name", 0, &
00093 sda_smioc_grids(ib)%cg_grid_name, il_length )
00094
00095
00096
00097
00098 sda_smioc_grids(ib)%iga_periodic(1) = .true.
00099
00100 #else
00101
00102
00103
00104
00105 id_error = &
00106 sasa_c_get_attri_2nd_level (id_XML_doc, &
00107 'component', 0, 'grid', ib, 'local_name', &
00108 sda_smioc_grids(ib)%cg_grid_name, il_length)
00109
00110
00111 id_error = &
00112 sasa_c_get_number_3rd_level(id_XML_doc, &
00113 'component', 0, 'grid', ib, 'indexing_dimension',&
00114 ib_ind)
00115
00116 IF (ib_ind > 0) THEN
00117 DO ib_bis = 1, ib_ind
00118 id_error = &
00119 sasa_c_get_attri_3rd_level (id_XML_doc, &
00120 'component', 0, 'grid', ib, 'indexing_dimension', &
00121 ib_bis, 'index', cla_char, il_length)
00122
00123 IF (id_error .EQ. 0) THEN
00124 READ (cla_char, *) il_index
00125 ELSE
00126 PRINT *, '****************************************************'
00127 PRINT *, 'Problem in reading index in indexing_dimension '
00128 PRINT *, '****************************************************'
00129 CALL PSMILe_Flushstd
00130 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00131 ENDIF
00132
00133 id_error = &
00134 sasa_c_get_attri_3rd_level (id_XML_doc, &
00135 'component', 0, 'grid', ib, 'indexing_dimension', &
00136 ib_bis, 'periodic', cla_char, il_length)
00137 IF (id_error .EQ. 0) THEN
00138 sda_smioc_grids(ib)%iga_periodic(il_index) = &
00139 sasa_c_convert_char2int(cla_char(1:il_length))
00140 ENDIF
00141
00142 END DO
00143 ENDIF
00144 #endif
00145
00146 END DO
00147
00148 END SUBROUTINE get_grids_details
00149
00150
00151