00001
00002
00003
00004
00005
00006
00007 SUBROUTINE get_smioc_numbers ( id_XML_doc, &
00008 id_nb_unitsets, &
00009 id_nb_grids, &
00010 id_nb_transi, &
00011 id_nb_persis, &
00012 id_comp, &
00013 cda_app_name, &
00014 cda_comp_name, &
00015 ld_userdef_details, &
00016 id_error )
00017
00018
00019
00020
00021
00022
00023
00024 USE PSMILe_smioc
00025 IMPLICIT NONE
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 INTEGER, INTENT(In) :: id_XML_doc
00037
00038
00039 INTEGER, INTENT(Out) :: id_nb_unitsets
00040
00041
00042 INTEGER, INTENT(Out) :: id_nb_grids
00043
00044
00045 INTEGER, INTENT(Out) :: id_nb_transi
00046
00047
00048 INTEGER, INTENT(Out) :: id_nb_persis
00049
00050
00051 INTEGER, INTENT(In) :: id_comp
00052
00053
00054 CHARACTER(len=*), INTENT(In) :: cda_app_name
00055 CHARACTER(len=*), INTENT(In) :: cda_comp_name
00056
00057
00058 LOGICAL, INTENT(In) :: ld_userdef_details
00059
00060
00061 INTEGER, INTENT(Out) :: id_error
00062
00063 #if CIM
00064 INTEGER :: sasa_c_get_number_10th_level, sasa_c_get_number_11th_level
00065 CHARACTER(len=max_name+44) :: cla_model_appli
00066 CHARACTER(len=max_name+44) :: cla_model_comp
00067 #else
00068 INTEGER :: sasa_c_get_number_2nd_level, sasa_c_get_number_3rd_level
00069 INTEGER :: sasa_c_get_number_1st_level, il_nbpc
00070 #endif
00071
00072
00073
00074
00075 #if CIM
00076
00077
00078
00079
00080
00081 cla_model_appli = 'modelComponent[normalize-space(shortName)="'//TRIM(cda_app_name)//'"]'
00082 cla_model_comp = 'modelComponent[normalize-space(shortName)="'//TRIM(cda_comp_name)//'"]'
00083
00084 id_error = &
00085 sasa_c_get_number_10th_level (id_XML_doc, &
00086 "simulationComposite", 0, "child", 0, "simulationRun", 0, "model", 0, "modelComponent", 0, &
00087 "childComponent", 0, TRIM(cla_model_appli), 0, "childComponent", 0, &
00088 TRIM(cla_model_comp), 0, "grid", id_nb_grids)
00089
00090 id_error = &
00091 sasa_c_get_number_11th_level (id_XML_doc, &
00092 "simulationComposite", 0, "child", 0, "simulationRun", 0, "model", 0, "modelComponent", 0, &
00093 "childComponent", 0, TRIM(cla_model_appli), 0, "childComponent", 0, &
00094 TRIM(cla_model_comp), 0, "componentProperties", 0, "componentProperty", id_nb_transi)
00095
00096 id_nb_unitsets = 0
00097 id_nb_persis = 0
00098
00099 #else
00100
00101
00102
00103 il_nbpc = 0
00104 id_error = &
00105 sasa_c_get_number_1st_level(id_XML_doc, &
00106 'prismcomponent', il_nbpc)
00107 IF (il_nbpc == 1) THEN
00108 PRINT *, '******************************************************'
00109 PRINT *, 'Since SVN revision 2633, "prismcomponent" must be '
00110 PRINT *, 'replaced by "component" in all SMIOC XML file'
00111 PRINT *, '******************************************************'
00112 CALL PSMILe_Flushstd
00113 CALL MPI_Abort(MPI_COMM_WORLD, 1, id_error)
00114 ENDIF
00115
00116 id_error = &
00117 sasa_c_get_number_3rd_level(id_XML_doc, 'component', 0, &
00118 'code', 0, 'Fortran_units', id_nb_unitsets)
00119 print *,' get_smioc_numbers id_error units = ',id_error
00120
00121 id_error = &
00122 sasa_c_get_number_2nd_level(id_XML_doc, &
00123 'component', 0, 'grid', id_nb_grids)
00124 print *,' get_smioc_numbers id_error grids = ',id_error
00125
00126 id_error = &
00127 sasa_c_get_number_2nd_level(id_XML_doc, &
00128 'component', 0, 'transient', id_nb_transi)
00129 print *,' get_smioc_numbers id_error transi = ',id_error
00130
00131 id_error = &
00132 sasa_c_get_number_2nd_level(id_XML_doc, &
00133 'component', 0, 'persistent', id_nb_persis)
00134 print *,' get_smioc_numbers id_error persist = ',id_error
00135 #endif
00136
00137
00138
00139
00140 if ( ld_userdef_details ) then
00141 id_nb_transi = id_nb_transi + iga_comp_nb_udef(id_comp)
00142 id_nb_grids = id_nb_grids + iga_comp_nb_udef(id_comp)
00143 endif
00144
00145 END SUBROUTINE get_smioc_numbers
00146
00147