! $Id: star_fsi.f90 r4887 2022-11-03 15:48:28Z sti $ !****m* Modules/star_fsi ! ! NAME ! star_fsi - Interface module for the star full spectrum inversion routines. ! ! SYNOPSIS ! USE star_fsi ! ! DESCRIPTION ! This module provides interfaces for the full spectrum inversion ! routines contained in the ROPP PP library. ! ! AUTHOR ! Yong Chen, NOAA/NESDIS/STAR, yong.chen@noaa.gov ! ! COPYRIGHT ! Copyright (c) 2022-2023 Yong Chen ! For further details please refer to the file COPYRIGHT ! which you should have received as part of this distribution. ! !**** MODULE star_fsi !------------------------------------------------------------------------------- ! 1. Other modules !------------------------------------------------------------------------------- USE typesizes, ONLY: wp => EightByteReal USE ropp_pp_types USE ropp_pp_constants USE ropp_pp_utils USE ropp_pp_spline USE load_ciraq_model !------------------------------------------------------------------------------- ! 2. !------------------------------------------------------------------------------- INTERFACE SUBROUTINE gpsleofix(nmax, r_gns, r_leo, r_coc, phase_sm, imon,& r10, r20, teta, full_phase, iflag) USE typesizes, ONLY: wp => EightByteReal INTEGER, INTENT(in) :: nmax ! number of data points considered REAL(wp), DIMENSION(:,:), INTENT(in) :: r_gns ! GNSS coordinates (m) REAL(wp), DIMENSION(:,:), INTENT(in) :: r_leo ! LEO coordinates (m) REAL(wp), DIMENSION(:), INTENT(in) :: r_coc ! Centre curvature (m) REAL(wp), DIMENSION(:,:), INTENT(in) :: phase_sm ! excess phase after smooth (m)[ch, t] INTEGER, INTENT(in) :: imon ! month REAL(wp), INTENT(out) :: r10 ! absolute radius for GNSS (m) REAL(wp), INTENT(out) :: r20 ! absolute radius for LEO (m) REAL(wp), DIMENSION(:), INTENT(out) :: teta ! central angle between 1st and 2nd radius-vectors REAL(wp), DIMENSION(:,:), INTENT(out) :: full_phase! full phase (m) after propagating to circular orbit[ch, t] INTEGER, INTENT(out) :: iflag ! 0~teta increasing with time; 1~teta decreasing END SUBROUTINE gpsleofix END INTERFACE INTERFACE SUBROUTINE phs2dop(phase, dop) USE typesizes, ONLY: wp => EightByteReal REAL(wp), DIMENSION(:,:), INTENT(in) :: phase ! Excess phase (m) [ch, t] REAL(wp), DIMENSION(:,:), INTENT(inout) :: dop ! doppler shift (m) [ch, t] END SUBROUTINE phs2dop END INTERFACE INTERFACE SUBROUTINE dop2phs(phase, dop_sm, phase_sm) USE typesizes, ONLY: wp => EightByteReal REAL(wp), DIMENSION(:,:), INTENT(in) :: phase ! Excess phase (m) [ch, t] REAL(wp), DIMENSION(:,:), INTENT(in) :: dop_sm ! smoothed doppler shift (m) [ch, t] REAL(wp), DIMENSION(:,:), INTENT(inout) :: phase_sm ! Reconstruct phase after smooth (m) [ch, t] END SUBROUTINE dop2phs END INTERFACE INTERFACE SUBROUTINE ray(imonth, x1, y1, z1, x2, y2, z2, & fi1, fi2, dfi2, glat, ras, ierr) USE typesizes, ONLY: wp => EightByteReal INTEGER, INTENT(in) :: imonth REAL(wp), INTENT(in) :: x1, y1, z1, x2, y2, z2 REAL(wp), INTENT(out) :: fi1, fi2, dfi2, glat, ras INTEGER, INTENT(out) :: ierr END SUBROUTINE ray END INTERFACE INTERFACE SUBROUTINE benmod(imonth, glat, a, b, b1, amin, bmax) USE typesizes, ONLY: wp => EightByteReal INTEGER, INTENT(in) :: imonth ! month REAL(wp), INTENT(in) :: glat ! latitude REAL(wp), INTENT(in) :: a ! input bending angle REAL(wp), INTENT(out) :: b ! output bending angle REAL(wp), INTENT(out) :: b1 ! output bending angle derivative REAL(wp), INTENT(out) :: amin ! min impact height REAL(wp), INTENT(out) :: bmax ! max bending angle END SUBROUTINE benmod END INTERFACE INTERFACE SUBROUTINE runav(nw,x,y) USE typesizes, ONLY: wp => EightByteReal INTEGER, INTENT(inout) :: nw ! window size for averaging (nw must be odd !!!) REAL(wp), DIMENSION(:), INTENT(in) :: x ! input array REAL(wp), DIMENSION(:), INTENT(inout) :: y ! output array after smoothing END SUBROUTINE runav END INTERFACE INTERFACE SUBROUTINE remove_spikes(xin, yin, nx, threshold, xout, yout, idx, nout) USE typesizes, ONLY: wp => EightByteReal REAL(wp), DIMENSION(:), INTENT(in) :: xin REAL(wp), DIMENSION(:), INTENT(in) :: yin INTEGER, INTENT(inout) :: nx REAL(wp), INTENT(in) :: threshold REAL(wp), DIMENSION(:), INTENT(inout) :: xout REAL(wp), DIMENSION(:), INTENT(inout) :: yout INTEGER, DIMENSION(:), INTENT(inout) :: idx INTEGER, INTENT(out) :: nout END SUBROUTINE remove_spikes END INTERFACE INTERFACE SUBROUTINE splinx1(x, y, xx, yy, der) USE typesizes, ONLY: wp => EightByteReal REAL(wp), DIMENSION(:), INTENT(in) :: x ! array of input argument data REAL(wp), DIMENSION(:), INTENT(in) :: y ! array of input function data REAL(wp), INTENT(in) :: xx ! output argument data REAL(wp), INTENT(out) :: yy ! output function data REAL(wp), INTENT(out) :: der ! derivative of output function END SUBROUTINE splinx1 END INTERFACE INTERFACE SUBROUTINE sqfit(x, y, a, b, c) USE typesizes, ONLY: wp => EightByteReal REAL(wp), DIMENSION(:), INTENT(IN) :: x REAL(wp), DIMENSION(:), INTENT(IN) :: y REAL(wp), INTENT(OUT) :: a REAL(wp), INTENT(OUT) :: b REAL(wp), INTENT(OUT) :: c END SUBROUTINE sqfit END INTERFACE INTERFACE SUBROUTINE cos_window(x1, x2, dx1, dx2, x, w) USE typesizes, ONLY: wp => EightByteReal REAL(wp), INTENT(IN) :: x1 REAL(wp), INTENT(IN) :: x2 REAL(wp), INTENT(IN) :: dx1 REAL(wp), INTENT(IN) :: dx2 REAL(wp), INTENT(IN) :: x REAL(wp), INTENT(OUT) :: w END SUBROUTINE cos_window END INTERFACE INTERFACE SUBROUTINE fsi_fourier_filter(nmax, nf, x, xf) USE typesizes, ONLY: wp => EightByteReal INTEGER, INTENT(in) :: nmax ! used input data size INTEGER, INTENT(in) :: nf ! half width of response (data points) REAL(wp), DIMENSION(:), INTENT(in) :: x ! input data array REAL(wp), DIMENSION(:), INTENT(out) :: xf ! output data array END SUBROUTINE fsi_fourier_filter END INTERFACE END MODULE star_fsi