|
Last change
on this file since 3985 was
3985,
checked in by jbclement, 7 days ago
|
|
PEM:
Addition of a module "phys_constants" to read and store physical parameter of the planet properly, i.e. without going through the module "comcstfi_h" and/or "comconst_mod".
JBC
|
|
File size:
1.5 KB
|
| Line | |
|---|
| 1 | MODULE tracers |
|---|
| 2 | |
|---|
| 3 | implicit none |
|---|
| 4 | |
|---|
| 5 | ! Indices for tracers taken from the PCM |
|---|
| 6 | integer :: iPCM_qh2o |
|---|
| 7 | |
|---|
| 8 | ! Molar masses of tracers |
|---|
| 9 | real, dimension(:), allocatable :: mmol |
|---|
| 10 | |
|---|
| 11 | !======================================================================= |
|---|
| 12 | contains |
|---|
| 13 | !======================================================================= |
|---|
| 14 | |
|---|
| 15 | SUBROUTINE ini_tracers_id(nqtot,noms) |
|---|
| 16 | |
|---|
| 17 | implicit none |
|---|
| 18 | |
|---|
| 19 | ! Arguments |
|---|
| 20 | !---------- |
|---|
| 21 | integer, intent(in) :: nqtot |
|---|
| 22 | character(*), dimension(nqtot), intent(in) :: noms |
|---|
| 23 | |
|---|
| 24 | ! Local variables |
|---|
| 25 | !---------------- |
|---|
| 26 | integer :: i |
|---|
| 27 | |
|---|
| 28 | ! Code |
|---|
| 29 | !----- |
|---|
| 30 | ! Allocation |
|---|
| 31 | call ini_tracers(nqtot) |
|---|
| 32 | |
|---|
| 33 | ! Initialization |
|---|
| 34 | iPCM_qh2o = -1 |
|---|
| 35 | |
|---|
| 36 | ! Getting the index |
|---|
| 37 | do i = 1,nqtot |
|---|
| 38 | if (noms(i) == "h2o_vap") then |
|---|
| 39 | iPCM_qh2o = i |
|---|
| 40 | mmol(i) = 18. |
|---|
| 41 | endif |
|---|
| 42 | enddo |
|---|
| 43 | |
|---|
| 44 | ! Checking if everything has been found |
|---|
| 45 | if (iPCM_qh2o < 0) error stop 'ini_frost_id: H2O vapour index not found!' |
|---|
| 46 | |
|---|
| 47 | END SUBROUTINE ini_tracers_id |
|---|
| 48 | !======================================================================= |
|---|
| 49 | |
|---|
| 50 | SUBROUTINE ini_tracers(nqtot) |
|---|
| 51 | |
|---|
| 52 | implicit none |
|---|
| 53 | |
|---|
| 54 | ! Arguments |
|---|
| 55 | !---------- |
|---|
| 56 | integer, intent(in) :: nqtot |
|---|
| 57 | |
|---|
| 58 | ! Local variables |
|---|
| 59 | !---------------- |
|---|
| 60 | |
|---|
| 61 | ! Code |
|---|
| 62 | !----- |
|---|
| 63 | if (.not. allocated(mmol)) allocate(mmol(nqtot)) |
|---|
| 64 | |
|---|
| 65 | END SUBROUTINE ini_tracers |
|---|
| 66 | !======================================================================= |
|---|
| 67 | |
|---|
| 68 | SUBROUTINE end_tracers() |
|---|
| 69 | |
|---|
| 70 | implicit none |
|---|
| 71 | |
|---|
| 72 | ! Arguments |
|---|
| 73 | !---------- |
|---|
| 74 | |
|---|
| 75 | ! Local variables |
|---|
| 76 | !---------------- |
|---|
| 77 | |
|---|
| 78 | ! Code |
|---|
| 79 | !----- |
|---|
| 80 | if (allocated(mmol)) deallocate(mmol) |
|---|
| 81 | |
|---|
| 82 | END SUBROUTINE end_tracers |
|---|
| 83 | |
|---|
| 84 | END MODULE tracers |
|---|
Note: See
TracBrowser
for help on using the repository browser.