21 integer(kind=i_kind) :: idx_o3, idx_no, idx_no2, idx_o2
27 character(len=*),
parameter :: fmt_hdr =
"(A10,',',A10,',',A10,',',A10,',',A10)"
28 character(len=*),
parameter :: fmt_dat =
"(ES10.4,',',ES10.4,',',ES10.4,',',ES10.4,',',ES10.4)"
33 integer(kind=i_kind) :: i_time
39 call camp_core%initialize( )
43 if( .not.camp_core%get_chem_spec_data( chem_spec_data ) )
then
44 write(*,*)
"Something's gone wrong!"
48 idx_o3 = chem_spec_data%gas_state_id(
"O3" )
49 idx_no = chem_spec_data%gas_state_id(
"NO" )
50 idx_no2 = chem_spec_data%gas_state_id(
"NO2" )
51 idx_o2 = chem_spec_data%gas_state_id(
"O2" )
52 if( idx_o3.eq.0 .or. idx_no2.eq.0 .or.idx_o2.eq.0 )
then
53 write(*,*)
"Missing species!"
59 call camp_core%solver_initialize( )
60 camp_state => camp_core%new_state( )
62 call camp_state%env_states(1)%set_temperature_K( 275.4_dp )
63 call camp_state%env_states(1)%set_pressure_Pa( 101532.2_dp )
65 camp_state%state_var( idx_o3 ) = 0.13
66 camp_state%state_var( idx_no ) = 0.02
67 camp_state%state_var( idx_no2 ) = 0.053
68 camp_state%state_var( idx_o2 ) = 2.1e5
72 write(*,fmt_hdr)
"time",
"O3",
"NO",
"NO2",
"O2"
74 call camp_core%solve( camp_state, 1.0d-15 )
75 write(*,fmt_dat) i_time*1.0e-15, &
76 camp_state%state_var( idx_o3 ), &
77 camp_state%state_var( idx_no ), &
78 camp_state%state_var( idx_no2 ), &
79 camp_state%state_var( idx_o2 )
82 deallocate( camp_core )
83 deallocate( camp_state )
The camp_core_t structure and associated subroutines.
The camp_state_t structure and associated subroutines.
The chem_spec_data_t structure and associated subroutines.