recover_temperature_constant_cp Subroutine

public subroutine recover_temperature_constant_cp(params, energy)

Recover T from h using the constant-cp thermodynamic model.

Arguments

Type IntentOptional Attributes Name
type(case_params_t), intent(in) :: params
type(energy_fields_t), intent(inout) :: energy

Source Code

   subroutine recover_temperature_constant_cp(params, energy)
      type(case_params_t), intent(in) :: params
      type(energy_fields_t), intent(inout) :: energy

      if (.not. allocated(energy%T) .or. .not. allocated(energy%h)) then
         call fatal_error('energy', 'energy arrays are not allocated')
      end if

      if (params%energy_cp <= tiny_safe) then
         call fatal_error('energy', 'energy_cp must be positive')
      end if

      energy%T = params%energy_reference_T + &
                 (energy%h - params%energy_reference_h) / params%energy_cp
   end subroutine recover_temperature_constant_cp