Calculates specific volume of sea water from T, S and P.
Definition at line 75 of file MOM_EOS.F90.
|
| subroutine | calc_spec_vol_scalar (T, S, pressure, specvol, EOS, spv_ref, scale) |
| | Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs. More...
|
| |
| subroutine | calculate_spec_vol_array (T, S, pressure, specvol, start, npts, EOS, spv_ref, scale) |
| | Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs. More...
|
| |
| subroutine | calc_spec_vol_1d (T, S, pressure, specvol, EOS, dom, spv_ref, scale) |
| | Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on. More...
|
| |
Calculates specific volume of sea water from T, S and P.
Definition at line 75 of file MOM_EOS.F90.
◆ calc_spec_vol_1d()
| subroutine mom_eos::calculate_spec_vol::calc_spec_vol_1d |
( |
real, dimension(:), intent(in) |
T, |
|
|
real, dimension(:), intent(in) |
S, |
|
|
real, dimension(:), intent(in) |
pressure, |
|
|
real, dimension(:), intent(inout) |
specvol, |
|
|
type(eos_type), pointer |
EOS, |
|
|
integer, dimension(2), intent(in), optional |
dom, |
|
|
real, intent(in), optional |
spv_ref, |
|
|
real, intent(in), optional |
scale |
|
) |
| |
|
private |
Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs, potentially limiting the domain of indices that are worked on.
- Parameters
-
| [in] | t | Potential temperature referenced to the surface [degC] |
| [in] | s | Salinity [ppt] |
| [in] | pressure | Pressure [R L2 T-2 ~> Pa] |
| [in,out] | specvol | In situ specific volume [R-1 ~> m3 kg-1] |
| eos | Equation of state structure |
| [in] | dom | The domain of indices to work on, taking into account that arrays start at 1. |
| [in] | spv_ref | A reference specific volume [R-1 ~> m3 kg-1] |
| [in] | scale | A multiplicative factor by which to scale output specific volume in combination with scaling given by US [various] |
Definition at line 571 of file MOM_EOS.F90.
571 real,
dimension(:),
intent(in) :: t
572 real,
dimension(:),
intent(in) :: s
573 real,
dimension(:),
intent(in) :: pressure
574 real,
dimension(:),
intent(inout) :: specvol
575 type(eos_type),
pointer :: eos
576 integer,
dimension(2),
optional,
intent(in) :: dom
578 real,
optional,
intent(in) :: spv_ref
579 real,
optional,
intent(in) :: scale
583 real,
dimension(size(specvol)) :: pres
587 real :: spv_reference
588 integer :: i, is, ie, npts
590 if (.not.
associated(eos))
call mom_error(fatal, &
591 "calc_spec_vol_1d called with an unassociated EOS_type EOS.")
593 if (
present(dom))
then 594 is = dom(1) ; ie = dom(2) ; npts = 1 + ie - is
596 is = 1 ; ie =
size(specvol) ; npts = 1 + ie - is
599 p_scale = eos%RL2_T2_to_Pa
600 spv_unscale = eos%kg_m3_to_R
602 if ((p_scale == 1.0) .and. (spv_unscale == 1.0))
then 603 call calculate_spec_vol_array(t, s, pressure, specvol, is, npts, eos, spv_ref)
604 elseif (
present(spv_ref))
then 605 do i=is,ie ; pres(i) = p_scale * pressure(i) ;
enddo 606 spv_reference = spv_unscale*spv_ref
607 call calculate_spec_vol_array(t, s, pres, specvol, is, npts, eos, spv_reference)
610 do i=is,ie ; pres(i) = p_scale * pressure(i) ;
enddo 611 call calculate_spec_vol_array(t, s, pres, specvol, is, npts, eos)
614 spv_scale = eos%R_to_kg_m3
615 if (
present(scale)) spv_scale = spv_scale * scale
616 if (spv_scale /= 1.0)
then ;
do i=is,ie
617 specvol(i) = spv_scale * specvol(i)
◆ calc_spec_vol_scalar()
| subroutine mom_eos::calculate_spec_vol::calc_spec_vol_scalar |
( |
real, intent(in) |
T, |
|
|
real, intent(in) |
S, |
|
|
real, intent(in) |
pressure, |
|
|
real, intent(out) |
specvol, |
|
|
type(eos_type), pointer |
EOS, |
|
|
real, intent(in), optional |
spv_ref, |
|
|
real, intent(in), optional |
scale |
|
) |
| |
|
private |
Calls the appropriate subroutine to calculate specific volume of sea water for scalar inputs.
- Parameters
-
| [in] | t | Potential temperature referenced to the surface [degC] |
| [in] | s | Salinity [ppt] |
| [in] | pressure | Pressure [Pa] or [R L2 T-2 ~> Pa] |
| [out] | specvol | In situ? specific volume [m3 kg-1] or [R-1 ~> m3 kg-1] |
| eos | Equation of state structure |
| [in] | spv_ref | A reference specific volume [m3 kg-1] or [R-1 m3 kg-1] |
| [in] | scale | A multiplicative factor by which to scale specific volume in combination with scaling given by US [various] |
Definition at line 533 of file MOM_EOS.F90.
533 real,
intent(in) :: t
534 real,
intent(in) :: s
535 real,
intent(in) :: pressure
536 real,
intent(out) :: specvol
537 type(eos_type),
pointer :: eos
538 real,
optional,
intent(in) :: spv_ref
539 real,
optional,
intent(in) :: scale
542 real,
dimension(1) :: ta, sa, pres, spv
543 real :: spv_reference
546 if (.not.
associated(eos))
call mom_error(fatal, &
547 "calc_spec_vol_scalar called with an unassociated EOS_type EOS.")
549 pres(1) = eos%RL2_T2_to_Pa*pressure
550 ta(1) = t ; sa(1) = s
552 if (
present(spv_ref))
then 553 spv_reference = eos%kg_m3_to_R*spv_ref
554 call calculate_spec_vol_array(ta, sa, pres, spv, 1, 1, eos, spv_reference)
556 call calculate_spec_vol_array(ta, sa, pres, spv, 1, 1, eos)
560 spv_scale = eos%R_to_kg_m3
561 if (
present(scale)) spv_scale = spv_scale * scale
562 if (spv_scale /= 1.0)
then 563 specvol = spv_scale * specvol
◆ calculate_spec_vol_array()
| subroutine mom_eos::calculate_spec_vol::calculate_spec_vol_array |
( |
real, dimension(:), intent(in) |
T, |
|
|
real, dimension(:), intent(in) |
S, |
|
|
real, dimension(:), intent(in) |
pressure, |
|
|
real, dimension(:), intent(inout) |
specvol, |
|
|
integer, intent(in) |
start, |
|
|
integer, intent(in) |
npts, |
|
|
type(eos_type), pointer |
EOS, |
|
|
real, intent(in), optional |
spv_ref, |
|
|
real, intent(in), optional |
scale |
|
) |
| |
|
private |
Calls the appropriate subroutine to calculate the specific volume of sea water for 1-D array inputs.
- Parameters
-
| [in] | t | potential temperature relative to the surface [degC] |
| [in] | s | salinity [ppt] |
| [in] | pressure | pressure [Pa] |
| [in,out] | specvol | in situ specific volume [kg m-3] |
| [in] | start | the starting point in the arrays. |
| [in] | npts | the number of values to calculate. |
| eos | Equation of state structure |
| [in] | spv_ref | A reference specific volume [m3 kg-1] |
| [in] | scale | A multiplicative factor by which to scale specific volume in combination with scaling given by US [various] |
Definition at line 486 of file MOM_EOS.F90.
486 real,
dimension(:),
intent(in) :: t
487 real,
dimension(:),
intent(in) :: s
488 real,
dimension(:),
intent(in) :: pressure
489 real,
dimension(:),
intent(inout) :: specvol
490 integer,
intent(in) :: start
491 integer,
intent(in) :: npts
492 type(eos_type),
pointer :: eos
493 real,
optional,
intent(in) :: spv_ref
494 real,
optional,
intent(in) :: scale
497 real,
dimension(size(specvol)) :: rho
500 if (.not.
associated(eos))
call mom_error(fatal, &
501 "calculate_spec_vol_array called with an unassociated EOS_type EOS.")
503 select case (eos%form_of_EOS)
505 call calculate_spec_vol_linear(t, s, pressure, specvol, start, npts, &
506 eos%rho_T0_S0, eos%drho_dT, eos%drho_dS, spv_ref)
508 call calculate_spec_vol_unesco(t, s, pressure, specvol, start, npts, spv_ref)
510 call calculate_spec_vol_wright(t, s, pressure, specvol, start, npts, spv_ref)
512 call calculate_spec_vol_teos10(t, s, pressure, specvol, start, npts, spv_ref)
514 call calculate_density_nemo(t, s, pressure, rho, start, npts)
515 if (
present(spv_ref))
then 516 specvol(:) = 1.0 / rho(:) - spv_ref
518 specvol(:) = 1.0 / rho(:)
521 call mom_error(fatal,
"calculate_spec_vol_array: EOS%form_of_EOS is not valid.")
524 if (
present(scale))
then ;
if (scale /= 1.0)
then ;
do j=start,start+npts-1
525 specvol(j) = scale * specvol(j)
526 enddo ;
endif ;
endif
The documentation for this interface was generated from the following file:
- /home/cermak/src/MOM6.devrob/src/equation_of_state/MOM_EOS.F90