FV3 Bundle
c_qg_model.F90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine c_qg_setup (c_confspec, c_key_geom, c_key_confdata)
 Setup the QG model. More...
 
subroutine c_qg_delete (c_key_conf)
 Delete the QG model. More...
 
subroutine c_qg_prepare_integration (c_key_conf, c_key_state)
 Prepare for an integration of the QG model. More...
 
subroutine c_qg_prepare_integration_ad (c_key_conf, c_key_incr)
 Prepare for an integration of the QG model - Adjoint. More...
 
subroutine c_qg_prepare_integration_tl (c_key_conf, c_key_incr)
 Prepare for an integration of the QG model - Tangent Linear. More...
 
subroutine c_qg_propagate (c_key_conf, c_key_state)
 Perform a timestep of the QG model. More...
 
subroutine c_qg_propagate_ad (c_key_conf, c_key_incr, c_key_traj)
 Perform a timestep of the QG model - Adjoint This routine is called from C++ to propagate the adjoint variables. More...
 
subroutine c_qg_propagate_tl (c_key_conf, c_key_incr, c_key_traj)
 Perform a timestep of the QG model - Tangent Linear This routine is called from C++ to propagate the increment. More...
 
subroutine c_qg_prop_traj (c_key_conf, c_key_state, c_key_traj)
 Save trajectory and perform a timestep of the QG model. More...
 
subroutine c_qg_wipe_traj (c_key_traj)
 Wipe out trajectory of the QG model. More...
 

Function/Subroutine Documentation

◆ c_qg_delete()

subroutine c_qg_delete ( integer(c_int), intent(inout)  c_key_conf)

Delete the QG model.

Parameters
[in,out]c_key_confKey to configuration structure

Definition at line 139 of file c_qg_model.F90.

◆ c_qg_prepare_integration()

subroutine c_qg_prepare_integration ( integer(c_int), intent(in)  c_key_conf,
integer(c_int), intent(in)  c_key_state 
)

Prepare for an integration of the QG model.

At the start of a timestep of the QG model, the state must contain streamfunction, potential vorticity and wind components. The control variable for the analysis, however, contains only streamfunction. This routine calculates potential vorticity and wind from the streamfunction, and is called before an integration of the QG model.

Parameters
[in]c_key_confConfiguration structure
[in]c_key_stateModel fields

Definition at line 165 of file c_qg_model.F90.

Here is the call graph for this function:

◆ c_qg_prepare_integration_ad()

subroutine c_qg_prepare_integration_ad ( integer(c_int), intent(in)  c_key_conf,
integer(c_int), intent(in)  c_key_incr 
)

Prepare for an integration of the QG model - Adjoint.

Parameters
[in]c_key_confConfiguration structure
[in]c_key_incrModel fields

Definition at line 197 of file c_qg_model.F90.

Here is the call graph for this function:

◆ c_qg_prepare_integration_tl()

subroutine c_qg_prepare_integration_tl ( integer(c_int), intent(in)  c_key_conf,
integer(c_int), intent(in)  c_key_incr 
)

Prepare for an integration of the QG model - Tangent Linear.

Parameters
[in]c_key_confConfiguration structure
[in]c_key_incrModel fields

Definition at line 231 of file c_qg_model.F90.

Here is the call graph for this function:

◆ c_qg_prop_traj()

subroutine c_qg_prop_traj ( integer(c_int), intent(in)  c_key_conf,
integer(c_int), intent(in)  c_key_state,
integer(c_int), intent(inout)  c_key_traj 
)

Save trajectory and perform a timestep of the QG model.

Parameters
[in]c_key_confConfig structure
[in]c_key_stateModel fields
[in,out]c_key_trajTrajectory structure

Definition at line 442 of file c_qg_model.F90.

Here is the call graph for this function:

◆ c_qg_propagate()

subroutine c_qg_propagate ( integer(c_int), intent(in)  c_key_conf,
integer(c_int), intent(in)  c_key_state 
)

Perform a timestep of the QG model.

Parameters
[in]c_key_confConfig structure
[in]c_key_stateModel fields

Definition at line 259 of file c_qg_model.F90.

Here is the call graph for this function:

◆ c_qg_propagate_ad()

subroutine c_qg_propagate_ad ( integer(c_int), intent(in)  c_key_conf,
integer(c_int), intent(in)  c_key_incr,
integer(c_int), intent(in)  c_key_traj 
)

Perform a timestep of the QG model - Adjoint This routine is called from C++ to propagate the adjoint variables.

Parameters
[in]c_key_confConfig structure
[in]c_key_incrModel fields
[in]c_key_trajTrajectory structure

Definition at line 285 of file c_qg_model.F90.

Here is the call graph for this function:

◆ c_qg_propagate_tl()

subroutine c_qg_propagate_tl ( integer(c_int), intent(in)  c_key_conf,
integer(c_int), intent(in)  c_key_incr,
integer(c_int), intent(in)  c_key_traj 
)

Perform a timestep of the QG model - Tangent Linear This routine is called from C++ to propagate the increment.

Parameters
[in]c_key_confConfig structure
[in]c_key_incrModel fields
[in]c_key_trajTrajectory structure

Definition at line 364 of file c_qg_model.F90.

Here is the call graph for this function:

◆ c_qg_setup()

subroutine c_qg_setup ( type(c_ptr), intent(in)  c_confspec,
integer(c_int), intent(in)  c_key_geom,
integer(c_int), intent(inout)  c_key_confdata 
)

Setup the QG model.

The C++ code only knows about dimensional variables, whereas the QG model is expressed in terms of non-dimensional variables. Here, we query the configuration for the dimensional values, calculate the equivalent non-dimensional values, and store them in the config structure.

The convention used in the QG model is that a zero is appended to the names of dimensional variables, whereas non-dimensional variable names do not end in zero. (An exception to this convention are the layer depths: D1 and D2.)

The non-dimensionalisation is the usual one:

\begin{eqnarray*} t &=& \tilde t \frac{\overline U}{L} \\\ x &=& \frac{\tilde x}{L} \\\ y &=& \frac{\tilde y}{L} \\\ u &=& \frac{\tilde u}{\overline U} \\\ v &=& \frac{\tilde v}{\overline U} \\\ F_1 &=& \frac{f_0^2 L^2}{D_1 g \Delta\theta / {\overline\theta}} \\\ F_2 &=& \frac{f_0^2 L^2}{D_2 g \Delta\theta / {\overline\theta}} \\\ \beta &=& \beta_0 \frac{L^2}{\overline U} \end{eqnarray*}

where \( \overline U \), \( L \), \( \Delta\theta / {\overline\theta} \), etc. are defined in qg_constants.f90 .

The Rossby number is \( \epsilon = {\overline U} / f_0 L \).

Parameters
[in]c_confspecpointer to object of class Config
[in]c_key_geomGeometry
[in,out]c_key_confdataKey to configuration data

Definition at line 40 of file c_qg_model.F90.

◆ c_qg_wipe_traj()

subroutine c_qg_wipe_traj ( integer(c_int), intent(inout)  c_key_traj)

Wipe out trajectory of the QG model.

Parameters
[in,out]c_key_trajTrajectory structure

Definition at line 473 of file c_qg_model.F90.

Here is the call graph for this function: