file_grib_base.F90 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. !#######################################################################
  2. !
  3. #define TRACEBACK write (*,'("ERROR in ",a," (line",i5,")")') __FILE__, __LINE__
  4. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  5. #define IF_ERROR_RETURN(action) if (status >0) then; TRACEBACK; action; return; end if
  6. !
  7. !#######################################################################
  8. module file_grib_base
  9. implicit none
  10. ! --- in/out -------------------------------
  11. private
  12. public :: levtype_sfc, levtype_hyb, levtype_land, levtype_hyb2
  13. public :: gridtype_ll, gridtype_gg, gridtype_sh, gridtype_red_gg
  14. public :: pidname, pidmax
  15. ! public :: pid_T
  16. ! public :: pid_Q
  17. ! public :: pid_U, pid_V, pid_W
  18. ! public :: pid_SP, pid_LNSP
  19. ! public :: pid_VO, pid_D
  20. ! public :: pid_Z, pid_LSM
  21. ! public :: pid_SR, pid_AL, pid_LSRH
  22. ! public :: pid_SLHF
  23. ! public :: pid_CLWC, pid_CIWC, pid_CC
  24. ! --- const ------------------------------
  25. character(len=*), parameter :: mname = 'file_grib_base'
  26. ! *** Type of level (Code Table 3)
  27. integer, parameter :: levtype_sfc = 1 ! ground or water surface
  28. integer, parameter :: levtype_hyb = 109 ! hybrid level half-level [Grib1]
  29. integer, parameter :: levtype_hyb_full = 110 ! hybrid level full-level [Grib1]
  30. integer, parameter :: levtype_hyb2 = 105 ! hybrid levels (both full or half) [Grib2]
  31. integer, parameter :: levtype_land = 112 ! layer below surface
  32. ! ! *** parameter identifier (Code Table 2)
  33. !
  34. ! ! o numbers
  35. !
  36. ! integer, parameter :: pid_Z = 129 ! geopotential (orography)
  37. ! integer, parameter :: pid_T = 130 ! temperature
  38. ! integer, parameter :: pid_U = 131 ! u-velocity
  39. ! integer, parameter :: pid_V = 132 ! v-velocity
  40. ! integer, parameter :: pid_Q = 133 ! specific humidity
  41. ! integer, parameter :: pid_SP = 134 ! surface pressure
  42. ! integer, parameter :: pid_W = 135 ! vertical velocity
  43. !
  44. ! integer, parameter :: pid_VO = 138 ! vorticity
  45. !
  46. ! integer, parameter :: pid_SLHF = 147 ! surface latent heat flux (W m**-2 s)
  47. !
  48. ! integer, parameter :: pid_LNSP = 152 ! ln surface pressure
  49. !
  50. ! integer, parameter :: pid_D = 155 ! divergence
  51. !
  52. ! integer, parameter :: pid_LSM = 172 ! land sea mask
  53. ! integer, parameter :: pid_SR = 173 ! Surface roughness m
  54. ! integer, parameter :: pid_AL = 174 ! Albedo (0-1)
  55. !
  56. ! integer, parameter :: pid_LSRH = 234 ! Logarithm of SR length for heat
  57. !
  58. ! integer, parameter :: pid_CLWC = 246 ! cloud liquid water content
  59. ! integer, parameter :: pid_CIWC = 247 ! cloud ice water content
  60. ! integer, parameter :: pid_CC = 248 ! cloud cover
  61. ! o maximum number
  62. integer, parameter :: pidmax = 260
  63. ! o names
  64. character(len=4), parameter :: pidname(pidmax) = (/ &
  65. 'a ','b ','c ','d ','e ','f ','g ','p008','p009','p010', &
  66. 'p011','p012','p013','p014','p015','p016','p017','p018','p019','p020', &
  67. 'p021','p022','p023','p024','p025','p026','p027','p028','p029','p030', &
  68. 'p031','p032','p033','p034','p035','p036','p037','p038','p039','p040', &
  69. 'p041','p042','p043','p044','p045','p046','p047','p048','p049','p050', &
  70. 'p051','p052','p053','p054','p055','p056','p057','p058','p059','p060', &
  71. 'p061','p062','p063','p064','p065','p066','p067','p068','p069','p070', &
  72. 'p071','p072','p073','p074','p075','p076','p077','p078','p079','p080', &
  73. 'p081','p082','p083','p084','p085','p086','p087','p088','p089','p090', &
  74. 'p091','p092','p093','p094','p095','p096','p097','p098','p099','p100', &
  75. 'p101','p102','p103','p104','p105','p106','p107','p108','p109','p110', &
  76. 'p111','p112','p113','p114','p115','p116','p117','p118','p119','p120', &
  77. 'p121','p122','p123','p124','p125','p126','p127','p128','Z ','T ', &
  78. 'U ','V ','Q ','SP ','W ','p136','p137','VO ','p139','p140', &
  79. 'SD ','LSP ','CP ','SF ','p145','SSHF','SLHF','p148','p149','p150', &
  80. 'p151','LNSP','p153','p154','D ','zg ','pw ','pu ','pv ','sp ', &
  81. 'eu ','du ','dk ','ed ','dd ','p166','T2M ','D2M ','p169','p170', &
  82. 'p171','LSM ','SR ','AL ','p175','SSR ','p177','p178','p179','EWSS', &
  83. 'NSSS','p182','p183','p184','p185','p186','p187','p188','p189','clb ', &
  84. 'clt ','clfs','p193','p194','p195','p196','p197','SRC ','p199','p200', &
  85. 'p201','p202','p203','p204','p205','p206','p207','p208','p209','p210', &
  86. 'p211','p212','p213','p214','p215','p216','p217','p218','p219','p220', &
  87. 'p221','p222','p223','p224','p225','p226','p227','p228','p229','p230', &
  88. 'p231','p232','p233','LSRH','p235','p236','p237','p238','p239','p240', &
  89. 'p241','p242','p243','p244','p245','CLWC','CIWC','CC ','cco ','ccu ', &
  90. 'p251','p252','p253','p254','p255','p256','p257','p258','p259','p260' /)
  91. ! *** data representation type (Code Table 6)
  92. integer, parameter :: gridtype_ll = 0
  93. integer, parameter :: gridtype_gg = 4 ! 40 in Edition 2
  94. integer, parameter :: gridtype_red_gg = 43
  95. integer, parameter :: gridtype_sh = 50
  96. end module file_grib_base