m7_data.F90 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 = 66
  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. ENDDO
  84. DO imode=1,nsol
  85. ALLOCATE(rwd_mode(region,imode)%d3(i1:i2, j1:j2, lmr))
  86. ! added halo for h2o_mode, needed for station output in USER_OUTPUT_AEROCOM
  87. h2o_mode(region,imode)%halo = l_halo
  88. ALLOCATE(h2o_mode(region,imode)%d3(i1-l_halo:i2+l_halo, j1-l_halo:j2+l_halo, lmr))
  89. h2o_mode(region,imode)%d3 = 0.0
  90. rwd_mode(region,imode)%d3 = 0.1e-6
  91. ENDDO
  92. ENDDO
  93. ! ok
  94. status = 0
  95. END SUBROUTINE INIT_M7_DATA
  96. !EOC
  97. !--------------------------------------------------------------------------
  98. ! TM5 !
  99. !--------------------------------------------------------------------------
  100. !BOP
  101. !
  102. ! !IROUTINE: FREE_M7_DATA
  103. !
  104. ! !DESCRIPTION:
  105. !\\
  106. !\\
  107. ! !INTERFACE:
  108. !
  109. SUBROUTINE FREE_M7_DATA
  110. !
  111. ! !REVISION HISTORY:
  112. ! 20 Jun 2012 - P. Le Sager - no reference to MPI anymore
  113. !
  114. !EOP
  115. !------------------------------------------------------------------------
  116. !BOC
  117. INTEGER :: region, imode
  118. DO region=1,nregions
  119. DO imode=1,nmod
  120. DEALLOCATE(rw_mode(region,imode)%d3)
  121. DEALLOCATE(dens_mode(region,imode)%d3)
  122. ENDDO
  123. DO imode=1,nsol
  124. DEALLOCATE(h2o_mode(region,imode)%d3)
  125. DEALLOCATE(rwd_mode(region,imode)%d3)
  126. ENDDO
  127. ENDDO
  128. END SUBROUTINE FREE_M7_DATA
  129. !EOC
  130. END MODULE M7_DATA