grid.F90 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. !
  2. !ProTeX: 1.15
  3. !
  4. !BOI
  5. !
  6. ! !TITLE: Grid - grid definitions and transformations
  7. ! !AUTHORS: Arjo Segers
  8. ! !AFFILIATION: KNMI
  9. ! !DATE: 21/04/2004
  10. !
  11. ! !INTRODUCTION: Introduction
  12. !
  13. ! \bv
  14. !
  15. ! NAME
  16. ! grid - grid definitions, interpolations, etc
  17. !
  18. ! LAT/LON GRIDS
  19. !
  20. ! ! conect grid module:
  21. ! use grid
  22. !
  23. ! ! declare grid definition and grid:
  24. ! type(TllGridInfo) :: lli
  25. ! real, allocatable :: ll(:,:)
  26. !
  27. ! ! define global grid of 2.5x2.5 degrees:
  28. ! ! (mid point west, dlon, nlon, mid point south, dlat, nlat)
  29. ! call Init( lli, -180.0, 2.5, 144, -90.0, 2.5, 72 )
  30. !
  31. ! ! storage of grid:
  32. ! allocate( ll(lli%im,lli%jm) )
  33. !
  34. ! ! check if grid size is ok:
  35. ! call Check( lli, ll )
  36. !
  37. ! ! devide or multiply all cells with their area:
  38. ! call AreaOper( lli, ll, '/', 'rad2' ) ! [ll]/rad^2
  39. ! call AreaOper( lli, ll, '/', 'm2' ) ! [ll]/m^2
  40. ! call AreaOper( lli, ll, '*', 'rad2' ) ! [ll] rad^2
  41. ! call AreaOper( lli, ll, '*', 'm2' ) ! [ll] m^2
  42. !
  43. ! !
  44. ! ! Fill ll (defined by lli,nuv) with values from llX (defined by lliX,nuvX)
  45. ! !
  46. ! call FillGrid( lli, nuv, ll, lliX, nuvX, llX, combkey, status )
  47. ! !
  48. ! ! Key to identify data positions:
  49. ! ! 'n' : value valid for cell (center) ll(1:nlon ,1:nlat )
  50. ! ! 'u' : value valid for east/west boundaries ll(1:nlon+1,1:nlat )
  51. ! ! 'v' : value valid for north/south boundaries ll(1:nlon ,1:nlat+1)
  52. ! !
  53. ! ! Coverage of lli by lliX :
  54. ! ! o lliX is larger than or equal to lli -> all cells in ll changed
  55. ! ! o lliX is smaller than lli -> only part of ll is changed
  56. ! !
  57. ! ! Create new ll from llX:
  58. ! ! o llX is superset -> copy values from llX into ll
  59. ! ! o llX is fine -> fill ll by combining cells in llX
  60. ! ! (average/sum/etc given the combine key)
  61. ! !
  62. ! ! Combine keys: 'aver', 'sum'
  63. ! !
  64. !
  65. ! ! clear memory:
  66. ! deallocate( ll )
  67. ! call Done( lli )
  68. !
  69. ! HIARCHY
  70. !
  71. ! binas # general constants (pi etc)
  72. !
  73. ! singleton # FFT routine
  74. !
  75. ! grid_tools # area of a rectangle etc
  76. !
  77. ! grid_type_ll # define lat/lon grid
  78. ! grid_type_gg # define Gaussian grid
  79. ! grid_type_sh # define spherical harmonic grid
  80. !
  81. ! grid_interpol # interpolate between grid types
  82. !
  83. ! grid_type_hyb # hybride level definition
  84. !
  85. ! grid_3d # transform 3D fields
  86. !
  87. ! grid # main module, collects all grid stuff
  88. !
  89. !
  90. ! CHANGES
  91. ! Arjo Segers
  92. !
  93. ! \ev
  94. !
  95. !EOI
  96. !
  97. module grid
  98. use grid_tools
  99. use grid_type_ll
  100. use grid_type_gg
  101. use grid_type_sh
  102. use grid_interpol
  103. use grid_type_hyb
  104. use grid_3d
  105. implicit none
  106. public
  107. end module grid