user_input__co2.F90 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. !
  2. #define TRACEBACK write (gol,'("in ",a," (",a,", line",i5,")")') rname, __FILE__, __LINE__; call goErr
  3. #define IF_NOTOK_RETURN(action) if (status/=0) then; TRACEBACK; action; return; end if
  4. #define IF_ERROR_RETURN(action) if (status> 0) then; TRACEBACK; action; return; end if
  5. !
  6. #include "tm5.inc"
  7. !
  8. !-----------------------------------------------------------------------------
  9. ! TM5 !
  10. !-----------------------------------------------------------------------------
  11. !BOP
  12. !
  13. ! !MODULE: USER_INPUT
  14. !
  15. ! !DESCRIPTION: provide routine for user to specify his/her own startup
  16. ! values.
  17. !\\
  18. !\\
  19. ! !INTERFACE:
  20. !
  21. MODULE USER_INPUT
  22. !
  23. ! !USES:
  24. !
  25. use GO, only : gol, goPr, goErr
  26. implicit none
  27. private
  28. !
  29. ! !PUBLIC MEMBER FUNCTIONS:
  30. !
  31. public :: user_input_start
  32. !
  33. ! !PRIVATE DATA MEMBERS:
  34. !
  35. character(len=*), parameter :: mname = 'user_input'
  36. !
  37. ! !REVISION HISTORY:
  38. !
  39. ! !REMARKS:
  40. !
  41. !EOP
  42. !------------------------------------------------------------------------
  43. CONTAINS
  44. !--------------------------------------------------------------------------
  45. ! TM5 !
  46. !--------------------------------------------------------------------------
  47. !BOP
  48. !
  49. ! !IROUTINE: USER_INPUT_START
  50. !
  51. ! !DESCRIPTION:
  52. !\\
  53. !\\
  54. ! !INTERFACE:
  55. !
  56. SUBROUTINE USER_INPUT_START( status )
  57. !
  58. ! !USES:
  59. !
  60. use chem_param, only : fscale
  61. use dims, only : nregions
  62. use meteodata, only : m_dat
  63. use chem_param, only : ntracet
  64. use global_data, only : mass_dat
  65. !
  66. ! !OUTPUT PARAMETERS:
  67. !
  68. integer, intent(out) :: status
  69. !
  70. ! !REVISION HISTORY:
  71. ! 16 May 2014 - T. van Noije - created for initializing CO2 to constant vmr
  72. !
  73. ! !REMARKS:
  74. !
  75. !EOP
  76. !------------------------------------------------------------------------------
  77. !BOC
  78. character(len=*), parameter :: rname = mname//'/user_input_start'
  79. real, dimension(:,:,:), pointer :: m
  80. integer n, region
  81. ! --- begin --------------------------------
  82. do region=1,nregions
  83. m => m_dat(region)%data
  84. do n=1,ntracet
  85. ! set CO2 concentrations to 354 ppm (1990) or 284 ppm (1850)
  86. !mass_dat(region)%rm(:,:,:,n) = 3.54e-4 * m / fscale(n)
  87. mass_dat(region)%rm(:,:,:,n) = 2.8432e-4 * m / fscale(n)
  88. enddo
  89. #ifdef slopes
  90. mass_dat(region)%rxm = 0.0
  91. mass_dat(region)%rym = 0.0
  92. mass_dat(region)%rzm = 0.0
  93. #ifdef secmom
  94. mass_dat(region)%rxxm = 0.0
  95. mass_dat(region)%rxym = 0.0
  96. mass_dat(region)%rxzm = 0.0
  97. mass_dat(region)%ryym = 0.0
  98. mass_dat(region)%ryzm = 0.0
  99. mass_dat(region)%rzzm = 0.0
  100. #endif
  101. #endif
  102. nullify(m)
  103. enddo
  104. write(gol,*) ' rm initialized at volume mixing ratio of 284 ppm (CO2)'; call goPr
  105. ! ok
  106. status=0
  107. END SUBROUTINE USER_INPUT_START
  108. !EOC
  109. END MODULE USER_INPUT