[1926] | 1 | subroutine inimufi(ptimestep) |
---|
[1795] | 2 | |
---|
| 3 | use mmp_gcm |
---|
[1897] | 4 | use callkeys_mod, only : callclouds, p_prod, tx_prod, rc_prod, air_rad |
---|
[1795] | 5 | use tracer_h |
---|
| 6 | use comcstfi_mod, only : g, rad, mugaz |
---|
| 7 | use datafile_mod |
---|
| 8 | |
---|
| 9 | implicit none |
---|
| 10 | |
---|
| 11 | |
---|
| 12 | !============================================================================ |
---|
| 13 | ! |
---|
| 14 | ! Purpose |
---|
| 15 | ! ------- |
---|
| 16 | ! This routine call mm_initialize which perform the global initialization |
---|
| 17 | ! for the microphysical YAMMS model. |
---|
| 18 | ! It also performs some sanity checks on microphysical tracer names. |
---|
| 19 | ! |
---|
| 20 | ! Authors |
---|
| 21 | ! ------- |
---|
| 22 | ! J. Vatant d'Ollone, J.Burgalat, S.Lebonnois (09/2017) |
---|
| 23 | ! |
---|
| 24 | !============================================================================ |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | !-------------------------- |
---|
| 28 | ! 0. Declarations |
---|
| 29 | ! ------------------------- |
---|
| 30 | |
---|
| 31 | real, intent(in) :: ptimestep ! Timestep (s) |
---|
| 32 | |
---|
| 33 | integer :: i,idx |
---|
| 34 | character(len=20), dimension(4), parameter :: aernames = & |
---|
| 35 | (/"mu_m0as ", "mu_m3as ", & |
---|
| 36 | "mu_m0af ", "mu_m3af "/) |
---|
| 37 | CHARACTER(len=20), DIMENSION(2), PARAMETER :: ccnnames = & |
---|
| 38 | (/"mu_m0n ", "mu_m3n "/) |
---|
| 39 | logical :: err |
---|
| 40 | |
---|
[1897] | 41 | ! PATCH : YAMMS now allows to enable/disable effective g computations: |
---|
| 42 | ! In the library it defaults to .true., in the GCM we do not want it ! |
---|
| 43 | mm_use_effg = .false. |
---|
[1795] | 44 | |
---|
| 45 | !---------------------------------------------------- |
---|
| 46 | ! 1. Call microphysical model global initialization |
---|
| 47 | ! --------------------------------------------------- |
---|
| 48 | |
---|
[1926] | 49 | ! enable log for what it's worth... |
---|
| 50 | ! mm_log = .true. |
---|
| 51 | |
---|
| 52 | call mmp_initialize(ptimestep,p_prod,tx_prod,rc_prod, & |
---|
[1795] | 53 | rad,g,air_rad,mugaz,callclouds,config_mufi) |
---|
| 54 | |
---|
| 55 | ! ------------------------- |
---|
| 56 | ! 2. Check names of tracers |
---|
| 57 | ! ------------------------- |
---|
| 58 | err = .false. |
---|
| 59 | DO i=1,size(aernames) |
---|
| 60 | idx = indexOfTracer(TRIM(aernames(i)),.false.) |
---|
| 61 | IF (idx <= 0) THEN |
---|
| 62 | WRITE(*,*) "inimufi: '"//TRIM(aernames(i))//"' not found in tracers table." |
---|
| 63 | err = .true. |
---|
| 64 | ENDIF |
---|
| 65 | ENDDO |
---|
| 66 | IF (callclouds) THEN |
---|
| 67 | DO i=1,size(ccnnames) |
---|
| 68 | idx = indexOfTracer(TRIM(ccnnames(i)),.false.) |
---|
| 69 | IF (idx <= 0) THEN |
---|
| 70 | WRITE(*,*) "inimufi: '"//TRIM(ccnnames(i))//"' not found in tracers table." |
---|
| 71 | err = .true. |
---|
| 72 | ENDIF |
---|
| 73 | ENDDO |
---|
| 74 | ALLOCATE(ices_indx(mm_nesp)) |
---|
| 75 | ices_indx(:) = -1 |
---|
| 76 | DO i=1,mm_nesp |
---|
| 77 | idx = indexOfTracer("mu_m3"//TRIM(mm_spcname(i)),.false.) |
---|
| 78 | IF (idx <= 0) THEN |
---|
| 79 | WRITE(*,*) "inimufi: 'mu_m3"//TRIM(mm_spcname(i))//"' not found in tracers table." |
---|
| 80 | err = .true. |
---|
| 81 | ELSE |
---|
| 82 | ices_indx(i) = idx |
---|
| 83 | ENDIF |
---|
| 84 | ENDDO |
---|
| 85 | IF (err) THEN |
---|
| 86 | WRITE(*,*) "You loose.... Try again" |
---|
| 87 | STOP |
---|
| 88 | ENDIF |
---|
| 89 | ENDIF |
---|
| 90 | |
---|
| 91 | end subroutine inimufi |
---|