use_insitu_pcm Function

private pure function use_insitu_pcm(pgf, ms, eos) result(yes)

Does the FV_MOM6 constant-by-layer branch take the IN-SITU density path (compute_fv_mom6_insitu_pcm_impl)? Only when it can change the answer: the knob is on, there is an EOS handle and T/S to evaluate it on, and the EOS depends on pressure. For the linear EOS ms%rho_layer already IS the in-situ density, so the legacy path runs, bit-identical.

Arguments

Type IntentOptional Attributes Name
type(ocean_pressure_force_t), intent(in) :: pgf
type(multilayer_state_t), intent(in) :: ms
type(eos_t), intent(in), optional :: eos

Return Value logical


Called by

proc~~use_insitu_pcm~~CalledByGraph proc~use_insitu_pcm use_insitu_pcm proc~ocean_pressure_force_compute ocean_pressure_force_compute proc~ocean_pressure_force_compute->proc~use_insitu_pcm proc~run_stage run_stage proc~run_stage->proc~ocean_pressure_force_compute proc~run_stage_split run_stage_split proc~run_stage_split->proc~ocean_pressure_force_compute proc~ocean_dyn_step ocean_dyn_step proc~ocean_dyn_step->proc~run_stage proc~ocean_dyn_step_split ocean_dyn_step_split proc~ocean_dyn_step_split->proc~run_stage_split proc~engine_step engine_step proc~engine_step->proc~ocean_dyn_step proc~engine_step->proc~ocean_dyn_step_split proc~driver_run_ocean driver_run_ocean proc~driver_run_ocean->proc~engine_step proc~rdb_ocean_step rdb_ocean_step proc~rdb_ocean_step->proc~engine_step

Source Code

   pure function use_insitu_pcm(pgf, ms, eos) result(yes)
      !! Does the FV_MOM6 constant-by-layer branch take the IN-SITU
      !! density path (`compute_fv_mom6_insitu_pcm_impl`)?  Only when it
      !! can change the answer: the knob is on, there is an EOS handle and
      !! T/S to evaluate it on, and the EOS depends on pressure.  For the
      !! linear EOS `ms%rho_layer` already IS the in-situ density, so the
      !! legacy path runs, bit-identical.
      type(ocean_pressure_force_t), intent(in) :: pgf
      type(multilayer_state_t), intent(in) :: ms
      type(eos_t), intent(in), optional :: eos
      logical :: yes
      yes = .false.
      if (.not. pgf%insitu_density) return
      if (.not. present(eos)) return
      if (ms%idx_salinity <= 0 .or. ms%idx_temperature <= 0) return
      yes = eos%variant == EOS_VARIANT_WRIGHT_97 .or. &
            eos%variant == EOS_VARIANT_ROQUET_SPV
   end function use_insitu_pcm