Called for each column per timestep this will calculate the buoyancy terms for the SW field.
102 type(model_state_type),
target,
intent(inout) :: current_state
107 if (.not. current_state%passive_th .and. current_state%th%active)
then 108 do k=2,current_state%local_grid%size(z_index)-1
109 w_buoyancy(k)=(0.5_default_precision*current_state%global_grid%configuration%vertical%buoy_co(k))*&
110 (current_state%th%data(k, current_state%column_local_y, current_state%column_local_x)&
111 +current_state%th%data(k+1, current_state%column_local_y, current_state%column_local_x))
112 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)=&
113 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)+w_buoyancy(k)
116 if (.not. current_state%passive_q .and. current_state%number_q_fields .gt. 0)
then 117 if (current_state%use_anelastic_equations)
then 118 do n=1,current_state%number_q_fields
119 do k=2,current_state%local_grid%size(z_index)-1
120 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)=&
121 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)+&
122 (0.5_default_precision*current_state%global_grid%configuration%vertical%buoy_co(k))*&
123 current_state%cq(n)* (current_state%global_grid%configuration%vertical%thref(k)*&
124 current_state%q(n)%data(k, current_state%column_local_y, current_state%column_local_x)+&
125 current_state%global_grid%configuration%vertical%thref(k+1)*&
126 current_state%q(n)%data(k+1, current_state%column_local_y, current_state%column_local_x))
130 do n=1,current_state%number_q_fields
131 do k=2,current_state%local_grid%size(z_index)-1
132 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)=&
133 current_state%sw%data(k, current_state%column_local_y, current_state%column_local_x)+&
134 g_over_2*current_state%cq(n)*&
135 (current_state%q(n)%data(k, current_state%column_local_y, current_state%column_local_x)+&
136 current_state%q(n)%data(k+1, current_state%column_local_y, current_state%column_local_x))