FV3 Bundle
ufo_stericheight_mod.F90
Go to the documentation of this file.
1 ! (C) Copyright 2017-2018 UCAR
2 !
3 ! This software is licensed under the terms of the Apache Licence Version 2.0
4 ! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5 
6 !> Fortran module to handle steric height operator
7 
9 
10 use iso_c_binding
11 use ufo_vars_mod
13 use kinds
14 
15 implicit none
16 public :: ufo_stericheight
18 private
19 integer, parameter :: max_string=800
20 
21 !> Fortran derived type for steric height observation operator
23 end type ufo_stericheight
24 
25 
26 ! ------------------------------------------------------------------------------
27 
28 contains
29 
30 ! ------------------------------------------------------------------------------
31 
32 subroutine ufo_stericheight_simobs(self, geovals, hofx)
33 implicit none
34 type(ufo_stericheight), intent(in) :: self
35 type(ufo_geovals), intent(in) :: geovals
36 real(c_double), intent(inout) :: hofx(:)
37 
38 character(len=*), parameter :: myname_="ufo_stericheight_simobs"
39 character(max_string) :: err_msg
40 
41 integer :: iobs
42 type(ufo_geoval), pointer :: geoval_temp, geoval_salt, geoval_adt
43 
44 print *,myname_
45 
46 !dh - this cant be done here *** hofx%nobs = geovals%nobs
47 print *, myname_, ' nobs: ', geovals%nobs, size(hofx,1)
48 
49 ! check if nobs is consistent in geovals & hofx
50 if (geovals%nobs /= size(hofx,1)) then
51  write(err_msg,*) myname_, ' error: nobs inconsistent!'
52  call abor1_ftn(err_msg)
53 endif
54 
55 ! Sea surface height above geoid (absolute dynamic topography)
56 call ufo_geovals_get_var(geovals, var_abs_topo, geoval_adt)
57 
58 ! Potential Temperature
59 call ufo_geovals_get_var(geovals, var_ocn_pot_temp, geoval_temp)
60 
61 ! Salinity
62 call ufo_geovals_get_var(geovals, var_ocn_salt, geoval_salt)
63 
64 ! Steric height obs operator
65 do iobs = 1, size(hofx,1)
66  hofx(iobs) = geoval_adt%vals(1,iobs)
67  write(102,*)hofx(iobs)
68 enddo
69 
70 end subroutine ufo_stericheight_simobs
71 
72 
73 end module ufo_stericheight_mod
subroutine, public ufo_geovals_get_var(self, varname, geoval, status)
integer, parameter max_string
subroutine, public ufo_stericheight_simobs(self, geovals, hofx)
character(len=maxvarlen), public var_ocn_salt
character(len=maxvarlen), public var_ocn_pot_temp
type to hold interpolated fields required by the obs operators
character(len=maxvarlen), public var_abs_topo
Fortran derived type for steric height observation operator.
type to hold interpolated field for one variable, one observation
Fortran module to handle steric height operator.