tmm_param.F90 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. !###############################################################################
  2. !
  3. ! NAME
  4. ! tmm_param - parameter specfic keys
  5. !
  6. ! USAGE
  7. !
  8. ! use tmm_param
  9. !
  10. ! ! Character keys for vertical combination,
  11. ! ! to be used as input for 'CopyAndProcess' routine of 'Grid' module.
  12. ! ! Specifies how to combine multiple levels:
  13. ! !
  14. ! ! 'bottom' : use bottom value (most close to the ground)
  15. ! ! 'top' : use top value (most close to the model top)
  16. ! ! 'sum' : sum values
  17. ! ! 'aver' : average of all levels
  18. ! ! 'mass-aver' : mass weighted average
  19. ! !
  20. ! call CombineKey( combkey, 'pu'|'T'|... )
  21. !
  22. !
  23. !### macro's ###################################################################
  24. !
  25. #define TRACEBACK write (gol,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__; call goErr
  26. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  27. #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
  28. !
  29. #include "tmm.inc"
  30. !
  31. !###############################################################################
  32. module tmm_param
  33. implicit none
  34. ! --- in/out ------------------------------
  35. private
  36. public :: GetCombineKeys
  37. ! --- const ---------------------------------------
  38. character(len=*), parameter :: mname = 'module tmm_param'
  39. contains
  40. ! ==============================================================
  41. subroutine GetCombineKeys( hcomb, vcomb, paramkey, status )
  42. ! --- in/out ---------------------------------
  43. character(len=*), intent(out) :: hcomb
  44. character(len=*), intent(out) :: vcomb
  45. character(len=*), intent(in) :: paramkey
  46. integer, intent(out) :: status
  47. ! --- const --------------------------------------
  48. character(len=*), parameter :: name = mname//', GetCombineKeys'
  49. ! --- begin ---------------------------------
  50. select case ( paramkey )
  51. ! ~~~ tm fields ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  52. case ( 'sp', 'spm', 'sp_sfc' )
  53. hcomb = 'area-aver'
  54. vcomb = 'none'
  55. case ( 'oro' , 'lsm' , 'sr', 'srols', 'sr_ols', 'sr_mer', &
  56. 'cvl', 'cvh', &
  57. 'tv01', 'tv02', 'tv03', 'tv04', 'tv05', &
  58. 'tv06', 'tv07', 'tv08', 'tv09', 'tv10', &
  59. 'tv11', 'tv12', 'tv13', 'tv14', 'tv15', &
  60. 'tv16', 'tv17', 'tv18', 'tv19', 'tv20', &
  61. 'swvl1', &
  62. 'al', 'albedo', &
  63. 'lsrh', 'ci' , '10fg', 'g10m', 'u10m', 'v10m', 'sd', &
  64. 'lsp' , 'cp' , 'sf' , 'sshf', 'slhf', 'blh' , &
  65. 't2m' , 'd2m' , &
  66. 'ssr' , 'ssrd', 'str', 'strd', &
  67. 'sstr', 'ewss', 'nsss', &
  68. 'src' , 'raero', 'ustar', &
  69. 'sst' , 'skt', &
  70. 'ch4fire' )
  71. hcomb = 'area-aver'
  72. vcomb = 'none'
  73. case ( 'pu', 'pv', 'mfu', 'mfv' )
  74. hcomb = 'sum'
  75. vcomb = 'sum'
  76. case ( 'pw', 'mfw' )
  77. hcomb = 'sum'
  78. vcomb = 'bottom'
  79. case ( 'T', 'Tv', 'Q', 'PVo', 'PV', 'theta' )
  80. hcomb = 'mass-aver'
  81. vcomb = 'mass-aver'
  82. case ( 'CLWC', 'CIWC', 'CC', &
  83. 'clwc', 'ciwc', 'cc' )
  84. hcomb = 'mass-aver'
  85. vcomb = 'mass-aver'
  86. case ( 'eu', 'du', 'ed', 'dd' )
  87. hcomb = 'area-aver'
  88. vcomb = 'sum'
  89. ! ecmwf convective fields:
  90. ! o mass fluxes in kg/m2, upper half level
  91. ! o detrainments in kg/m2/m
  92. case ( 'UDMF', 'DDMF' )
  93. hcomb = 'area-aver'
  94. ! vcomb = 'TEST-THAT-IS-NOT-USED'
  95. vcomb = 'top'
  96. case ( 'UDDR', 'DDDR' )
  97. hcomb = 'area-aver'
  98. ! vcomb = 'TEST-THAT-IS-NOT-USED'
  99. vcomb = 'height-aver'
  100. ! ecmwf turbulent diffusiton coeff for heat:
  101. ! o upper half level
  102. case ( 'K' )
  103. hcomb = 'area-aver'
  104. vcomb = 'top'
  105. case ( 'u', 'v' )
  106. hcomb = 'aver'
  107. vcomb = 'aver'
  108. ! relic from the time that TMPP archived meteo in grib files ...
  109. !case ( 'Kz' )
  110. ! hcomb = 'none'
  111. ! vcomb = 'bottom'
  112. case ( 'cco', 'CCO' )
  113. hcomb = 'area-aver'
  114. vcomb = 'bottom'
  115. case ( 'ccu', 'CCU' )
  116. hcomb = 'area-aver'
  117. vcomb = 'top'
  118. ! ~~~ sh/gg fields ~~~~~~~~~~~~~~~~~~~~~
  119. case ( 'lnsp' )
  120. hcomb = 'exp,aver'
  121. vcomb = 'none'
  122. ! ~~~ dummy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123. case default
  124. !write (*,'("ERROR - do not know how to combine levels for parameter `",a,"`")') paramkey
  125. !write (*,'("ERROR in ",a)') name; status=1; return
  126. hcomb = 'unknown'
  127. vcomb = 'unknown'
  128. end select
  129. ! ok
  130. status = 0
  131. end subroutine GetCombineKeys
  132. end module tmm_param