text:
-makelib ies_lib/xilinx_vip -sv \
  "G:/Xilinx/Vivado/2018.3/data/xilinx_vip/hdl/axi4stream_vip_axi4streampc.sv" \
  "G:/Xilinx/Vivado/2018.3/data/xilinx_vip/hdl/axi_vip_axi4pc.sv" \
  "G:/Xilinx/Vivado/2018.3/data/xilinx_vip/hdl/xil_common_vip_pkg.sv" \
  "G:/Xilinx/Vivado/2018.3/data/xilinx_vip/hdl/axi4stream_vip_pkg.sv" \
  "G:/Xilinx/Vivado/2018.3/data/xilinx_vip/hdl/axi_vip_pkg.sv" \
  "G:/Xilinx/Vivado/2018.3/data/xilinx_vip/hdl/axi4stream_vip_if.sv" \
  "G:/Xilinx/Vivado/2018.3/data/xilinx_vip/hdl/axi_vip_if.sv" \
  "G:/Xilinx/Vivado/2018.3/data/xilinx_vip/hdl/clk_vip_if.sv" \
  "G:/Xilinx/Vivado/2018.3/data/xilinx_vip/hdl/rst_vip_if.sv" \
-endlib
-makelib ies_lib/xil_defaultlib -sv \
  "G:/Xilinx/Vivado/2018.3/data/ip/xpm/xpm_cdc/hdl/xpm_cdc.sv" \
  "G:/Xilinx/Vivado/2018.3/data/ip/xpm/xpm_fifo/hdl/xpm_fifo.sv" \
  "G:/Xilinx/Vivado/2018.3/data/ip/xpm/xpm_memory/hdl/xpm_memory.sv" \
-endlib
-makelib ies_lib/xpm \
  "G:/Xilinx/Vivado/2018.3/data/ip/xpm/xpm_VCOMP.vhd" \
-endlib
-makelib ies_lib/axi_infrastructure_v1_1_0 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/ec67/hdl/axi_infrastructure_v1_1_vl_rfs.v" \
-endlib
-makelib ies_lib/axi_vip_v1_1_4 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/98af/hdl/axi_vip_v1_1_vl_rfs.sv" \
-endlib
-makelib ies_lib/processing_system7_vip_v1_0_6 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/70cf/hdl/processing_system7_vip_v1_0_vl_rfs.sv" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_processing_system7_0_0/sim/ov5640_hdmi_design_processing_system7_0_0.v" \
  "../../../bd/ov5640_hdmi_design/ipshared/45ee/cmos_cfg.v" \
  "../../../bd/ov5640_hdmi_design/ipshared/45ee/cmos_data_capture.v" \
  "../../../bd/ov5640_hdmi_design/ipshared/45ee/cmos_wr_driver.v" \
  "../../../bd/ov5640_hdmi_design/ipshared/45ee/coms_capture.v" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_ddr3_hdmi_ov5640_0_0/sim/ov5640_hdmi_design_ddr3_hdmi_ov5640_0_0.v" \
-endlib
-makelib ies_lib/v_vid_in_axi4s_v4_0_9 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/b2aa/hdl/v_vid_in_axi4s_v4_0_vl_rfs.v" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_v_vid_in_axi4s_0_0/sim/ov5640_hdmi_design_v_vid_in_axi4s_0_0.v" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_clk_wiz_0_0/ov5640_hdmi_design_clk_wiz_0_0_clk_wiz.v" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_clk_wiz_0_0/ov5640_hdmi_design_clk_wiz_0_0.v" \
-endlib
-makelib ies_lib/util_vector_logic_v2_0_1 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/2137/hdl/util_vector_logic_v2_0_vl_rfs.v" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_util_vector_logic_0_0/sim/ov5640_hdmi_design_util_vector_logic_0_0.v" \
-endlib
-makelib ies_lib/lib_cdc_v1_0_2 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/ef1e/hdl/lib_cdc_v1_0_rfs.vhd" \
-endlib
-makelib ies_lib/lib_pkg_v1_0_2 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/0513/hdl/lib_pkg_v1_0_rfs.vhd" \
-endlib
-makelib ies_lib/fifo_generator_v13_2_3 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/64f4/simulation/fifo_generator_vlog_beh.v" \
-endlib
-makelib ies_lib/fifo_generator_v13_2_3 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/64f4/hdl/fifo_generator_v13_2_rfs.vhd" \
-endlib
-makelib ies_lib/fifo_generator_v13_2_3 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/64f4/hdl/fifo_generator_v13_2_rfs.v" \
-endlib
-makelib ies_lib/lib_fifo_v1_0_12 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/544a/hdl/lib_fifo_v1_0_rfs.vhd" \
-endlib
-makelib ies_lib/blk_mem_gen_v8_4_2 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/37c2/simulation/blk_mem_gen_v8_4.v" \
-endlib
-makelib ies_lib/lib_bmg_v1_0_11 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/556c/hdl/lib_bmg_v1_0_rfs.vhd" \
-endlib
-makelib ies_lib/lib_srl_fifo_v1_0_2 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/51ce/hdl/lib_srl_fifo_v1_0_rfs.vhd" \
-endlib
-makelib ies_lib/axi_datamover_v5_1_20 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/dfb3/hdl/axi_datamover_v5_1_vh_rfs.vhd" \
-endlib
-makelib ies_lib/axi_vdma_v6_3_6 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/58e2/hdl/axi_vdma_v6_3_rfs.v" \
-endlib
-makelib ies_lib/axi_vdma_v6_3_6 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/58e2/hdl/axi_vdma_v6_3_rfs.vhd" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_vdma_0_0/sim/ov5640_hdmi_design_axi_vdma_0_0.vhd" \
-endlib
-makelib ies_lib/axi_lite_ipif_v3_0_4 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/66ea/hdl/axi_lite_ipif_v3_0_vh_rfs.vhd" \
-endlib
-makelib ies_lib/v_tc_v6_1_13 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/a92c/hdl/v_tc_v6_1_vh_rfs.vhd" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_v_tc_0_0/sim/ov5640_hdmi_design_v_tc_0_0.vhd" \
-endlib
-makelib ies_lib/v_axi4s_vid_out_v4_0_10 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/a87e/hdl/v_axi4s_vid_out_v4_0_vl_rfs.v" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_v_axi4s_vid_out_0_0/sim/ov5640_hdmi_design_v_axi4s_vid_out_0_0.v" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_util_vector_logic_1_0/sim/ov5640_hdmi_design_util_vector_logic_1_0.v" \
  "../../../bd/ov5640_hdmi_design/ipshared/2679/encode.v" \
  "../../../bd/ov5640_hdmi_design/ipshared/2679/parallel_to_serial.v" \
  "../../../bd/ov5640_hdmi_design/ipshared/2679/hdmi_trans.v" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_hdmi_trans_0_0/sim/ov5640_hdmi_design_hdmi_trans_0_0.v" \
-endlib
-makelib ies_lib/xlconstant_v1_1_5 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/4649/hdl/xlconstant_v1_1_vl_rfs.v" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_xlconstant_0_0/sim/ov5640_hdmi_design_xlconstant_0_0.v" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/sim/bd_c6bb.v" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_0/sim/bd_c6bb_one_0.v" \
-endlib
-makelib ies_lib/proc_sys_reset_v5_0_13 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/8842/hdl/proc_sys_reset_v5_0_vh_rfs.vhd" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_1/sim/bd_c6bb_psr_aclk_0.vhd" \
-endlib
-makelib ies_lib/smartconnect_v1_0 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/979d/hdl/sc_util_v1_0_vl_rfs.sv" \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/c012/hdl/sc_switchboard_v1_0_vl_rfs.sv" \
-endlib
-makelib ies_lib/xil_defaultlib -sv \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_2/sim/bd_c6bb_arsw_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_3/sim/bd_c6bb_rsw_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_4/sim/bd_c6bb_awsw_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_5/sim/bd_c6bb_wsw_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_6/sim/bd_c6bb_bsw_0.sv" \
-endlib
-makelib ies_lib/smartconnect_v1_0 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/f85e/hdl/sc_mmu_v1_0_vl_rfs.sv" \
-endlib
-makelib ies_lib/xil_defaultlib -sv \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_7/sim/bd_c6bb_s00mmu_0.sv" \
-endlib
-makelib ies_lib/smartconnect_v1_0 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/ca72/hdl/sc_transaction_regulator_v1_0_vl_rfs.sv" \
-endlib
-makelib ies_lib/xil_defaultlib -sv \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_8/sim/bd_c6bb_s00tr_0.sv" \
-endlib
-makelib ies_lib/smartconnect_v1_0 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/9ade/hdl/sc_si_converter_v1_0_vl_rfs.sv" \
-endlib
-makelib ies_lib/xil_defaultlib -sv \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_9/sim/bd_c6bb_s00sic_0.sv" \
-endlib
-makelib ies_lib/smartconnect_v1_0 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/b89e/hdl/sc_axi2sc_v1_0_vl_rfs.sv" \
-endlib
-makelib ies_lib/xil_defaultlib -sv \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_10/sim/bd_c6bb_s00a2s_0.sv" \
-endlib
-makelib ies_lib/smartconnect_v1_0 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/b2d0/hdl/sc_node_v1_0_vl_rfs.sv" \
-endlib
-makelib ies_lib/xil_defaultlib -sv \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_11/sim/bd_c6bb_sarn_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_12/sim/bd_c6bb_srn_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_13/sim/bd_c6bb_s01mmu_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_14/sim/bd_c6bb_s01tr_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_15/sim/bd_c6bb_s01sic_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_16/sim/bd_c6bb_s01a2s_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_17/sim/bd_c6bb_sawn_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_18/sim/bd_c6bb_swn_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_19/sim/bd_c6bb_sbn_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_20/sim/bd_c6bb_s02mmu_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_21/sim/bd_c6bb_s02tr_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_22/sim/bd_c6bb_s02sic_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_23/sim/bd_c6bb_s02a2s_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_24/sim/bd_c6bb_sarn_1.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_25/sim/bd_c6bb_srn_1.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_26/sim/bd_c6bb_s03mmu_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_27/sim/bd_c6bb_s03tr_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_28/sim/bd_c6bb_s03sic_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_29/sim/bd_c6bb_s03a2s_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_30/sim/bd_c6bb_sawn_1.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_31/sim/bd_c6bb_swn_1.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_32/sim/bd_c6bb_sbn_1.sv" \
-endlib
-makelib ies_lib/smartconnect_v1_0 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/7005/hdl/sc_sc2axi_v1_0_vl_rfs.sv" \
-endlib
-makelib ies_lib/xil_defaultlib -sv \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_33/sim/bd_c6bb_m00s2a_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_34/sim/bd_c6bb_m00arn_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_35/sim/bd_c6bb_m00rn_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_36/sim/bd_c6bb_m00awn_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_37/sim/bd_c6bb_m00wn_0.sv" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_38/sim/bd_c6bb_m00bn_0.sv" \
-endlib
-makelib ies_lib/smartconnect_v1_0 -sv \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/b387/hdl/sc_exit_v1_0_vl_rfs.sv" \
-endlib
-makelib ies_lib/xil_defaultlib -sv \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/bd_0/ip/ip_39/sim/bd_c6bb_m00e_0.sv" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_smc_0/sim/ov5640_hdmi_design_axi_smc_0.v" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_rst_ps7_0_50M_0/sim/ov5640_hdmi_design_rst_ps7_0_50M_0.vhd" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/sim/ov5640_hdmi_design.v" \
-endlib
-makelib ies_lib/generic_baseblocks_v2_1_0 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/b752/hdl/generic_baseblocks_v2_1_vl_rfs.v" \
-endlib
-makelib ies_lib/axi_register_slice_v2_1_18 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/cc23/hdl/axi_register_slice_v2_1_vl_rfs.v" \
-endlib
-makelib ies_lib/axi_data_fifo_v2_1_17 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/c4fd/hdl/axi_data_fifo_v2_1_vl_rfs.v" \
-endlib
-makelib ies_lib/axi_crossbar_v2_1_19 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/6c9d/hdl/axi_crossbar_v2_1_vl_rfs.v" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_xbar_0/sim/ov5640_hdmi_design_xbar_0.v" \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/7eb5/hdl/verilog/image_filter_CTRL_BUS_s_axi.v" \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/7eb5/hdl/verilog/image_filter_mac_bkb.v" \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/7eb5/hdl/verilog/image_filter.v" \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_image_filter_0_0/sim/ov5640_hdmi_design_image_filter_0_0.v" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_axi_vdma_1_0/sim/ov5640_hdmi_design_axi_vdma_1_0.vhd" \
-endlib
-makelib ies_lib/axi_protocol_converter_v2_1_18 \
  "../../../../XC7Z020_316_ES_ConerDetect.srcs/sources_1/bd/ov5640_hdmi_design/ipshared/7a04/hdl/axi_protocol_converter_v2_1_vl_rfs.v" \
-endlib
-makelib ies_lib/xil_defaultlib \
  "../../../bd/ov5640_hdmi_design/ip/ov5640_hdmi_design_auto_pc_0/sim/ov5640_hdmi_design_auto_pc_0.v" \
-endlib
-makelib ies_lib/xil_defaultlib \
  glbl.v
-endlib

max_stars_repo_name: NekoSilverFox/CornerDetectionOnZYNQ

max_issues_repo_name: NekoSilverFox/CornerDetectionOnZYNQ

max_forks_repo_name: NekoSilverFox/CornerDetectionOnZYNQ


text:
subroutine  ale_Reabcs(a,itask,kflag)
   ! NAME
   !    ale_reabcs
   ! DESCRIPTION
   !    This routine reads the specific boundary conditions for NSTINC.
   !
   !    For conditions on nodes, bvess(idime,ipoin,1) contains the
   !    velocity value.
   !    The different codes for kfl_fixno_nsi(ipoin) are:
   !    = 1 ... Dirichlet
   !    = 0 ... Free Surface
   !    = 2 ... Not Fixed: we transform it to -1
   !
   !
   !------------------------------------------------------------------------
   use MPI
   use typre
   use Mod_AleMov
   implicit none

   class(AlemovProblem) :: a
   integer(ip) :: itask
   integer(ip), optional :: kflag

   integer(ip) :: iboun,ipoin,idime,ndime
   integer(ip) :: nboun,npoin

   character(150) :: outstr

   !Periodic boundary conditions
   integer(ip) :: kfl_perio

   !MPI
   integer :: ierr

   !Initializations
   if (itask == 0) then

   !Header
   elseif(itask == 1) then

    !Finalization
   elseif(itask == 100) then

     !We transform fixno 2 to -1
     !For legacy reasons (should be 0 but it was occupied by Free surface (apont))
     call a%Mesh%Getnpoin(npoin)
     call a%Mesh%GetNdime(ndime)
     do ipoin = 1,npoin
        do idime = 1,ndime
           if (a%kfl_fixno(idime,ipoin) == 2) a%kfl_fixno(idime,ipoin) = -1
        enddo
     enddo

   endif

end subroutine

subroutine ale_ReadOnNodes(a)
   use typre
   use Mod_AleMov
   implicit none
   class(AlemovProblem) :: a

   integer(ip) :: ndime

end subroutine

subroutine ale_ReadOnFunctions(a,ifunc)
   use typre
   use Mod_AleMov
   implicit none
   class(AlemovProblem) :: a
   integer(ip) :: ifunc

   if (a%Listener%words(2) == 'ROTAT') then
      a%kfl_funty(ifunc,1)=-1
      a%kfl_funty(ifunc,2)=6
   endif
end subroutine

subroutine ale_ReadOnBoundaries(a)
   use typre
   use Mod_Alemov
   implicit none
   class(AlemovProblem) :: a
   integer(ip)                :: nbody,iboun,nboun,pnodb,ipsta

end subroutine

max_stars_repo_name: ciaid-colombia/InsFEM

max_issues_repo_name: ciaid-colombia/InsFEM

max_forks_repo_name: ciaid-colombia/InsFEM


text:
      SUBROUTINE TSTRML	(IERROR)
C
C LATEST REVISION	 JUNE 1984
C
C PURPOSE		 TO PROVIDE A SIMPLE DEMONSTRATION OF
C			 ROUTINE STRMLN.
C
C USAGE			 CALL TSTRML (IERROR)
C
C ARGUMENTS
C
C ON OUTPUT		 IERROR
C			   AN INTEGER VARIABLE
C			   =0 IF THERE IS A NORMAL EXIT	FROM THE
C			      ROUTINE STRMLN.
C			   =1 OTHERWISE
C
C I/O			 IF THERE IS A NORMAL EXIT FROM	THE ROUTINE
C			 STRMLN	THE MESSAGE
C			   STRMLN TEST SUCCESSFUL . . .	SEE PLOT TO
C			   VERIFY PERFORMANCE
C			 IS PRINTED.
C
C PRECISION		 SINGLE
C
C
C LANGUAGE		 FORTRAN
C
C ALGORITHM		 ROUTINE TSTRML	CALLS ROUTINE STRMLN TO
C			 PRODUCE A PLOT	REPRESENTING THE  FLOW AND
C			 MAGNITUDE OF A	VECTOR FIELD.
C
C PORTABILITY		 FORTRAN77
C
C
C
      REAL	      U(21,25)	 ,V(21,25)   ,WRK(1050)
C
C SPECIFY COORDINATES FOR PLOT TITLES.	ON AN ABSTRACT GRID WHERE
C THE INTEGER COORDINATES RANGE	FROM 0.0 TO 1.0, THE VALUES TX AND TY
C DEFINE THE CENTER OF THE TITLE STRING.
C
      DATA TX/.5/,TY/.9765/
C
C     SET DIMENSIONS
C
      DATA NH,NV/21,25/
C
C INITIALIZE ERROR PARAMETER
C
      IERROR = 1
C
C SPECIFY HORIZONTAL AND VERTICAL VECTOR COMPONENTS U AND V ON
C THE RECTANGULAR GRID
C
      TPIMX = 2.*3.14/FLOAT(NH)
      TPJMX = 2.*3.14/FLOAT(NV)
      DO  20 J=1,NV
	 DO  10	I=1,NH
	 U(I,J)	= SIN(TPIMX*(FLOAT(I)-1.))
	 V(I,J)	= SIN(TPJMX*(FLOAT(J)-1.))
   10	 CONTINUE
   20 CONTINUE
C
C SELECT NORMALIZATION TRANSFORMATION 0
C
      CALL GSELNT (0)
C
C CALL WTSTR FOR STRMLN	PLOT TITLE
C
      CALL WTSTR (TX,TY,'DEMONSTRATION PLOT FOR ROUTINE STRMLN',2,
     1		  0,0)
C
C DEFINE NORMALIZATION TRANSFORMATION 1, AND SET UP LOG	SCALING
C
      CALL GSVP	( 1, 0.1, 0.9, 0.1, 0.9	)
      CALL GSWN	( 1, 1.0, 21., 1.0, 25.	)
      CALL SETUSV ( 'LS' , 1 )
C
C SELECT NORMALIZATION TRANSFORMATION 1
C
      CALL GSELNT (1)
C
C     DRAW PERIMETER
C
c     CALL PERIM(1,0,1,0)
C
C CALL STRMLN FOR VECTOR FIELD STREAMLINES PLOT
C
      CALL STRMLN (U,V,WRK,NH,NH,NV,0,IER)
C
c     CALL NEWFM
C
      IERROR = 0
c     WRITE (6,1001)
      RETURN
C
c1001 FORMAT ('	    STRMLN TEST	SUCCESSFUL',24X,
c    1	      'SEE PLOT	TO VERIFY PERFORMANCE')
C
      END

ext: f

max_stars_repo_name: ysBach/irafdocgen

max_issues_repo_name: kirxkirx/iraf

max_forks_repo_name: kirxkirx/iraf


text:
      SUBROUTINE GP3C
C
C     GP3C EXECUTES ONLY IF PLOAD2 AND/OR PLOAD3 CARDS ARE PRESENT. ITS
C     FUNCTION IS TO --
C     (1) PROCESS PLOAD2 CARDS SO THAT THEIR FORMAT IS IDENTICAL TO
C         PLOAD CARDS.  IF A PLOAD RECORD EXISTS ON GEOM3, PLOAD2 DATA
C         IS APPENDED TO THE DATA, SORTED, AND ALL RESULTING PLOAD DATA
C         IS WRITTEN ON SCR2.
C     (2) PROCESS PLOAD3 CARDS SO THAT ALL PRESSURES APPLIED TO AN ISO-
C         PARAMETRIC SOLID ARE GATHERED IN ONE ENTRY AND SORTED BY THE
C         FACE NUMBER TO WHICH THE PRESSURE IS APPLIED.  THE SORTED
C         PRESSURES AND GRID POINT NUMBERS FOR EACH ELEMENT ARE WRITTEN
C         ON SCR2.
C
C
      EXTERNAL        ANDF
      INTEGER         GEOM3 ,GEOM2 ,SCR2  ,BUF1  ,BUF2  ,BUF   ,CLSREW,
     1                WRTREW,RDREW ,ELEM  ,FILE  ,NAM(2),PLOAD2,Z     ,
     2                CARDID,PLOAD3,PL2   ,PL3   ,PLD(3),D1    ,D2    ,
     3                ANDF  ,FACES(6,12)  ,PL3ERR(14)
      REAL            RZ(1),P(12)
      COMMON /GP3COM/ GEOM3 ,EQEXIN,GEOM2 ,SLT   ,GPTT  ,SCR1  ,SCR2   ,
     1                BUF1  ,BUF2  ,BUF(50)      ,CARDID(60)   ,IDNO(30)
     2              , CARDDT(60)   ,MASK(60)     ,STATUS(60)   ,NTYPES ,
     3                IPLOAD,IGRAV ,PLOAD2(2)    ,LOAD(2)      ,NOPLD2 ,
     4                TEMP(2)      ,TEMPD(2)     ,TEMPP1(2)    ,
     5                TEMPP2(2)    ,TEMPP3(2)    ,TEMPRB(2)    ,BUF3   ,
     6                PLOAD3(2)    ,IPLD3
      COMMON /NAMES / RD    ,RDREW ,WRT   ,WRTREW,CLSREW
      COMMON /ZZZZZZ/ Z(1)
      COMMON /GPTA1 / NELEM ,LAST  ,INCR  ,ELEM(1)
      COMMON /TWO   / TWO(32)
      COMMON /SYSTEM/ SYSBUF,NOUT
      EQUIVALENCE     (RZ(1),Z(1))
C
C  FACE                 IHEX1             IHEX2             IHEX3
C   NO                D1      D2        D1      D2        D1      D2
      DATA    FACES/   1,      3,        1,      5,        1,      7,
     1                 2,      4,        3,      7,        4,     10,
     2                 1,      6,        1,     15,        1,     24,
     2                 2,      5,        3,     13,        4,     21,
     3                 2,      7,        3,     17,        4,     27,
     3                 3,      6,        5,     15,        7,     24,
     4                 3,      8,        5,     19,        7,     30,
     4                 4,      7,        7,     17,       10,     27,
     5                 1,      8,        1,     19,        1,     30,
     5                 4,      5,        7,     13,       10,     21,
     6                 5,      7,       13,     17,       21,     27,
     6                 6,      8,       15,     19,       24,     30/
C
      DATA   N3304,N3305,PL3ERR/4H3304, 4H3305, 4H0***, 4H USE, 4HR FA,
     C                          4HTAL , 4HMESS, 4HAGE , 4H330*, 4H, PL,
     2                          4HOAD3, 4H CAR, 4HD FR, 4HOM L, 4HOAD ,
     3                          4HSET /
      DATA   NAM  /    4HGP3C,4H      /
C
C     CHECK TRAILER BITS FOR PRESENCE OF PLOAD2 AND PLOAD3 CARDS.
C     IF NONE EXIST, RETURN.  OTHERWISE, BRANCH AND INITIALIZE TO
C     PROCESS ONE OF THESE CARD TYPES.
C
      NOGO = 0
      PL2  = 0
      PL3  = 0
      J    = (PLOAD2(2)-1)/16
      K    = PLOAD2(2) - 16*J
      IF (ANDF(BUF(J+2),TWO(K+16)) .NE. 0) PL2 = 1
      J    = (PLOAD3(2)-1)/16
      K    = PLOAD3(2) - 16*J
      IF (ANDF(BUF(J+2),TWO(K+16)) .NE. 0) PL3 = 1 - 2*PL2
      FILE = SCR2
      IF (PL2-PL3 .NE. 0) CALL OPEN (*210,SCR2,Z(BUF2),WRTREW)
      IF (PL2 .EQ. 0) GO TO 15
      NOPLD2 = 1
      PLD(1) = PLOAD2(1)
      PLD(2) = PLOAD2(2)
      PLD(3) = 24
      INCRD  = 3
      INCL   = 6
      IDL    = 2
      GO TO 10
   15 IF (PL3 .EQ. 0) GO TO 196
      NOPLD2 = NOPLD2 + 2
      PLD(1) = PLOAD3(1)
      PLD(2) = PLOAD3(2)
      PLD(3) = 255
      INCRD  = 5
      INCL   = 39
      IDL    = 1
C
C     READ PLOAD2 OR PLOAD3 CARDS INTO CORE IN AN EXPANDED FORMAT.
C     SET THE SET ID NEGATIVE TO INDICATE THE CARD IS NOT YET CONVERTED.
C
   10 I = 1
      FILE = GEOM3
      CALL PRELOC (*210,Z(BUF1),GEOM3)
      CALL LOCATE (*230,Z(BUF1),PLD,FLAG)
      IF (PL2 .NE. 1) GO TO 20
      PLD(1) = CARDID(IPLOAD  )
      PLD(2) = CARDID(IPLOAD+1)
   20 CALL READ (*220,*30,GEOM3,Z(I),INCRD,0,FLAG)
      Z(I) = -Z(I)
      IF (PL2 .EQ.  1) GO TO 29
      IF (I .LT. INCL) GO TO 25
      DO 21 J = 2,I,INCL
      K = J
      IF (Z(J) .NE. Z(I+2)) GO TO 21
      IF (Z(J-1) .EQ. Z(I)) GO TO 22
   21 CONTINUE
   25 P(1)   = RZ(I+1)
      Z(I+1) = Z(I+2)
      RZ(I+2)= P(1)
      Z(I+14)= Z(I+3)
      Z(I+15)= Z(I+4)
      Z(I+3) =-1
      GO TO 29
   22 J = K + 2
   23 IF (Z(J) .EQ. -1) GO TO 24
      J = J + 1
      IF (J .LE. K+12) GO TO 23
      GO TO 25
   24 RZ(J) = RZ(I+1)
      IF (J .LT. K+12) Z(J+1) = -1
      J = K + 15 + 2*(J-K-2)
      Z(J  ) = Z(I+3)
      Z(J+1) = Z(I+4)
      GO TO 20
   29 Z(I+INCL-1) = 0
      I = I+INCL
      IF (I .LT. BUF2) GO TO 20
      CALL MESAGE (-8,0,NAM)
   30 CALL CLOSE (GEOM3,CLSREW)
      NPLD2 = I - INCL
      NWDS  = I - 1
C
C     POSITION TO FIRST DATA RECORD ON GEOM2.
C
      FILE = GEOM2
      CALL OPEN (*130,GEOM2,Z(BUF1),RDREW)
      CALL FWDREC (*220,GEOM2)
C
C     READ 3-WORD RECORD ID. LOOK FOR ID IN ELEM TABLE.
C     IF NOT THERE, SKIP RECORD.
C     IF PROCESSING PLOAD2, AND NOT A TWO-DIMENSIONAL ELEMENT, SKIP REC.
C     IF PROCESSING PLOAD3, AND NOT AN ISOPARAMETRIC ELEMENT, SKIP REC.
C     OTHERWISE,  INITIALIZE PARAMETERS.
C
   50 CALL READ (*130,*50,GEOM2,BUF,3,0,FLAG)
      DO 60 I = 1,LAST,INCR
      IF (BUF(1) .EQ. ELEM(I+3)) GO TO 80
   60 CONTINUE
   70 CALL FWDREC (*220,GEOM2)
      GO TO 50
   80 NGPS  = ELEM(I+9)
      ITYPE = ELEM(I+2)
C
C   . IF ELEMENT TYPE IS 68 (QUADTS) THEN USE FIRST FOUR  GRID POINTS
C   . IF ELEMENT TYPE IS 69 (TRIATS) THEN USE FIRST THREE GRID POINTS
C
      IF (ITYPE.EQ.68 .OR. ITYPE.EQ.69) NGPS = NGPS/2
      IF (PL2.EQ.1 .AND. (NGPS.LT.3 .OR. NGPS.GT.4)) GO TO 70
      IF (PL3.EQ.1 .AND. (ITYPE.LT.65 .OR. ITYPE.GT.67)) GO TO 70
      ITYPE  = 2*(ITYPE-64) - 1
      NWDECT = ELEM(I+5)
      J1 = ELEM(I+12)
      J2 = J1 + NGPS - 1
C
C     READ EACH ELEMENT IN RECORD. LOOK FOR ELEMENT ID MATCH IN PLOAD2
C     OR PLOAD3 LIST.  IF FOUND, SET THE SET ID POSITIVE TO INDICATE
C     ENTRY IS CONVERTED.
C
   90 CALL READ (*220,*50,GEOM2,BUF,NWDECT,0,FLAG)
      DO 110 I = 1,NPLD2,INCL
      IF (Z(I) .GT. 0) GO TO 110
      IF (Z(I+IDL) .NE. BUF(1)) GO TO 110
      Z(I) = -Z(I)
      IX   = I
      IF (PL3 .EQ. 1) GO TO 300
C
C     PLACE GRID POINT NUMBERS FROM ELEMENT CARD IN PLOAD2 ENTRY TO
C     MAKE IT LOOK LIKE PLOAD CARD.
C
      DO 100 J = J1,J2
      Z(IX+2) = BUF(J)
      IX = IX + 1
  100 CONTINUE
      GO TO 110
C
C     FIND THE DIAGONALS ON THE PLOAD3 CARD ON THE ELEMENT CARD TO
C     DETERMINE THE FACES TO WHICH THE PRESSURES ARE APPLIED.  SORT
C     THE PRESSURES BY FACE NUMBER AND APPEN+ THE GRID POINT NUMBERS
C     FROM THE ELEMENT CARD TO THE PLOAD3 ENTRY.
C
  300 NP = 0
      DO 310 J = 1,12
      IF (Z(I+J+1) .EQ. -1) GO TO 315
      NP = NP + 1
      P(J) = RZ(I+J+1)
  310 CONTINUE
  315 DO 320 J = 1,6
  320 RZ(I+J)  = 0.0
      DO 350 J = 1,NP
      K   = I + 14 + 2*(J-1)
      ID1 = Z(K  )
      ID2 = Z(K+1)
      DO 322 K = J1,J2
      IF (ID1 .EQ. BUF(K)) GO TO 324
  322 CONTINUE
      GO TO 335
  324 ID1 = K - J1 + 1
      DO 326 K = J1,J2
      IF (ID2 .EQ. BUF(K)) GO TO 328
  326 CONTINUE
      GO TO 335
  328 ID2 = K - J1 + 1
      D1  = MIN0(ID1,ID2)
      D2  = MAX0(ID1,ID2)
      DO 330 K = 1,12
      NFACE = (K+1)/2
      IF (D1 .NE. FACES(ITYPE  ,K)) GO TO 330
      IF (D2 .EQ. FACES(ITYPE+1,K)) GO TO 340
  330 CONTINUE
  335 NOGO = 1
      PL3ERR(7) = N3305
      WRITE (NOUT,420) PL3ERR,Z(I),BUF(1)
      GO TO 350
  340 RZ(I+NFACE) = RZ(I+NFACE)+P(J)
  350 CONTINUE
      IX = IX + 7
      DO 360 J = J1,J2
      Z(IX) = BUF(J)
      IX = IX + 1
  360 CONTINUE
      IF (IX+1-I .GT. 39) GO TO 110
      K = I + 38
      DO 370 J = IX,K
  370 Z(J) = 0
  110 CONTINUE
      GO TO 90
C
C     HERE WHEN END-OF-FILE ON GEOM2 IS ENCOUNTERED.
C     MAKE SURE ALL PLOAD2 OR PLOAD3 ENTRIES HAVE BEEN CONVERTED.
C
  130 CALL CLOSE (GEOM2,CLSREW)
      DO 140 I = 1,NPLD2,INCL
      IF (Z(I) .GT. 0) GO TO 140
      NOGO = 1
      BUF(1) = -Z(I)
      BUF(2) =  Z(I+IDL)
      IF (PL2 .EQ. 1) CALL MESAGE (30,105,BUF)
      PL3ERR(7) = N3304
      IF (PL3 .EQ. 1) WRITE (NOUT,410) PL3ERR,BUF(1),BUF(2)
  140 CONTINUE
      IF (NOGO .NE. 0) CALL MESAGE (-61,0,0)
      IF (PL3  .EQ. 1) GO TO 190
C
C     LOCATE PLOAD RECORD ON GEOM3. IF PRESENT, READ PLOAD DATA INTO
C     CORE (AFTER PLOAD2 DATA) AND SORT COMBINED DATA ON SET ID.
C
      CALL PRELOC (*210,Z(BUF1),GEOM3)
      CALL LOCATE (*180,Z(BUF1),CARDID(IPLOAD),FLAG)
      I = NPLD2 + 6
  160 CALL READ (*220,*170,GEOM3,Z(I),6,0,FLAG)
      I = I + 6
      IF (I .LT. BUF2) GO TO 160
      CALL MESAGE (-8,0,NAM)
  170 NPLD2 = I - 6
      NWDS  = I - 1
      CALL SORT (0,0,6,1,Z,NWDS)
  180 CALL CLOSE (GEOM3,CLSREW)
C
C     WRITE DATA ON SCR2, SET FLAG TO INDICATE AND RETURN.
C
  190 CALL WRITE (SCR2,PLD,3,0)
      CALL WRITE (SCR2,Z,NWDS,1)
      IF (PL2 .NE. 1) GO TO 196
  195 PL2 = -PL2
      PL3 = -PL3
      GO TO 15
  196 CALL CLOSE (SCR2,CLSREW)
      RETURN
C
C     ERROR MESSAGES.
C
  200 CALL MESAGE (N,FILE,NAM)
  210 N = -1
      GO TO 200
  220 N = -2
      GO TO 200
C
C     ABNORMAL RETURN.
C
  230 IF (PL3 .LT. 0) GO TO 195
      CALL CLOSE (GEOM3,CLSREW)
      RETURN
C
C     PLOAD3 CARD ERRORS
C
  410 FORMAT (14A4,I9,' REFERENCES MISSING OR NON-ISOPARAMETRIC ELEMENT'
     1       ,I9)
  420 FORMAT (14A4,I9,' HAS INVALID GRID POINT NUMBERS FOR ELEMENT',I9)
      END


text:
! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
! See https://llvm.org/LICENSE.txt for license information.
! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
!

module mod_gen
implicit none
private
type, public :: v
integer r(10)
end type
type, public, extends(v) :: w
integer tag
end type

type, public :: t
class(v),allocatable :: comp
end type
end module

program p
USE CHECK_MOD
use mod_gen
class(t), allocatable :: obj
class(t), allocatable :: obj2
logical rslt(7)
logical expect(7)
real rr(10)

rslt = .false.
expect = .true.

allocate(obj)
!print *, allocated(obj%comp)
rslt(1) = .not. allocated(obj%comp)
allocate(w::obj%comp)
!print *, allocated(obj%comp)
rslt(2) = allocated(obj%comp)

do i=1,10
obj%comp%r(i) = i
rr(i) = i
enddo

select type(o=>obj%comp)
type is (w)
o%tag = 999
rslt(3) = all(o%r .eq. rr)
!print *, o
end select

allocate(obj2,source=obj)
deallocate(obj%comp)
rslt(4) = .not. allocated(obj%comp)
rslt(5) = allocated(obj2%comp)

select type(o=>obj2%comp)
type is (w)
!print *, o
rslt(6) = o%tag .eq. 999
rslt(7) = all(o%r .eq. rr)
end select

call check(rslt,expect,7)

end

max_stars_repo_name: abrahamtovarmob/flang

max_issues_repo_name: abrahamtovarmob/flang

max_forks_repo_name: abrahamtovarmob/flang


text:
      subroutine conic(xm,b)
!     to obtain mach number derivatives in radial flow
      use kinddefine
      use gg, only:g5,g6,g8,ga,qt
      implicit none
      real(kind=K8),dimension(4),intent(out) :: b
      real(kind=K8),intent(in) :: xm
      real(kind=K8) :: area,bmm,c2,c4,cmm,dmm,four,one,thr,two
      real(kind=K8) :: xmm,xmm1,xmm2
      data one/1.d+0/,two/2.d+0/,thr/3.d+0/,four/4.d+0/
      xmm=xm*xm
      xmm1=xmm-one
      xmm2=xmm1**2
      bmm=one+g8*xmm
      area=(g6+g5*xmm)**ga/xm
      b(1)=area**qt
      b(2)=xm*bmm/qt/xmm1/b(1)
      c2=two-(one+thr*g8)/qt
      c4=g8/qt-one
      cmm=xmm*(c2+xmm*c4)-one-one/qt
      b(3)=b(2)*cmm/xmm2/b(1)
      dmm=(four*c4*xmm+two*c2)/cmm-four/xmm1
      b(4)=b(3)*(b(3)/b(2)+xm*b(2)*dmm-one/b(1))
      end subroutine conic

max_stars_repo_name: aldorona/contur

max_issues_repo_name: aldorona/contur

max_forks_repo_name: aldorona/contur


text:
      subroutine dump_globals_lg(iunit,iomode,ierror)
C
C#######################################################################
C
C     PURPOSE -
C
C        This routine dumps global information to a file
C
C     INPUT ARGUMENTS -
C
C        iunit   - file number.
c        iomode  - ascii or binary
C
C     OUTPUT ARGUMENTS -
C
C        ierror  - Error Return Code (==0 ==> OK, <>0 ==> Error).
C
C     CHANGE HISTORY -
C
C        $Log: dump_globals_lg.f,v $
C        Revision 2.00  2007/11/05 19:45:52  spchu
C        Import to CVS
C
CPVCS
CPVCS       Rev 1.1   Mon Feb 07 14:08:58 2000   dcg
C#######################################################################
C
      implicit none
C
C#######################################################################
C
      include 'global_lg.h'
C
C#######################################################################
C
      integer  iunit
      character*32 iomode
C
      integer ierror
C
C#######################################################################
C
C     LOCAL VARIABLE DEFINITION
C
      integer i, len,  icscode, numint,numreal,numchar,j
      character*32 partname
C
      character*132 logmess

C
C#######################################################################
C
C.... access global variable data blocks
C
      partname='global_lg'
      call mmfindbk('global_name',partname,ipglobal_name,len,icscode)
      call mmfindbk('global_type',partname,ipglobal_type,len,icscode)
      call mmfindbk('global_index',partname,ipglobal_index,len,icscode)
      call mmfindbk('global_integer',partname,
     *            ipglobal_integer,len,icscode)
      call mmfindbk('global_real',partname,
     *            ipglobal_real,len,icscode)
      call mmfindbk('global_character',partname,
     *            ipglobal_character,len,icscode)
c
c... write number of globals, names, types and indices
c
      if(iomode.eq.'ascii') then
         write(iunit,10) number_of_globals
      else
         write(iunit) number_of_globals
      endif
      if(iomode.eq.'ascii') then
         write(iunit,40) (global_name(i),i=1,number_of_globals)
         write(iunit,20) (global_type(i),i=1,number_of_globals)
         write(iunit,20) (global_index(i),i=1,number_of_globals)
      else
         write(iunit) (global_name(i),global_type(i),
     *     global_index(i),i=1,number_of_globals)
      endif
 10   format(i10)
 20   format(10i10)
c
c... write out global values and defaults
c... first count up number of each
c
      numint=0
      numreal=0
      numchar=0
      do i=1,number_of_globals
         if(1.eq.global_type(i)) numint=numint+1
         if(2.eq.global_type(i)) numreal=numreal+1
         if(3.eq.global_type(i)) numchar=numchar+1
      enddo
      if(iomode.eq.'ascii') then
         write(iunit,20) numint,numreal,numchar
      else
         write(iunit)  numint,numreal,numchar
      endif
      if(numint.ne.0) then
         if(iomode.eq.'ascii') then
            write(iunit,20) (global_integer(1,j),
     *          global_integer(2,j),j=1,numint)
         else
            write(iunit)   (global_integer(1,j),
     *          global_integer(2,j),j=1,numint)
         endif
      endif
      if(numreal.ne.0) then
         if(iomode.eq.'ascii') then
            write(iunit,30) (global_real(1,j),
     *          global_real(2,j),j=1,numreal)
         else
            write(iunit)   (global_real(1,j),
     *          global_real(2,j),j=1,numreal)
         endif
      endif
      if(numchar.ne.0) then
         if(iomode.eq.'ascii') then
            write(iunit,40) (global_character(1,j),
     *          global_character(2,j),j=1,numchar)
         else
            write(iunit)   (global_character(1,j),
     *          global_character(2,j),j=1,numchar)
         endif
      endif
 30   format(5f22.14)
 40   format(4a32)
      ierror=0
 9999 return
      end

max_forks_repo_name: daniellivingston/LaGriT


text:
-makelib xcelium_lib/xil_defaultlib \
  "../../../../debounce_0/src/debounce.vhd" \
  "../../../../debounce_0/sim/debounce_0.vhd" \
-endlib


text:
SUBROUTINE pearsn(xbar, sd, itype, rb1, b2, bndry, sigpt, ifault)

! Code converted using TO_F90 by Alan Miller
! Date: 1999-09-25  Time: 16:22:51
! N.B. Array a has been removed from the list of arguments,
!      and replaced with a PARAMETER statement in this routine.

!     ALGORITHM AS 192  APPL. STATIST. (1983) VOL.32, NO.3

!     Computes approximate significance points of a Pearson curve with given
!     first four moments, or first three moments and left or right boundary.

! Error codes
! IFAULT = 0  successful completion
!        = 1 SD < 0.0
!        = 2 ITYPE < 1 or > 3
!        = 3 | RB1 | > 2.0
!        = 4 XBAR value impossible with the value entered for BNDRY
!        = 5 B2 cannot be computed for the first 3 moments + left boundary
!        = 6 B2 out of range, that is:
!            If | RB1 | <= 1.0 then
!               B2 < 1.5 * | RB1 | + 1.5  or  B2 > 0.2 * | RB1 | + 10.8
!            If | RB1 | > 1.0 then
!               B2 < 3.9 * | RB1 | - 0.9  or  B2 > 4.8 * | RB1 | + 6.2

IMPLICIT NONE

REAL, INTENT(IN)      :: xbar
REAL, INTENT(IN)      :: sd
INTEGER, INTENT(IN)   :: itype
REAL, INTENT(IN)      :: rb1
REAL, INTENT(IN OUT)  :: b2
REAL, INTENT(IN)      :: bndry
REAL, INTENT(OUT)     :: sigpt(:)
INTEGER, INTENT(OUT)  :: ifault

REAL    :: b(9), rbeta1, ca, ca2, carb1, denom, absca, bnd1, bnd2, sgn, &
           pi1, pi2
INTEGER :: i, j, k, l
REAL, PARAMETER :: zero = 0.0, point2 = 0.2, rthalf = 0.70710678,  &
                   point9 = 0.9, one = 1.0, onept5 = 1.5, two = 2.0, &
                   three = 3.0, thrpt9 = 3.9, four = 4.0, forpt8 = 4.8, &
                   sixpt2 = 6.2, tenpt8 = 10.8
REAL, PARAMETER :: a(418) = (/    &
-1.9336, -1.6061, 2.6955, -1.7036, 1.7236, -1.3209, -2.5464, 1.6812, -0.11812, 0.050875, 0.16042, -1.0616, 0.43929, &
-0.35799, 0.51040, 1.0958, -0.63453, 0.053175, -0.019945, 0.25597, 0.32520, -0.094571, 2.0418, -2.5786, 0.61148, -0.64242, &
 1.1968, -0.33145, 0.015508, -4.1444, 0.13884, 4.6625, 0.37661, -0.20447, -1.9508, -0.20214, 0.11921, -0.0085268, &

-1.6453, -1.8494, 2.3915, -1.5844, 1.8290, -1.1167, -3.6091, 2.7150, -0.45857, 0.048102, 0.89117, -1.2700, 0.37653, &
-0.81542, 0.56815, 1.6562, -1.1908, 0.24574, -0.024375, -1.5063, 4.4876, -0.60765, -6.5584, 2.8944, -0.42381, 2.2664, &
-1.3425, 0.25806, -0.010421, -1.9526, 0.21332, 2.1317, -1.1996, 0.21033, -0.52154, 0.53597, -0.12355, 0.0060658, &

-1.1044, -1.1300, 1.7681, 0.10947, 0.30566, -0.90598, -0.98814, 0.49355, 0.30625, -0.018707, 0.74941, -1.3174, 0.23974, &
-0.12433, 0.59105, 0.85714, -0.47292, -0.16028, 0.012684, -1.4645, 4.5349, -0.71053, -7.9213, 4.0018, -0.61932, 2.7320, &
-1.7752, 0.35919, -0.014944, -2.0999, 0.30754, 3.6865, -2.3140, 0.39961, -1.1530, 1.0257, -0.22981, 0.011032, &

-0.85842, 0.78929, 1.2196, -0.55088, -0.96385, -0.57312, -0.076974, 0.34882, 0.47311, -0.056120, -0.63153, -1.2697, 0.64649, &
 0.92712, 0.49088, 0.48118, -0.46407, -0.39753, 0.052413, -0.92873, 2.2039, 0.25828, 0.74312, -2.4307, 0.49934, 0.029833, &
 0.68249, -0.19687, 0.0068136, -2.9758, -0.050738, 0.067069, 2.0835, -0.45211, -0.28149, -0.58012, 0.17621, -0.0067195, &

-2.4031, -1.4891, 0.75590, -2.3309, 9.2314, -3.8930, -7.0192, 2.3648, 0.44308, -0.029437, 16.616, -4.9826, 1.0626, &
-18.888, 7.2830, 14.642, -2.6394, -1.2739, 0.060862, -1.6092, 0.81385, -0.059847, -0.18180, 1.2679, -0.36205, 0.29683, &
-0.83310, 0.26630, -0.015081, 0.43536, 0.27965, 1.2516, -3.0536, 0.65936, -1.0579, 1.7886, -0.47962, 0.025311, &

-2.0711E-4, 0.0068277, -7.5482E-6, 0.47086, -0.21213, 1.1003E-4, -0.22462, 0.11733, -0.079682, -1.0565E-5, 2.5087, -2.6169, &
 0.94103, -2.3261, 1.6482, 2.3024, -1.4821, -0.020294, 9.9168E-4, -0.097078, 0.58192, -0.019936, -0.7025, 0.11526, 0.0013959, &
 0.1595, -0.062382, 0.01338, 1.8557E-4, -1.8383, -0.54124, 0.68041, 1.7654, -0.37606, -1.113, 0.044447, 0.042456, -0.0017448, &

 0.39672, -0.17140, -0.74246, 0.48553, 0.19650, 0.58942, -1.5768, 0.37082, -0.32481, 0.025296, -0.60818, -1.9005, 0.45451, &
 0.79612, 1.0544, -1.9010, 0.29849, -0.51728, 0.050926, 0.45223, -2.4004, 0.38372, 3.6817, -1.0796, 0.016619, -1.6829, &
 0.81147, -0.10376, 0.0052116, -4.3837, 0.67456, 6.3029, -1.8042, 0.023516, -2.9320, 1.4537, -0.20680, 0.010634, &

 0.77212, 0.028272, -1.3932, 0.95628, -0.37918, 0.85487, 0.38225, -1.3009, 0.42400, -0.051933, 0.17133, -1.5330, 1.2721, &
-0.58446, 0.78993, 0.33412, -1.2988, 0.39155, -0.046683, 2.2548, -1.7005, -0.65377, -2.9256, 2.1397, 0.093244, 3.2094, &
-2.2896, 0.24580, -0.0020536, 0.30478, -0.58544, -4.0524, 1.8239, 0.083952, 3.4072, -2.0163, 0.20345, -7.5748E-4, &

 1.1504, 0.22674, -1.7407, 1.1356, -0.58596, 0.88839, 0.34743, -1.2531, 0.42319, -0.014362, 0.17074, -1.2892, 1.1653, &
-0.46699, 0.58479, 0.33975, -1.0005, 0.25271, -0.0091547, 2.1265, -8.7599, 2.3560, 8.0491, -3.3844, -0.028416, -4.3522, &
 3.9741, -0.92840, 0.055908, -5.5206, 1.6024, 6.1077, -2.4508, -0.012514, -3.7719, 2.8877, -0.59134, 0.034299, &

 1.5989, 1.5353, -2.2124, 0.83145, -1.2543, 0.92247, 2.2076, -1.4147, 0.053879, 0.058513, 0.42581, -1.1636, 0.67165, &
-0.47849, 0.46159, 0.97601, -0.61165, -0.054400, 0.029952, 10.803, -5.6739, -8.3559, -12.404, 29.846, -7.7439, -6.2673, &
-1.3612, 1.3966, -0.22122, 2.8678, -3.0580, -14.864, 16.489, -4.0334, -0.49139, -1.7927, 0.98545, -0.10118, &

 2.4201, -1.9281, -3.3357, 2.3720, 1.7318, 1.4149, -0.64616, -2.7558, 0.28474, -0.034471, -0.078628, -1.2092, 0.43924, &
 0.43093, 0.53223, 0.34235, -1.0741, 0.080494, -0.013004, -15.787, -3.9798, 23.933, 24.332, -46.762, 6.0862, 15.874, &
 5.2360, -2.4644, 0.28404, -14.830, 8.5161, 23.701, -19.419, 2.4239, -1.8457, 4.8007, -1.2525, 0.099997 /)

!     Check for invalid input arguments

ifault = 1
IF (sd <= zero) RETURN
ifault = 2
IF (itype < 1 .OR. itype > 3) RETURN
rbeta1 = ABS(rb1)
ifault = 3
IF (rbeta1 > two) RETURN
IF (itype == 1) GO TO 10

!     Compute B2 using XBAR, SD, RB1, and the known boundary

ifault = 4
IF ((itype == 2 .AND. xbar <= bndry) .OR. (itype == 3 .AND. xbar >= bndry))  &
    RETURN
ifault = 5
ca = sd / (xbar - bndry)
ca2 = ca * ca
carb1 = ca * rb1
denom = four * ca2 - carb1 + two
IF (denom <= zero) RETURN
absca = ABS(ca)
bnd1 = (ca2 - one) / ca
IF (absca <= rthalf) THEN
  bnd2 = four * ca / (one - ca2)
ELSE
  bnd2 = four * ca + two / ca
END IF
IF ((itype == 2 .AND. (rb1 < bnd1 .OR. rb1 > bnd2)) .OR.  &
    (itype == 3 .AND. (rb1 < bnd2 .OR. rb1 > bnd1))) RETURN
b2 = three * (carb1 * (carb1 + one) + rb1 * rb1 + two) / denom

10 ifault = 6
IF ((rbeta1 <= one .AND. (b2 < onept5 * rbeta1 + onept5 .OR.  &
    b2 > point2 * rbeta1 + tenpt8)) .OR. (rbeta1 > one .AND.  &
    (b2 < thrpt9 * rbeta1 - point9 .OR. b2 > forpt8 * rbeta1 + sixpt2))) RETURN
ifault = 0

!     Initialization

b(1) = rbeta1
b(2) = b2
b(3) = rbeta1 * rbeta1
b(4) = rbeta1 * b2
b(5) = b2 * b2
b(6) = b(3) * rbeta1
b(7) = b(3) * b2
b(8) = b(5) * rbeta1
b(9) = b(5) * b2

!     Significance point computation

k = -19
IF (rbeta1 > one) k = 0
sgn = one
IF (rb1 < zero) sgn = -one
DO  i = 1, 11
  l = i
  IF (rb1 < zero) l = 12 - i
  k = k + 20
  pi1 = a(k)
  DO  j = 1, 9
    k = k + 1
    pi1 = pi1 + a(k) * b(j)
  END DO
  pi2 = one
  DO  j = 1, 9
    k = k + 1
    pi2 = pi2 + a(k) * b(j)
  END DO

!     Compute significance point

  sigpt(l) = xbar + sd * sgn * pi1 / pi2
END DO
RETURN
END SUBROUTINE pearsn

PROGRAM test_as192
IMPLICIT NONE

INTERFACE
  SUBROUTINE pearsn(xbar, sd, itype, rb1, b2, bndry, sigpt, ifault)
    IMPLICIT NONE
    REAL, INTENT(IN)      :: xbar
    REAL, INTENT(IN)      :: sd
    INTEGER, INTENT(IN)   :: itype
    REAL, INTENT(IN)      :: rb1
    REAL, INTENT(IN OUT)  :: b2
    REAL, INTENT(IN)      :: bndry
    REAL, INTENT(OUT)     :: sigpt(:)
    INTEGER, INTENT(OUT)  :: ifault
  END SUBROUTINE pearsn
END INTERFACE

INTEGER :: itype, ifault
REAL    :: xbar, sd, rb1, b2, bndry, sigpt(11)

DO

  WRITE(*, '(a)', ADVANCE='NO') ' Enter mean & st.devn.: '
  READ(*, *) xbar, sd
  WRITE(*, *) 'ITYPE = 1  4 moments used'
  WRITE(*, *) 'ITYPE = 2  3 moments + left boundary used'
  WRITE(*, *) 'ITYPE = 3  3 moments + right boundary used'
  WRITE(*, '(a)', ADVANCE='NO') ' Enter ITYPE: '
  READ(*, *) itype
  WRITE(*, '(a)', ADVANCE='NO') ' Enter root(beta1) with sign of beta1: '
  READ(*, *) rb1
  IF (itype == 1) THEN
    WRITE(*, '(a)', ADVANCE='NO') ' Enter beta2: '
    READ(*, *) b2
  END IF
  IF (itype > 1) THEN
    WRITE(*, '(a)', ADVANCE='NO') ' Enter boundary: '
    READ(*, *) bndry
  END IF

  CALL pearsn(xbar, sd, itype, rb1, b2, bndry, sigpt, ifault)
  IF (ifault /= 0) THEN
    WRITE(*, *) 'IFAULT = ', ifault
  ELSE
    WRITE(*, '(" Percentage points"/ " ", 11f7.2)') sigpt
  END IF

END DO

STOP
END PROGRAM test_as192

max_stars_repo_name: agforero/FTFramework

max_issues_repo_name: agforero/fortran-testing-framework

max_forks_repo_name: agforero/fortran-testing-framework


    module module_mosaic_settling
    contains
    subroutine mosaic_settling_driver( &
        t_phy, rho_phy, dz8w, chem, dtstep, &
        ids,ide, jds,jde, kds,kde, &
        ims,ime, jms,jme, kms,kme, &
        its,ite, jts,jte, kts,kte )
    USE module_data_mosaic_asect, ONLY: &
        dens_water_aer, mw_water_aer, dens_aer, &
        dlo_sect, dcen_sect, dhi_sect, volumlo_sect, &
        volumhi_sect, ai_phase, ncomp_aer, nsize_aer, ntype_aer, &
        numptr_aer, waterptr_aer, massptr_aer, lptr_so4_aer
    USE module_configure, ONLY: num_chem
    USE module_data_mosaic_other, ONLY: pi
    USE module_wrf_error
    implicit none
    integer, intent(in) :: &
        ids, ide, jds, jde, kds, kde, &
        ims, ime, jms, jme, kms, kme, &
        its, ite, jts, jte, kts, kte
    real, intent(in), &
        dimension( ims:ime, kms:kme, jms:jme ) :: &
        t_phy, rho_phy, dz8w
    real, intent(inout), &
        dimension( ims:ime, kms:kme, jms:jme, 1:num_chem ) :: &
        chem
    real, intent(in) :: dtstep
    integer it, jt, kt, idiagaa, ntdt, ndt_settl, nsettl
    integer iphase, itype, n, ll, l1
    integer, parameter :: r8=8
    real(r8) :: temp
    real(r8) :: airdens
    real(r8) :: dumfact, dummass, rnum
    real(r8) :: dtmax, aer_mass_above, aer_mass, aer_water_above, aer_water, aer_num
    real(r8) :: dt_settl, air_volume_vert_ratio
    real(r8) :: aer_mass_change, aer_vol_change, aer_num_change
    real(r8) :: wetdp, wetdens, wetmass, wetvol, &
         drydp, drydens, drymass, dryvol
    real(r8) :: vsettl
    real(r8), dimension(kts:kte) :: vsettl_col, dz_ij
    real(r8), parameter :: densdefault = 2.0
    real(r8), parameter :: smallmassaa = 1.0e-19
    real(r8), parameter :: smallmassbb = 1.0e-29
    real(r8), parameter :: piover6 = pi/6.0
    real(r8), parameter :: onethird = 1.0/3.0
    CHARACTER (LEN=250) :: message
    real(r8), dimension(kts:kte) :: check_mass_after
    real(r8), dimension(kts:kte) :: check_mass_before
    real(r8) :: aer_mass_before
    do jt = jts, jte
    do it = its, ite
    iphase = ai_phase
    do itype = 1, ntype_aer
    do n = 1, nsize_aer(itype)
    do kt = kts, kte
      dryvol = 0.0_r8
      drymass = 0.0_r8
      do ll = 1, ncomp_aer(itype)
          l1 = massptr_aer(ll,n,itype,iphase)
          dummass = chem(it,kt,jt,l1) * 1.0E-6_r8
          drymass = drymass + dummass
          dryvol = dryvol + dummass/dens_aer(ll,itype)
      end do
      l1 = waterptr_aer(n,itype)
      dummass = chem(it,kt,jt,l1) * 1.0E-6_r8
      wetmass = drymass + dummass
      wetvol = dryvol + dummass/dens_water_aer
      l1 = numptr_aer(n,itype,iphase)
      rnum = chem(it,kt,jt,l1)
      if (drymass .le. smallmassbb) then
          drydp = dcen_sect(n,itype)
          drydens = densdefault
          wetdp = drydp
          wetdens = drydens
      else
          if (drymass .le. smallmassaa) then
              wetmass = drymass
              wetvol = dryvol
          end if
          drydens = drymass/dryvol
          wetdens = wetmass/wetvol
          if (rnum .ge. dryvol/volumlo_sect(n,itype)) then
              drydp = dlo_sect(n,itype)
          else if (rnum .le. dryvol/volumhi_sect(n,itype)) then
              drydp = dhi_sect(n,itype)
          else
              drydp = (dryvol/(piover6*rnum))**onethird
          end if
          if(abs(wetvol).gt.(1000.*abs(dryvol))) then
              dumfact=10.0
          else
              dumfact=abs(wetvol/dryvol)**onethird
              dumfact=max(1.0,min(dumfact,10.0))
          endif
          wetdp = drydp*dumfact
      endif
      temp = t_phy(it,kt,jt)
      airdens = rho_phy(it,kt,jt)*1.0e-3_r8
      call aerosol_depvel( &
           wetdp, wetdens,temp, airdens, vsettl)
      vsettl_col(kt)=vsettl
    end do
    dz_ij(kts:kte) = dz8w(it,:,jt)*1.0E2_r8
    l1 = lptr_so4_aer(n,itype,iphase)
    check_mass_before(kts:kte)=(dz8w(it,kts:kte,jt)*chem(it,kts:kte,jt,l1)*rho_phy(it,kts:kte,jt))
    do kt = kts, kte
      ntdt=INT(dtstep)
      dtmax = dz_ij(kt+1) / vsettl_col(kt+1)
      dtmax = max( dtmax, dz_ij(kt) / vsettl_col(kt) )
      ndt_settl = MAX( 1, INT( ntdt /dtmax) )
      dt_settl = REAL(ntdt) / REAL(ndt_settl)
      IF (ndt_settl > 12) ndt_settl = 12
      air_volume_vert_ratio = ( rho_phy(it,kt+1,jt) * dz_ij(kt+1) ) / (rho_phy(it,kt,jt) * dz_ij(kt) )
      l1 = numptr_aer(n,itype,iphase)
      aer_num = chem(it,kt,jt,l1)
      do ll = 1, ncomp_aer(itype)
        l1 = massptr_aer(ll,n,itype,iphase)
        aer_mass = chem(it,kt,jt,l1)
        aer_mass_above = chem(it,kt+1,jt,l1)
        aer_mass_before = aer_mass
        do nsettl = 1, ndt_settl
           if (kt .eq. kts) then
             aer_mass = aer_mass + aer_mass_above * ( vsettl_col(kt+1) * dt_settl/dz_ij(kt+1) ) * &
                         air_volume_vert_ratio
             aer_mass_change = aer_mass_above * ( vsettl_col(kt+1) * dt_settl/dz_ij(kt+1) ) * &
                               air_volume_vert_ratio * 1.0E-6_r8
             aer_vol_change = aer_mass_change / dens_aer(ll,itype)
             aer_num_change = 6.0_r8 * aer_vol_change * 1.0_r8/pi * 1.0_r8 / dcen_sect(n,itype) ** 3.0_r8
             aer_num = aer_num + aer_num_change
           elseif (kt .eq. kte) then
             aer_mass = aer_mass * (1.0_r8 - vsettl_col(kt)*dt_settl/dz_ij(kt))
             aer_mass_change = - aer_mass * vsettl_col(kt)*dt_settl/dz_ij(kt) * 1.0E-6_r8
             aer_vol_change = aer_mass_change / dens_aer(ll,itype)
             aer_num_change = 6.0_r8 * aer_vol_change * 1.0_r8/pi * 1.0_r8 / dcen_sect(n,itype) ** 3.0_r8
             aer_num = aer_num + aer_num_change
           else
             aer_mass = aer_mass * ( 1.0_r8 - vsettl_col(kt)*dt_settl / dz_ij(kt) ) + &
                         aer_mass_above * ( vsettl_col(kt+1) * dt_settl / dz_ij(kt+1) ) * &
                         air_volume_vert_ratio
             aer_mass_change = (- aer_mass * vsettl_col(kt) * dt_settl / dz_ij(kt) + &
                               aer_mass_above * ( vsettl_col(kt+1) * dt_settl / dz_ij(kt+1) ) * &
                               air_volume_vert_ratio) * 1.0E-6_r8
             aer_vol_change = aer_mass_change / dens_aer(ll,itype)
             aer_num_change = 6.0_r8 * aer_vol_change * 1.0_r8/pi * 1.0_r8 / dcen_sect(n,itype) ** 3.0_r8
             aer_num = aer_num + aer_num_change
           end if
        end do
          idiagaa = 0
          if (idiagaa>0) print 9310, it, jt, kt, n, ll, &
               vsettl_col(kt), dt_settl, dz_ij(kt), aer_mass, aer_mass_above, aer_mass_change, aer_mass-aer_mass_before
               9310 format( 'aerdep', 4i4, i3, 1p, 7e10.2, &
               2x, 0p )
        if (aer_mass < 0.0_r8 ) aer_mass = 0.0_r8
        l1 = massptr_aer(ll,n,itype,iphase)
        chem(it,kt,jt,l1) = aer_mass
      end do
      if (aer_num < 0.0_r8) aer_num = 0.0_r8
      l1 = numptr_aer(n,itype,iphase)
      chem(it,kt,jt,l1) = aer_num
      l1 = waterptr_aer(n,itype)
      aer_water = chem(it,kt,jt,l1)
      aer_water_above = chem(it,kt+1,jt,l1)
      do nsettl = 1, ndt_settl
         if (kt==kts) then
           aer_water = aer_water + aer_water_above * ( vsettl_col(kt+1) * dt_settl/dz_ij(kt+1) ) * &
                        air_volume_vert_ratio
         elseif (kt==kte) then
           aer_water = aer_water * (1.0_r8 - vsettl_col(kt)*dt_settl/dz_ij(kt))
         else
           aer_water = aer_water * ( 1.0_r8 - vsettl_col(kt)*dt_settl / dz_ij(kt) )+ &
                        aer_water_above * ( vsettl_col(kt+1) * dt_settl /dz_ij(kt+1) ) * &
                        air_volume_vert_ratio
         end if
      end do
      if (aer_water < 0.0_r8) aer_water = 0.0_r8
      l1 = waterptr_aer(n,itype)
      chem(it,kt,jt,l1)=aer_water
    end do
    l1 = lptr_so4_aer(n,itype,iphase)
    check_mass_after(kts:kte)=dz8w(it,kts:kte,jt)*chem(it,kts:kte,jt,l1)*rho_phy(it,kts:kte,jt)
    WRITE(message, * ) ' aer_settling it,jt,masscol_before,masscol_after = ',it, jt, sum(check_mass_before), sum(check_mass_after)
    IF (idiagaa >0) CALL wrf_debug ( 15, message )
    end do
    end do
    end do
    end do
    end subroutine mosaic_settling_driver
    subroutine aerosol_depvel( &
              dgnum, aerodens, &
              temp, airdens, &
              vsettl )
    implicit none
    integer, parameter :: r8=8
    real(r8), intent(in) :: temp, airdens
    real(r8), intent(in) :: dgnum, aerodens
    real(r8), intent(out) :: vsettl
    real airkinvisc
    real freepath
    real vsettl_dgnum
    real cunningham_fact
    real pi
    parameter (pi = 3.1415926536)
    real gravity
    parameter (gravity = 980.616)
    airkinvisc = ( 1.8325e-4 * (416.16/(temp+120.0)) * &
                      ((temp/296.16)**1.5) ) / airdens
    freepath = 7.39758e-4 * airkinvisc / sqrt(temp)
    cunningham_fact = 1.0 + 2.0 * freepath/dgnum * ( 1.257+ 0.400 * exp( -0.55 * dgnum/freepath ) )
    vsettl_dgnum = (gravity*aerodens*dgnum*dgnum)/ &
              (18.*airkinvisc*airdens)
    vsettl = vsettl_dgnum * cunningham_fact
    return
    end subroutine aerosol_depvel
    end module module_mosaic_settling


text:
!
!     MIT License
!
!     Copyright (c) 2020 flavianowilliams
!
!     Permission is hereby granted, free of charge, to any person obtaining a copy
!     of this software and associated documentation files (the "Software"), to deal
!     in the Software without restriction, including without limitation the rights
!     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
!     copies of the Software, and to permit persons to whom the Software is
!     furnished to do so, subject to the following conditions:
!
!     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
!     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
!     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
!     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
!     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
!     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
!     SOFTWARE.
!
      subroutine output(vacf,strmm,flexmm,int)

      implicit none

      integer ird,irdd,iwrx,iwrt,iwtt,iwrz,iwrh
      integer opm,ddw,bnd,flx,i
      integer oph(2,10,3),natk(2,10,3),opz(2)
      real(kind=4) dni,strcut,vacf,strmm,flexmm,int

      common/acfdata/ opm,opz,oph,ddw,bnd,flx,dni,strcut,natk
      common/units/ ird,irdd,iwrh,iwrx,iwtt,iwrz,iwrt

      write(iwrt,*)
      write(iwrt,*)
      write(iwrt,*)'Valores de saida'
      write(iwrt,*)'Molecula',opm
      write(iwrt,*)('-',i=1,41)
      write(iwrt,'(4x,a8,7x,a7,7x,a5)')'Grandeza','Unidade','Valor'
      write(iwrt,*)('-',i=1,41)
      write(iwrt,'(a13,4x,a11,4x,f5.2)')'Difusao','x10-5 cm2/s',vacf
      write(iwrt,'(a13,4x,a8,7x,f5.2)')'Dipolo','Debye',int
      write(iwrt,'(a13,4x,a9,6x,f5.2)')'Estiramento','Angstrom',strmm
      write(iwrt,'(a13,4x,a8,6x,f6.2)')'Angulo flexao','Graus',flexmm
      write(iwrt,*)('-',i=1,41)

      return

      end subroutine output


! most of subroutined are for testing. I don't recommend to use this program for serious projects.

module sparse_type
  implicit none
  type dcsr_t
    integer :: m, n
    logical :: is_cr_owner = .true.
    real(8), pointer :: v(:) => NULL()
    integer, pointer :: c(:) => NULL(), r(:) => NULL()
  end type
end module

module dcsr_builder
  use sparse_type
  implicit none
  integer :: numelems, allocsz, currentrow, currentcol
contains
  subroutine initialize(A, m, n, sz)
    type(dcsr_t), intent(inout) :: A
    integer, intent(in) :: m, n
    integer, optional :: sz

    if(associated(A%v)) deallocate(A%v)
    if(associated(A%c)) deallocate(A%c)
    if(associated(A%r)) deallocate(A%r)

    A%m = m
    A%n = n
    A%is_cr_owner = .true.

    currentrow = 1
    currentcol = 0
    numelems = 0
    allocsz = 0

    ! check for null matrix.
    if(m .eq. 0) return

    allocate(A%r(m+1))
    A%r(1) = 1

    if(n .eq. 0) then
      ! null matrix with logical rows.
      A%r(2:m+1) = 1
      return
    end if
    if(present(sz) .and. sz .ge. 1) then
      allocate(A%v(sz), A%c(sz))
      allocsz = sz
    end if
  end subroutine

  subroutine share_cr(A, B)
    ! build matrix B which has same zero-structure with A
    type(dcsr_t), intent(in) :: A
    type(dcsr_t), intent(out) :: B

    allocate(B%v(A%r(A%m+1)-1))
    B%m = A%m
    B%n = A%n
    B%is_cr_owner = .false.
    B%c => A%c
    B%r => A%r
  end subroutine

  subroutine append_row(A, i, d)
    type(dcsr_t), intent(inout) :: A
    integer, intent(in) :: i
    real(8), intent(in) :: d

    if( i .le. currentcol ) error stop
    if( .not. associated(A%v) .or. numelems .eq. allocsz ) then
      call resize(A)
    end if
    numelems = numelems + 1
    currentcol = i
    A%v(numelems) = d
    A%c(numelems) = i
  end subroutine

  subroutine nextrow(A)
    type(dcsr_t), intent(in) :: A

    if(currentrow == A%m + 1) error stop
    currentrow = currentrow + 1
    currentcol = 0
    A%r(currentrow) = numelems + 1
  end subroutine

  subroutine resize(A)
    type(dcsr_t), intent(inout) :: A
    real(8), pointer :: vtemp(:)
    integer, pointer :: ctemp(:)
    integer :: sztemp

    if(allocsz == 0) then
      if(associated(A%v)) deallocate(A%v)
      if(associated(A%c)) deallocate(A%c)
      allocate(A%v(1), A%c(1))
      allocsz = 1
    else
      sztemp = allocsz * 2
      allocate(vtemp(sztemp), ctemp(sztemp))
      vtemp(1:allocsz) = A%v(1:allocsz)
      ctemp(1:allocsz) = A%c(1:allocsz)
      deallocate(A%v)
      deallocate(A%c)
      A%v => vtemp
      A%c => ctemp
      allocsz = sztemp
    end if
  end subroutine

  subroutine finalize(A)
    type(dcsr_t), intent(inout) :: A
    if(associated(A%v)) deallocate(A%v)
    if(A%is_cr_owner .and. associated(A%c)) deallocate(A%c)
    if(A%is_cr_owner .and. associated(A%r)) deallocate(A%r)
  end subroutine
end module

module sparse_blas
  use sparse_type
  implicit none
#ifdef USEMKL
include "mkl.fi"
#endif

contains
  subroutine spmv_test(M, x, y)
    type(dcsr_t), intent(in) :: M
    real(8), intent(in) :: x(M%n)
    real(8), intent(out) :: y(M%m)

#ifdef USEMKL
    call mkl_dcsrmv('n', M%m, M%n, 1d0, 'giifii', &
      M%v, M%c, M%r, M%r(2:), x, 1d0, y)
#else
    integer :: i, j
    real(8) :: t
    do i = 1, M%m
      t = 0d0
      if(M%r(i) .eq. M%r(i+1)) continue
      do j = M%r(i), M%r(i+1) - 1
        t = t + M%v(j) * x(M%c(j))
      end do
      y(i) = t
    end do
#endif
  end subroutine

  subroutine spmv_T(M, x, y)
    type(dcsr_t), intent(in) :: M
    real(8), intent(in) :: x(M%n)
    real(8), intent(out) :: y(M%m)

#ifdef USEMKL
    call mkl_dcsrmv('t', M%n, M%m, 1d0, 'giifii', &
      M%v, M%c, M%r, M%r(2:), x, 1d0, y)
#else
    integer :: i, j
    y = 0d0
    do i = 1, M%m
      if(M%r(i) .eq. M%r(i+1)) continue
      do j = M%r(i), M%r(i+1) - 1
        y(M%c(j)) = y(M%c(j)) + M%v(j) * x(i)
      end do
    end do
#endif
  end subroutine

   subroutine spmm_test(A, x, ldx, ncol, y, ldy)
    type(dcsr_t), intent(in) :: A
    integer, intent(in) :: ncol, ldx, ldy
    real(8), intent(in) :: x(ldx, ncol)
    real(8), intent(inout) :: y(ldy, ncol)

#ifdef USEMKL
    call mkl_dcsrmm('n', A%m, ncol, A%n, 1d0, 'giifii', &
      A%v, A%c, A%r, A%r(2:), x, ldx, 0d0, y, ldy)
#else
    integer :: i
    do i=1, ncol
      call spmv_test(A, x(:,i), y(:,i))
    end do
#endif
  end subroutine

  subroutine spmm_T(A, x, ldx, ncol, y, ldy)
    type(dcsr_t), intent(in) :: A
    integer, intent(in) :: ncol, ldx, ldy
    real(8), intent(in) :: x(ldx, ncol)
    real(8), intent(inout) :: y(ldy, ncol)

#ifdef USEMKL
    call mkl_dcsrmm('t', A%m, ncol, A%n, 1d0, 'giifii', &
      A%v, A%c, A%r, A%r(2:), x, ldx, 0d0, y, ldy)
#else
    integer :: i
    do i=1, ncol
      call spmv_T(A, x(:,i), y(:,i))
    end do
#endif
  end subroutine

  subroutine kron_dencesq_eye(m, A, n, B)
    use dcsr_builder
    integer, intent(in) :: m, n
    real(8), intent(in) :: A(m, m)
    type(dcsr_t), intent(out) :: B

    integer :: i, j, e

    call initialize(B, m*n, m*n, m*m*n)

    do i = 1, m*n
      e = (i-1)*m
      B%r(i) = e + 1
      do j = 1, m
        B%v(e+j) = A((i-1)/n+1, j)
        B%c(e+j) = mod(i-1,n) + 1 + (j-1)*n
      end do
    end do
    B%r(m*n+1) = m*m*n + 1
  end subroutine

  subroutine kron_sp_eye(A, n, B)
    use dcsr_builder
    integer, intent(in) :: n
    type(dcsr_t), intent(in) :: A
    type(dcsr_t), intent(out) :: B

    integer :: sz, nrbl
    integer :: i, ii, j, p, q, pr, nc
    sz = A%r(A%m+1) - 1
    nrbl = A%m

    call initialize(B, A%m * n, A%n * n, sz*n)

    do ii = 1, nrbl
      pr = A%r(ii)
      nc = A%r(ii+1) - pr
      q = (pr-1) * n + 1
      !print *, '**', ii, q, nc
      do i = 1, n
        B%r((ii-1)*n + i) = q
        p = pr
        do j = 1, nc
          B%v(q) = A%v(p)
          B%c(q) = (A%c(p)-1) * n + i
          p = p + 1
          q = q + 1
          !print *, (ii-1)*n+i, j, B%v(q-1), B%c(q-1)
        end do
      end do
    end do
    B%r(B%m+1) = sz*n + 1
  end subroutine

  subroutine kron_eye_spsq(n, A, B)
    use dcsr_builder
    integer, intent(in) :: n
    type(dcsr_t), intent(in) :: A
    type(dcsr_t), intent(out) :: B

    integer :: ii, sz, rbl
    rbl = A%m
    sz = A%r(A%m+1) - 1

    call initialize(B, A%m * n, A%n * n, sz*n+1)

    B%r(1) = 1

    do ii = 1, n
      B%v((ii-1)*sz+1:ii*sz) = A%v(1:sz)
      B%c((ii-1)*sz+1:ii*sz) = A%c(1:sz) + (ii-1)*rbl
      B%r((ii-1)*rbl+2:ii*rbl+1) = A%r(2:rbl+1) + (ii-1)*sz
    end do

  end subroutine

  function num_unique(x, m, y, n)
    integer :: num_unique
    integer, intent(in) :: x(:), y(:)
    integer, intent(in) :: m, n

    integer :: i, j, num
    i = 1
    j = 1
    num = 0

    do
      if(i .eq. m+1 .or. j .eq. n+1) exit
      if(x(i) .eq. y(j)) then
        num = num + 1
        i = i + 1
        j = j + 1
      else if(x(i) .le. y(j)) then
        num = num + 1
        i = i + 1
      else
        num = num + 1
        j = j + 1
      end if
    end do
    num_unique = num + (m+1-i) + (n+1-j)
  end function

  subroutine spadd(A, alpha, B, beta, C)
    use dcsr_builder
    type(dcsr_t), intent(in) :: A, B
    real(8), intent(in) :: alpha, beta
    type(dcsr_t), intent(out) :: C

    integer :: i, sz=0, m, n, rsza, rszb, p, q, ca, cb

    if(A%m .ne. B%m .or. A%n .ne. B%n) error stop
    m = A%m
    n = A%n

    ! count the size of C
    do i=1,m
      rsza = A%r(i+1) - A%r(i)
      rszb = B%r(i+1) - B%r(i)
      sz = sz + num_unique(A%c(A%r(i):A%r(i+1)-1), rsza, B%c(B%r(i):B%r(i+1)-1), rszb)
    end do

    call initialize(C, m, n, sz)

    do i=1, m
      rsza = A%r(i+1)
      rszb = B%r(i+1)
      p = A%r(i)
      q = B%r(i)
      do
        if(p .eq. rsza .or. q .eq. rszb) exit
        ca = A%c(p)
        cb = B%c(q)
        if(ca .eq. cb) then
          !print *, '$$AB', ca, A%v(p), cb, B%v(q)
          call append_row(C, ca, A%v(p) * alpha + B%v(q) * beta)
          p = p + 1
          q = q + 1
        else if(ca .lt. cb) then
          !print *, '$$A1', ca, A%v(p)
          call append_row(C, ca, A%v(p) * alpha)
          p = p + 1
        else
          !print *, '$$B1', cb, B%v(q)
          call append_row(C, cb, B%v(q) * beta)
          q = q + 1
        end if
      end do
      do
        if(p .eq. rsza) exit
        !print *, '$$A2', ca, A%v(p)
        ca = A%c(p)
        call append_row(C, ca, A%v(p) * alpha)
        p = p + 1
      end do
      do
        if(q .eq. rszb) exit
        !print *, '$$B2', cb, B%v(q)
        cb = B%c(q)
        call append_row(C, cb, B%v(q) * beta)
        q = q + 1
      end do
      call nextrow(C)
    end do
  end subroutine

end module

module sparse_utils
  use sparse_type
  implicit none

contains
  subroutine printsp(M)
    type(dcsr_t), intent(in) :: M
    integer :: i, j,  pr, e
    e = 1
    do i = 1, M%m
      pr = M%r(i)
      if( M%r(i+1) .eq. pr ) continue
      do j = 1, M%c(M%r(i+1)-1)
        if( j .eq. M%c(e) ) then
          write (*,fmt='(a)',advance='no') "*"
          e = e + 1
        else
          write (*,fmt='(a)',advance='no') " "
        end if
      end do
      print *, " "
    end do
  end subroutine

  subroutine f2cindex(A)
    type(dcsr_t), intent(inout) ::A
    A%r = A%r - 1
    A%c = A%c - 1
  end subroutine
  subroutine c2findex(A)
    type(dcsr_t), intent(inout) :: A
    A%r = A%r + 1
    A%c = A%c + 1
  end subroutine

  subroutine dnscsr(m, n, A, lda, B)
    use dcsr_builder
    integer, intent(in) :: m, n, lda
    real(8), intent(in) :: A(lda, n)
    type(dcsr_t), intent(out) :: B

    integer :: numelem, i, j
    numelem = 0

    ! count non-zeros, allocate and build csr.
    do j = 1, n
      do i = 1, m
        if( A(j, i) .ne. 0d0 ) numelem = numelem + 1
      end do
    end do

    call initialize(B, m, n, numelem)
    B%r(m+1) = numelem + 1

    numelem = 1
    do j = 1, n
      B%r(j) = numelem
      do i = 1, m
        if( A(j, i) .ne. 0d0 ) then
          B%v(numelem) = A(j, i)
          B%c(numelem) = i
          numelem = numelem + 1
        end if
      end do
    end do
  end subroutine

  subroutine csrdns(A, B, lda)
    type(dcsr_t), intent(in) :: A
    integer, intent(in) :: lda
    real(8), intent(out) :: B(lda, A%n)

    integer :: i, j

    B(1:A%m, 1:A%n) = 0d0

    do i=1,A%m
      if(A%r(i) .eq. A%r(i+1)) continue
      do j=A%r(i),A%r(i+1)-1
        B(i,A%c(j)) = A%v(j)
      end do
    end do
  end subroutine

end module

#ifdef UNIT_TEST
program main
  use sparse_type
  use dcsr_builder
  use sparse_blas
  use sparse_utils
  use pardiso_solver

  implicit none

  type(dcsr_t) :: A, B, C, D, E, F, G
  real(8) :: x(4), y(4), M(4,4), s(4)

  real(8) :: T(2,2)

  type(solver_init_t) :: env
  type(solver_t) :: slv
  integer :: error

  A%m = 4
  A%n = 4
  allocate(A%v(7), A%c(7), A%r(5))
  A%v = (/ 1d0, 2d0, 1d0, 2d0, 1d0, 2d0, 1d0 /)
  A%c = (/ 1, 2, 2, 3, 3, 4, 4 /)
  A%r = (/ 1, 3, 5, 7, 8 /)
  x = (/ 1d0, 2d0, 3d0, 4d0 /)
  call printsp(A)

  call spmv_test(A, x, y)
  print *, y

  M(:,:) = 0.
  M(1,1) = 1.
  M(1,2) = 2.
  M(2,2) = 1.
  M(2,3) = 2.
  M(3,3) = 1.
  M(3,4) = 2.
  M(4,4) = 1.
  call dnscsr(4, 4, M, 4, B)
  call printsp(B)
  print *, int(B%v)
  print *, B%c
  print *, B%r

  T(1,1) = 2.
  T(1,2) = 1.
  T(2,1) = 3.
  T(2,2) = 4.
  call kron_dencesq_eye(2,T,5,C)
  call printsp(C)
  print *, int(C%v)
  print *, C%c
  print *, C%r

  call kron_sp_eye(A, 3, D)
  call printsp(D)
  print *, int(D%v)
  print *, D%c
  print *, D%r

  call kron_eye_spsq(3, A, E)
  call printsp(E)
  print *, int(E%v)
  print *, E%c
  print *, E%r

  call spadd(D, 1d0, E, 2d0, G)
  call printsp(G)
  print *, int(G%v)
  print *,  G%c
  print *, G%r

  call initialize(F, 4, 4)
  call append_row(F, 1, 3d0)
  call append_row(F, 4, 1d0)
  call nextrow(F)
  call append_row(F, 1, 1d0)
  call append_row(F, 3, 3d0)
  call nextrow(F)
  call append_row(F, 4, 1d0)
  call nextrow(F)
  call append_row(F, 1, 1d0)
  call append_row(F, 4, 4d0)
  call nextrow(F)
  call printsp(F)
  print *, int(F%v)
  print *, F%c
  print *, F%r

  call solver_initialize(env)
  call pardiso_chkmatrix(11, 4, A%v, A%c, A%r, error)
  print *, error
  call pardiso_printstats(11, 4, A%v, A%c, A%r, 1, y, error)
  print *, error
  call solver_analyze(env, slv, 1, A, 1, 1)
  call solver_factorize(env, slv, 1, A)
  s = y
  call solver_solve(env, slv, 1, A, s)
  print *, int(x)
  print *, int(y)
  print *, int(s)
  call solver_finalize(env, slv)
end program

#endif