61     type(model_state_type), 
target, 
intent(inout) :: current_state
 
   69        if (current_state%passive_q) 
then  
   72           call log_master_log(log_warn, 
"The combination if baroclinicity and active q is not allowed, code will run but"// & 
 
   73                " no advection of mean baroclinicity")
 
   77     fcoriol=options_get_real(current_state%options_database, 
"fcoriol")
 
   95       allocate( 
tend_3d_th(current_state%local_grid%size(z_index),  &
 
   96                            current_state%local_grid%size(y_index),  &
 
   97                            current_state%local_grid%size(x_index)   )    )
 
  100       allocate( 
tend_3d_tabs(current_state%local_grid%size(z_index),  &
 
  101                              current_state%local_grid%size(y_index),  &
 
  102                              current_state%local_grid%size(x_index)   )    )
 
  107       allocate( 
tend_pr_tot_th(current_state%local_grid%size(z_index)) )
 
  120     type(model_state_type), 
target, 
intent(inout) :: current_state
 
  136     type(model_state_type), 
target, 
intent(inout) :: current_state
 
  138     integer :: current_x_index, current_y_index, target_x_index, target_y_index
 
  140     current_x_index=current_state%column_local_x
 
  141     current_y_index=current_state%column_local_y
 
  142     target_y_index=current_y_index-current_state%local_grid%halo_size(y_index)
 
  143     target_x_index=current_x_index-current_state%local_grid%halo_size(x_index)
 
  146     if (current_state%first_timestep_column) 
then 
  178     type(model_state_type), 
target, 
intent(inout) :: current_state
 
  179     integer, 
intent(in) :: local_y, local_x
 
  182     real(kind=default_precision) :: sctmp1, sctmp2
 
  184     if (current_state%use_anelastic_equations) 
then 
  186       do k=2, current_state%local_grid%size(z_index)
 
  187         sctmp1=current_state%global_grid%configuration%vertical%tzc1(k)*2.0_default_precision*&
 
  188              current_state%global_grid%configuration%vertical%dthref(k-1)
 
  189         sctmp2=current_state%global_grid%configuration%vertical%tzc2(k)*2.0_default_precision*&
 
  190              current_state%global_grid%configuration%vertical%dthref(k)
 
  191         current_state%sth%data(k, local_y, local_x)=current_state%sth%data(k, local_y, local_x)-(sctmp1*&
 
  192              current_state%w%data(k-1, local_y, local_x) + sctmp2*current_state%w%data(k, local_y, local_x))
 
  202     type(model_state_type), 
target, 
intent(inout) :: current_state
 
  203     integer, 
intent(in) :: local_y, local_x
 
  208        if (current_state%use_anelastic_equations) 
then 
  209           do k=2, current_state%local_grid%size(z_index)
 
  210              current_state%sth%data(k, local_y, local_x)=current_state%sth%data(k, local_y, local_x)+&
 
  211                   current_state%global_grid%configuration%vertical%thref(k)*
fcoriol_over_g*&
 
  216           do k=2, current_state%local_grid%size(z_index)
 
  217              current_state%sth%data(k, local_y, local_x)=current_state%sth%data(k, local_y, local_x)+&
 
  234     type(model_state_type), 
target, 
intent(in) :: current_state
 
  235     integer, 
intent(in) ::  cxn, cyn, txn, tyn
 
  239       tend_3d_th(:,tyn,txn)=current_state%sth%data(:,cyn,cxn)
 
  242       tend_3d_tabs(:,tyn,txn)=current_state%sth%data(:,cyn,cxn) * current_state%global_grid%configuration%vertical%rprefrcp(:)
 
  255     type(model_state_type), 
target, 
intent(inout) :: current_state
 
  256     integer, 
intent(in) ::  cxn, cyn, txn, tyn
 
  264        current_state%sth%data(:,cyn,cxn) * current_state%global_grid%configuration%vertical%rprefrcp(:)   &
 
  285     type(model_state_type), 
target, 
intent(inout) :: current_state
 
  286     character(len=*), 
intent(in) :: name
 
  287     type(component_field_information_type), 
intent(out) :: field_information
 
  291     strcomp=index(name, 
"thadvection_3d_local")
 
  292     if (strcomp .ne. 0) 
then 
  293       field_information%field_type=component_array_field_type
 
  294       field_information%number_dimensions=3
 
  295       field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
 
  296       field_information%dimension_sizes(2)=current_state%local_grid%size(y_index)
 
  297       field_information%dimension_sizes(3)=current_state%local_grid%size(x_index)
 
  298       field_information%data_type=component_double_data_type
 
  300       if (name .eq. 
"tend_th_thadvection_3d_local") 
then 
  302       else if (name .eq. 
"tend_tabs_thadvection_3d_local") 
then 
  305         field_information%enabled=.true.
 
  311     strcomp=index(name, 
"thadvection_profile_total_local")
 
  312     if (strcomp .ne. 0) 
then 
  313       field_information%field_type=component_array_field_type
 
  314       field_information%number_dimensions=1
 
  315       field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
 
  316       field_information%data_type=component_double_data_type
 
  318       if (name .eq. 
"tend_th_thadvection_profile_total_local") 
then 
  320       else if (name .eq. 
"tend_tabs_thadvection_profile_total_local") 
then 
  323         field_information%enabled=.true.
 
  336     type(model_state_type), 
target, 
intent(inout) :: current_state
 
  337     character(len=*), 
intent(in) :: name
 
  338     type(component_field_value_type), 
intent(out) :: field_value
 
  341     if (name .eq. 
"tend_th_thadvection_3d_local" .and. 
allocated(
tend_3d_th)) 
then 
  343     else if (name .eq. 
"tend_tabs_thadvection_3d_local" .and. 
allocated(
tend_3d_tabs)) 
then 
  347     else if (name .eq. 
"tend_th_thadvection_profile_total_local" .and. 
allocated(
tend_pr_tot_th)) 
then 
  349     else if (name .eq. 
"tend_tabs_thadvection_profile_total_local" .and. 
allocated(
tend_pr_tot_tabs)) 
then 
  361     type(component_field_value_type), 
intent(inout) :: field_value
 
  362     real(kind=default_precision), 
dimension(:), 
optional :: real_1d_field
 
  363     real(kind=default_precision), 
dimension(:,:), 
optional :: real_2d_field
 
  364     real(kind=default_precision), 
dimension(:,:,:), 
optional :: real_3d_field
 
  366     if (
present(real_1d_field)) 
then 
  367       allocate(field_value%real_1d_array(
size(real_1d_field)), source=real_1d_field)
 
  368     else if (
present(real_2d_field)) 
then 
  369       allocate(field_value%real_2d_array(
size(real_2d_field, 1), 
size(real_2d_field, 2)), source=real_2d_field)
 
  370     else if (
present(real_3d_field)) 
then 
  371       allocate(field_value%real_3d_array(
size(real_3d_field, 1), 
size(real_3d_field, 2), 
size(real_3d_field, 3)), &
 
  372                source=real_3d_field)