dims_grid__eur.F90 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. !#################################################################
  2. !
  3. ! Grids.
  4. !
  5. !### macro's #####################################################
  6. !
  7. #define TRACEBACK write (gol,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__; call goErr
  8. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  9. #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
  10. !
  11. #include "tm5.inc"
  12. !
  13. !#################################################################
  14. module dims_grid
  15. use GO, only : gol, goPr, goErr
  16. implicit none
  17. ! --- in/out ------------------------------
  18. public
  19. ! --- const -------------------------------
  20. ! Basic model definition: resolution etc. including some routines
  21. ! to fill the data structure.
  22. ! basic (coarsest) resolution in degrees for x and y (dz default 1.0)
  23. real, parameter :: dx = 6.0
  24. real, parameter :: dy = 4.0
  25. real, parameter :: dz = 1.0
  26. ! Maximum number of zoom regions,
  27. ! including the basic (coarsest grid) region;
  28. ! arrays are allocated for each of these regions:
  29. integer, parameter :: nregions_max = 3
  30. ! extra grid:
  31. integer, parameter :: nregions_all = nregions_max + 1
  32. integer, parameter :: iglbsfc = nregions_max + 1
  33. ! Actual number of zoom regions,
  34. ! during testing this could be set to 1 to quickly run the model.
  35. ! The include file should contains the following line:
  36. !
  37. ! integer, parameter :: nregions=3
  38. !
  39. ! The include file 'dims_grid.h_template' is only a template;
  40. ! the actual file is written by the 'configure' script.
  41. include "dims_grid.h"
  42. ! region_name is used to recognise the METEO files
  43. ! region_name is also used in the HDF output file name
  44. ! region 1 should always be the global domain
  45. character(len=10), parameter :: region_name(0:nregions_all) = &
  46. (/ 'globe ','glb600x400','eur300x200','eur100x100','glb100x100'/)
  47. ! coordinates (in degrees) for each region:
  48. ! xcyc = 1 if the region has cyclic x-boundary conditions
  49. ! touch_np = 1 if region touches the north pole
  50. ! touch_sp = 1 if region touches the south pole
  51. ! xbeg : the westmost border of the region
  52. ! xend : the eastmost border of the region
  53. ! ybeg : the southmost border of the region
  54. ! yend : the northmost border of the region
  55. ! zbeg : should be 0 (zooming in the vertical not implemented)
  56. ! zend : should be lm (zooming the the vertical not implemented)
  57. ! NOTE : zbeg and zend should be the same for all regions
  58. ! dimensions are NOT calculated automatically
  59. ! (several compilers complain about these obscure lines ...)
  60. !
  61. !integer,dimension(nregions),parameter :: &
  62. ! im = (xend(1:nregions)-xbeg(1:nregions))/(dx/xref(1:nregions)) + .5
  63. !integer,dimension(nregions),parameter :: &
  64. ! jm = (yend(1:nregions)-ybeg(1:nregions))/(dy/yref(1:nregions)) + .5
  65. integer, dimension(0:nregions_all), parameter :: &
  66. xcyc = (/ 1, 1, 0, 0, 1 /), &
  67. touch_np = (/ 1, 1, 0, 0, 1 /), &
  68. touch_sp = (/ 1, 1, 0, 0, 1 /), &
  69. xbeg = (/ -180, -180, -36, -21, -180 /), &
  70. xend = (/ 180, 180, 54, 39, 180 /), &
  71. ybeg = (/ -90, -90, 2, 12, -90 /), &
  72. yend = (/ 90, 90, 74, 66, 90 /), &
  73. im = (/ 1, 60, 30, 60, 360 /), &
  74. jm = (/ 1, 45, 36, 54, 180 /)
  75. ! maximum refinement factor (can be arbitrary in principle):
  76. integer, parameter :: maxref = 10
  77. ! refinement factors for each region (<= maxref)
  78. ! tref may differ from xref/yref. In the current
  79. ! implementation it should be 1,2,4,6,...
  80. integer, dimension(0:nregions_max), parameter :: &
  81. xref = (/ 1, 1, 2, 6 /), &
  82. yref = (/ 1, 1, 2, 4 /), &
  83. zref = (/ 1, 1, 1, 1 /), &
  84. tref = (/ 1, 1, 2, 4 /)
  85. ! Define the parent of each region.
  86. ! Global region 1 should have parent 0.
  87. integer, parameter :: parent(nregions_max) = (/ 0, 1, 2 /)
  88. ! NB: number of region should not be smaller than number of its parent:
  89. ! region > parent(region)
  90. end module dims_grid