m7_data.F90 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. #define IF_NOTOK_RETURN(action) if (status/=0) then; write (gol,'("in ",a)') rname; call goErr; action; return; end if
  2. #define IF_ERROR_RETURN(action) if (status> 0) then; write (gol,'("in ",a)') rname; call goErr; action; return; end if
  3. !
  4. #include "tm5.inc"
  5. !
  6. !-----------------------------------------------------------------------------
  7. ! TM5 !
  8. !-----------------------------------------------------------------------------
  9. !BOP
  10. !
  11. ! !MODULE: M7_DATA
  12. !
  13. ! !DESCRIPTION: holds m7 data and methods to allocate (INIT_M7_DATA), and
  14. ! deallocate them (FREE_M7_DATA).
  15. !\\
  16. !\\
  17. ! !INTERFACE:
  18. !
  19. MODULE M7_DATA
  20. !
  21. ! !USES:
  22. !
  23. USE GO, ONLY : gol, goErr, goPr
  24. USE mo_aero_m7, ONLY : nmod, nsol
  25. USE tm5_distgrid, ONLY : Get_DistGrid, dgrid
  26. USE chem_param, ONLY : d3_data
  27. USE dims, ONLY : im,jm,lm,nregions
  28. IMPLICIT NONE
  29. !
  30. ! !PUBLIC DATA MEMBERS:
  31. !
  32. INTEGER, PARAMETER :: nm7procs = 88
  33. TYPE(d3_data), DIMENSION(nregions, nmod), TARGET :: rw_mode
  34. TYPE(d3_data), DIMENSION(nregions, nmod), TARGET :: dens_mode
  35. TYPE(d3_data), DIMENSION(nregions, nsol), TARGET :: h2o_mode, rwd_mode
  36. !
  37. ! !REVISION HISTORY:
  38. ! 20 Jun 2012 - P. Le Sager - updated to Narcissa/Achim version : i.e.
  39. ! added rwd_mode
  40. ! - protex; all public by default
  41. ! - adapted for lon-lat MPI domain decomposition
  42. !
  43. ! !REMARKS:
  44. !
  45. !EOP
  46. !------------------------------------------------------------------------
  47. CONTAINS
  48. !--------------------------------------------------------------------------
  49. ! TM5 !
  50. !--------------------------------------------------------------------------
  51. !BOP
  52. !
  53. ! !IROUTINE: INIT_M7_DATA
  54. !
  55. ! !DESCRIPTION:
  56. !\\
  57. !\\
  58. ! !INTERFACE:
  59. !
  60. SUBROUTINE INIT_M7_DATA( status )
  61. !
  62. ! !OUTPUT PARAMETERS:
  63. !
  64. INTEGER, INTENT(out) :: status
  65. !
  66. ! !REVISION HISTORY:
  67. ! 20 Jun 2012 - P. Le Sager - adapted for lon-lat MPI domain decomposition
  68. !
  69. !EOP
  70. !------------------------------------------------------------------------
  71. !BOC
  72. INTEGER :: region, imode, i1, i2, j1, j2, lmr
  73. INTEGER :: l_halo
  74. l_halo = 1
  75. DO region=1,nregions
  76. call Get_DistGrid( dgrid(region), I_STRT=i1, I_STOP=i2, J_STRT=j1, J_STOP=j2 )
  77. lmr = lm(region)
  78. DO imode=1,nmod
  79. ALLOCATE(rw_mode (region,imode)%d3(i1:i2, j1:j2, lmr))
  80. ALLOCATE(dens_mode(region,imode)%d3(i1:i2, j1:j2, lmr))
  81. rw_mode (region,imode)%d3 = 0.1e-6 ! m
  82. dens_mode(region,imode)%d3 = 1800.0 ! kg/m3
  83. rw_mode (region,imode)%halo = 0
  84. dens_mode(region,imode)%halo = 0
  85. ENDDO
  86. DO imode=1,nsol
  87. ALLOCATE(rwd_mode(region,imode)%d3(i1:i2, j1:j2, lmr))
  88. ALLOCATE(h2o_mode(region,imode)%d3(i1-l_halo:i2+l_halo, j1-l_halo:j2+l_halo, lmr))
  89. rwd_mode(region,imode)%d3 = 0.1e-6
  90. h2o_mode(region,imode)%d3 = 0.0
  91. rwd_mode(region,imode)%halo = 0
  92. h2o_mode(region,imode)%halo = l_halo
  93. ENDDO
  94. ENDDO
  95. ! ok
  96. status = 0
  97. END SUBROUTINE INIT_M7_DATA
  98. !EOC
  99. !--------------------------------------------------------------------------
  100. ! TM5 !
  101. !--------------------------------------------------------------------------
  102. !BOP
  103. !
  104. ! !IROUTINE: FREE_M7_DATA
  105. !
  106. ! !DESCRIPTION:
  107. !\\
  108. !\\
  109. ! !INTERFACE:
  110. !
  111. SUBROUTINE FREE_M7_DATA
  112. !
  113. ! !REVISION HISTORY:
  114. ! 20 Jun 2012 - P. Le Sager - no reference to MPI anymore
  115. !
  116. !EOP
  117. !------------------------------------------------------------------------
  118. !BOC
  119. INTEGER :: region, imode
  120. DO region=1,nregions
  121. DO imode=1,nmod
  122. DEALLOCATE(rw_mode(region,imode)%d3)
  123. DEALLOCATE(dens_mode(region,imode)%d3)
  124. ENDDO
  125. DO imode=1,nsol
  126. DEALLOCATE(h2o_mode(region,imode)%d3)
  127. DEALLOCATE(rwd_mode(region,imode)%d3)
  128. ENDDO
  129. ENDDO
  130. END SUBROUTINE FREE_M7_DATA
  131. !EOC
  132. END MODULE M7_DATA