1module columnVariableTransforms_mod
2 ! MODULE columnVariableTransforms_mod (prefix='cvt' category='4. Data Object transformations')
3 !
4 !:Purpose: To store various functions for variable transforms using inputs
5 ! from column(s). Outputs are also placed in a column.
6 !
7 use columnData_mod
8 use utilities_mod
9 use calcHeightAndPressure_mod
10 use utilities_mod
11
12 implicit none
13 save
14 private
15
16 ! public procedures
17 public :: cvt_transform
18
19CONTAINS
20
21 !--------------------------------------------------------------------------
22 ! cvt_transform
23 !--------------------------------------------------------------------------
24 subroutine cvt_transform(columnInc, transform, columnRefOnIncLev_opt)
25 implicit none
26
27 ! Arguments:
28 type(struct_columnData), intent(inout) :: columnInc
29 character(len=*), intent(in) :: transform
30 type(struct_columnData), optional, intent(in) :: columnRefOnIncLev_opt
31
32 select case(trim(transform))
33
34 case ('ZandP_nl')
35 call czp_calcZandP_nl(columnInc)
36
37 case ('ZandP_tl')
38 if (.not. present(columnRefOnIncLev_opt)) then
39 call utl_abort('cvt_transform: columnRefOnIncLev_opt required')
40 end if
41 call czp_calcZandP_tl(columnInc, columnRefOnIncLev_opt)
42
43 case ('ZandP_ad')
44 if (.not. present(columnRefOnIncLev_opt)) then
45 call utl_abort('cvt_transform: columnRefOnIncLev_opt required')
46 end if
47 call czp_calcZandP_ad(columnInc, columnRefOnIncLev_opt)
48
49 case default
50 write(*,*)
51 write(*,*) 'Unsupported function : ', trim(transform)
52 call utl_abort('cvt_transform')
53 end select
54
55 end subroutine cvt_transform
56
57end module columnVariableTransforms_mod